/* =========================================================================
   MPD — Síntese das Entrevistas Internas
   Design system · identidade MPD (laranja + terracota + carvão) · light/dark
   ========================================================================= */

:root {
  /* Surfaces & ink (light) */
  --page:            #f5f3f1;
  --surface-1:       #ffffff;
  --surface-2:       #faf8f6;
  --surface-3:       #f0ece8;
  --ink:             #2b2529;
  --ink-2:           #57504f;
  --ink-muted:       #857c7a;
  --hairline:        #e6e0da;
  --hairline-strong: #cdc5bd;
  --ring:            rgba(43, 37, 41, 0.10);
  --shadow:          0 1px 2px rgba(60,52,56,.05), 0 6px 24px rgba(60,52,56,.07);
  --shadow-lg:       0 12px 40px rgba(60,52,56,.14);

  /* Marca MPD */
  --brand:           #3c3438;   /* cinza-carvão quente (texto MPD) */
  --brand-2:         #574c4f;
  --accent:          #e97d26;   /* laranja MPD */
  --accent-2:        #b84e28;   /* terracota (sombra dos blocos) */
  --accent-soft:     #fbe8d6;

  /* Rampa sequencial LARANJA (magnitude) */
  --o50:#fdf1e5; --o100:#fbe1c8; --o150:#f8d2ac; --o200:#f5bd85;
  --o300:#f0a55c; --o400:#ec8a38; --o450:#e97d26; --o500:#d96e1c;
  --o550:#bf5f1c; --o600:#a54f1a; --o650:#894118; --o700:#6d3313;

  /* Selos metodológicos */
  --seal-percepcao:  #2a78d6;
  --seal-evidencia:  #159169;
  --seal-hipotese:   #a9720f;
  --seal-confirmar:  #c85a24;
  --seal-descoberta: #5a49b8;
  --seal-naovalidado:#cf3a3a;

  /* Status */
  --good:#0ca30c; --warn:#c9820c; --serious:#d15a26; --critical:#d03b3b;

  --radius: 14px;
  --radius-sm: 9px;
  --sidebar-w: 274px;
  --maxw: 1080px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

:root[data-theme="dark"] {
  --page:#100d0e; --surface-1:#191517; --surface-2:#1f1a1c; --surface-3:#272122;
  --ink:#f5f0ee; --ink-2:#cbc2c0; --ink-muted:#938987; --hairline:#2f2829; --hairline-strong:#3f3739;
  --ring:rgba(255,255,255,.10);
  --shadow:0 1px 2px rgba(0,0,0,.4),0 8px 28px rgba(0,0,0,.42);
  --shadow-lg:0 16px 48px rgba(0,0,0,.55);
  --brand:#e7b48f; --brand-2:#d8a888; --accent:#f0904a; --accent-2:#d96a3c; --accent-soft:#3a2a1e;
  --seal-percepcao:#5a9bea; --seal-evidencia:#2bbd8f; --seal-hipotese:#dca63a;
  --seal-confirmar:#ec7f4f; --seal-descoberta:#9a8fe6; --seal-naovalidado:#e66767;
  --good:#2fbf2f; --warn:#e0a93a; --serious:#ea7f4f; --critical:#e66767;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --page:#100d0e; --surface-1:#191517; --surface-2:#1f1a1c; --surface-3:#272122;
    --ink:#f5f0ee; --ink-2:#cbc2c0; --ink-muted:#938987; --hairline:#2f2829; --hairline-strong:#3f3739;
    --ring:rgba(255,255,255,.10);
    --shadow:0 1px 2px rgba(0,0,0,.4),0 8px 28px rgba(0,0,0,.42);
    --shadow-lg:0 16px 48px rgba(0,0,0,.55);
    --brand:#e7b48f; --brand-2:#d8a888; --accent:#f0904a; --accent-2:#d96a3c; --accent-soft:#3a2a1e;
    --seal-percepcao:#5a9bea; --seal-evidencia:#2bbd8f; --seal-hipotese:#dca63a;
    --seal-confirmar:#ec7f4f; --seal-descoberta:#9a8fe6; --seal-naovalidado:#e66767;
    --good:#2fbf2f; --warn:#e0a93a; --serious:#ea7f4f; --critical:#e66767;
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; font-family: var(--font); background: var(--page); color: var(--ink);
  line-height: 1.55; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
h1,h2,h3,h4 { line-height: 1.2; margin: 0; font-weight: 700; letter-spacing: -0.01em; }
p { margin: 0 0 .8em; }
a { color: var(--accent-2); }
::selection { background: color-mix(in srgb, var(--accent) 40%, transparent); }

/* ---------- Layout ---------- */
.app { display: flex; min-height: 100vh; }

/* ---------- Sidebar ---------- */
.sidebar {
  width: var(--sidebar-w); flex: 0 0 var(--sidebar-w);
  background: var(--surface-1); border-right: 1px solid var(--hairline);
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  display: flex; flex-direction: column; z-index: 40;
}
.brandbar { padding: 18px 18px 15px; border-bottom: 1px solid var(--hairline); }
.brandbar .logo { display: flex; align-items: center; gap: 11px; }
.brandbar .logo svg { flex: 0 0 auto; }
.brandbar .name { font-size: 14.5px; font-weight: 800; letter-spacing: .2px; }
.brandbar .sub { font-size: 11px; color: var(--ink-muted); margin-top: 1px; }

.nav { padding: 10px 10px 20px; flex: 1; }
.nav .group-label {
  font-size: 10.5px; text-transform: uppercase; letter-spacing: .09em;
  color: var(--ink-muted); font-weight: 700; padding: 14px 12px 6px;
}
.nav a {
  display: flex; align-items: center; gap: 10px; padding: 8.5px 12px; margin: 1px 0;
  border-radius: 9px; color: var(--ink-2); text-decoration: none; font-size: 13.5px;
  font-weight: 500; transition: background .12s, color .12s;
}
.nav a .ni { width: 18px; text-align: center; opacity: .8; font-size: 13px; }
.nav a:hover { background: var(--surface-3); color: var(--ink); }
.nav a.active {
  background: color-mix(in srgb, var(--accent) 15%, transparent);
  color: var(--accent-2); font-weight: 650;
}
:root[data-theme="dark"] .nav a.active { color: var(--accent); }

.side-foot { padding: 14px 16px; border-top: 1px solid var(--hairline); font-size: 11px; color: var(--ink-muted); }

/* ---------- Main ---------- */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  position: sticky; top: 0; z-index: 30;
  background: color-mix(in srgb, var(--seal-naovalidado) 12%, var(--surface-1));
  border-bottom: 1px solid color-mix(in srgb, var(--seal-naovalidado) 30%, var(--hairline));
  display: flex; align-items: center; gap: 12px; padding: 9px 22px; font-size: 12.5px; color: var(--ink-2);
}
.topbar .warn-dot { color: var(--seal-naovalidado); font-weight: 800; flex: 0 0 auto; }
.topbar .disc { flex: 1; min-width: 0; }
.topbar .disc strong { color: var(--ink); font-weight: 700; }

.toolbar {
  position: sticky; top: 39px; z-index: 25; display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 12px 22px; background: var(--surface-2); border-bottom: 1px solid var(--hairline);
}
.menu-btn {
  display: none; background: var(--surface-1); border: 1px solid var(--hairline);
  border-radius: 9px; width: 40px; height: 40px; font-size: 18px; color: var(--ink); cursor: pointer;
}
.search { flex: 1; min-width: 160px; max-width: 380px; position: relative; }
.search input {
  width: 100%; padding: 9px 12px 9px 34px; border-radius: 10px; border: 1px solid var(--hairline);
  background: var(--surface-1); color: var(--ink); font-size: 13.5px; font-family: inherit;
}
.search input:focus { outline: 2px solid color-mix(in srgb, var(--accent) 45%, transparent); outline-offset: 0; border-color: transparent; }
.search .si { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--ink-muted); font-size: 14px; }

.tool-btn {
  background: var(--surface-1); border: 1px solid var(--hairline); border-radius: 10px; height: 38px;
  padding: 0 12px; cursor: pointer; color: var(--ink-2); font-size: 13px;
  display: flex; align-items: center; gap: 6px; white-space: nowrap;
}
.tool-btn:hover { border-color: var(--hairline-strong); color: var(--ink); }
.tool-btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.tool-btn.primary:hover { background: var(--o500); }

.content { padding: 30px 26px 90px; max-width: calc(var(--maxw) + 52px); width: 100%; margin: 0 auto; }

/* ---------- Section shell ---------- */
.section { animation: fade .25s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(6px);} to {opacity:1; transform:none;} }
.section-head { margin-bottom: 22px; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 7px; font-size: 11.5px; font-weight: 700;
  letter-spacing: .06em; text-transform: uppercase; color: var(--accent-2); margin-bottom: 9px;
}
:root[data-theme="dark"] .eyebrow { color: var(--accent); }
.eyebrow .chip-n { background: var(--accent-soft); color: var(--accent-2); border-radius: 6px; padding: 1px 7px; font-size: 11px; }
:root[data-theme="dark"] .eyebrow .chip-n { color: var(--accent); }
.section-head h1 { font-size: 27px; margin-bottom: 8px; display: flex; align-items: center; gap: 12px; }
.section-head h1 .h-ico {
  width: 40px; height: 40px; flex: 0 0 40px; border-radius: 11px; display: grid; place-items: center;
  font-size: 20px; background: var(--accent-soft); color: var(--accent-2);
}
:root[data-theme="dark"] .section-head h1 .h-ico { color: var(--accent); }
.section-head .lede { font-size: 15px; color: var(--ink-2); max-width: 720px; }

.block { margin: 26px 0; }
.block > h3 { font-size: 16.5px; margin-bottom: 12px; display: flex; align-items: center; gap: 9px; }
.block > h3::before { content:""; width: 4px; height: 17px; border-radius: 3px; background: var(--accent); display:inline-block; }

/* ---------- Cards / grid ---------- */
.card { background: var(--surface-1); border: 1px solid var(--hairline); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, 1fr); }
.g3 { grid-template-columns: repeat(3, 1fr); }
.g4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 860px){ .g2,.g3,.g4{ grid-template-columns:1fr; } }

/* ---------- Stat tiles ---------- */
.stats { display: grid; grid-template-columns: repeat(4,1fr); gap: 14px; }
@media (max-width:860px){ .stats{ grid-template-columns: repeat(2,1fr);} }
.stat { background: var(--surface-1); border: 1px solid var(--hairline); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); position: relative; overflow: hidden; }
.stat::after{ content:""; position:absolute; left:0; top:0; bottom:0; width:4px; background: var(--accent); }
.stat .v { font-size: 30px; font-weight: 800; letter-spacing: -.02em; }
.stat .l { font-size: 12.5px; color: var(--ink-muted); margin-top: 2px; }

/* ---------- Seals / badges ---------- */
.seal { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 650; line-height: 1;
  padding: 4px 9px 4px 7px; border-radius: 999px; white-space: nowrap; border: 1px solid transparent; cursor: default; }
.seal .ic { font-size: 11px; }
.seal.percepcao  { color: var(--seal-percepcao);  background: color-mix(in srgb, var(--seal-percepcao) 13%, var(--surface-1)); border-color: color-mix(in srgb, var(--seal-percepcao) 34%, transparent); }
.seal.evidencia  { color: var(--seal-evidencia);  background: color-mix(in srgb, var(--seal-evidencia) 13%, var(--surface-1)); border-color: color-mix(in srgb, var(--seal-evidencia) 34%, transparent); }
.seal.hipotese   { color: var(--seal-hipotese);   background: color-mix(in srgb, var(--seal-hipotese) 15%, var(--surface-1)); border-color: color-mix(in srgb, var(--seal-hipotese) 36%, transparent); }
.seal.confirmar  { color: var(--seal-confirmar);  background: color-mix(in srgb, var(--seal-confirmar) 14%, var(--surface-1)); border-color: color-mix(in srgb, var(--seal-confirmar) 34%, transparent); }
.seal.descoberta { color: var(--seal-descoberta); background: color-mix(in srgb, var(--seal-descoberta) 14%, var(--surface-1)); border-color: color-mix(in srgb, var(--seal-descoberta) 34%, transparent); }
.seal.naovalidado{ color: var(--seal-naovalidado);background: color-mix(in srgb, var(--seal-naovalidado) 13%, var(--surface-1)); border-color: color-mix(in srgb, var(--seal-naovalidado) 34%, transparent); }
.seal-row { display: flex; flex-wrap: wrap; gap: 6px; }

/* área / assunto tags (clicáveis → conexões) */
.tag { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 550;
  padding: 3px 8px; border-radius: 7px; color: var(--ink-2); background: var(--surface-3); border: 1px solid var(--hairline); }
.tag.clickable { cursor: pointer; transition: all .12s; }
.tag.clickable:hover { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-2); }
:root[data-theme="dark"] .tag.clickable:hover { color: var(--accent); }
.tag.clickable::before { content:"🔗"; font-size: 9px; opacity: .55; }
.tag-row { display: flex; flex-wrap: wrap; gap: 6px; }

/* ---------- Lists ---------- */
ul.clean { list-style: none; padding: 0; margin: 0; }
ul.clean li { position: relative; padding: 5px 0 5px 20px; font-size: 14px; color: var(--ink-2); }
ul.clean li::before { content:""; position: absolute; left: 3px; top: 12px; width: 6px; height: 6px; border-radius: 2px; background: var(--accent); }
ul.check li::before { content:"→"; background: none; left: 0; top: 3px; width:auto;height:auto; color: var(--accent-2); font-weight: 700; }
:root[data-theme="dark"] ul.check li::before { color: var(--accent); }

/* ---------- Premise banner ---------- */
.premise { border: 1px solid color-mix(in srgb, var(--seal-naovalidado) 30%, var(--hairline));
  background: color-mix(in srgb, var(--seal-naovalidado) 7%, var(--surface-1)); border-radius: var(--radius); padding: 18px 20px; margin: 22px 0; }
.premise h3 { display: flex; align-items: center; gap: 9px; font-size: 15px; margin-bottom: 10px; }
.premise h3 .ic { color: var(--seal-naovalidado); }
.premise ul.clean li::before { background: var(--seal-naovalidado); }

/* callout */
.callout { border-left: 3px solid var(--accent); background: var(--surface-2); border-radius: 0 10px 10px 0; padding: 12px 15px; margin: 12px 0; font-size: 14px; color: var(--ink-2); }
.callout.insight { border-left-color: var(--accent-2); }
.callout.insight .k { color: var(--accent-2); }
:root[data-theme="dark"] .callout.insight .k { color: var(--brand); }
.callout .k { font-weight: 700; color: var(--accent-2); }
:root[data-theme="dark"] .callout .k { color: var(--accent); }

.blockquote { border-left: 3px solid var(--hairline-strong); padding: 6px 14px; margin: 10px 0; font-size: 14px; color: var(--ink-2); }
.blockquote .who { display:block; font-size: 11.5px; font-weight: 700; color: var(--ink-muted); margin-bottom: 3px; text-transform: uppercase; letter-spacing: .04em; }

/* ---------- Pattern / achado card ---------- */
.pcard { display: flex; flex-direction: column; gap: 12px; }
.pcard .p-num { width: 34px; height: 34px; flex: 0 0 34px; border-radius: 9px;
  background: linear-gradient(135deg,var(--accent),var(--accent-2)); color:#fff; display: grid; place-items: center; font-weight: 800; font-size: 15px; }
.pcard .p-top { display: flex; align-items: flex-start; gap: 12px; }
.pcard .p-title { font-size: 15.5px; font-weight: 700; }
.pcard.collapsible .p-body { display: none; }
.pcard.collapsible.open .p-body { display: block; }
.pcard .p-toggle { margin-left: auto; background: none; border: 1px solid var(--hairline); color: var(--ink-muted);
  border-radius: 8px; width: 30px; height: 30px; cursor: pointer; flex: 0 0 30px; font-size: 15px; transition: transform .15s; }
.pcard.open .p-toggle { transform: rotate(180deg); color: var(--accent-2); }

/* ---------- Journey ---------- */
.journey { display: flex; gap: 0; overflow-x: auto; padding: 6px 2px 14px; }
.jstep { flex: 1 0 150px; min-width: 150px; position: relative; padding: 0 8px; }
.jstep .jbox { background: var(--surface-1); border: 1px solid var(--hairline); border-radius: 12px; padding: 13px; box-shadow: var(--shadow); height: 100%; border-top: 3px solid var(--accent); }
.jstep.risco-alto .jbox { border-top-color: var(--critical); }
.jstep.risco-medio .jbox { border-top-color: var(--warn); }
.jstep .jn { font-size: 11px; color: var(--ink-muted); font-weight: 700; }
.jstep .jt { font-size: 14.5px; font-weight: 700; margin: 3px 0 6px; }
.jstep .jd { font-size: 12px; color: var(--ink-2); }
.jstep .jarrow { position: absolute; right: -7px; top: 26px; z-index: 2; color: var(--ink-muted); font-size: 15px; }
.jstep:last-child .jarrow { display: none; }
.jrisk { display:inline-block; margin-top:8px; font-size:10.5px; font-weight:700; padding:2px 7px; border-radius: 6px; }
.jrisk.alto{ color: var(--critical); background: color-mix(in srgb,var(--critical) 14%, var(--surface-1)); }
.jrisk.medio{ color: var(--warn); background: color-mix(in srgb,var(--warn) 16%, var(--surface-1)); }

.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12px; color: var(--ink-muted); margin-top: 6px; align-items:center; }
.legend .dot { display:inline-block; width:12px; height:12px; border-radius:3px; margin-right:5px; vertical-align:middle;}

/* ---------- CSD ---------- */
.csd-cols { display: grid; grid-template-columns: repeat(3,1fr); gap: 16px; }
@media (max-width: 960px){ .csd-cols{ grid-template-columns: 1fr; } }
.csd-col h3 { font-size: 15px; margin-bottom: 4px; display: flex; align-items: center; gap: 8px; }
.csd-col .cnt { font-size: 12px; color: var(--ink-muted); font-weight: 600; }
.csd-col .col-head { padding: 12px 14px; border-radius: 12px 12px 0 0; border: 1px solid var(--hairline); border-bottom: none; }
.csd-col.certeza .col-head { background: color-mix(in srgb, var(--seal-evidencia) 12%, var(--surface-1)); }
.csd-col.suposicao .col-head { background: color-mix(in srgb, var(--seal-hipotese) 13%, var(--surface-1)); }
.csd-col.duvida .col-head { background: color-mix(in srgb, var(--seal-descoberta) 12%, var(--surface-1)); }
.csd-list { border: 1px solid var(--hairline); border-radius: 0 0 12px 12px; padding: 8px; background: var(--surface-2); display: flex; flex-direction: column; gap: 8px; max-height: 620px; overflow-y: auto; }
.csd-item { background: var(--surface-1); border: 1px solid var(--hairline); border-radius: 9px; padding: 10px 12px; font-size: 13px; }
.csd-item .theme { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--accent-2); }
:root[data-theme="dark"] .csd-item .theme { color: var(--accent); }
.csd-item .txt { color: var(--ink); margin-top: 2px; }

/* force meter (laranja) */
.force { display: inline-flex; align-items: center; gap: 6px; margin-top: 7px; font-size: 11px; color: var(--ink-muted); font-weight: 600; }
.force .bars { display: inline-flex; gap: 3px; }
.force .bars i { width: 16px; height: 6px; border-radius: 2px; background: var(--hairline-strong); }
.force .bars i.on { background: var(--o450); }
.force.f-alta .bars i.on { background: var(--o600); }
.force.f-media .bars i.on { background: var(--o400); }
.force.f-baixa .bars i.on { background: var(--o200); }

/* prioridade pills */
.prio-pill { display:inline-flex; align-items:center; gap:6px; font-weight:800; font-size:12px; padding:4px 10px; border-radius: 8px; color:#fff; }
.prio-P0 { background: var(--accent-2); }
.prio-P1 { background: var(--accent); }
.prio-P2 { background: var(--o300); color: var(--o700); }

/* ---------- Heatmap (gaps) ---------- */
.heat-wrap { overflow-x: auto; border: 1px solid var(--hairline); border-radius: var(--radius); background: var(--surface-1); box-shadow: var(--shadow); }
table.heat { border-collapse: collapse; width: 100%; min-width: 640px; font-size: 13.5px; }
table.heat th, table.heat td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--hairline); }
table.heat thead th { font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-muted); font-weight: 700; background: var(--surface-2); position: sticky; top: 0; }
table.heat tbody tr:last-child td { border-bottom: none; }
table.heat .pr { font-weight: 800; text-align: center; width: 42px; }
table.heat .pr span { display:inline-grid; place-items:center; width: 26px; height: 26px; border-radius: 8px; background: var(--accent); color:#fff; font-size: 13px; }
table.heat td.gapname { font-weight: 600; color: var(--ink); }
.hcell { display:inline-block; min-width: 84px; text-align:center; padding: 5px 10px; border-radius: 8px; font-size: 12px; font-weight: 700; }
.hl-3 { background: var(--o600); color:#fff; }
.hl-2 { background: var(--o450); color:#fff; }
.hl-1 { background: var(--o200); color: var(--o700); }
.hl-0 { background: var(--o100); color: var(--o700); }

/* ---------- Matriz 2x2 de priorização ---------- */
.matrix { position: relative; background: var(--surface-1); border: 1px solid var(--hairline); border-radius: var(--radius); box-shadow: var(--shadow); padding: 44px 20px 20px 52px; }
.matrix .m-plot { position: relative; width: 100%; aspect-ratio: 16/10; min-height: 320px; border-left: 2px solid var(--hairline-strong); border-bottom: 2px solid var(--hairline-strong); }
.matrix .m-quad { position: absolute; inset: 0; display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; }
.matrix .m-quad > div { border-right: 1px dashed var(--hairline); border-top: 1px dashed var(--hairline); }
.matrix .m-quad .q-hot { background: color-mix(in srgb, var(--accent) 7%, transparent); }
.matrix .m-dot {
  position: absolute; transform: translate(-50%, -50%); width: 30px; height: 30px; border-radius: 50%;
  background: var(--accent); color: #fff; font-size: 12px; font-weight: 800; display: grid; place-items: center;
  border: 2px solid var(--surface-1); box-shadow: var(--shadow); cursor: default; transition: transform .1s;
}
.matrix .m-dot:hover { transform: translate(-50%, -50%) scale(1.18); z-index: 5; }
.matrix .m-dot.p-top { background: var(--accent-2); }
.matrix .m-dot .m-tip {
  position: absolute; bottom: 130%; left: 50%; transform: translateX(-50%); width: max-content; max-width: 230px;
  background: var(--brand); color: #fff; font-size: 11.5px; font-weight: 500; line-height: 1.35; padding: 7px 10px;
  border-radius: 8px; opacity: 0; pointer-events: none; transition: opacity .12s; z-index: 10; white-space: normal; text-align:left; }
:root[data-theme="dark"] .matrix .m-dot .m-tip { background: #000; }
.matrix .m-dot:hover .m-tip { opacity: 1; }
.matrix .ax-x { position: absolute; bottom: 14px; left: 52px; right: 20px; text-align: center; font-size: 11.5px; font-weight: 700; color: var(--ink-muted); text-transform: uppercase; letter-spacing: .05em; }
.matrix .ax-y { position: absolute; top: 44px; bottom: 44px; left: 14px; width: 16px; writing-mode: vertical-rl; transform: rotate(180deg); text-align: center; font-size: 11.5px; font-weight: 700; color: var(--ink-muted); text-transform: uppercase; letter-spacing: .05em; }
.matrix .ax-note { position:absolute; font-size: 10.5px; color: var(--ink-muted); }

/* ---------- Barras de distribuição ---------- */
.distrib { display: flex; flex-direction: column; gap: 12px; }
.distrib .row { display: grid; grid-template-columns: 130px 1fr 42px; align-items: center; gap: 12px; }
.distrib .row .lbl { font-size: 12.5px; color: var(--ink-2); font-weight: 600; }
.distrib .row .track { height: 22px; background: var(--surface-3); border-radius: 6px; overflow: hidden; }
.distrib .row .fill { height: 100%; border-radius: 6px; }
.distrib .row .val { font-size: 13px; font-weight: 800; text-align: right; font-variant-numeric: tabular-nums; }
.fill-certeza { background: var(--seal-evidencia); }
.fill-suposicao { background: var(--seal-hipotese); }
.fill-duvida { background: var(--seal-descoberta); }
.fill-accent { background: var(--accent); }

/* ---------- Donut (conic) ---------- */
.donut-wrap { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.donut { width: 150px; height: 150px; border-radius: 50%; flex: 0 0 150px; position: relative; }
.donut::after { content: attr(data-total); position: absolute; inset: 26px; background: var(--surface-1); border-radius: 50%; display: grid; place-items: center; font-size: 30px; font-weight: 800; color: var(--ink); }
.donut-legend { display: flex; flex-direction: column; gap: 8px; }
.donut-legend .dl { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-2); }
.donut-legend .dl b { color: var(--ink); }
.donut-legend .sw { width: 12px; height: 12px; border-radius: 3px; flex: 0 0 12px; }

/* ---------- Funil de indicadores ---------- */
.funnel { display: flex; flex-direction: column; gap: 10px; }
.funnel .fstage { border: 1px solid var(--hairline); border-radius: 11px; overflow: hidden; background: var(--surface-1); }
.funnel .fstage .fs-head { padding: 9px 14px; font-weight: 700; font-size: 13.5px; color: #fff; display:flex; align-items:center; gap: 8px; }
.funnel .fstage .fs-head .cnt { margin-left:auto; font-size: 11.5px; font-weight: 600; opacity: .9; }
.funnel .fstage .fs-body { padding: 8px; display: flex; flex-wrap: wrap; gap: 6px; }
.funnel .fs-pill { font-size: 12px; background: var(--surface-2); border: 1px solid var(--hairline); border-radius: 7px; padding: 5px 9px; color: var(--ink-2); }

/* ---------- Tables generic ---------- */
.tbl-wrap { overflow-x: auto; border: 1px solid var(--hairline); border-radius: var(--radius); background: var(--surface-1); box-shadow: var(--shadow); }
table.tbl { border-collapse: collapse; width: 100%; min-width: 620px; font-size: 13.5px; }
table.tbl th, table.tbl td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--hairline); vertical-align: top; }
table.tbl thead th { font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-muted); font-weight: 700; background: var(--surface-2); position: sticky; top: 0; }
table.tbl tbody tr:hover { background: var(--surface-2); }
table.tbl code, .mono { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 12.5px; color: var(--ink-2); }
.freq-pill { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 6px; background: var(--surface-3); color: var(--ink-2); white-space: nowrap; }

/* ---------- Atomic cards ---------- */
.atomic { border-top: 4px solid var(--accent); }
.atomic.tipo-hipotese { border-top-color: var(--seal-hipotese); }
.atomic .a-head { display:flex; align-items:center; gap:8px; margin-bottom: 10px; }
.atomic .a-type { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing:.05em; padding: 3px 9px; border-radius: 7px; background: var(--accent-soft); color: var(--accent-2); }
:root[data-theme="dark"] .atomic .a-type { color: var(--accent); }
.atomic.tipo-hipotese .a-type { background: color-mix(in srgb,var(--seal-hipotese) 16%, var(--surface-1)); color: var(--seal-hipotese); }
.atomic .a-title { font-size: 15.5px; font-weight: 700; margin: 4px 0 10px; }
.atomic .a-field { margin: 8px 0; font-size: 13px; }
.atomic .a-field .lab { font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing:.05em; color: var(--ink-muted); display:block; margin-bottom: 2px; }
.atomic .a-field.opp { background: var(--surface-2); border-radius: 8px; padding: 9px 11px; }

/* dimension cards */
.dim { text-align: left; position: relative; overflow: hidden; }
.dim .dn { font-size: 40px; font-weight: 800; color: color-mix(in srgb, var(--accent) 30%, transparent); line-height: 1; }
.dim .dt { font-size: 17px; font-weight: 800; margin: 4px 0 6px; color: var(--accent-2); }
:root[data-theme="dark"] .dim .dt { color: var(--accent); }
.dim .dd { font-size: 13.5px; color: var(--ink-2); }

/* ---------- Conexões (painel) ---------- */
.conn-head { background: linear-gradient(135deg, color-mix(in srgb,var(--accent) 14%, var(--surface-1)), var(--surface-1)); border: 1px solid var(--hairline); border-radius: var(--radius); padding: 16px 18px; margin-bottom: 20px; display:flex; align-items:center; gap:12px; }
.conn-head .c-ico { width: 42px; height: 42px; border-radius: 11px; background: var(--accent); color: #fff; display:grid; place-items:center; font-size: 20px; flex:0 0 42px; }
.conn-head .c-term { font-size: 20px; font-weight: 800; }
.conn-head .c-sub { font-size: 12.5px; color: var(--ink-muted); }
.conn-group { margin: 18px 0; }
.conn-group h3 { font-size: 14px; display:flex; align-items:center; gap:8px; margin-bottom: 10px; }
.conn-group h3 .badge { font-size: 11px; background: var(--surface-3); border-radius: 999px; padding: 1px 8px; color: var(--ink-muted); font-weight: 700; }
.conn-item { background: var(--surface-1); border: 1px solid var(--hairline); border-left: 3px solid var(--accent); border-radius: 9px; padding: 11px 14px; margin-bottom: 8px; cursor: pointer; transition: all .12s; }
.conn-item:hover { border-color: var(--hairline-strong); box-shadow: var(--shadow); }
.conn-item .ci-kind { font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing:.05em; color: var(--accent-2); }
:root[data-theme="dark"] .conn-item .ci-kind { color: var(--accent); }
.conn-item .ci-title { font-size: 13.5px; font-weight: 600; color: var(--ink); margin-top: 2px; }

/* seals legend grid */
.seals-legend { display: grid; grid-template-columns: repeat(2,1fr); gap: 10px; }
@media (max-width: 720px){ .seals-legend{ grid-template-columns: 1fr; } }
.seals-legend .sl { display: flex; gap: 11px; align-items: flex-start; padding: 12px 13px; border: 1px solid var(--hairline); border-radius: 11px; background: var(--surface-1); }
.seals-legend .sl .sd { font-size: 12.5px; color: var(--ink-2); }

.empty { text-align: center; color: var(--ink-muted); padding: 60px 20px; font-size: 14px; }

/* filter chips */
.filters { display: flex; gap: 7px; flex-wrap: wrap; align-items: center; }
.filters .fl-lab { font-size: 12px; color: var(--ink-muted); font-weight: 600; margin-right: 2px; }
.fchip { font-size: 12px; font-weight: 600; padding: 5px 11px; border-radius: 999px; cursor: pointer; border: 1px solid var(--hairline); background: var(--surface-1); color: var(--ink-2); transition: all .12s; }
.fchip:hover { border-color: var(--hairline-strong); }
.fchip.active { background: var(--accent); color: #fff; border-color: var(--accent); }

.hidden { display: none !important; }
mark { background: color-mix(in srgb, var(--accent) 45%, transparent); color: inherit; border-radius: 3px; padding: 0 1px; }

/* ---------- Report / analytical mode ---------- */
.report { max-width: 800px; }
.report h2 { font-size: 21px; margin: 34px 0 12px; padding-top: 10px; border-top: 1px solid var(--hairline); }
.report h2:first-of-type { border-top: none; padding-top: 0; }
.report h3 { font-size: 16px; margin: 22px 0 8px; color: var(--accent-2); }
:root[data-theme="dark"] .report h3 { color: var(--accent); }
.report h4 { font-size: 14px; margin: 16px 0 6px; }
.report p, .report li { font-size: 14.5px; color: var(--ink-2); }
.report ul { padding-left: 20px; }
.report ul li { margin: 3px 0; }
.report .rmeta { font-size: 12px; color: var(--ink-muted); margin-bottom: 4px; }
.report .anchor-h { scroll-margin-top: 110px; }

/* ---------- MODO APRESENTAÇÃO ---------- */
:root.presenting .sidebar,
:root.presenting .topbar,
:root.presenting .toolbar,
:root.presenting .backdrop { display: none !important; }
:root.presenting .content { max-width: 1000px; padding: 48px 40px 120px; }
:root.presenting .section-head h1 { font-size: 34px; }
:root.presenting .section-head .lede { font-size: 18px; }
:root.presenting body { background: var(--page); }
.present-bar {
  display: none; position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 100;
  background: var(--brand); color: #fff; border-radius: 999px; padding: 8px 10px; gap: 6px; align-items: center;
  box-shadow: var(--shadow-lg);
}
:root[data-theme="dark"] .present-bar { background: #000; border: 1px solid var(--hairline); }
:root.presenting .present-bar { display: flex; }
.present-bar button { background: rgba(255,255,255,.12); color: #fff; border: none; width: 38px; height: 38px; border-radius: 50%; cursor: pointer; font-size: 17px; display:grid; place-items:center; }
.present-bar button:hover { background: rgba(255,255,255,.24); }
.present-bar button:disabled { opacity: .3; cursor: default; }
.present-bar .pg { font-size: 13px; font-weight: 700; padding: 0 12px; min-width: 88px; text-align: center; font-variant-numeric: tabular-nums; }
.present-bar .pg small { display:block; font-size: 10px; font-weight: 500; opacity: .75; text-transform: uppercase; letter-spacing: .04em; }
.present-bar .exit { background: var(--accent); }
.present-bar .exit:hover { background: var(--o500); }

/* mobile */
.backdrop { display:none; }
@media (max-width: 900px) {
  .menu-btn { display: grid; place-items: center; }
  .sidebar { position: fixed; left: 0; top: 0; transform: translateX(-100%); transition: transform .22s ease; box-shadow: var(--shadow-lg); }
  .sidebar.open { transform: none; }
  .backdrop.show { display:block; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 39; }
  .content { padding: 22px 16px 80px; }
  .section-head h1 { font-size: 22px; }
  .toolbar { top: 39px; }
  .distrib .row { grid-template-columns: 96px 1fr 36px; }
}

/* ---------- IMPRESSÃO / PDF ---------- */
@media print {
  @page { margin: 14mm; }
  .sidebar, .toolbar, .menu-btn, .topbar, .present-bar, .backdrop, .filters { display: none !important; }
  body, .app { display: block; background: #fff; color: #000; }
  .content { max-width: none; padding: 0; }
  .card, .stat, .heat-wrap, .tbl-wrap, .matrix, .csd-list, .conn-item { box-shadow: none; break-inside: avoid; }
  .pcard.collapsible .p-body { display: block !important; }
  .csd-list { max-height: none; overflow: visible; }
  .journey { flex-wrap: wrap; }
  .section-head h1 { font-size: 22px; }
  a { color: #000; text-decoration: none; }
  mark { background: none; font-weight: 700; }
}
