/* ==========================================================================
   styles.css — folha de estilo compartilhada dos mapas de rede em camadas.
   Fonte única para os 11 mapas (01–11). Tokens + componentes do grafo
   (.nm-*) + navegação, rodapé, referências, badge de evidência e foco.
   ========================================================================== */

:root {
  --color-text-primary: #2A2A2E;
  --color-text-secondary: #5C5C66;
  --color-text-tertiary: #8C8C96;
  --color-background-primary: #FFFFFF;
  --color-background-secondary: #F5F5F8;
  --color-background-tertiary: #EAEAF0;
  --color-border-tertiary: rgba(0,0,0,0.10);
  --color-accent: #378ADD;
  --border-radius-lg: 12px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --color-text-primary: #E8E8EC;
    --color-text-secondary: #A8A8B2;
    --color-text-tertiary: #7C7C86;
    --color-background-primary: #232328;
    --color-background-secondary: #2A2A30;
    --color-background-tertiary: #34343A;
    --color-border-tertiary: rgba(255,255,255,0.12);
    --color-accent: #85B7EB;
  }
}
* { box-sizing: border-box; }
body {
  margin: 0; padding: 24px;
  background: #ECEEF2;
  color: var(--color-text-primary);
  font-family: 'Outfit', system-ui, -apple-system, sans-serif;
  font-size: 14px; line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
@media (prefers-color-scheme: dark) {
  body { background: #1A1A1D; }
}
.container {
  max-width: 1100px;
  margin: 0 auto;
  background: var(--color-background-primary);
  border-radius: 16px;
  padding: 28px;
  border: 1px solid var(--color-border-tertiary);
}
header {
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--color-border-tertiary);
}
header h1 {
  font-weight: 500;
  font-size: 18px;
  margin: 0 0 4px;
  letter-spacing: -0.01em;
}
header .meta {
  margin: 0;
  font-size: 12px;
  color: var(--color-text-tertiary);
}
.sr-only {
  position: absolute; left: -10000px;
  width: 1px; height: 1px; overflow: hidden;
}
.nm-wrap { padding: 0.5rem 0; font-size: 14px; }
.nm-sub { font-size: 13px; color: var(--color-text-secondary); margin: 0 0 10px; line-height: 1.5; }
.nm-hint { font-size: 12px; color: var(--color-text-tertiary); margin: 0 0 12px; }
.nm-svg-box { width: 100%; overflow-x: auto; }
.nm-svg { width: 100%; min-width: 600px; display: block; }
.nm-node { cursor: pointer; transition: opacity 0.2s; }
.nm-node:hover rect { stroke-width: 1.5; }
.nm-node-dim { opacity: 0.22; }
.nm-node-active rect { stroke-width: 2.2 !important; }
.nm-conn { fill: none; opacity: 0.10; stroke-width: 0.6; transition: opacity 0.25s, stroke-width 0.25s; pointer-events: none; }
.nm-conn-active { opacity: 0.85 !important; stroke-width: 1.8 !important; }
.nm-conn-faded { opacity: 0.03 !important; }
.nm-fill-s1 { fill: #EEEDFE; stroke: #AFA9EC; }
.nm-fill-s2 { fill: #E1F5EE; stroke: #5DCAA5; }
.nm-fill-s3 { fill: #E6F1FB; stroke: #85B7EB; }
.nm-fill-s4 { fill: #FAECE7; stroke: #F0997B; }
.nm-fill-s5 { fill: #F1EFE8; stroke: #B4B2A9; }
.nm-text-s1 { fill: #26215C; } .nm-text-s2 { fill: #04342C; } .nm-text-s3 { fill: #042C53; }
.nm-text-s4 { fill: #4A1B0C; } .nm-text-s5 { fill: #2C2C2A; }
.nm-conn-s1 { stroke: #7F77DD; } .nm-conn-s2 { stroke: #1D9E75; } .nm-conn-s3 { stroke: #378ADD; }
.nm-conn-s4 { stroke: #D85A30; } .nm-conn-s5 { stroke: #888780; }
.nm-stage-h { fill: var(--color-text-secondary); font-size: 11px; font-weight: 500; text-anchor: middle; }
.nm-stage-sub { fill: var(--color-text-tertiary); font-size: 10px; text-anchor: middle; }
.nm-divider { stroke: var(--color-border-tertiary); stroke-width: 0.5; }
.nm-node-label { font-size: 11px; font-weight: 500; pointer-events: none; }
.nm-aspect-label { fill: var(--color-text-tertiary); font-size: 10px; font-weight: 500; text-anchor: start; letter-spacing: 0.3px; }
@media (prefers-color-scheme: dark) {
  .nm-fill-s1 { fill: #3C3489; stroke: #AFA9EC; }
  .nm-fill-s2 { fill: #085041; stroke: #9FE1CB; }
  .nm-fill-s3 { fill: #0C447C; stroke: #B5D4F4; }
  .nm-fill-s4 { fill: #712B13; stroke: #F5C4B3; }
  .nm-fill-s5 { fill: #444441; stroke: #D3D1C7; }
  .nm-text-s1 { fill: #EEEDFE; } .nm-text-s2 { fill: #E1F5EE; } .nm-text-s3 { fill: #E6F1FB; }
  .nm-text-s4 { fill: #FAECE7; } .nm-text-s5 { fill: #F1EFE8; }
}
.nm-detail { padding: 16px; border-radius: var(--border-radius-lg); background: var(--color-background-secondary); margin: 16px 0 0; border: 0.5px solid var(--color-border-tertiary); min-height: 180px; }
.nm-detail-empty { color: var(--color-text-secondary); font-size: 13px; text-align: center; padding: 24px 16px; line-height: 1.6; }
.nm-detail-head { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 14px; }
.nm-detail-badge { padding: 4px 10px; border-radius: 999px; font-size: 11px; font-weight: 500; flex-shrink: 0; }
.nm-detail-title { font-size: 16px; font-weight: 500; margin: 0 0 2px; color: var(--color-text-primary); line-height: 1.3; }
.nm-detail-stage { font-size: 11px; color: var(--color-text-tertiary); margin: 0; letter-spacing: 0.3px; text-transform: uppercase; }
.nm-detail-section { margin-bottom: 12px; }
.nm-detail-label { font-size: 11px; font-weight: 500; color: var(--color-text-secondary); margin-bottom: 3px; display: block; text-transform: uppercase; letter-spacing: 0.5px; }
.nm-detail-body { font-size: 13px; line-height: 1.6; color: var(--color-text-primary); }
.nm-detail-evidence { font-size: 12px; line-height: 1.55; color: var(--color-text-secondary); font-style: italic; }
.nm-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.nm-chip { display: inline-flex; align-items: center; padding: 4px 10px; background: var(--color-background-primary); border: 0.5px solid var(--color-border-tertiary); border-radius: 999px; font-size: 12px; cursor: pointer; transition: background 0.15s; color: var(--color-text-primary); }
.nm-chip:hover { background: var(--color-background-tertiary); }
.nm-dot { width: 6px; height: 6px; border-radius: 50%; margin-right: 6px; display: inline-block; }
.nm-dot-s1 { background: #7F77DD; } .nm-dot-s2 { background: #1D9E75; } .nm-dot-s3 { background: #378ADD; } .nm-dot-s4 { background: #D85A30; } .nm-dot-s5 { background: #888780; }
.nm-badge-s1 { background: #EEEDFE; color: #26215C; }
.nm-badge-s2 { background: #E1F5EE; color: #04342C; }
.nm-badge-s3 { background: #E6F1FB; color: #042C53; }
.nm-badge-s4 { background: #FAECE7; color: #4A1B0C; }
.nm-badge-s5 { background: #F1EFE8; color: #2C2C2A; }
@media (prefers-color-scheme: dark) {
  .nm-badge-s1 { background: #3C3489; color: #CECBF6; }
  .nm-badge-s2 { background: #085041; color: #9FE1CB; }
  .nm-badge-s3 { background: #0C447C; color: #B5D4F4; }
  .nm-badge-s4 { background: #712B13; color: #F5C4B3; }
  .nm-badge-s5 { background: #444441; color: #D3D1C7; }
}

/* ==========================================================================
   Adições do refactor (navegação, rodapé, referências, evidência, foco)
   ========================================================================== */

/* ---- Barra de navegação compartilhada ---- */
.topnav { max-width: 1100px; margin: 0 auto 14px; display: flex; align-items: center; gap: 12px; font-size: 13px; }
.topnav a, .topnav .is-disabled { font-family: 'Outfit', system-ui, sans-serif; text-decoration: none; color: var(--color-text-secondary); padding: 6px 12px; border-radius: 999px; border: 1px solid var(--color-border-tertiary); background: var(--color-background-primary); transition: border-color .15s, color .15s; }
.topnav a:hover { color: var(--color-text-primary); border-color: var(--color-accent); }
.topnav .is-disabled { opacity: .4; }
.topnav-seq { margin-left: auto; display: flex; gap: 8px; }

/* ---- Rodapé / disclaimer clínico ---- */
.page-footer { max-width: 1100px; margin: 18px auto 0; padding: 0 4px; }
.disclaimer { font-family: 'Outfit', system-ui, sans-serif; font-size: 12px; line-height: 1.5; color: var(--color-text-secondary); background: var(--color-background-secondary); border: 1px solid var(--color-border-tertiary); border-radius: 10px; padding: 12px 14px; margin: 0 0 8px; }
.credit { font-family: 'Outfit', system-ui, sans-serif; font-size: 11px; color: var(--color-text-tertiary); text-align: center; margin: 0; }
.credit a { color: inherit; }

/* ---- Referências agregadas ---- */
#nm-refs { margin-top: 14px; }
.nm-refs { font-family: 'Outfit', system-ui, sans-serif; font-size: 12px; border: 1px solid var(--color-border-tertiary); border-radius: 10px; background: var(--color-background-secondary); padding: 8px 14px; }
.nm-refs summary { cursor: pointer; font-weight: 500; color: var(--color-text-secondary); }
.nm-refs-list { margin: 10px 0 6px; padding-left: 20px; color: var(--color-text-secondary); line-height: 1.5; }
.nm-refs-list li { margin-bottom: 3px; }
.nm-refs-note { font-size: 11px; color: var(--color-text-tertiary); margin: 4px 0 2px; }

/* ---- Badge de força de evidência (scaffolding — preenchível por nó via campo "grade") ---- */
.nm-grade { display: inline-block; margin-left: 8px; padding: 1px 7px; border-radius: 999px; font-size: 10px; font-weight: 600; vertical-align: middle; border: 1px solid var(--color-border-tertiary); }
.nm-grade-a { background: #E1F5EE; color: #04342C; }
.nm-grade-b { background: #FBF3E2; color: #5A4A12; }
.nm-grade-c { background: #FAECE7; color: #4A1B0C; }

/* ---- Foco visível para navegação por teclado ---- */
.nm-node:focus { outline: none; }
.nm-node:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }
.nm-node:focus-visible rect { stroke-width: 2.4; }
.nm-chip:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }
.nm-refs summary:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }
