/* Vistoria PDF: identidade da Traço Soft, mesma linguagem do TraçoCAD Viewer (tema escuro, azul do logo) */
:root {
  --bg: #212a36;
  --bar: #0f1724;
  --bar-2: #162131;
  --panel: #1c2838;
  --panel-2: #24344a;
  --line: #2a3a50;
  --fg: #eef3fa;
  --muted: #93a3b8;
  --ac: #2f81f7;
  --ac-2: #5ad1ff;
  --ac-soft: rgba(47, 129, 247, 0.16);
  --danger: #ff6b6b;
  --ok: #3ddc84;
  --warn: #ffb547;
  --radius: 14px;
  --radius-sm: 12px;
  --shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
  --grad: linear-gradient(135deg, var(--ac), #3d9bff);
  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden], .hidden { display: none !important; }
html, body { height: 100%; }

body {
  margin: 0;
  font: 15px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--fg);
  background: var(--bg);
  overflow: hidden;
  overscroll-behavior: none;
  -webkit-font-smoothing: antialiased;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

h1, h2 { margin: 0; letter-spacing: -0.01em; }
h2 { font-size: 13px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; }
.muted { color: var(--muted); font-size: 13px; margin: 0; }
b { font-weight: 600; }

svg { display: block; }
.btn svg, .tool svg, .menu-item svg {
  width: 22px; height: 22px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}
.mark { width: 38px; height: 38px; flex: none; filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.4)); }

/* ---------- Botões e campos ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--fg);
  font: inherit;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s, transform 0.08s;
}
.btn:active, .tool:active, .chip:active { transform: scale(0.96); }
.btn:focus-visible, .tool:focus-visible { outline: 2px solid var(--ac-2); outline-offset: 2px; }
.btn:disabled { opacity: 0.4; cursor: default; }
.btn.icon, .side .btn, dialog .btn { border-color: var(--line); background: var(--panel); }
.btn.icon:hover, .side .btn:hover, dialog .btn:hover { background: var(--panel-2); }
.btn.square { width: 44px; padding: 0; }
.btn.primary { background: var(--grad); border-color: transparent; color: #fff; font-weight: 600; box-shadow: 0 4px 14px rgba(47, 129, 247, 0.35); }
.btn.primary:hover { filter: brightness(1.08); background: var(--grad); }
.btn.primary.big { min-height: 54px; padding: 0 26px; font-size: 17px; border-radius: 16px; }
.btn.danger { color: var(--danger); }
.btn.small { min-height: 36px; padding: 0 12px; font-size: 13px; }
.btn.on { background: var(--grad); border-color: transparent; color: #fff; }

input, select, textarea {
  font: inherit;
  color: var(--fg);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 12px;
  background: var(--bar);
  min-height: 44px;
  width: 100%;
}
select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 34px;
  background: var(--bar) url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="%2393a3b8" stroke-width="2" stroke-linecap="round"><path d="M7 10l5 5 5-5"/></svg>') no-repeat right 10px center / 16px;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--ac); outline-offset: -1px; }
textarea { resize: vertical; line-height: 1.45; }
::placeholder { color: #6b7d94; }

/* ---------- Barra de cima (igual nas duas telas) ---------- */

.topbar {
  flex: none;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  min-height: 60px;
  background: linear-gradient(180deg, var(--bar-2), var(--bar));
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.titles { display: flex; flex-direction: column; min-width: 0; }
.titles .app { font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.titles .app b { color: var(--ac-2); font-weight: 700; }
.titles .name { font-size: 16px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.actions { display: flex; align-items: center; gap: 6px; }

/* ---------- Tela inicial ---------- */

.home { height: 100%; display: flex; flex-direction: column; }
.home-body {
  flex: 1;
  overflow: auto;
  padding: 24px 16px 40px;
  background: radial-gradient(1200px 700px at 50% 0%, #263243, var(--bg));
}
.home-body > * { max-width: 980px; margin-left: auto; margin-right: auto; }

.hero {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 22px 24px;
  background: linear-gradient(135deg, rgba(47, 129, 247, 0.14), rgba(90, 209, 255, 0.04)), var(--panel);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow);
}
.hero-mark { width: 84px; height: 84px; flex: none; filter: drop-shadow(0 10px 24px rgba(47, 129, 247, 0.35)); }
.hero-text { flex: 1; min-width: 0; }
.hero h1 { font-size: 30px; font-weight: 700; }
.hero h1 b { font-weight: 700; background: linear-gradient(90deg, var(--ac), var(--ac-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lead { margin: 4px 0 0; color: var(--muted); font-size: 16px; }
.lead b { color: var(--fg); }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 16px; }
.stat {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 18px;
  overflow: hidden;
}
.stat::before { content: ''; position: absolute; left: 0; top: 14px; bottom: 14px; width: 3px; border-radius: 0 3px 3px 0; background: var(--grad); }
.stat.warn::before { background: var(--warn); }
.stat strong { display: block; font-size: 28px; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.stat span { color: var(--muted); font-size: 13px; }

.install-card {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 16px;
  padding: 14px 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.install-card div { flex: 1; font-size: 14px; color: var(--muted); }
.install-card strong { color: var(--fg); }

.dropzone {
  margin-top: 16px;
  padding: 18px 16px;
  border: 1.5px dashed var(--line);
  border-radius: var(--radius);
  text-align: center;
  color: var(--muted);
  transition: border-color 0.15s, background 0.15s;
}
.dropzone.over { border-color: var(--ac-2); background: var(--ac-soft); color: var(--fg); }

.section-head { display: flex; justify-content: space-between; align-items: baseline; margin-top: 26px; margin-bottom: 10px; }
.doc-list { list-style: none; padding: 0; display: grid; gap: 8px; margin-top: 0; margin-bottom: 0; }
.doc-card {
  display: flex;
  gap: 12px;
  align-items: center;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 8px 10px 8px 14px;
  transition: border-color 0.15s, background 0.15s;
}
.doc-card:hover { border-color: #3a5170; background: #1f2d40; }
.doc-ico {
  width: 42px; height: 42px; flex: none; display: grid; place-items: center;
  border-radius: 10px; background: var(--ac-soft); color: var(--ac-2);
}
.doc-ico svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.doc-open {
  flex: 1;
  min-width: 0;
  text-align: left;
  border: 0;
  background: none;
  font: inherit;
  color: inherit;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 6px 0;
}
.doc-open strong { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc-open:hover strong { color: var(--ac-2); }
.badge-open { flex: none; font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 999px; background: rgba(255, 181, 71, 0.14); color: var(--warn); }
.empty-note {
  color: var(--muted);
  font-size: 14px;
  padding: 18px;
  text-align: center;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-top: 0;
  margin-bottom: 0;
}
.empty-note b { color: var(--fg); }
.app-footer { margin-top: 28px; text-align: center; font-size: 12px; color: var(--muted); letter-spacing: 0.02em; }
.app-footer b { color: var(--fg); }

/* ---------- Visualizador ---------- */

.viewer { height: 100%; display: flex; flex-direction: column; }
.viewer .actions { overflow-x: auto; scrollbar-width: none; }
.viewer .actions::-webkit-scrollbar { display: none; }

.workspace { position: relative; flex: 1; min-height: 0; display: flex; }

.stage {
  flex: 1;
  min-width: 0;
  overflow: auto;
  padding: 24px 24px 72px;
  display: flex;
  background: radial-gradient(1200px 700px at 50% 40%, #263243, var(--bg));
}
.page-wrap {
  margin: auto;
  background: #fff;
  border-radius: 4px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35), 0 18px 48px rgba(0, 0, 0, 0.45);
  line-height: 0;
}
#pageCanvas {
  display: block;
  touch-action: pan-x pan-y pinch-zoom;
  -webkit-user-select: none;
  user-select: none;
  border-radius: 4px;
}

/* Dica: etiqueta flutuante acima das ferramentas, como a medida do Viewer */
.hint {
  position: absolute;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%);
  max-width: calc(100% - 24px);
  z-index: 4;
  pointer-events: none;
  font-size: 14px;
  font-weight: 500;
  text-align: center;
  background: rgba(15, 23, 36, 0.88);
  border: 1px solid var(--line);
  padding: 8px 16px;
  border-radius: 999px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.hint:empty { display: none; }
/* Com a lista aberta, a dica fica centrada na planta e não por baixo do painel */
.workspace:has(.side:not(.hidden)) .hint { left: calc((100% - 390px) / 2); max-width: calc(100% - 414px); }

.menu { position: relative; }
.menu > summary { list-style: none; }
.menu > summary::-webkit-details-marker { display: none; }
.menu[open] > summary { background: var(--panel-2); border-color: #3a5170; }
.menu-items {
  position: fixed;
  right: 12px;
  top: 64px;
  z-index: 30;
  display: grid;
  min-width: 270px;
  background: rgba(22, 33, 49, 0.98);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 6px;
}
.menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  min-height: 48px;
  padding: 8px 12px;
  border: 0;
  background: none;
  color: var(--fg);
  font: inherit;
  border-radius: 10px;
  cursor: pointer;
}
.menu-item svg { color: var(--ac-2); }
.menu-item:hover { background: var(--ac-soft); }

/* ---------- Ferramentas (dock de baixo) ---------- */

.dock {
  flex: none;
  display: flex;
  justify-content: center;
  align-items: stretch;
  gap: 10px;
  padding: 8px 10px 10px;
  overflow-x: auto;
  scrollbar-width: none;
  background: linear-gradient(0deg, var(--bar-2), var(--bar));
  border-top: 1px solid var(--line);
}
.dock::-webkit-scrollbar { display: none; }
.dock .group {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 4px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  flex: none;
}
.tool, .chip {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-width: 66px;
  min-height: 58px;
  padding: 6px 8px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, transform 0.08s;
}
.tool svg { width: 24px; height: 24px; }
.tool:hover:not(:disabled), .chip:hover { background: var(--panel-2); color: var(--fg); }
.tool:disabled { opacity: 0.35; cursor: default; }
.chip { min-width: 84px; padding: 6px 10px; }
.chip .cico { position: relative; display: block; }
.chip .ico { width: 24px; height: 24px; }
.chip .count {
  position: absolute;
  top: -6px;
  right: -16px;
  min-width: 20px;
  padding: 0 5px;
  font-size: 11px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
  color: var(--fg);
  background: var(--bar);
  border: 1px solid var(--line);
  border-radius: 999px;
}
.chip.on { color: #fff; background: var(--grad); box-shadow: 0 4px 12px rgba(47, 129, 247, 0.35); }
.chip.on .count { background: rgba(0, 0, 0, 0.35); border-color: transparent; }
.chip.on .ico path { stroke: #fff; }
.page-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 96px;
  padding: 0 6px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.page-info strong { font-size: 16px; font-weight: 700; }
.page-info small { font-size: 11px; color: var(--muted); }
.ico { width: 18px; height: 18px; flex: none; }

/* ---------- Painel lateral (folha flutuante, como Camadas no Viewer) ---------- */

.side {
  position: absolute;
  top: 10px;
  right: 10px;
  bottom: 10px;
  width: min(370px, 92vw);
  z-index: 10;
  display: flex;
  flex-direction: column;
  background: rgba(22, 33, 49, 0.97);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  overflow-y: auto;
}
.side-head {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 12px 12px 16px;
  background: var(--bar-2);
  border-bottom: 1px solid var(--line);
}
.side-head strong { font-size: 16px; font-weight: 700; }
.filters { display: grid; gap: 8px; padding: 12px; grid-template-columns: 1fr 1fr; }
.filters select { min-height: 40px; font-size: 13px; }

.marker-list { list-style: none; margin: 0; padding: 0 6px 8px; }
.marker-list li {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 11px 10px;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.12s;
}
.marker-list li + li { border-top: 1px solid rgba(42, 58, 80, 0.6); }
.marker-list li:hover { background: var(--ac-soft); }
.marker-list li.resolved { opacity: 0.55; }
.marker-list li.empty { cursor: default; color: var(--muted); justify-content: center; padding: 24px 10px; }
.marker-list li.empty:hover { background: none; }
.li-icon { width: 22px; flex: none; padding-top: 2px; }
.li-body { flex: 1; min-width: 0; font-size: 14px; }
.li-body .muted { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.tag {
  flex: none;
  font-size: 12px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(255, 181, 71, 0.14);
  color: var(--warn);
}
.tag.resolvido { background: rgba(61, 220, 132, 0.14); color: var(--ok); }

.detail { display: grid; gap: 12px; align-content: start; padding: 0 0 16px; }
.detail > :not(.side-head) { margin: 0 16px; }
.detail .side-head { justify-content: flex-start; }
.field { display: grid; gap: 6px; font-size: 13px; font-weight: 500; color: var(--muted); }
.field select, .field textarea { color: var(--fg); font-size: 15px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; justify-content: space-between; }

/* ---------- Diálogos ---------- */

dialog {
  width: min(580px, 94vw);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 24px;
  color: var(--fg);
  background: var(--bar-2);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
}
dialog::backdrop { background: rgba(5, 9, 15, 0.7); backdrop-filter: blur(4px); }
dialog h2 { text-transform: none; letter-spacing: -0.01em; font-size: 19px; color: var(--fg); margin-bottom: 6px; }
dialog .row { margin-top: 20px; }
.cat-editor { list-style: none; padding: 0; margin: 16px 0 0; display: grid; gap: 8px; }
.cat-row { display: grid; grid-template-columns: 48px 1fr 150px auto; gap: 8px; align-items: center; }
.cat-row input[type="color"] { padding: 4px; height: 44px; cursor: pointer; }

/* ---------- Avisos ---------- */

.toast {
  position: fixed;
  left: 50%;
  top: calc(74px + env(safe-area-inset-top));
  transform: translate(-50%, -16px);
  background: var(--grad);
  color: #fff;
  font-weight: 600;
  padding: 11px 20px;
  border-radius: 999px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  max-width: 90vw;
  text-align: center;
  font-size: 14px;
  z-index: 100;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Fontes, navegação em nuvem e Sobre ---------- */

.source-list { display: grid; gap: 10px; margin-top: 16px; }
.source-btn {
  display: grid;
  gap: 2px;
  text-align: left;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--fg);
  font: inherit;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.source-btn:hover { border-color: var(--ac); background: var(--panel-2); }
.source-btn strong { font-weight: 600; }
.source-btn span { font-size: 13px; }

dialog.browse { width: min(560px, 94vw); height: min(640px, 86vh); padding: 0; display: flex; flex-direction: column; }
dialog.browse:not([open]) { display: none; }
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; padding: 10px 16px; font-size: 13px; border-bottom: 1px solid var(--line); }
.crumb { border: 0; background: none; color: var(--ac-2); font: inherit; padding: 4px 6px; border-radius: 6px; cursor: pointer; }
.crumb:hover { background: var(--ac-soft); }
.sep { color: var(--muted); }
.browse-list { list-style: none; margin: 0; padding: 0; flex: 1; overflow-y: auto; }
.browse-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding: 10px 16px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: none;
  color: var(--fg);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.browse-item:hover { background: var(--ac-soft); }
.browse-item .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kind { flex: none; font-size: 11px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; padding: 3px 7px; border-radius: 6px; }
.kind.folder { background: var(--ac-soft); color: var(--ac-2); }
.kind.pdf { background: rgba(255, 107, 107, 0.14); color: var(--danger); }
.browse-status { padding: 10px 16px; min-height: 36px; margin: 0; }

dialog.about { width: min(480px, 94vw); }
.about-head { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; }
.about-head .mark { width: 64px; height: 64px; }
.about-head h2 { font-size: 21px; margin: 0; }
.about-list { display: grid; grid-template-columns: 130px 1fr; gap: 10px 14px; margin: 18px 0 0; font-size: 14px; }
.about-list dt { color: var(--muted); }
.about-list dd { margin: 0; }

/* ---------- Telas menores ---------- */

@media (min-width: 1100px) {
  .side { position: static; width: 370px; flex: none; margin: 10px 10px 10px 0; }
}

@media (max-width: 900px) {
  .dock { justify-content: flex-start; }
  .chip { min-width: 70px; }
  .tool { min-width: 56px; }
}

@media (max-width: 720px) {
  .topbar .actions .btn span, .topbar > .btn span { display: none; }
  .topbar .actions .btn, .topbar > .btn { width: 44px; padding: 0; }
  .titles .app, .viewer .brand .mark { display: none; }
  .hero { flex-wrap: wrap; padding: 18px; gap: 14px; }
  .hero-mark { width: 60px; height: 60px; }
  .hero h1 { font-size: 24px; }
  .hero .btn.big { width: 100%; }
  .stats { gap: 8px; }
  .stat { padding: 12px; }
  .stat strong { font-size: 22px; }
  .badge-open, .doc-ico { display: none; }
  .doc-card { padding-left: 12px; }
  .stage { padding: 12px 12px 64px; }
  .cat-row { grid-template-columns: 48px 1fr; }
  .cat-row .c-shape { grid-column: 1 / 3; }
}

/* ---------- Dados da vistoria ---------- */

dialog.info { width: min(640px, 94vw); }
.info-form { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 14px; }
.info-form .wide { grid-column: 1 / -1; }
.info-form input, .info-form textarea { color: var(--fg); font-size: 15px; }
.info-form .row { margin-top: 8px; justify-content: flex-end; }
@media (max-width: 560px) { .info-form { grid-template-columns: 1fr; } }

/* ---------- Fotos das marcações ---------- */

.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 8px; }
.photos:empty::before { content: "Nenhuma foto."; color: var(--muted); font-weight: 400; }
.photo-thumb {
  position: relative; aspect-ratio: 1; padding: 0; border: 1px solid var(--line); border-radius: 10px;
  overflow: hidden; background: var(--panel); cursor: pointer;
}
.photo-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-actions { justify-content: flex-start; }
.photo-actions .btn { flex: 1 1 140px; }
.li-photos { display: inline-flex; align-items: center; gap: 3px; margin-left: 6px; color: var(--ac-2); font-size: 12px; }
.li-photos svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; }

dialog.photo-view { width: min(1000px, 96vw); padding: 14px; }
dialog.photo-view img { display: block; width: 100%; max-height: 72vh; object-fit: contain; border-radius: 12px; background: #0b1220; }
dialog.photo-view .row { margin-top: 12px; align-items: center; }
.row-end { display: flex; gap: 10px; }

/* ---------- Gerando o relatório ---------- */

.busy { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; background: rgba(5, 9, 15, 0.6); backdrop-filter: blur(3px); }
.busy-box { display: flex; align-items: center; gap: 14px; padding: 18px 22px; border-radius: 16px; background: var(--bar-2); border: 1px solid var(--line); box-shadow: var(--shadow); }
.spinner { width: 22px; height: 22px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--ac-2); animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.report-ico { width: 56px; height: 56px; display: grid; place-items: center; border-radius: 16px; background: var(--grad); flex: none; }
.report-ico svg { width: 30px; height: 30px; fill: none; stroke: #fff; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.report-name { word-break: break-word; font-weight: 600; }
dialog.about.report { width: min(620px, 94vw); }
.btn.danger-fill { background: #c62828; border-color: transparent; color: #fff; font-weight: 600; }
.btn.danger-fill:hover { filter: brightness(1.1); background: #c62828; }
dialog.confirm h2 { font-size: 18px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

/* ---------- Antes / depois ---------- */

.photo-group { grid-column: 1 / -1; margin-top: 4px; font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.photo-thumb .badge { position: absolute; left: 4px; bottom: 4px; padding: 1px 6px; border-radius: 6px; font-size: 10px; font-weight: 700; color: #fff; background: rgba(46, 125, 50, .92); }
.photo-thumb .pen { position: absolute; right: 4px; top: 4px; width: 18px; height: 18px; padding: 2px; border-radius: 6px; background: rgba(15, 23, 36, .8); }
.photo-thumb .pen svg { width: 14px; height: 14px; fill: none; stroke: #ffd60a; stroke-width: 2; }

/* ---------- Desenho sobre a foto ---------- */

dialog.draw { width: 100vw; max-width: 100vw; height: 100vh; max-height: 100vh; margin: 0; padding: 0; border: 0; border-radius: 0; display: flex; flex-direction: column; background: #0b1220; }
dialog.draw:not([open]) { display: none; }
.draw-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 10px 12px; background: var(--bar); border-bottom: 1px solid var(--line); }
.draw-bar .seg { display: flex; gap: 6px; align-items: center; }
.draw-bar .seg.end { margin-left: auto; }
.tool-btn { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); color: var(--fg); font: inherit; cursor: pointer; }
.tool-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tool-btn.on { background: var(--grad); border-color: transparent; color: #fff; }
.swatch { width: 38px; height: 38px; border-radius: 50%; border: 3px solid var(--line); background: var(--c); cursor: pointer; }
.swatch.on { border-color: var(--ac-2); box-shadow: 0 0 0 2px var(--bar); }
.draw-stage { flex: 1; display: grid; place-items: center; overflow: hidden; padding: 12px; }
#drawCanvas { touch-action: none; max-width: 100%; max-height: 100%; border-radius: 8px; cursor: crosshair; }

/* ---------- Assinatura ---------- */

dialog.sign { width: min(720px, 96vw); }
.sign-canvas { display: block; width: 100%; height: 240px; margin-top: 12px; border-radius: 12px; background: #fff; touch-action: none; cursor: crosshair; }
.sign-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.sign-row .btn { margin-left: auto; }
.sign-preview { height: 56px; max-width: 220px; object-fit: contain; background: #fff; border-radius: 8px; padding: 4px 8px; }
