/* cerneo · DDD Banking Reference Architect — identidade cerneo.com.br.
   Paleta teal "neo" sobre neutros frios (charcoal/mist), Urbanist (única
   família da marca) para display e UI + mono (JetBrains) para dados,
   botões pill, cantos generosos, muito respiro, motion calmo.
   Webfonts self-hosted em /fonts (OFL) — segue funcionando offline. */

/* ---------- fontes ---------- */
@font-face {
  font-family: "Urbanist";
  src: url("../fonts/urbanist-var.woff2") format("woff2");
  font-weight: 100 900; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Urbanist";
  src: url("../fonts/urbanist-var-italic.woff2") format("woff2");
  font-weight: 100 900; font-style: italic; font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("../fonts/jetbrains-mono-var.woff2") format("woff2");
  font-weight: 100 800; font-style: normal; font-display: swap;
}

/* ---------- tokens ---------- */
:root {
  /* cor (light — mist/charcoal + teal "neo" cerneo) */
  --bg: #F5F7FA;
  --surface: #ffffff;
  --surface-2: #E8EEF3;
  --ink: #0B1220;
  --ink-2: #334155;
  --ink-3: #64748B;
  --line: #E2E8F0;
  --brand: #0F766E;
  --green: #059669;
  --amber: #B45309;
  --blue: #0369A1;
  --blue-soft: #0EA5E9;
  --terra: #C2410C;

  /* aliases legados (referenciados por valores antigos em JS inline styles) */
  --paper: var(--bg);
  --paper-2: var(--surface-2);
  --rule: var(--line);
  --rule-strong: var(--ink);
  --oxblood: var(--brand);

  /* tipo */
  --display: "Urbanist", -apple-system, "Segoe UI", sans-serif;
  --sans: "Urbanist", -apple-system, "Segoe UI", sans-serif;
  --serif: var(--sans); /* alias legado: corpo migrou para sans */
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  /* raio */
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 24px;
  --r-pill: 999px;

  /* sombra difusa */
  --shadow-1: 0 1px 2px rgba(11, 18, 32, .05), 0 2px 8px rgba(11, 18, 32, .04);
  --shadow-2: 0 2px 6px rgba(11, 18, 32, .05), 0 10px 28px rgba(11, 18, 32, .09);
  --shadow-3: 0 8px 20px rgba(11, 18, 32, .08), 0 24px 60px rgba(11, 18, 32, .16);
  --shadow-hard: var(--shadow-1); /* alias legado */
  --shadow-lift: var(--shadow-2); /* alias legado */

  /* motion */
  --ease: cubic-bezier(.22, .61, .36, 1);
  --spring: cubic-bezier(.34, 1.56, .64, 1);
  --elastic: cubic-bezier(.5, 1.75, .4, .9);
  --t-fast: .15s;
  --t-slow: .35s;

  color-scheme: light;
}

/* ---------- tema escuro (charcoal cerneo + teal claro) ---------- */
html[data-theme="dark"] {
  --bg: #0B1220;
  --surface: #111A2B;
  --surface-2: #1F2A37;
  --ink: #F3F4F6;
  --ink-2: #9CA9BB;
  --ink-3: #64748B;
  --line: #263449;
  --brand: #2DD4BF;
  --green: #34D399;
  --amber: #FBBF24;
  --blue: #7DD3FC;
  --blue-soft: #38BDF8;
  --terra: #FB923C;

  --shadow-1: 0 1px 2px rgba(0, 0, 0, .35), 0 2px 8px rgba(0, 0, 0, .28);
  --shadow-2: 0 2px 6px rgba(0, 0, 0, .38), 0 10px 28px rgba(0, 0, 0, .42);
  --shadow-3: 0 8px 20px rgba(0, 0, 0, .45), 0 24px 60px rgba(0, 0, 0, .6);

  color-scheme: dark;
}

* { box-sizing: border-box; margin: 0; }
[hidden] { display: none !important; } /* .btn e afins redefinem display — hidden precisa vencer */

::selection { background: color-mix(in srgb, var(--brand) 20%, transparent); }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 4px; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--line); border: 3px solid var(--bg); border-radius: var(--r-pill); }
::-webkit-scrollbar-thumb:hover { background: var(--ink-3); }

html { height: 100%; scrollbar-gutter: stable; }
body {
  height: 100%;
  font-family: var(--sans);
  font-weight: 400;
  color: var(--ink);
  background: var(--bg);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.shell { display: flex; min-height: 100vh; min-height: 100dvh; }

/* ---------- sidebar ---------- */
.sidebar {
  /* espaçamentos modulados pelos degraus de compactação por altura (abaixo) */
  --sb-pad-top: 30px; --sb-pad-bottom: 24px; --sb-gap: 30px;
  --sb-link-pad-y: 8px; --sb-link-fs: 14.5px;
  --sb-label-mt: 12px; --sb-label-mb: 4px;
  --sb-mark: 48px; --sb-mark-mb: 16px;
  width: 264px; flex: none;
  padding: var(--sb-pad-top) 18px var(--sb-pad-bottom);
  display: flex; flex-direction: column; gap: var(--sb-gap);
  position: sticky; top: 0;
  height: 100vh; height: 100dvh;
  overflow-y: auto; overflow-x: hidden;
  scrollbar-width: thin;
  transition: width .45s cubic-bezier(.6, 0, .4, 1);
}
/* menu colapsável: rail de 86px (estado em html[data-nav="rail"]).
   O conteúdo interno tem LARGURA FIXA (228px = 264 − 2×18): a animação de
   largura é um clip puro — nada re-flui, nada se move; textos só esvaecem. */
html[data-nav="rail"] .sidebar { width: 86px; }
.brand, #nav, .candle-wrap, .sidebar-foot { width: 228px; flex: none; }
.nav-ico { width: 15px; height: 15px; flex: none; align-self: center; opacity: .75; }
#nav a.active .nav-ico { opacity: 1; }
.nav-txt, .nav-label, .brand h1, .brand-sub, .sidebar-foot, .candle-label {
  transition: opacity .3s var(--ease);
}
html[data-nav="rail"] :is(.nav-txt, .nav-label, .brand h1, .brand-sub, .sidebar-foot, .candle-label) {
  opacity: 0; pointer-events: none;
}

/* hambúrguer com squish elástico (nunca vira X: as barras encurtam) */
.burger {
  position: relative; width: 36px; height: 32px; flex: none;
  border: none; border-radius: 10px; background: transparent; cursor: pointer;
  transition: background var(--t-fast) var(--ease);
}
.burger:hover { background: var(--surface-2); }
.burger i {
  position: absolute; left: 10px; height: 2px; border-radius: 2px;
  background: var(--ink-2); display: block;
  transition: width .5s var(--elastic), background .3s;
}
.burger i:nth-child(1) { top: 10px; width: 16px; }
.burger i:nth-child(2) { top: 15px; width: 16px; transition-delay: .04s; }
.burger i:nth-child(3) { top: 20px; width: 16px; transition-delay: .08s; }
html[data-nav="rail"] .burger i:nth-child(2) { width: 9px; }
html[data-nav="rail"] .burger i:nth-child(3) { width: 13px; }

.brand { padding: 0 10px; }
.brand-mark {
  width: var(--sb-mark); height: var(--sb-mark);
  display: grid; place-items: center; margin-bottom: var(--sb-mark-mb);
}
.brand-mark img { width: var(--sb-mark); height: var(--sb-mark); display: block; }
.brand h1 {
  font-family: var(--display); font-size: 22px; line-height: 1.15;
  font-weight: 700; letter-spacing: -.02em; text-transform: uppercase;
}
.brand-sub {
  margin-top: 8px; font-family: var(--mono); font-size: 10px;
  text-transform: uppercase; letter-spacing: .14em; color: var(--ink-3);
}
#nav { display: flex; flex-direction: column; gap: 2px; }
#nav a {
  color: var(--ink-2); text-decoration: none; padding: var(--sb-link-pad-y, 8px) 12px;
  border-radius: var(--r-md);
  font-size: var(--sb-link-fs, 14.5px); font-weight: 500;
  display: flex; gap: 10px; align-items: center;
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
#nav a .nav-txt { flex: 1; min-width: 0; }
#nav a:hover { background: var(--surface-2); color: var(--ink); }
#nav a.active { background: var(--ink); color: var(--bg); font-weight: 600; box-shadow: var(--shadow-1); }
.nav-rule { height: 16px; }
.nav-label {
  margin: var(--sb-label-mt, 12px) 12px var(--sb-label-mb, 4px); font-family: var(--mono); font-size: 9.5px;
  text-transform: uppercase; letter-spacing: .14em; color: var(--ink-3);
}
#nav .nav-label:first-child { margin-top: 0; }

/* ---------- sidebar compacta adaptativa ----------
   O conteúdo da sidebar tem altura ~fixa em px (~1070px no estado folgado);
   os degraus abaixo comprimem espaçamentos conforme a ALTURA do viewport para
   o menu caber sem rolar nas 3 telas (MacBook, ultrawide, 1080p). Guarda de
   min-width para nunca interferir no header horizontal mobile (≤900px). */

/* degrau 1: notebooks/1080p — orçamento ~900px */
@media (min-width: 901px) and (max-height: 1080px) {
  .sidebar {
    --sb-pad-top: 20px; --sb-pad-bottom: 18px; --sb-gap: 18px;
    --sb-link-pad-y: 6px;
    --sb-label-mt: 8px; --sb-label-mb: 3px;
    --sb-mark: 40px; --sb-mark-mb: 10px;
  }
  .sidebar-foot { font-size: 11.5px; }
}

/* degrau 2: MacBook com chrome do browser / janelas baixas — orçamento ~690px */
@media (min-width: 901px) and (max-height: 930px) {
  .sidebar {
    --sb-pad-top: 14px; --sb-pad-bottom: 14px; --sb-gap: 12px;
    --sb-link-pad-y: 5px; --sb-link-fs: 13.5px;
    --sb-label-mt: 6px; --sb-label-mb: 2px;
    --sb-mark: 32px; --sb-mark-mb: 8px;
  }
  .brand h1 { font-size: 19px; }
  .nav-label { font-size: 9px; }
  /* mesmo tratamento que o mobile (breakpoint ≤900px) já dá a estes dois */
  .brand-sub, .sidebar-foot { display: none; }
}

/* fallback quando nem compactado cabe: só o #nav cede e rola, com barra fina
   visível apenas no hover/foco; vela e rodapé permanecem ancorados embaixo */
@media (min-width: 901px) {
  #nav {
    flex: 0 1 auto; min-height: 220px; /* ~6 itens sempre visíveis */
    overflow-y: auto; overscroll-behavior: contain;
    scrollbar-width: thin; scrollbar-color: transparent transparent;
  }
  .sidebar:hover #nav, #nav:focus-within {
    scrollbar-color: color-mix(in srgb, var(--ink-3) 45%, transparent) transparent;
  }
  #nav::-webkit-scrollbar { width: 5px; }
  /* o thumb global tem border de 3px — zerar aqui para a barra ficar fina */
  #nav::-webkit-scrollbar-thumb { background: transparent; border: none; border-radius: var(--r-pill); }
  .sidebar:hover #nav::-webkit-scrollbar-thumb,
  #nav:focus-within::-webkit-scrollbar-thumb {
    background: color-mix(in srgb, var(--ink-3) 45%, transparent);
  }
  /* último recurso (janelas minúsculas): a sidebar inteira rola com barra fina */
  .sidebar::-webkit-scrollbar { width: 5px; }
  .sidebar::-webkit-scrollbar-thumb { background: var(--line); border: none; }
  /* no rail a barra do #nav ficaria clipada na borda — esconder de vez */
  html[data-nav="rail"] #nav { scrollbar-width: none; }
  html[data-nav="rail"] #nav::-webkit-scrollbar { display: none; }
}

/* ---------- landscape-país (pôster 2D: planos > categorias > tiles) ---------- */
/* a página-país usa a tela toda (as demais views mantêm o max-width) */
.view:has(.pl-wrap) { max-width: none; }
/* blueprint standalone: página enxuta para caber em 1 tela
   (:not(.wz-app) obrigatório — mesma especificidade de .view.wz-app) */
.view:not(.wz-app):has(.pl-wrap--bp) { padding: 18px clamp(20px, 2vw, 40px) 24px; }
.pl-canvas {
  display: grid; gap: 14px;
  grid-template-columns: minmax(200px, 16fr) minmax(0, 62fr) minmax(280px, 22fr);
  grid-template-areas:
    "modulos modulos modulos"
    "base    spb     reporte"
    "reg     reg     reg";
}
.pl-plane {
  border: 1.5px dashed color-mix(in srgb, var(--ink-3) 55%, transparent);
  border-radius: var(--r-lg); padding: 12px 14px 14px;
  background: color-mix(in srgb, var(--surface) 40%, transparent);
}
.pl-plane-brand { background: color-mix(in srgb, var(--brand) 3.5%, transparent); }
.pl-plane-amber { background: color-mix(in srgb, var(--amber) 4%, transparent); }
.pl-plane-title {
  font-family: var(--mono); font-size: 10px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .12em; color: var(--ink-2);
  margin-bottom: 10px;
}
.pl-cats { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-start; }
.pl-cat {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-md); box-shadow: var(--shadow-1);
  flex: 1 1 260px; min-width: 0; overflow: hidden;
}
.pl-plane[style*="base"] .pl-cat, .pl-plane[style*="reporte"] .pl-cat,
.pl-cat--full { flex: 1 1 100%; }
.pl-cat-h {
  font-family: var(--mono); font-size: 9.5px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .09em; color: var(--ink-2);
  background: var(--surface-2); padding: 5px 10px;
  border-bottom: 1px solid var(--line);
}
.pl-plane-brand .pl-cat-h { background: color-mix(in srgb, var(--brand) 9%, var(--surface-2)); }
.pl-plane-amber .pl-cat-h { background: color-mix(in srgb, var(--amber) 10%, var(--surface-2)); }
.pl-tiles { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px; }
.pl-tile {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; min-width: 86px; max-width: 128px; padding: 8px 8px 7px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 9px;
  cursor: pointer; text-align: center; color: var(--ink-2);
  transition: border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease),
    transform var(--t-fast) var(--ease);
}
.pl-tile:hover { border-color: var(--ink-3); box-shadow: var(--shadow-1); transform: translateY(-1px); color: var(--ink); }
.pl-tile strong { font-size: 12px; color: var(--ink); line-height: 1.15; }
.pl-tile span {
  font-size: 8.5px; line-height: 1.25; color: var(--ink-3);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.pl-tile-wide {
  flex-direction: row; min-width: 0; max-width: none; padding: 5px 11px;
  font-size: 10.5px; text-align: left;
}
.pl-tile-dev { border-style: dashed; background: color-mix(in srgb, var(--amber) 6%, var(--surface)); }
.pl-tile-static { cursor: default; }
.pl-tile-static:hover { border-color: var(--line); box-shadow: none; transform: none; color: var(--ink-2); }

/* Landscape da Solução (0.2) na mesma gramática de planos; ACL e Parceiros
   empilham na coluna direita enquanto a Plataforma ocupa as duas linhas */
.pl-canvas--solution {
  grid-template-columns: minmax(0, 68fr) minmax(300px, 32fr);
  grid-template-rows: auto auto 1fr auto;
  grid-template-areas:
    "acesso     acesso"
    "plataforma acl"
    "plataforma parceiros"
    "fora       fora";
}
.pl-cat-h--group {
  font-family: var(--sans); font-size: 12.5px; font-weight: 650;
  text-transform: none; letter-spacing: 0;
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
}
.pl-cat .bl-br { margin: 0 10px 10px; padding-top: 8px; border-top: 1px dotted var(--line); }
/* .pl-canvas.pl-canvas--solution: especificidade acima da regra mobile da
   página-país (.pl-canvas, mais adiante no arquivo), que senão vence o cascade */
@media (max-width: 1150px) {
  .pl-canvas.pl-canvas--solution { grid-template-columns: 1fr; grid-template-rows: none; grid-template-areas: "acesso" "plataforma" "acl" "parceiros" "fora"; }
}

/* densidade do blueprint (escopada — a página-país mantém os valores base) */
.pl-wrap--bp {
  --bp-gap: 10px;                /* canvas gap, era 14 */
  --bp-plane-pad: 8px 11px 10px; /* era 12 14 14 */
  --bp-title-mb: 6px;            /* era 10 */
  --bp-cats-gap: 7px;            /* era 10 */
  --bp-tiles-pad: 7px;           /* era 10 */
  --bp-tiles-gap: 5px;           /* era 6 */
  --bp-tile-pad: 3px 9px;        /* era 5 11 */
  --bp-tile-fs: 10px;            /* era 10.5 */
}
.pl-wrap--bp .pl-canvas { gap: var(--bp-gap); }
.pl-wrap--bp .pl-plane { padding: var(--bp-plane-pad); }
.pl-wrap--bp .pl-plane-title { margin-bottom: var(--bp-title-mb); }
.pl-wrap--bp .pl-cats { gap: var(--bp-cats-gap); }
.pl-wrap--bp .pl-tiles { padding: var(--bp-tiles-pad); gap: var(--bp-tiles-gap); }
.pl-wrap--bp .pl-tile-wide { padding: var(--bp-tile-pad); font-size: var(--bp-tile-fs); }
.pl-wrap--bp .pl-cat-h { padding: 4px 9px; }
.pl-wrap--bp .pl-cat .bl-br { margin: 0 9px 7px; padding-top: 6px; }
@media (min-width: 1151px) and (max-height: 930px) {
  .pl-wrap--bp { --bp-gap: 8px; --bp-plane-pad: 6px 9px 8px; --bp-title-mb: 4px;
    --bp-cats-gap: 6px; --bp-tiles-pad: 6px; --bp-tiles-gap: 4px;
    --bp-tile-pad: 2px 8px; --bp-tile-fs: 9.5px; }
  .pl-wrap--bp .bl-title { font-size: 18px; }
}

/* header/footer compactos do blueprint */
.pl-wrap--bp .bl-header { align-items: center; padding-bottom: 8px; margin-bottom: 10px; }
.pl-wrap--bp .bl-title { font-size: 20px; }
.pl-wrap--bp .bl-subtitle { font-size: 12.5px; margin-top: 1px; }
.pl-wrap--bp .bl-meta { line-height: 1.45; }
.bl-head-right { display: flex; align-items: center; gap: 12px; }
.bl-head-right .bl-toolbar { margin: 0; }
.pl-wrap--bp .bl-footer { margin-top: 8px; padding-top: 8px; flex-wrap: nowrap; }
.pl-wrap--bp .bl-legend { flex-wrap: nowrap; white-space: nowrap; }

/* faixa fundida clientes + canais */
.pl-plane--strip { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 8px; padding: 7px 12px; }
.pl-plane--strip .pl-plane-title { margin: 0 8px 0 0; }
.pl-strip-sep { width: 1px; align-self: stretch; background: var(--line); margin: 0 5px; }

/* fora do escopo colapsado (details no nível do plano) */
.pl-plane--off > summary { cursor: pointer; list-style: none; margin: 0;
  display: flex; align-items: center; gap: 8px; }
.pl-plane--off > summary::-webkit-details-marker { display: none; }
.pl-plane--off > summary::after { content: "expandir ▾"; margin-left: auto; opacity: .6; }
.pl-plane--off[open] > summary { margin-bottom: var(--bp-title-mb, 10px); }
.pl-plane--off[open] > summary::after { content: "recolher ▴"; }
.pl-count {
  font-family: var(--mono); font-size: 8.5px; color: var(--ink-3);
  background: var(--surface-2); border-radius: var(--r-pill); padding: 1px 6px; margin-left: 4px;
}
@media (max-width: 1150px) {
  .pl-canvas { grid-template-columns: 1fr; grid-template-areas: "modulos" "base" "spb" "reporte" "reg"; }
}
@media print {
  .pl-plane, .pl-cat, .pl-cat-h, .pl-tile { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  .pl-wrap--bp { --bp-gap: 12px; --bp-tile-fs: 10.5px; }
}
/* ---------- vela (toggle de tema): acesa = claro, soprada = escuro ---------- */
.candle-wrap { margin-top: auto; display: flex; align-items: flex-end; gap: 9px; padding: 0 8px; }
.candle { position: relative; width: 36px; height: 48px; flex: none; border: none; background: transparent; cursor: pointer; padding: 0; }
.candle-glow { position: absolute; left: 50%; top: 13px; width: 28px; height: 28px; border-radius: 50%; transform: translate(-50%,-50%); background: radial-gradient(circle, rgba(255,183,77,.5), transparent 70%); animation: candle-glow 2.6s infinite ease-in-out; transition: opacity .5s; }
.candle-flame { position: absolute; left: 50%; top: 6px; width: 7px; height: 10px; margin-left: -3.5px; background: linear-gradient(#FFB74D, #E65100); border-radius: 50% 50% 50% 50% / 62% 62% 38% 38%; transform-origin: 50% 100%; animation: candle-flick .5s infinite alternate ease-in-out; transition: opacity .35s; }
.candle-smoke { position: absolute; left: 50%; top: 10px; width: 5px; height: 5px; margin-left: -2.5px; opacity: 0; transition: opacity .4s; }
.candle-smoke i { position: absolute; inset: 0; border-radius: 50%; background: rgba(150,148,144,.75); animation: candle-smoke 2.2s infinite ease-out; }
.candle-wick { position: absolute; left: 50%; top: 14px; width: 1.5px; height: 5px; margin-left: -.75px; background: #673C63; border-radius: 2px; }
.candle-body { position: absolute; left: 50%; bottom: 6px; width: 16px; height: 23px; margin-left: -8px; background: var(--surface); border: 1.5px solid #673C63; border-radius: 5px 5px 3px 3px; transition: background .5s; }
.candle-body i { position: absolute; top: 7px; width: 2.5px; height: 2.5px; border-radius: 50%; background: #673C63; animation: candle-blink 3.4s infinite; }
.candle-body i:first-child { left: 3px; }
.candle-body i:last-child { right: 3px; }
.candle-floor { position: absolute; left: 50%; bottom: 4px; width: 26px; height: 2.5px; margin-left: -13px; background: #673C63; border-radius: 2px; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
/* estado escuro: chama some, fumaça sobe, olhinhos param de piscar */
html[data-theme="dark"] .candle-flame,
html[data-theme="dark"] .candle-glow { opacity: 0; }
html[data-theme="dark"] .candle-smoke { opacity: 1; }
html[data-theme="dark"] .candle-body i { animation: none; }
.candle-label { font-size: 10px; color: var(--ink-3); white-space: nowrap; padding-bottom: 7px; }
@keyframes candle-flick { from { transform: scaleY(1) rotate(-2deg); } to { transform: scaleY(1.18) rotate(2deg); } }
@keyframes candle-glow { 0%,100% { transform: translate(-50%,-50%) scale(1); } 50% { transform: translate(-50%,-50%) scale(1.3); } }
@keyframes candle-smoke { 0% { opacity: 0; transform: translateY(2px) scale(.5); } 30% { opacity: .85; } 100% { opacity: 0; transform: translateY(-16px) scale(1.5); } }
@keyframes candle-blink { 0%,42%,51%,100% { transform: scaleY(1); } 45%,48% { transform: scaleY(.12); } }

.sidebar-foot { padding: 0 10px; font-size: 12px; color: var(--ink-3); line-height: 1.5; }

/* ---------- topo ---------- */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; gap: 18px;
  padding: 16px 36px;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  position: sticky; top: 0; z-index: 5; backdrop-filter: blur(10px);
}
.search { flex: 1; display: flex; align-items: center; gap: 10px; max-width: 560px; position: relative; }
.search-glyph { position: absolute; left: 16px; font-size: 15px; color: var(--ink-3); pointer-events: none; }
#search-input {
  flex: 1; font-family: var(--sans); font-size: 13.5px;
  border: 1px solid transparent; border-radius: var(--r-pill);
  background: var(--surface); box-shadow: var(--shadow-1);
  padding: 10px 18px 10px 42px; color: var(--ink); outline: none;
  transition: box-shadow var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease);
}
#search-input::placeholder { color: var(--ink-3); }
#search-input:focus { border-color: var(--ink); box-shadow: var(--shadow-2); }
.status { font-family: var(--mono); font-size: 10.5px; color: var(--ink-3); }

/* ---------- sessão colaborativa ---------- */
.session-pill {
  display: inline-flex; align-items: center; gap: 8px; flex: none;
  font-family: var(--sans); font-size: 13px; font-weight: 600;
  color: var(--ink-2); background: var(--surface);
  border: 1px solid transparent; border-radius: var(--r-pill);
  padding: 9px 16px; cursor: pointer; box-shadow: var(--shadow-1);
  transition: box-shadow var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease),
    color var(--t-fast) var(--ease);
}
.session-pill:hover { border-color: var(--ink); box-shadow: var(--shadow-2); color: var(--ink); }
.session-pill.is-active { color: var(--brand); }
.session-pill .session-ico { width: 15px; height: 15px; fill: currentColor; }
.session-pill-code { font-family: var(--mono); font-size: 12px; letter-spacing: .1em; }
.session-pill-count { color: var(--ink-3); font-weight: 500; }
.session-dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--green); flex: none;
  animation: session-pulse 2.4s var(--ease) infinite;
}
@keyframes session-pulse {
  0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--green) 45%, transparent); }
  55% { box-shadow: 0 0 0 5px transparent; }
}
.session-panel { max-width: 620px; }
.session-panel-head { display: flex; gap: 14px; align-items: flex-start; margin: 4px 0 20px; }
.session-panel-head h3 { font-family: var(--display); font-weight: 700; font-size: 24px; letter-spacing: -.02em; }
.session-panel-ico { width: 26px; height: 26px; fill: var(--brand); flex: none; margin-top: 4px; }
.session-muted { font-size: 12.5px; color: var(--ink-3); margin-top: 4px; }
.session-forms { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.session-card {
  background: var(--surface-2); border-radius: var(--r-lg); padding: 18px;
  display: flex; flex-direction: column; gap: 12px;
}
.session-card h4 { font-size: 14.5px; font-weight: 700; }
.session-card label {
  display: flex; flex-direction: column; gap: 5px;
  font-family: var(--mono); font-size: 10px; text-transform: uppercase;
  letter-spacing: .1em; color: var(--ink-3);
}
.session-card input {
  font-family: var(--sans); font-size: 14px; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md);
  padding: 9px 12px; outline: none;
  transition: border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}
.session-card input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent); }
.session-card input.session-code-input {
  font-family: var(--mono); font-size: 18px; letter-spacing: .3em; text-transform: uppercase;
}
.session-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--sans); font-size: 13.5px; font-weight: 600;
  color: var(--bg); background: var(--brand);
  border: none; border-radius: var(--r-pill); padding: 10px 18px; cursor: pointer;
  box-shadow: var(--shadow-1);
  transition: filter var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}
.session-btn:hover { filter: brightness(1.08); box-shadow: var(--shadow-2); }
.session-btn .ri { width: 14px; height: 14px; fill: currentColor; }
.session-btn.ghost {
  color: var(--ink-2); background: var(--surface); border: 1px solid var(--line);
}
.session-btn.ghost:hover { color: var(--ink); border-color: var(--ink); filter: none; }
.session-btn.danger { background: transparent; color: var(--terra); border: 1px solid color-mix(in srgb, var(--terra) 40%, transparent); box-shadow: none; align-self: flex-start; margin-top: 18px; }
.session-btn.danger:hover { background: color-mix(in srgb, var(--terra) 8%, transparent); filter: none; }
.session-code-row { display: flex; align-items: center; gap: 14px; margin: 6px 0 20px; }
.session-code {
  font-family: var(--mono); font-size: 34px; font-weight: 700; letter-spacing: .28em;
  color: var(--brand); background: var(--surface-2);
  border-radius: var(--r-lg); padding: 10px 18px 10px 24px;
}
.session-people-wrap h4 { font-size: 13px; font-weight: 700; margin-bottom: 8px; }
.session-people { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 13.5px; }
.session-people em { color: var(--ink-3); font-style: normal; }
.session-people .pdot {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  margin-right: 8px; vertical-align: 1px;
}
.session-people .pdot.on { background: var(--green); }
.session-people .pdot.off { background: var(--ink-3); opacity: .5; }
.session-error { color: var(--terra); font-size: 13px; margin-top: 12px; min-height: 1em; }
@media (max-width: 760px) { .session-forms { grid-template-columns: 1fr; } .session-pill-label { display: none; } }

/* ---------- command palette (⌘K) ---------- */
#palette {
  position: absolute; top: calc(100% + 8px); left: 0; right: 0; z-index: 30;
  background: var(--surface); border-radius: var(--r-lg);
  box-shadow: var(--shadow-3); max-height: 420px; overflow-y: auto; overflow-x: hidden;
}
.pal-item {
  display: grid; grid-template-columns: 110px 1fr auto; gap: 10px;
  align-items: baseline; padding: 10px 16px; cursor: pointer;
  font-size: 13.5px;
  transition: background var(--t-fast) var(--ease);
}
.pal-item + .pal-item { border-top: 1px solid var(--line); }
.pal-item:hover, .pal-item.active { background: var(--surface-2); }
.pal-item.active { box-shadow: inset 3px 0 0 var(--brand); }
.pal-tipo {
  font-family: var(--mono); font-size: 9px; text-transform: uppercase;
  letter-spacing: .08em; color: var(--brand);
}
.pal-nome { font-weight: 600; }
.pal-extra { font-family: var(--mono); font-size: 10px; color: var(--ink-3); }
.pal-hint {
  padding: 8px 16px; font-family: var(--mono); font-size: 9.5px;
  color: var(--ink-3); background: var(--surface-2);
}

/* ---------- view ---------- */
.view {
  padding: 36px clamp(28px, 3vw, 56px) 60px;
  max-width: 1560px; width: 100%;
  margin-inline: auto; /* excedente em telas largas vira respiro simétrico */
}
.view > * { animation: rise var(--t-slow) var(--ease) both; }
.view > *:nth-child(1) { animation-delay: 0s; }
.view > *:nth-child(2) { animation-delay: .05s; }
.view > *:nth-child(3) { animation-delay: .1s; }
.view > *:nth-child(4) { animation-delay: .14s; }
.view > *:nth-child(n+5) { animation-delay: .18s; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }

.view-head { margin-bottom: 32px; }
.view-kicker {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .18em;
  text-transform: uppercase; color: var(--kc, var(--brand)); margin-bottom: 10px;
  background: color-mix(in srgb, var(--kc, var(--brand)) 7%, transparent);
}
.view-head h2 {
  font-family: var(--display); font-size: clamp(30px, 3.4vw, 42px);
  font-weight: 560; letter-spacing: -.015em; line-height: 1.08;
}
.view-head .lede { margin-top: 12px; color: var(--ink-2); max-width: 66ch; font-size: 15.5px; }

.section-title {
  font-size: 11px; font-weight: 600; letter-spacing: .14em;
  text-transform: uppercase; color: var(--ink-2);
  border-bottom: 1px solid var(--line); padding-bottom: 8px;
  margin: 36px 0 16px; display: flex; justify-content: space-between; align-items: baseline;
}
.section-title .count { font-family: var(--mono); font-weight: 400; color: var(--ink-3); }
.section-title .st-label { display: inline-flex; align-items: center; gap: 9px; }
.section-title .swatch { width: 10px; height: 10px; border-radius: 4px; flex: none; display: inline-block; }

/* ---------- cards de registro (com governanca) ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.card {
  background: var(--surface); padding: 20px 22px; cursor: pointer;
  border-radius: var(--r-lg); box-shadow: var(--shadow-1);
  display: flex; flex-direction: column; gap: 9px;
  position: relative;
  transition: transform var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow-2); }
.card h3 { font-size: 16.5px; font-weight: 650; line-height: 1.25; letter-spacing: -.01em; }
.card-trow { display: flex; align-items: center; gap: 9px; }
.card-ico {
  width: 27px; height: 27px; border-radius: 9px; flex: none;
  background: color-mix(in srgb, var(--gc, var(--brand)) 10%, var(--surface));
  color: var(--gc, var(--brand)); display: grid; place-items: center;
  font-family: var(--display); font-style: italic; font-size: 13.5px;
}
.card-go {
  position: absolute; right: 18px; bottom: 15px;
  width: 24px; height: 24px; border-radius: var(--r-pill);
  background: var(--ink); color: var(--bg);
  display: grid; place-items: center; font-size: 11px;
  opacity: 0; transform: translateX(-4px);
  transition: opacity .25s var(--ease), transform .35s var(--spring);
}
.card:hover .card-go { opacity: 1; transform: none; }
.card:hover .chip { transform: scale(1.04); }
.card .desc { font-size: 13.5px; color: var(--ink-2); }
.card-static { cursor: default; }
.card-static:hover { transform: none; box-shadow: var(--shadow-1); }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  font-family: var(--mono); font-size: 10px; letter-spacing: .03em;
  padding: 3px 10px; border-radius: var(--r-pill);
  color: var(--ink-2); background: var(--surface-2); white-space: nowrap;
}
.chip.core { background: color-mix(in srgb, var(--brand) 10%, var(--surface)); color: var(--brand); }
.chip.link { cursor: pointer; transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease); }
.chip.link:hover { background: color-mix(in srgb, var(--ink) 10%, var(--surface-2)); color: var(--ink); }
.chip.sel { background: var(--ink); color: var(--bg); }

/* nota de governanca — rodape de cada card/detalhe */
.gov {
  margin-top: auto; padding-top: 10px; border-top: 1px solid var(--line);
  font-family: var(--mono); font-size: 10px; color: var(--ink-3);
  display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center;
}
.gov a { color: inherit; }
.conf { display: inline-flex; gap: 2px; align-items: center; }
.conf i { width: 7px; height: 7px; border: 1px solid currentColor; border-radius: 50%; display: inline-block; }
.conf.alto { color: var(--green); } .conf.alto i { background: currentColor; }
.conf.medio { color: var(--amber); } .conf.medio i:first-of-type { background: currentColor; }
.conf.baixo { color: var(--brand); }

.a-curar {
  font-family: var(--mono); font-size: 10.5px; color: var(--amber);
  background: color-mix(in srgb, var(--amber) 10%, var(--surface));
  padding: 2px 9px; border-radius: var(--r-pill); white-space: nowrap;
}

/* ---------- tabelas ---------- */
.tbl {
  width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13.5px;
  background: var(--surface); border-radius: var(--r-md); overflow: hidden;
  box-shadow: var(--shadow-1);
}
.tbl th {
  font-size: 10px; text-transform: uppercase; letter-spacing: .1em;
  text-align: left; color: var(--ink-3); font-weight: 600;
  background: var(--surface); border-bottom: 1px solid var(--line); padding: 11px 14px;
}
.tbl td { border-bottom: 1px solid var(--line); padding: 10px 14px; vertical-align: top; }
.tbl tr:last-child td { border-bottom: none; }
.tbl tbody tr { transition: background var(--t-fast) var(--ease); }
.tbl tbody tr:hover td { background: color-mix(in srgb, var(--surface-2) 55%, var(--surface)); }
.tbl tr.rowlink { cursor: pointer; }
.tbl .mono { font-family: var(--mono); font-size: 11.5px; font-variant-numeric: tabular-nums; }
.detail .tbl thead th { position: sticky; top: 46px; background: var(--surface); z-index: 2; }

/* ---------- detalhe (painel sobreposto) ---------- */
.detail-overlay {
  position: fixed; inset: 0; background: rgba(27, 27, 24, .32);
  backdrop-filter: blur(3px);
  display: flex; justify-content: flex-end; z-index: 20; animation: fade var(--t-fast) var(--ease);
  padding: 10px;
}
@keyframes fade { from { opacity: 0; } }
.detail {
  width: min(780px, 92vw); height: 100%; overflow-y: auto;
  background: var(--bg); border-radius: var(--r-xl);
  padding: 32px 36px; animation: slide .28s var(--ease);
  box-shadow: var(--shadow-3);
}
@keyframes slide { from { transform: translateX(36px); opacity: .3; } }
.detail-close {
  position: sticky; top: 0; float: right;
  font-family: var(--sans); font-size: 12.5px; font-weight: 600;
  border: none; border-radius: var(--r-pill); background: var(--surface);
  box-shadow: var(--shadow-1);
  padding: 7px 14px; cursor: pointer; z-index: 5; color: var(--ink);
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.detail-close:hover { background: var(--ink); color: var(--bg); }
.detail h2 { font-family: var(--display); font-weight: 560; font-size: 28px; letter-spacing: -.01em; margin: 4px 0 2px; }
.detail .id-line { font-family: var(--mono); font-size: 11px; color: var(--ink-3); }
.detail dl { display: grid; grid-template-columns: 170px 1fr; gap: 7px 14px; margin: 16px 0; font-size: 13.5px; }
.detail dt { font-family: var(--mono); font-size: 10px; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); padding-top: 2px; }
.detail dd { color: var(--ink); }

/* ---------- abas ---------- */
.tabs {
  display: flex; gap: 3px; width: max-content; margin-bottom: 18px;
  background: var(--surface-2); border-radius: var(--r-pill); padding: 3px;
}
.tabs button {
  font-family: var(--sans); font-size: 12.5px; font-weight: 600;
  background: transparent; border: none; border-radius: var(--r-pill);
  padding: 7px 16px; cursor: pointer; color: var(--ink-2);
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}
.tabs button:hover { color: var(--ink); }
.tabs button.active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-1); }

/* ---------- diagramas / codigo ---------- */
.codebox { background: var(--surface); border-radius: var(--r-lg); position: relative; box-shadow: var(--shadow-1); overflow: hidden; }
.codebox pre {
  font-family: var(--mono); font-size: 12px; line-height: 1.5;
  padding: 20px; overflow-x: auto; max-height: 480px; overflow-y: auto;
}
.codebox .copy {
  position: absolute; top: 12px; right: 12px;
  font-family: var(--sans); font-size: 11.5px; font-weight: 600; padding: 5px 13px;
  border: none; border-radius: var(--r-pill); background: var(--surface-2);
  color: var(--ink-2); cursor: pointer;
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.codebox .copy:hover { background: var(--ink); color: var(--bg); }

/* ---------- zoom + pan + tela cheia dos diagramas (diagram-zoom.js) ---------- */
.dz-box { background: var(--surface); border-radius: var(--r-lg); position: relative; box-shadow: var(--shadow-1); overflow: hidden; }
.dz-holder { cursor: grab; }
.dz-holder.dz-grabbing { cursor: grabbing; user-select: none; }
.dz-controls {
  position: absolute; bottom: 12px; right: 12px; z-index: 6;
  display: flex; align-items: center; gap: 2px; padding: 3px;
  background: color-mix(in srgb, var(--surface) 86%, transparent);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  border: 1px solid var(--line); border-radius: var(--r-pill);
  box-shadow: var(--shadow-1);
  opacity: .55; transition: opacity var(--t-fast) var(--ease);
}
.codebox:hover .dz-controls, .dz-box:hover .dz-controls, .dz-controls:focus-within { opacity: 1; }
.dz-controls button {
  display: inline-flex; align-items: center; justify-content: center;
  border: none; background: transparent; color: var(--ink-2);
  border-radius: var(--r-pill); cursor: pointer; padding: 5px 7px;
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.dz-controls button:hover { background: var(--ink); color: var(--bg); }
.dz-controls .ri { width: 15px; height: 15px; }
.dz-controls .dz-pct {
  font-family: var(--mono); font-size: 10.5px; font-weight: 600;
  font-variant-numeric: tabular-nums; min-width: 42px;
}
.dz-sep { width: 1px; height: 16px; background: var(--line); margin: 0 3px; }

.dz-overlay {
  position: fixed; inset: 0; z-index: 40; background: var(--bg);
  display: flex; flex-direction: column; padding: 14px 18px 18px;
  animation: fade var(--t-fast) var(--ease);
}
.dz-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 2px 12px; }
.dz-bar .dz-title { font-family: var(--display); font-size: 17px; font-weight: 560; letter-spacing: -.01em; }
.dz-bar .dz-x {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--sans); font-size: 12.5px; font-weight: 600;
  border: none; border-radius: var(--r-pill); background: var(--surface);
  box-shadow: var(--shadow-1); padding: 7px 14px; cursor: pointer; color: var(--ink);
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.dz-bar .dz-x:hover { background: var(--ink); color: var(--bg); }
.dz-bar .dz-x .ri { width: 14px; height: 14px; }
.dz-overlay .codebox, .dz-overlay .dz-box { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.dz-overlay .dz-holder { flex: 1; min-height: 0; max-height: none !important; }
html.dz-lock, .dz-lock body { overflow: hidden; }

.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 18px; }
.toolbar select, .toolbar input[type="search"], .toolbar input[type="text"] {
  font-family: var(--sans); font-size: 13px; padding: 8px 14px;
  border: 1px solid var(--line); border-radius: var(--r-md);
  background: var(--surface); color: var(--ink);
  transition: border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}
.toolbar select:focus, .toolbar input:focus { border-color: var(--ink); box-shadow: var(--shadow-1); outline: none; }

.btn {
  cursor: pointer; text-decoration: none; display: inline-block;
  font-family: var(--sans); font-size: 13px; font-weight: 600;
  padding: 8px 18px; border-radius: var(--r-pill);
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  box-shadow: var(--shadow-1);
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease),
    transform var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}
.btn:hover { box-shadow: var(--shadow-2); transform: translateY(-1px); }
.btn:active { transform: scale(.98); box-shadow: var(--shadow-1); }
.btn.primary { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.btn.primary:hover { background: #000; }
.btn:disabled { opacity: .45; cursor: default; transform: none; }

.note {
  background: color-mix(in srgb, var(--amber) 9%, var(--surface));
  border-radius: var(--r-md);
  padding: 14px 18px; font-size: 13px; margin: 14px 0; color: var(--ink-2);
  max-width: 96ch; /* prosa não estica com a view em telas largas */
}
.note strong { color: var(--ink); }

/* ---------- ficha enterprise de entidade ---------- */
.defbox {
  background: color-mix(in srgb, var(--green) 7%, var(--surface));
  border-radius: var(--r-md);
  padding: 13px 17px; margin: 10px 0; font-size: 13.5px;
}
.defbox.en { background: var(--surface-2); }
.defbox.ddd { background: color-mix(in srgb, var(--brand) 6%, var(--surface)); }
.deftag {
  display: block; font-family: var(--mono); font-size: 9.5px;
  text-transform: uppercase; letter-spacing: .12em; color: var(--ink-3); margin-bottom: 5px;
}
.uml.uml-root thead th { background: var(--ink); color: var(--bg); }
.type-dt {
  cursor: pointer; color: var(--brand);
  border-bottom: 1px dashed color-mix(in srgb, var(--brand) 55%, transparent);
  transition: background var(--t-fast) var(--ease);
}
.type-dt:hover { background: color-mix(in srgb, var(--brand) 9%, transparent); border-radius: 3px; }
.type-enum { color: var(--green); border-bottom: 1px dotted var(--green); }
.card-mult { color: var(--amber); font-weight: 700; }
.checklist { margin: 0 0 0 20px; font-size: 13.5px; color: var(--ink-2); }
.checklist li { margin-bottom: 5px; }
.scen-list { margin: 0 0 0 18px; font-size: 13px; }
.scen-list li { margin-bottom: 3px; }
.scen-list a { color: var(--ink); }
.scen-list a:hover { color: var(--brand); }
.sd-links { display: flex; flex-wrap: wrap; gap: 5px; }
.sd-links a {
  font-family: var(--mono); font-size: 9.5px; letter-spacing: .03em;
  background: var(--surface-2); border-radius: var(--r-pill); padding: 3px 10px;
  color: var(--ink-2); text-decoration: none; white-space: nowrap;
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.sd-links a:hover { background: var(--ink); color: var(--bg); }

.opt { font-size: 11.5px; color: var(--ink-2); display: inline-flex; gap: 6px; align-items: center; }
.opt input { accent-color: var(--ink); }

/* ---------- solution builder: appbar (dots) + rodapé de navegação ---------- */
.wz-appbar {
  flex: none; display: flex; align-items: center; gap: 16px;
  background: var(--surface); border-radius: var(--r-pill);
  box-shadow: var(--shadow-1); padding: 6px 10px 6px 18px; margin-bottom: 12px;
}
.wz-appbar-kicker {
  font-family: var(--mono); font-size: 10px; letter-spacing: .16em;
  text-transform: uppercase; color: var(--brand); white-space: nowrap;
}
.wz-steps {
  display: flex; align-items: center; gap: 4px; flex: 1; min-width: 0;
  overflow-x: auto; scrollbar-width: none;
}
.wz-steps::-webkit-scrollbar { display: none; }
.wz-dot {
  flex: none; min-width: 28px; height: 28px; border-radius: var(--r-pill);
  border: none; background: transparent; color: var(--ink-2); cursor: pointer;
  font: 600 12px var(--sans);
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.wz-dot:hover { background: var(--surface-2); color: var(--ink); }
.wz-dot.done { color: var(--green); background: color-mix(in srgb, var(--green) 9%, transparent); }
.wz-dot.active { padding: 0 14px; background: var(--ink); color: var(--bg); box-shadow: var(--shadow-1); }
.wz-dot-label { display: none; white-space: nowrap; }
.wz-dot.active .wz-dot-label { display: inline; }

.wz-foot {
  flex: none; display: flex; align-items: center; gap: 12px;
  padding-top: 12px; margin-top: 10px; border-top: 1px solid var(--line);
}
.wz-foot-progress {
  flex: 1; height: 4px; border-radius: var(--r-pill);
  background: var(--surface-2); overflow: hidden;
}
.wz-foot-fill {
  display: block; height: 100%; background: var(--brand); width: 0;
  transition: width var(--t-slow) var(--ease);
}
.wz-foot-step { font-size: 10.5px; color: var(--ink-3); }

/* ---------- diagrama Team Topologies (notacao canonica, tons suavizados) ---------- */
.tt-canvas {
  background: var(--surface); border-radius: var(--r-xl); padding: 24px 26px 18px;
  box-shadow: var(--shadow-2);
}
.tt-flow {
  font-size: 10px; letter-spacing: .18em; text-transform: uppercase;
  color: var(--ink-3); display: flex; align-items: center; gap: 10px; margin-bottom: 16px;
}
.tt-flow-arrow { flex: 1; border-bottom: 2px solid var(--line); position: relative; height: 0; font-size: 0; }
.tt-flow-arrow::after { content: "▶"; position: absolute; right: -2px; top: -7px; font-size: 10px; color: var(--ink-3); }

.tt-board { position: relative; display: flex; flex-direction: column; gap: 14px; }
.tt-section { display: flex; gap: 10px; align-items: stretch; }
.tt-margin-label {
  writing-mode: vertical-rl; transform: rotate(180deg);
  font-family: var(--mono); font-size: 8.5px; letter-spacing: .14em;
  text-transform: uppercase; color: var(--ink-3); text-align: center;
  flex: none; width: 16px;
}
.tt-section-rows { flex: 1; display: flex; flex-direction: column; gap: 8px; }

/* faixa: badge a esquerda, titulo/descricao alinhados a direita */
.tt-row {
  display: flex; align-items: center; gap: 14px;
  padding: 10px 20px; min-height: 58px;
}
.tt-row-right { margin-left: auto; text-align: right; max-width: 58%; }
.tt-row-right strong { display: block; font-size: 15.5px; font-weight: 650; letter-spacing: -.01em; }
.tt-row-right span { font-size: 11px; color: rgba(27, 27, 24, .62); }
.tt-badge {
  flex: none; width: 28px; height: 28px; border-radius: 50%;
  background: var(--ink); color: var(--bg);
  display: grid; place-items: center;
  font-family: var(--mono); font-size: 11px; font-weight: 700;
  box-shadow: var(--shadow-1);
}
.tt-badge-sm { width: 22px; height: 22px; font-size: 10px; }
.tt-stream { background: #f6df8f; border: 1px solid #dcbd5e; border-radius: var(--r-pill); }
.tt-platform { background: #b7d0ec; border: 1px solid #8aa9cc; border-radius: var(--r-lg); }
.tt-fora { font-size: 10.5px; color: var(--ink-3); margin-top: 8px; }

/* enabling: colunas verticais cruzando as faixas */
.tt-enabling-overlay {
  position: absolute; top: -6px; bottom: -6px; left: 16%; width: 46%;
  display: flex; gap: 26px; justify-content: flex-start; align-items: stretch;
  pointer-events: none;
}
.tt-enabling-col {
  pointer-events: auto; width: 46px; border-radius: var(--r-lg);
  background: rgba(216, 194, 230, .9); border: 1px solid #ab8ac2;
  display: flex; flex-direction: column; align-items: center; justify-content: space-between;
  padding: 12px 0 8px; box-shadow: var(--shadow-1);
}
.tt-enabling-name {
  writing-mode: vertical-rl; transform: rotate(180deg);
  font-size: 12px; font-weight: 700; color: var(--ink); letter-spacing: .02em;
  overflow: hidden; text-overflow: ellipsis; max-height: 85%;
}

/* base: captions + complicated subsystems */
.tt-bottom { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-top: 10px; }
.tt-caption { font-size: 9px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); }
.tt-subsystems-wrap { margin-left: auto; text-align: center; }
.tt-subsystems { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
.tt-subsystem {
  background: #f4c4a0; border: 1px solid #d29368;
  clip-path: polygon(9% 0, 91% 0, 100% 24%, 100% 76%, 91% 100%, 9% 100%, 0 76%, 0 24%);
  text-align: center; padding: 12px 24px; max-width: 230px;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
}
.tt-subsystem strong { font-size: 12.5px; line-height: 1.15; }
.tt-sub-desc { font-size: 10px; color: rgba(27, 27, 24, .64); line-height: 1.25; }
.tt-subsystems-wrap .tt-caption { margin-top: 6px; }

/* legenda nomeada */
.tt-legend-box {
  margin-top: 16px; margin-left: auto; width: max-content; max-width: 100%;
  background: var(--surface-2); border-radius: var(--r-md);
  padding: 10px 14px; display: grid; grid-template-columns: 1fr 1fr; gap: 5px 18px;
  font-size: 10px; color: var(--ink-2);
}
.tt-legend-box span { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.tt-key { width: 20px; height: 11px; display: inline-block; border-width: 1px; border-style: solid; flex: none; }
.tt-key.tt-stream { background: #f6df8f; border-color: #dcbd5e; border-radius: 6px; }
.tt-key.tt-platform { background: #b7d0ec; border-color: #8aa9cc; border-radius: 3px; }
.tt-key.tt-enabling { background: #d8c2e6; border-color: #ab8ac2; border-radius: 4px; width: 11px; height: 17px; }
.tt-key.tt-subsystem { background: #f4c4a0; border-color: #d29368; clip-path: polygon(20% 0, 80% 0, 100% 30%, 100% 70%, 80% 100%, 20% 100%, 0 70%, 0 30%); }

@media (max-width: 900px) {
  .tt-enabling-overlay { position: static; width: auto; flex-direction: row; margin-top: 8px; }
  .tt-enabling-col { min-height: 90px; }
  .tt-row-right { max-width: 75%; }
}

/* ---------- mapa de contextos (SVG) ---------- */
.ctxmap { display: block; font-family: var(--sans); }
.ctxmap .edge {
  fill: none; stroke: var(--ink-3); stroke-width: 1.2;
  marker-end: url(#arrow); opacity: .5; transition: opacity var(--t-fast), stroke var(--t-fast);
}
.ctxmap .edge:hover { stroke: var(--brand); opacity: 1; stroke-width: 2; }
.ctxmap .edge-center { stroke: var(--green); stroke-dasharray: 4 3; }
.ctxmap marker path { fill: var(--ink-3); }
.ctxmap .node rect { fill: var(--surface); stroke: var(--line); stroke-width: 1; rx: 8; }
.ctxmap .node text { font-size: 11.5px; fill: var(--ink); }
.ctxmap .node:not(.ext) { cursor: pointer; }
.ctxmap .node:not(.ext):hover rect { fill: var(--surface-2); stroke: var(--ink); }
.ctxmap .node.sel rect { fill: var(--ink); stroke: var(--ink); }
.ctxmap .node.sel text { fill: var(--bg); }
.ctxmap .node.ext rect { stroke-dasharray: 5 4; fill: var(--surface-2); }
.ctxmap .node.ext text { fill: var(--ink-2); font-style: italic; }

.empty { padding: 44px; text-align: center; color: var(--ink-3); }
.error {
  padding: 16px 20px; border-radius: var(--r-md);
  background: color-mix(in srgb, var(--brand) 8%, var(--surface));
  color: var(--brand); font-family: var(--mono); font-size: 12.5px;
}

mark { background: color-mix(in srgb, var(--amber) 28%, transparent); color: inherit; padding: 0 1px; border-radius: 2px; }

@media (max-width: 900px) {
  .shell { flex-direction: column; }
  .sidebar { width: 100% !important; height: auto; position: static; }
  .brand, #nav, .candle-wrap, .sidebar-foot { width: auto; }
  .view { padding: 20px; }
  .detail dl { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- impressao (blueprint em A4 limpa) ---------- */
@media print {
  .sidebar, .topbar, .toolbar, .wz-appbar, .wz-foot, .btn, .detail-overlay,
  #wz-prev, #wz-next, #wz-reset, .copy { display: none !important; }
  .view { padding: 0; max-width: none; }
  .view > * { animation: none !important; }
  body { background: #fff; font-size: 12px; }
  .card, .codebox, .tt-canvas, .grid, .bl-canvas, .tbl { box-shadow: none !important; }
  .bl-canvas { border: 1px solid var(--line); }
  .bl-canvas, .bl-group, .tt-shape, .tt-canvas { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .section-title { break-after: avoid; }
  .bl-group, .bl-sol, .tt-canvas, .tbl { break-inside: avoid-page; }
}

/* ---------- estrategia de especializacao (badges tonais) ---------- */
.strat-badge {
  font-family: var(--mono); font-size: 9.5px; letter-spacing: .04em; font-weight: 600;
  padding: 3px 10px; border-radius: var(--r-pill); white-space: nowrap;
}
.strat-adotar-modelo-local { background: color-mix(in srgb, var(--green) 13%, var(--surface)); color: var(--green); }
.strat-camada-adapter { background: color-mix(in srgb, var(--blue-soft) 15%, var(--surface)); color: var(--blue); }
.strat-customizar-bian { background: color-mix(in srgb, var(--amber) 13%, var(--surface)); color: var(--amber); }
.strat-construir-proprio { background: color-mix(in srgb, var(--brand) 10%, var(--surface)); color: var(--brand); }

/* ---------- blueprint / landscape (documento de consultoria) ---------- */
.bl-canvas {
  background: var(--surface); border-radius: var(--r-xl);
  padding: 28px 30px 18px; box-shadow: var(--shadow-2);
}
.bl-header {
  display: flex; justify-content: space-between; align-items: flex-end;
  border-bottom: 1px solid var(--line); padding-bottom: 14px; margin-bottom: 8px;
}
.bl-title {
  font-family: var(--display); font-size: 26px; font-weight: 560;
  color: var(--ink); letter-spacing: -.015em;
}
.bl-subtitle { font-size: 14px; color: var(--ink-2); margin-top: 3px; }
.bl-meta { font-size: 9.5px; color: var(--ink-3); text-align: right; line-height: 1.6; }
.bl-row { display: flex; gap: 16px; border-top: 1px solid var(--line); padding: 14px 0; }
.bl-row:first-of-type { border-top: none; }
.bl-row-platform {
  background: color-mix(in srgb, var(--blue-soft) 6%, transparent);
  margin: 0 -30px; padding: 14px 30px; border-radius: 0;
}
.bl-label {
  flex: none; width: 96px; font-family: var(--mono); font-size: 9px;
  letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3);
  padding-top: 5px;
}
.bl-content { flex: 1; display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-start; }
.bl-client, .bl-channel {
  font-size: 12.5px; font-weight: 500; padding: 8px 16px;
  background: var(--surface-2); border-radius: var(--r-pill);
}
.bl-note { font-size: 9.5px; color: var(--ink-3); align-self: flex-end; }
.bl-platform { display: flex; gap: 14px; align-items: stretch; }
.bl-main {
  flex: 1; display: flex; flex-wrap: wrap; gap: 12px;
  align-items: stretch; align-content: flex-start;
}
.bl-main .bl-group { flex: 1 1 320px; max-width: 480px; }
.bl-group {
  background: var(--surface); padding: 14px 16px;
  border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--shadow-1);
}
.bl-group h4 { font-size: 13.5px; font-weight: 650; margin-bottom: 8px; }
.bl-boxes { display: flex; flex-wrap: wrap; gap: 5px; }
.bl-box {
  font-size: 10.5px; padding: 4px 11px; border-radius: var(--r-pill);
  background: var(--surface-2); color: var(--ink-2); white-space: nowrap;
}
.bl-br {
  margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--line);
  display: flex; flex-wrap: wrap; gap: 5px; align-items: center;
  font-size: 10px;
}
.bl-br .strat-badge { font-size: 8.5px; padding: 2px 8px; }
.bl-br-reqs { font-family: var(--mono); font-size: 9px; color: var(--ink-2); }
.bl-br-vendor { font-family: var(--mono); font-size: 9px; color: var(--brand); font-weight: 700; }
.bl-group-party { background: var(--surface-2); position: relative; }
.bl-party-tag {
  position: absolute; top: 10px; right: 14px;
  font-size: 8px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3);
}
.bl-group-party h4 { padding-right: 96px; }
.bl-partner {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12.5px; font-weight: 650; padding: 7px 16px;
  border-radius: var(--r-pill); color: var(--ink);
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-1);
}
.bl-logo { width: 18px; height: 18px; border-radius: 5px; }
.bl-logo-fb {
  width: 18px; height: 18px; border-radius: 5px; background: var(--brand);
  color: var(--bg); display: inline-grid; place-items: center;
  font-size: 10px; font-weight: 700;
}
.bl-ext {
  font-size: 11px; padding: 5px 13px; border-radius: var(--r-pill);
  background: var(--surface-2); color: var(--ink-2);
}
.bl-sep { color: var(--line); }
.bl-footer {
  display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap;
  border-top: 1px solid var(--line); margin-top: 6px; padding-top: 10px;
  font-size: 9px; color: var(--ink-3);
}
.bl-legend { display: inline-flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.bl-legend .strat-badge { font-size: 8px; padding: 1px 7px; }

/* ---------- build x buy, ACL, composicoes, fora do escopo ---------- */
.bb-badge {
  font-family: var(--mono); font-size: 8.5px; letter-spacing: .04em; font-weight: 600;
  padding: 2px 8px; border-radius: var(--r-pill); white-space: nowrap;
  vertical-align: 2px;
}
.bb-comprar { background: color-mix(in srgb, var(--blue-soft) 15%, var(--surface)); color: var(--blue); }
.bb-construir { background: color-mix(in srgb, var(--green) 13%, var(--surface)); color: var(--green); }
.bb-hibrido { background: color-mix(in srgb, var(--amber) 13%, var(--surface)); color: var(--amber); }

.bl-group-acl { border-left: 3px solid var(--brand); }
.bl-acl-tag {
  font-size: 8px; letter-spacing: .1em; padding: 2px 7px; border-radius: var(--r-pill);
  background: var(--brand); color: var(--bg); vertical-align: 2px;
}
.bl-row-acl {
  background: color-mix(in srgb, var(--brand) 4%, transparent);
  margin: 0 -30px; padding: 12px 30px;
}
.bl-acl-strip { gap: 6px; align-items: center; }
.bl-acl-note { flex: 1 1 100%; font-size: 9.5px; color: var(--ink-2); }
/* chip em dois segmentos: [⛨ adapter construido] → alvo externo · tipo */
.bl-acl-chip {
  display: inline-flex; align-items: stretch; font-family: var(--mono);
  font-size: 9.5px; border-radius: var(--r-pill);
  background: var(--surface); box-shadow: var(--shadow-1); overflow: hidden;
}
.bl-acl-chip b {
  background: var(--brand); color: var(--bg); font-weight: 700;
  padding: 5px 10px; white-space: nowrap;
}
.bl-acl-chip i { font-style: normal; color: var(--ink-2); padding: 5px 11px; white-space: nowrap; }

.sol-cov { font-size: 11px; color: var(--brand); letter-spacing: .12em; white-space: nowrap; font-family: var(--mono); }
.bl-sols { flex: 1 1 100%; }
.bl-sols-head { font-size: 9px; color: var(--ink-3); letter-spacing: .06em; margin-bottom: 8px; }
.bl-sols-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; align-items: start; }
.bl-sol {
  background: var(--surface); padding: 14px 16px;
  border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--shadow-1);
  font-size: 12px;
}
.bl-sol header { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; margin-bottom: 4px; }
.bl-sol-op {
  font-size: 8.5px; letter-spacing: .1em; text-transform: uppercase;
  padding: 2px 9px; background: var(--ink); color: var(--bg); border-radius: var(--r-pill);
}
.bl-sol-rac { font-size: 11px; color: var(--ink-2); margin: 0 0 7px; }
.bl-sol-comp { display: flex; gap: 8px; align-items: flex-start; padding: 6px 0; border-top: 1px solid var(--line); }
.bl-sol-comp.parcial { opacity: .92; }
.bl-sol-nivel { font-size: 9px; color: var(--ink-3); margin-left: 4px; }
.bl-sol-gap { font-family: var(--mono); font-size: 9.5px; color: var(--amber); }
.bl-sol-inc { font-size: 9px; color: var(--ink-3); }
.bl-sol-gaps { font-size: 11px; color: var(--brand); margin-top: 6px; }
.bl-sol-fund { font-size: 9.5px; color: var(--ink-2); margin-top: 4px; }

.bl-prov-row {
  flex: 1 1 100%; display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  border-top: 1px solid var(--line); padding-top: 10px; margin-top: 2px;
}
.bl-prov-row:first-child { border-top: none; padding-top: 0; }
.bl-prov-label { font-size: 8.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); width: 130px; }
/* logo de vendor no rodape 🇧🇷 dos grupos e na linha de gap (tooltip = nome) */
.bl-br-logo { display: inline-flex; }
.bl-br-logo .bl-logo, .bl-br-logo .bl-logo-fb { width: 16px; height: 16px; }
.bl-gap-comp {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 10.5px; color: var(--ink-2); padding: 5px 12px;
  background: color-mix(in srgb, var(--brand) 6%, var(--surface));
  border-radius: var(--r-pill);
}
.bl-reg { color: var(--ink); }

.bl-off-wrap {
  margin: 0 -30px; padding: 14px 30px 8px; border-top: 1px solid var(--line);
  background: color-mix(in srgb, var(--ink) 3%, transparent);
}
.bl-off-title { font-size: 9px; letter-spacing: .1em; color: var(--ink-3); margin-bottom: 8px; }
.bl-off-area { display: flex; gap: 12px; margin-bottom: 6px; align-items: baseline; }
.bl-off-label {
  flex: none; width: 96px; font-size: 8px; letter-spacing: .08em;
  text-transform: uppercase; color: var(--ink-3); text-align: right;
}
.bl-off-list { flex: 1; display: flex; flex-wrap: wrap; gap: 5px; }
.bl-off-cell { font-size: 10.5px; color: var(--ink-3); }
.bl-off-cell summary {
  cursor: pointer; list-style: none; border-radius: var(--r-pill);
  padding: 3px 10px; background: var(--surface); white-space: nowrap;
  box-shadow: var(--shadow-1);
  transition: color var(--t-fast) var(--ease);
}
.bl-off-cell summary:hover { color: var(--ink); }
.bl-off-cell[open] summary { color: var(--ink); background: var(--surface-2); }
.bl-off-cell ul { margin: 5px 4px; padding-left: 14px; font-size: 10px; max-width: 260px; }
.bl-off-sep summary { box-shadow: inset 0 0 0 1px var(--amber); }
.bl-legend .bb-badge { font-size: 8px; padding: 1px 7px; }

.entrega-embutido-no-parceiro { background: color-mix(in srgb, var(--blue-soft) 14%, var(--surface)); color: var(--blue); }
.entrega-provedor-regulado { background: var(--surface-2); color: var(--ink-2); }
.entrega-construir-proprio { background: color-mix(in srgb, var(--green) 12%, var(--surface)); color: var(--green); }

/* ---------- planes de engenharia ---------- */
.eng-plane {
  background: var(--surface); border-radius: var(--r-lg);
  margin-bottom: 12px; box-shadow: var(--shadow-1); overflow: hidden;
}
.eng-plane h4 {
  font-size: 10px; letter-spacing: .14em; text-transform: uppercase;
  padding: 9px 16px; background: var(--surface-2); color: var(--ink-2);
}
.eng-cats { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 16px; }
.eng-cat {
  background: var(--bg); border-radius: var(--r-sm); padding: 8px 12px;
  min-width: 150px; max-width: 240px;
}
.eng-cat strong { display: block; font-size: 11.5px; }
.eng-cat span { font-family: var(--mono); font-size: 9.5px; color: var(--ink-3); }

/* ---------- AARM (fase 2.9): estrategia, ilities, risk-storming, historias ---------- */
.wz-act {
  font-family: var(--mono); font-size: 8.5px; letter-spacing: .14em;
  text-transform: uppercase; color: var(--ink-3); padding: 0 4px 0 10px;
}
.wz-act:first-child { padding-left: 4px; }

.obj-card { cursor: pointer; }
.obj-on { box-shadow: inset 0 0 0 2px var(--ink), var(--shadow-1); }
.obj-on h3 { color: var(--green); }

.medal {
  display: inline-grid; place-items: center; width: 20px; height: 20px;
  border-radius: 50%; background: var(--ink); color: var(--bg);
  font-family: var(--mono); font-size: 11px; font-weight: 700;
  margin-right: 6px; vertical-align: -3px;
}

.risk-card.risk-off { opacity: .5; }
.risk-eval {
  display: flex; align-items: flex-end; gap: 4px; margin-top: 6px;
  padding-top: 10px; border-top: 1px solid var(--line);
}
.risk-score {
  font-family: var(--mono); font-size: 10px; font-weight: 700;
  padding: 2px 9px; border-radius: var(--r-pill); vertical-align: 2px;
}
.risk-alto { background: color-mix(in srgb, var(--terra) 14%, var(--surface)); color: var(--terra); }
.risk-medio { background: color-mix(in srgb, var(--amber) 16%, var(--surface)); color: var(--amber); }
.risk-baixo { background: color-mix(in srgb, var(--green) 12%, var(--surface)); color: var(--green); }

/* tinta de severidade do card (borda + fundo sutil) — mesmas faixas do score */
.risk-card { border-left: 3px solid transparent; }
.risk-tint-alto { border-left-color: var(--terra); background: color-mix(in srgb, var(--terra) 3%, var(--surface)); }
.risk-tint-medio { border-left-color: var(--amber); background: color-mix(in srgb, var(--amber) 3%, var(--surface)); }
.risk-tint-baixo { border-left-color: var(--green); }
.risk-card.just-dismissed { animation: rm-dim .4s var(--ease); }
@keyframes rm-dim { from { opacity: 1; } }

/* matriz P×I 3×3: 1 clique = probabilidade + impacto; heat verde→âmbar→terra */
.rm-grid {
  display: grid; grid-template-columns: 12px 14px repeat(3, 30px); gap: 4px;
  align-items: center; justify-items: center;
}
.rm-ax { font-size: 9px; color: var(--ink-3); }
.rm-ax-v {
  grid-row: 1 / 4; grid-column: 1;
  writing-mode: vertical-rl; transform: rotate(180deg);
  letter-spacing: .08em; text-transform: uppercase; font-size: 8px;
}
.rm-ax-i {
  grid-column: 3 / 6; justify-self: center;
  letter-spacing: .08em; text-transform: uppercase; font-size: 8px;
}
.rm-cell {
  width: 30px; height: 30px; border: none; border-radius: 9px; cursor: pointer;
  display: grid; place-items: center;
  font: 700 11px var(--mono); font-variant-numeric: tabular-nums;
  transition: transform var(--t-fast) var(--spring), box-shadow var(--t-fast) var(--ease),
    background var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.rm-heat-1 { background: color-mix(in srgb, var(--green) 11%, var(--surface)); color: var(--green); }
.rm-heat-2 { background: color-mix(in srgb, var(--amber) 13%, var(--surface)); color: var(--amber); }
.rm-heat-3 { background: color-mix(in srgb, var(--terra) 13%, var(--surface)); color: var(--terra); }
.rm-cell:hover { transform: scale(1.12); box-shadow: var(--shadow-1); }
.rm-cell:focus-visible { outline: 2px solid var(--ink); outline-offset: 1px; }
.rm-cell.sel { color: var(--bg); }
.rm-cell.sel.rm-heat-1 { background: var(--green); box-shadow: 0 0 0 2px var(--surface), 0 0 0 3.5px var(--green); }
.rm-cell.sel.rm-heat-2 { background: var(--amber); box-shadow: 0 0 0 2px var(--surface), 0 0 0 3.5px var(--amber); }
.rm-cell.sel.rm-heat-3 { background: var(--terra); box-shadow: 0 0 0 2px var(--surface), 0 0 0 3.5px var(--terra); }
.rm-cell.just-picked { animation: rm-pop .5s var(--spring); }
.risk-score.just-picked { display: inline-block; animation: rm-pop .55s var(--spring); }
@keyframes rm-pop { 0% { transform: scale(.55); } 62% { transform: scale(1.22); } 100% { transform: scale(1); } }

.rm-dismiss {
  margin-left: auto; align-self: flex-end;
  width: 30px; height: 30px; border: none; border-radius: 50%; cursor: pointer;
  background: transparent; color: var(--ink-3); display: grid; place-items: center;
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease),
    transform var(--t-fast) var(--spring);
}
.rm-dismiss:hover { background: var(--surface-2); color: var(--terra); transform: rotate(-12deg); }
.rm-dismiss.on { color: var(--terra); background: color-mix(in srgb, var(--terra) 10%, transparent); }

.story-card p { margin: 2px 0; }
.story-lineage {
  font-size: 10px; color: var(--ink-2); margin: 6px 0 2px;
  padding: 5px 10px; background: var(--surface-2); border-radius: var(--r-pill);
  width: max-content; max-width: 100%; overflow: hidden; text-overflow: ellipsis;
}

.adr {
  background: var(--surface); border-radius: var(--r-md); box-shadow: var(--shadow-1);
  padding: 10px 16px; margin-bottom: 8px; font-size: 13.5px;
}
.adr summary { cursor: pointer; }
.adr[open] summary { padding-bottom: 6px; border-bottom: 1px solid var(--line); }

/* ---------- icones Remix (SVG inline via js/icons.js) ---------- */
.ri {
  width: 1.05em; height: 1.05em; display: inline-block;
  vertical-align: -0.18em; fill: currentColor; flex: none;
}
.bb-badge .ri, .bl-acl-chip .ri { width: 1.15em; height: 1.15em; }

/* ---------- guia AARM (painel "aprenda" lateral sticky do builder) ---------- */
.wz-layout {
  display: grid;
  grid-template-columns: minmax(260px, 330px) minmax(0, 1fr);
  gap: clamp(16px, 2vw, 26px);
  align-items: start; /* obrigatório: sem isso o aside estica e o sticky morre */
}
.wz-main { min-width: 0; }
.wz-main > .section-title:first-child { margin-top: 0; }
/* o builder ganha mais largura útil quando o guia está presente */
.view:has(.wz-layout) { max-width: 1560px; }

.wz-guide {
  position: sticky; top: 82px; /* topbar sticky (~72px) + respiro */
  max-height: calc(100vh - 100px); max-height: calc(100dvh - 100px); overflow-y: auto;
  overscroll-behavior: contain;
  display: flex; flex-direction: column; gap: 12px;
}

.guide-panel {
  background: var(--surface); border-radius: var(--r-lg);
  box-shadow: var(--shadow-1); padding: 18px 20px;
  display: flex; flex-direction: column; gap: 13px;
  font-size: 13px;
  border-top: 3px solid color-mix(in srgb, var(--brand) 65%, transparent);
}
.guide-head {
  display: flex; align-items: center; gap: 11px;
  cursor: pointer; list-style: none; user-select: none;
}
.guide-head::-webkit-details-marker { display: none; }
.guide-ico {
  width: 34px; height: 34px; border-radius: 11px; flex: none;
  background: color-mix(in srgb, var(--brand) 10%, var(--surface));
  color: var(--brand); display: grid; place-items: center;
}
.guide-ico .ri { width: 17px; height: 17px; }
.guide-head-txt { flex: 1; min-width: 0; }
.guide-head-txt .deftag { margin-bottom: 1px; color: var(--brand); }
.guide-head-txt strong {
  display: block; font-family: var(--display); font-size: 15.5px;
  font-weight: 650; letter-spacing: -.01em; line-height: 1.2;
}
.guide-chev {
  flex: none; color: var(--ink-3); font-size: 10px;
  transition: transform var(--t-fast) var(--ease);
}
.guide-fold[open] .guide-chev { transform: rotate(180deg); }
.guide-body { display: flex; flex-direction: column; gap: 12px; margin-top: 13px; }
.guide-intro { color: var(--ink-2); font-size: 13px; line-height: 1.55; }
.guide-intro strong, .guide-callout strong { color: var(--ink); }

.guide-tag {
  display: flex; align-items: center; gap: 6px;
  font-family: var(--mono); font-size: 9.5px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .11em;
  color: var(--ink-3); margin-bottom: 6px;
}
.guide-tag .ri { width: 1.25em; height: 1.25em; }

.guide-callout {
  border-radius: var(--r-md); padding: 12px 14px;
  font-size: 12.5px; line-height: 1.5; color: var(--ink-2);
  background: color-mix(in srgb, var(--tone, var(--brand)) 8%, var(--surface));
  border-left: 3px solid color-mix(in srgb, var(--tone, var(--brand)) 55%, transparent);
}
.guide-callout .guide-tag { color: var(--tone, var(--brand)); }
.tone-brand { --tone: var(--brand); }
.tone-amber { --tone: var(--amber); }
.tone-green { --tone: var(--green); }
.tone-blue { --tone: var(--blue); }
.tone-terra { --tone: var(--terra); }

.guide-check { margin: 0; padding: 0; list-style: none; counter-reset: gc; }
.guide-check li {
  counter-increment: gc; position: relative; padding: 4px 0 4px 30px;
  font-size: 12.5px; line-height: 1.5; color: var(--ink-2);
}
.guide-check li::before {
  content: counter(gc); position: absolute; left: 0; top: 5px;
  width: 20px; height: 20px;
  border-radius: 50%; background: var(--surface-2); color: var(--ink-2);
  display: grid; place-items: center;
  font-family: var(--mono); font-size: 10px; font-weight: 700;
}

.guide-live { border-top: 1px solid var(--line); padding-top: 12px; }
.guide-live .guide-tag { color: var(--brand); }
.guide-live-item {
  display: flex; align-items: baseline; gap: 8px;
  font-size: 12.5px; padding: 4px 0; min-width: 0;
}
.guide-live-item .gl-name { font-weight: 600; color: var(--ink); }
.guide-live-item em { color: var(--ink-3); font-style: normal; font-size: 11px; }
.guide-live-item em.gl-pend { color: var(--amber); }
.guide-live-empty { color: var(--ink-3); font-size: 12px; line-height: 1.5; }
.guide-live .chips { margin-top: 2px; }
.guide-foot { font-size: 10px; color: var(--ink-3); }

/* faixa horizontal (passo Blueprint — sem aside, largura total) */
.guide-strip {
  display: flex; align-items: flex-start; gap: 12px;
  background: color-mix(in srgb, var(--brand) 6%, var(--surface));
  border-left: 3px solid var(--brand); border-radius: var(--r-md);
  padding: 13px 17px; margin-bottom: 16px;
  font-size: 13px; color: var(--ink-2);
}
.guide-strip .guide-ico { width: 30px; height: 30px; border-radius: 9px; }
.guide-strip .guide-tag { margin-bottom: 3px; color: var(--brand); }

/* badges de status nos cards de característica */
.st-badge {
  position: absolute; top: 15px; right: 17px;
  font-family: var(--mono); font-size: 8.5px; font-weight: 700;
  letter-spacing: .09em; text-transform: uppercase;
  padding: 3px 9px; border-radius: var(--r-pill); white-space: nowrap;
  display: inline-flex; align-items: center; gap: 4px;
}
.st-badge .ri { width: 1.2em; height: 1.2em; }
.st-top3 { background: var(--ink); color: var(--bg); }
.st-prior { background: color-mix(in srgb, var(--brand) 12%, var(--surface)); color: var(--brand); }
.st-opt { background: var(--surface-2); color: var(--ink-3); }
.ility-card h3, .obj-card h3 { padding-right: 86px; }

/* medidor de progresso da seleção ("6 selecionados" + barra) */
.wz-meters { display: flex; flex-wrap: wrap; gap: 8px 28px; margin: -4px 0 16px; }
.wz-meter {
  display: flex; align-items: center; gap: 10px;
  font-size: 12px; color: var(--ink-2); min-width: 0;
}
.wz-meter-n {
  font-family: var(--mono); font-size: 11.5px; font-weight: 700;
  font-variant-numeric: tabular-nums; color: var(--ink);
}
.wz-meter-bar {
  width: clamp(90px, 16vw, 200px); height: 6px; flex: none;
  border-radius: var(--r-pill); background: var(--surface-2);
  position: relative; overflow: hidden;
}
.wz-meter-fill {
  position: absolute; inset: 0 auto 0 0; border-radius: var(--r-pill);
  background: var(--amber);
  transition: width var(--t-slow) var(--ease), background var(--t-slow) var(--ease);
}
.wz-meter.ok .wz-meter-fill { background: var(--brand); }
.wz-meter-min {
  position: absolute; top: 0; bottom: 0; width: 2px;
  background: color-mix(in srgb, var(--ink) 35%, transparent);
}
.wz-meter-range { font-family: var(--mono); font-size: 10px; color: var(--ink-3); }
.wz-meter .ri { width: 1.15em; height: 1.15em; color: var(--brand); }
.wz-meter.ok .wz-meter-check { color: var(--green); }

/* callout "geração automática de ADR" (rodapé do passo Características) */
.adr-callout {
  display: flex; align-items: flex-start; gap: 12px;
  border-left: 3px solid var(--brand);
  background: color-mix(in srgb, var(--brand) 6%, var(--surface));
  border-radius: var(--r-md); padding: 14px 17px; margin-top: 18px;
  font-size: 13px; line-height: 1.55; color: var(--ink-2);
}
.adr-callout .guide-ico { width: 30px; height: 30px; border-radius: 9px; }
.adr-callout .guide-tag { margin-bottom: 3px; color: var(--brand); }
.adr-callout strong { color: var(--ink); }

/* responsivo: o aside deixa de caber → guia colapsável acima do conteúdo */
@media (max-width: 1150px) {
  .wz-layout { grid-template-columns: 1fr; }
  .wz-guide { position: static; max-height: none; }
  .guide-live { padding-top: 10px; }
  .guide-live-item { display: inline-flex; padding: 2px 10px 2px 0; }
}
@media (max-width: 760px) {
  .guide-panel { padding: 14px 16px; }
  .guide-head { min-height: 36px; }
  .wz-meter-bar { width: auto; flex: 1; min-width: 70px; }
  .wz-meter { flex: 1 1 100%; }
  .ility-card h3, .obj-card h3 { padding-right: 0; }
  .st-badge { position: static; order: -1; align-self: flex-start; margin: -2px 0 2px; }
  .st-grid { grid-template-columns: 1fr !important; }
}

@media print {
  .wz-guide, .guide-strip { display: none !important; }
  .wz-layout { display: block; }
}

/* ---------- builder app-like: cada passo cabe em 100vh (só desktop) ----------
   A cadeia de alturas é toda por flex (nenhum calc com altura do topbar):
   .main trava em 100dvh -> .view.wz-app flex:1 -> #wz-body flex:1 ->
   .wz-layout flex:1 -> .wz-main/.wz-guide rolam internamente. */
@media (min-width: 1151px) {
  .main:has(> .view.wz-app) { height: 100vh; height: 100dvh; overflow: hidden; }

  .view.wz-app {
    flex: 1; min-height: 0;
    display: flex; flex-direction: column; overflow: hidden;
    padding: 12px 32px 14px;
  }
  .view.wz-app > * { animation: none; } /* rise (transform) mataria o sticky interno */

  .view.wz-app #wz-body { flex: 1; min-height: 0; display: flex; flex-direction: column; }
  .view.wz-app #wz-body > .wz-layout { animation: wz-in .2s var(--ease); }

  .view.wz-app .wz-layout {
    flex: 1; min-height: 0;
    align-items: stretch; /* o guia vira coluna com scroll próprio (sem sticky) */
  }
  .view.wz-app .wz-guide {
    position: static; max-height: none; min-height: 0;
    overflow-y: auto; overscroll-behavior: contain; padding-bottom: 6px;
  }
  .view.wz-app .wz-main {
    min-height: 0; overflow-y: auto; overscroll-behavior: contain;
    outline: none; padding: 0 14px 28px 2px; scrollbar-gutter: stable;
  }

  /* variante sem guia (passo 9): chrome fixo (hero/abas) + conteúdo rolando */
  .view.wz-app .wz-layout--full { display: flex; flex-direction: column; }
  .view.wz-app .wz-layout--full > .wz-main { flex: 1; min-height: 0; }

  /* orientação durante o scroll interno */
  .view.wz-app .wz-main > .section-title {
    position: sticky; top: 0; z-index: 3;
    background: var(--bg); padding-top: 6px;
  }
}
@keyframes wz-in { from { opacity: 0; } }

@media (max-width: 1150px) {
  .wz-appbar { border-radius: var(--r-lg); flex-wrap: wrap; }
}

@media print {
  .wz-appbar, .wz-foot { display: none !important; }
  .main:has(> .view.wz-app), .view.wz-app, .view.wz-app #wz-body,
  .view.wz-app .wz-layout, .view.wz-app .wz-main, .view.wz-app .wz-guide {
    height: auto !important; max-height: none !important;
    overflow: visible !important; display: block !important;
  }
}

/* ---------- blueprint em abas (passo 9): hero de KPIs + capítulos ---------- */
.bp-hero { flex: none; display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 12px; }
.bp-kpis { display: flex; flex-wrap: wrap; gap: 8px; }
.bp-kpi {
  border: none; cursor: pointer; text-align: left;
  background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-1);
  padding: 8px 15px; min-width: 84px;
  transition: transform var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}
.bp-kpi:hover { transform: translateY(-2px); box-shadow: var(--shadow-2); }
.bp-kpi:active { transform: scale(.97); }
.bp-kpi-n {
  display: block; font-family: var(--mono); font-size: 20px; font-weight: 700;
  font-variant-numeric: tabular-nums; line-height: 1.1; color: var(--ink);
}
.bp-kpi-n small { font-size: 11px; color: var(--ink-3); font-weight: 500; }
.bp-kpi-l {
  font-family: var(--mono); font-size: 8.5px; letter-spacing: .1em;
  text-transform: uppercase; color: var(--ink-3); white-space: nowrap;
}
.bp-kpi--hot .bp-kpi-n { color: var(--terra); }
.bp-kpi--hot { box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--terra) 45%, transparent), var(--shadow-1); }

.bp-tabs { flex: none; margin: 0 0 14px; }
.bp-tabs button { font-size: 13px; padding: 8px 18px; display: inline-flex; align-items: center; gap: 7px; }
.bp-tabs .count {
  font-family: var(--mono); font-size: 9.5px; color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}
.bp-tabs button.active .count { color: var(--ink-2); }

.bp-pane { display: none; }
.bp-pane.active { display: block; animation: wz-in .2s var(--ease); }
.bp-pane > .section-title:first-child { margin-top: 0; }

.bp-export { position: relative; margin-left: auto; }
.bp-export summary { list-style: none; }
.bp-export summary::-webkit-details-marker { display: none; }
.bp-export-menu {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 12; min-width: 200px;
  background: var(--surface); border-radius: var(--r-md); box-shadow: var(--shadow-3); padding: 5px;
  transform-origin: top right; animation: bp-menu-in .28s var(--spring);
}
.bp-export-menu button {
  display: block; width: 100%; text-align: left; border: none; background: transparent;
  font: 600 12.5px var(--sans); color: var(--ink-2); padding: 8px 12px; border-radius: var(--r-sm);
  cursor: pointer; transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.bp-export-menu button:hover { background: var(--surface-2); color: var(--ink); }
@keyframes bp-menu-in { from { opacity: 0; transform: scale(.92) translateY(-4px); } }

@media print {
  .bp-tabs, .bp-export { display: none !important; }
  .bp-pane { display: block !important; animation: none; }
}

/* ---------- passo 4: fila de decisões de dependência ---------- */
.dq-filters { margin: 0 0 12px; }
.dq-card { margin-bottom: 8px; }
.dq-head { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: baseline; }
.dq-head h3 { margin: 0; }
.dq-dir {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .03em; font-weight: 600;
  padding: 2px 10px; border-radius: var(--r-pill); white-space: nowrap;
  display: inline-flex; align-items: center; gap: 5px;
}
.dq-dir-up { background: color-mix(in srgb, var(--brand) 10%, var(--surface)); color: var(--brand); }
.dq-dir-down { background: color-mix(in srgb, var(--blue-soft) 13%, var(--surface)); color: var(--blue); }
.dq-dir-ent { background: color-mix(in srgb, var(--amber) 12%, var(--surface)); color: var(--amber); }
.dq-jargon { opacity: .6; }
.dq-why { font-size: 12.5px; color: var(--ink-2); margin: 2px 0 4px; }
.dq-sub { font-size: 10.5px; color: var(--ink-3); margin: 8px 0 2px; }
.dq-rel summary {
  cursor: pointer; font-family: var(--mono); font-size: 11px; color: var(--ink-3);
  transition: color var(--t-fast) var(--ease);
}
.dq-rel summary:hover, .dq-rel[open] summary { color: var(--ink); }
.dq-done .dq-card { opacity: .65; }
.dq-done > summary, .dq-internal > summary {
  cursor: pointer; font-family: var(--mono); font-size: 11px; color: var(--ink-2);
  padding: 8px 0;
}
.dq-done, .dq-internal { margin: 16px 0 0; }
.dq-empty {
  text-align: center; color: var(--green); padding: 22px;
  background: color-mix(in srgb, var(--green) 6%, var(--surface));
  border-radius: var(--r-lg); font-weight: 600; font-size: 14px;
}
.dq-progress-note { font-family: var(--mono); font-size: 10.5px; color: var(--ink-3); }
/* animações: reuso de rm-dim/rm-pop/rise */
.dq-card.just-decided { animation: rm-dim .4s var(--ease); }
.dq-card.just-decided .chip.sel { animation: rm-pop .55s var(--spring); }
.dq-card.just-undone { animation: rise .35s var(--ease); }
.dq-flash { animation: dq-flash 1.2s var(--ease); }
@keyframes dq-flash { 0% { box-shadow: 0 0 0 2.5px var(--brand); } 100% { box-shadow: var(--shadow-1); } }

/* grafo compacto + estados de decisão
   (sem barra de rolagem: acima de maxRows por coluna, o excedente vira o nó
   "+K outros — decida na fila abaixo") */
.ctxmap--compact .node text { font-size: 10.5px; }
.ctxmap .node.more rect {
  fill: transparent; stroke: var(--ink-3); stroke-dasharray: 3 4; opacity: .7;
}
.ctxmap .node.more text { fill: var(--ink-3); font-style: italic; }
.ctxmap .node.more { cursor: default; }
.ctxmap .node.sep rect { stroke: var(--amber); stroke-dasharray: 5 4; fill: var(--surface); }
.ctxmap .node.sep text { fill: var(--amber); }
.ctxmap .node.just-in rect { stroke: var(--brand); stroke-width: 2; animation: fade .5s var(--ease); }

/* ---------- passo 4: níveis de recomendação + fronteira viva ---------- */
.dq-tier-head {
  display: flex; align-items: baseline; gap: 8px; margin: 18px 0 8px; padding: 6px 12px;
  border-radius: var(--r-sm); border-left: 3px solid var(--tier-c);
  background: color-mix(in srgb, var(--tier-c) 7%, transparent);
  color: var(--tier-c); font-size: 13px;
}
.dq-filters + .dq-tier-head { margin-top: 4px; }
.dq-tier-head--recomendado { --tier-c: var(--brand); }
.dq-tier-head--avaliar { --tier-c: var(--amber); }
.dq-tier-head--opcional { --tier-c: var(--ink-3); }
.dq-tier-glyph { font-size: 14px; }
.dq-tier-count { font-size: 10.5px; opacity: .75; }
.dq-tier-hint { margin-left: auto; font-size: 11px; color: var(--ink-2); font-weight: 400; text-align: right; }

.dq-tier {
  font-family: var(--mono); font-size: 10px; font-weight: 600; white-space: nowrap;
  padding: 2px 9px; border-radius: var(--r-pill);
  background: color-mix(in srgb, var(--tier-c) 10%, var(--surface)); color: var(--tier-c);
}
.dq-tier--recomendado { --tier-c: var(--brand); }
.dq-tier--avaliar { --tier-c: var(--amber); }
.dq-tier--opcional { --tier-c: var(--ink-3); }

.dq-reasons { gap: 4px; margin: 4px 0 6px; }
.dq-reason {
  font-family: var(--mono); font-size: 10.5px; color: var(--ink-2);
  background: var(--surface-2); border-radius: var(--r-pill); padding: 2px 9px;
}

/* vizinho recém-chegado (fronteira viva) */
.dq-card.dq-new { animation: rise .45s var(--ease); }
.dq-new-badge, .dq-new-note {
  font-family: var(--mono); font-size: 10px; font-weight: 600; color: var(--blue);
  background: color-mix(in srgb, var(--blue-soft) 12%, var(--surface));
  border-radius: var(--r-pill); padding: 2px 9px; white-space: nowrap;
  display: inline-flex; align-items: center; gap: 4px;
}

/* chip "para quê" — propósito da relação, sempre presente no card */
.dq-reason--pq {
  background: color-mix(in srgb, var(--brand) 8%, var(--surface));
  color: var(--ink-2);
}
.dq-reason--pq strong { color: var(--brand); font-weight: 700; }

/* ---------- responsividade: fit da solução como um todo ---------- */

/* grafo em telas estreitas: fonte menor acompanha as colunas encolhidas */
.ctxmap--narrow .node text { font-size: 9.5px; }
.ud-headers { flex-wrap: wrap; gap: 2px 10px; }

/* abas do blueprint roláveis quando não cabem (mobile) */
.bp-tabs { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.bp-tabs::-webkit-scrollbar { display: none; }

/* app-like intermediário (901-1150px): uma coluna, o .wz-layout inteiro rola
   (guia colapsado rola junto); appbar e rodapé continuam fixos */
@media (min-width: 901px) and (max-width: 1150px) {
  .main:has(> .view.wz-app) { height: 100vh; height: 100dvh; overflow: hidden; }
  .view.wz-app {
    flex: 1; min-height: 0;
    display: flex; flex-direction: column; overflow: hidden;
    padding: 12px 22px 12px;
  }
  .view.wz-app > * { animation: none; }
  .view.wz-app #wz-body { flex: 1; min-height: 0; display: flex; flex-direction: column; }
  .view.wz-app #wz-body > .wz-layout {
    flex: 1; min-height: 0; overflow-y: auto;
    overscroll-behavior: contain; padding-right: 6px;
    animation: wz-in .2s var(--ease);
  }
}

/* mobile/tablet empilhado (≤900px): sidebar vira cabeçalho compacto com o
   menu em linha rolável — antes ela ocupava a primeira tela inteira */
@media (max-width: 900px) {
  .sidebar {
    height: auto; overflow: visible; padding: 12px 16px 4px;
    flex-direction: row; flex-wrap: wrap; align-items: center; gap: 0 12px;
  }
  .burger { display: none; }
  .brand { display: flex; align-items: center; gap: 10px; padding: 0; width: auto; }
  .brand-mark, .brand-mark img { width: 30px; height: 30px; margin: 0; }
  .brand h1 { font-size: 17px; }
  .brand-sub, .sidebar-foot, .candle-label, .nav-label, .nav-rule { display: none; }
  .candle-wrap { width: auto; margin-left: auto; transform: scale(.72); transform-origin: right center; }
  #nav {
    width: 100%; flex: 1 1 100%; order: 3;
    display: flex; flex-direction: row; gap: 4px;
    overflow-x: auto; scrollbar-width: none; padding: 8px 0 6px;
  }
  #nav::-webkit-scrollbar { display: none; }
  #nav a { flex: none; padding: 7px 13px; font-size: 13px; white-space: nowrap; }
}

/* rodapé do wizard em telas estreitas: barra de progresso sobe para a própria linha */
@media (max-width: 760px) {
  .wz-foot { flex-wrap: wrap; gap: 8px; }
  .wz-foot-progress { order: -1; flex-basis: 100%; max-width: none; }
}

/* rótulos de padrão nas arestas do context map + legenda visível */
.ctxmap .edge-label rect {
  fill: var(--surface); stroke: var(--line); stroke-width: 1;
}
.ctxmap .edge-label text {
  font-family: var(--mono); font-size: 8.5px; font-weight: 600;
  fill: var(--ink-2); letter-spacing: .04em;
}
.ctxmap .edge-label:hover rect { stroke: var(--brand); }
.dq-legend { margin: 4px 0 10px; font-size: 12.5px; color: var(--ink-2); max-width: 96ch; }
.dq-legend p { margin: 3px 0; }
.dq-legend .chip { min-width: 34px; text-align: center; justify-content: center; }

/* ---------- camada didática dos mapas: modo simples, narrativa, tour ---------- */
.map-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 0 0 10px; }
.map-mode-toggle { margin: 0; }
.map-mode-toggle button { font-size: 11.5px; padding: 5px 13px; }

.map-story {
  border-radius: var(--r-md); padding: 12px 16px; margin: 8px 0 4px;
  font-size: 13px; line-height: 1.55; color: var(--ink-3);
  background: var(--surface-2); transition: background var(--t-slow) var(--ease);
}
.map-story--filled {
  color: var(--ink-2);
  background: color-mix(in srgb, var(--brand) 7%, var(--surface));
  border-left: 3px solid var(--brand);
  animation: rise .3s var(--ease);
}
.map-story strong { color: var(--ink); }

/* rótulo em frase (modo simples) */
.ctxmap .edge-label--plain text { font-family: var(--sans); font-size: 8.5px; font-weight: 600; letter-spacing: 0; }
.ctxmap .edge-label, .ctxmap .edge-g { cursor: pointer; }
.ctxmap .edge-hit { fill: none; stroke: transparent; stroke-width: 14; pointer-events: stroke; }
.ctxmap .edge-g.edge--active .edge { stroke: var(--brand); opacity: 1; stroke-width: 2.2; }

/* tour guiado */
.tour-backdrop {
  position: fixed; inset: 0; z-index: 30;
  background: color-mix(in srgb, var(--ink) 45%, transparent);
  animation: fade var(--t-fast) var(--ease);
}
.tour-card {
  position: fixed; right: 22px; bottom: 22px; z-index: 32; max-width: 380px;
  background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-3);
  padding: 16px 18px; animation: tour-in .35s var(--spring);
}
@keyframes tour-in { from { opacity: 0; transform: translateY(14px) scale(.96); } }
.tour-tag {
  display: block; font-size: 9.5px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--brand); margin-bottom: 5px;
}
.tour-card h4 { font-family: var(--display); font-size: 15.5px; font-weight: 650; margin-bottom: 6px; }
.tour-body { font-size: 13px; line-height: 1.55; color: var(--ink-2); }
.tour-body strong { color: var(--ink); }
.tour-nav { display: flex; gap: 8px; margin-top: 12px; }
.tour-nav .btn { font-size: 12px; padding: 6px 13px; }
.tour-nav [data-t="next"] { margin-left: auto; }

.tour-focus { position: relative; z-index: 31; box-shadow: 0 0 0 3px var(--brand), var(--shadow-2); border-radius: var(--r-sm); }
.tour-host { position: relative; z-index: 31; }
.ctxmap.tour-dim .node:not(.tour-focus),
.ctxmap.tour-dim .edge-g:not(.tour-focus),
.ctxmap.tour-dim .edge-label:not(.tour-focus) { opacity: .15; }
.ctxmap.tour-dim .node.tour-focus rect { stroke: var(--brand); stroke-width: 2.5; }
.ctxmap.tour-dim .edge-g.tour-focus .edge { stroke: var(--brand); opacity: 1; stroke-width: 2.4; }
.ctxmap.tour-dim .edge-label.tour-focus rect { stroke: var(--brand); stroke-width: 1.5; }

/* convite sutil na primeira visita */
.tour-nudge { animation: nudge 2.2s var(--ease) infinite; }
@keyframes nudge {
  0%, 100% { box-shadow: var(--shadow-1); }
  50% { box-shadow: 0 0 0 5px color-mix(in srgb, var(--brand) 25%, transparent), var(--shadow-1); }
}

@media print { .tour-backdrop, .tour-card, .map-tools { display: none !important; } }
