/* Horizonte — identidade visual própria: azul-índigo e coral sobre fundos frios. Sem fontes/CDN externos (funciona sem internet). */
:root {
  --ink: #0b1220; --ink-2: #3b4763; --muted: #66728c;
  --paper: #f3f6fb; --surface: #ffffff; --surface-2: #eef2fa; --line: #e0e6f1; --line-2: #ccd6ea;
  --horizon: #ff6b4a; --horizon-ink: #b63a1f; --horizon-soft: #ffe8e1;
  --sea: #5646e0; --sea-2: #7a4bf0; --sea-ink: #3f31b8; --sea-soft: #e9e7ff;
  --ok: #0c9d5a; --ok-soft: #ddf6ea; --warn: #b36b00; --warn-soft: #fff1d1; --bad: #d6404a; --bad-soft: #fde3e5;
  --focus: #5646e0;
  --shadow: 0 1px 2px rgba(11, 18, 32, .05), 0 10px 30px rgba(60, 70, 140, .08);
  --radius: 14px; --radius-s: 10px;
  --sans: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --serif: Georgia, Cambria, "Times New Roman", serif;
  --mono: "Cascadia Mono", Consolas, "SF Mono", Menlo, monospace;
  --grad: linear-gradient(135deg, var(--sea), var(--sea-2));
  --mesh: radial-gradient(900px 520px at 6% -8%, rgba(86, 70, 224, .11), transparent 62%), radial-gradient(760px 460px at 96% 0%, rgba(255, 107, 74, .09), transparent 58%);
}
:root[data-theme="dark"] {
  --ink: #e9eef9; --ink-2: #b9c4dc; --muted: #8d9ab8;
  --paper: #070b14; --surface: #0f1626; --surface-2: #131c30; --line: #1d2a44; --line-2: #2a3a5c;
  --horizon: #ff8a6b; --horizon-ink: #ffb3a0; --horizon-soft: #3a1e1a;
  --sea: #8b7dff; --sea-2: #b08bff; --sea-ink: #c1b9ff; --sea-soft: #1e1a4a;
  --ok: #4fd696; --ok-soft: #0f3324; --warn: #f0b05a; --warn-soft: #3a2a10; --bad: #ff8088; --bad-soft: #3b1519;
  --focus: #8b7dff; --shadow: 0 1px 2px rgba(0, 0, 0, .45), 0 10px 30px rgba(0, 0, 0, .3);
  --mesh: radial-gradient(900px 520px at 6% -8%, rgba(139, 125, 255, .16), transparent 62%), radial-gradient(760px 460px at 96% 0%, rgba(255, 138, 107, .10), transparent 58%);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ink: #e9eef9; --ink-2: #b9c4dc; --muted: #8d9ab8;
    --paper: #070b14; --surface: #0f1626; --surface-2: #131c30; --line: #1d2a44; --line-2: #2a3a5c;
    --horizon: #ff8a6b; --horizon-ink: #ffb3a0; --horizon-soft: #3a1e1a;
    --sea: #8b7dff; --sea-2: #b08bff; --sea-ink: #c1b9ff; --sea-soft: #1e1a4a;
    --ok: #4fd696; --ok-soft: #0f3324; --warn: #f0b05a; --warn-soft: #3a2a10; --bad: #ff8088; --bad-soft: #3b1519;
    --focus: #8b7dff; --shadow: 0 1px 2px rgba(0, 0, 0, .45), 0 10px 30px rgba(0, 0, 0, .3);
    --mesh: radial-gradient(900px 520px at 6% -8%, rgba(139, 125, 255, .16), transparent 62%), radial-gradient(760px 460px at 96% 0%, rgba(255, 138, 107, .10), transparent 58%);
  }
}

* { box-sizing: border-box; }
html { color-scheme: light dark; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 15px/1.5 var(--sans); -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4 { line-height: 1.2; margin: 0; letter-spacing: -.01em; }
a { color: var(--sea-ink); text-underline-offset: 2px; }
a:hover { color: var(--sea); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
.skip { position: absolute; left: -999px; top: 0; background: var(--ink); color: var(--paper); padding: 8px 12px; z-index: 50; }
.skip:focus { left: 8px; top: 8px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.mono { font-family: var(--mono); font-size: .86em; }
.muted { color: var(--muted); }
.small { font-size: .86rem; }


/* ---------- elementos ---------- */
button, .btn { font: inherit; cursor: pointer; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); border-radius: 9px;
  padding: 7px 13px; display: inline-flex; align-items: center; gap: 7px; text-decoration: none; }
button:hover, .btn:hover { border-color: var(--sea); color: var(--sea-ink); }
button.primary, .btn.primary { background: var(--ink); color: var(--paper); border-color: var(--ink); }
button.primary:hover, .btn.primary:hover { background: var(--sea-ink); border-color: var(--sea-ink); color: #fff; }
button.ghost { background: transparent; border-color: rgba(255, 255, 255, .22); color: inherit; }
.side button.ghost:hover { border-color: var(--horizon); color: #fff; }
button.small, .btn.small { padding: 4px 10px; font-size: .85rem; }
button:disabled { opacity: .5; cursor: not-allowed; }
input[type="text"], input[type="search"], input[type="number"], input[type="password"], input[type="date"], select, textarea {
  font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line-2); border-radius: 9px; padding: 8px 11px; width: 100%; }
textarea { min-height: 76px; resize: vertical; }
label { font-size: .85rem; color: var(--ink-2); font-weight: 600; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; }
.card h2 { font-size: 1.08rem; }
.grid { display: grid; gap: 16px; }
.grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid.auto { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
a.ucard { text-decoration: none; color: inherit; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spread { justify-content: space-between; }
.form-panel { display: grid; gap: 16px; }
.form-panel h2 { margin-bottom: 0; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.form-field { display: grid; gap: 6px; min-width: 0; }
.form-field > span { color: var(--ink-2); font-weight: 700; }
.form-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; padding-top: 4px; }
.form-actions .small { margin: 0; }
.form-note { margin: 0; padding-top: 2px; }
.choice-field { margin: 0; padding: 14px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface-2); }
.choice-field legend { padding: 0 8px; color: var(--ink); font-weight: 700; }
.choice-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; }
.choice-option { display: flex; gap: 9px; align-items: flex-start; min-height: 58px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--ink-2); cursor: pointer; transition: border-color .15s, background .15s, box-shadow .15s; }
.choice-option:hover { border-color: var(--sea); }
.choice-option:has(input:checked) { border-color: var(--sea); background: var(--sea-soft); box-shadow: inset 0 0 0 1px var(--sea); }
.choice-option input { flex: none; margin-top: 3px; accent-color: var(--sea); }
.choice-option span { font-weight: 700; }
.choice-option small { display: block; margin-top: 2px; color: var(--muted); font-size: .72rem; font-weight: 400; }
.section-title { display: flex; align-items: baseline; gap: 10px; margin: 28px 0 12px; }
.section-title h2 { font-size: 1.15rem; }
.section-title small { color: var(--muted); }

/* ---------- chips e indicadores ---------- */
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 99px; font-size: .76rem; font-weight: 600; border: 1px solid transparent;
  background: var(--surface-2); color: var(--ink-2); white-space: nowrap; }
.chip.kind { background: var(--sea-soft); color: var(--sea-ink); }
.chip.explicit { background: var(--sea-soft); color: var(--sea-ink); border-color: var(--sea); }
.chip.inferred { background: var(--horizon-soft); color: var(--horizon-ink); border: 1px dashed var(--horizon); }
.chip.doc { background: var(--ink); color: var(--paper); }
.chip.ok { background: var(--ok-soft); color: var(--ok); }
.chip.warn { background: var(--warn-soft); color: var(--warn); }
.chip.bad { background: var(--bad-soft); color: var(--bad); }
.chip.neutral { border-color: var(--line-2); }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex: none; }
.dot.alta { background: var(--bad); } .dot.media { background: var(--horizon); } .dot.info { background: var(--sea); }
.kpi { padding: 16px 18px; }
.kpi .v { font-size: 2rem; font-weight: 700; letter-spacing: -.02em; }
.kpi .l { color: var(--muted); font-size: .84rem; }
.kpi .s { color: var(--ink-2); font-size: .8rem; margin-top: 2px; }
.bar { height: 8px; background: var(--line); border-radius: 99px; overflow: hidden; display: flex; }
.bar > i { display: block; height: 100%; }
.bar .a { background: var(--sea); } .bar .b { background: var(--horizon); } .bar .c { background: var(--line-2); }
.metric { display: grid; gap: 4px; }
.metric .top { display: flex; justify-content: space-between; font-size: .84rem; color: var(--ink-2); }
.metric .top b { color: var(--ink); }
.tech-vs-sci { display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px; }
.sci { border-left: 4px solid var(--horizon); background: var(--horizon-soft); border-color: var(--horizon); }
.sci h2 { color: var(--horizon-ink); }
.sci .state { display: inline-block; margin: 8px 0; padding: 3px 10px; border-radius: 99px; background: var(--surface); color: var(--horizon-ink); font-weight: 700; font-size: .82rem; border: 1px dashed var(--horizon); }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: .8rem; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.legend i.a { background: var(--sea); } .legend i.b { background: var(--horizon); }

.doc-card { display: flex; flex-direction: column; gap: 12px; }
.doc-card h3 { font-size: 1.05rem; }
.doc-card .meta { color: var(--muted); font-size: .82rem; }
.alert-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.alert-list li { display: grid; grid-template-columns: 12px 1fr; gap: 10px; align-items: start; font-size: .9rem; }
.alert-list .dot { margin-top: 7px; }
.alert-list .src { color: var(--muted); font-size: .76rem; display: block; }
details.alerts { border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--surface-2); padding: 8px 12px; }
details.alerts summary { cursor: pointer; font-weight: 600; font-size: .9rem; }

/* ---------- biblioteca ---------- */
.lib { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 20px; align-items: start; }
.lib-list { display: flex; flex-direction: column; gap: 10px; position: sticky; top: 14px; }
.lib-item { text-align: left; width: 100%; display: block; padding: 13px 14px; border-radius: 11px; border: 1px solid var(--line); background: var(--surface); }
.lib-item[aria-current="true"] { border-color: var(--sea); box-shadow: 0 0 0 3px var(--sea-soft); }
.lib-item strong { display: block; }
.lib-item small { color: var(--muted); }
dl.meta-grid { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 0; margin: 0; }
dl.meta-grid dt, dl.meta-grid dd { padding: 8px 0; border-bottom: 1px solid var(--line); margin: 0; }
dl.meta-grid dt { color: var(--muted); font-size: .86rem; padding-right: 12px; }
dl.meta-grid dd { overflow-wrap: anywhere; }
.viewer { display: grid; gap: 12px; }
.viewer-bar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.viewer-bar input[type="number"] { width: 84px; }
.page-img-wrap { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-s); padding: 10px; display: grid; place-items: start center; min-height: 240px; overflow: auto; }
.page-img-wrap img { max-width: 100%; height: auto; box-shadow: var(--shadow); background: #fff; }
.page-text { white-space: pre-wrap; font: .86rem/1.55 var(--mono); background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-s); padding: 12px; max-height: 70vh; overflow: auto; }
.page-text .hl, .ctx-lines .hl { background: var(--horizon-soft); box-shadow: inset 3px 0 0 var(--horizon); }
.tabs { display: inline-flex; border: 1px solid var(--line-2); border-radius: 9px; overflow: hidden; }
.tabs button { border: 0; border-radius: 0; background: transparent; }
.tabs button[aria-selected="true"] { background: var(--ink); color: var(--paper); }

/* ---------- explorador ---------- */
.explorer { display: grid; grid-template-columns: 250px minmax(0, 1fr) minmax(360px, 460px); gap: 18px; align-items: start; }
.explorer.no-detail { grid-template-columns: 250px minmax(0, 1fr); }
.filters { position: sticky; top: 14px; display: flex; flex-direction: column; gap: 14px; }
.filters fieldset { border: 0; padding: 0; margin: 0; display: grid; gap: 6px; }
.filters legend { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 4px; font-weight: 700; }
.check { display: flex; align-items: center; gap: 8px; font-size: .88rem; font-weight: 500; color: var(--ink); }
.check input { width: 16px; height: 16px; accent-color: var(--sea); }
.check .n { margin-left: auto; color: var(--muted); font-size: .78rem; }
.ulist { display: grid; gap: 10px; }
.ucard { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-s); padding: 12px 14px; cursor: pointer; text-align: left; display: grid; gap: 8px; width: 100%; }
.ucard:hover { border-color: var(--sea); }
.ucard[aria-current="true"] { border-color: var(--sea); box-shadow: 0 0 0 3px var(--sea-soft); }
.ucard .chips { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.ucard .id { margin-left: auto; color: var(--muted); }
.quote { font-family: var(--serif); font-size: .98rem; line-height: 1.5; color: var(--ink); overflow-wrap: anywhere; }
.ucard .quote { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.ucard .foot { color: var(--muted); font-size: .76rem; display: flex; gap: 12px; flex-wrap: wrap; }
.evidence { font-family: var(--serif); font-size: 1.02rem; line-height: 1.6; white-space: pre-wrap; border-left: 4px solid var(--horizon); background: var(--surface-2);
  padding: 12px 14px; border-radius: 0 var(--radius-s) var(--radius-s) 0; overflow-wrap: anywhere; max-height: 38vh; overflow: auto; }
.detail { position: sticky; top: 14px; max-height: calc(100vh - 28px); overflow: auto; display: flex; flex-direction: column; gap: 14px; }
.detail h2 { font-size: 1.1rem; }
.detail-close { display: none; }
.ctx-lines { font: .84rem/1.55 var(--mono); background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-s); padding: 8px 0; max-height: 38vh; overflow: auto; }
.ctx-lines div { padding: 0 12px; white-space: pre-wrap; overflow-wrap: anywhere; }
.ctx-lines .ln { color: var(--muted); display: inline-block; min-width: 2.2em; margin-right: 8px; user-select: none; }
.attrs { display: grid; grid-template-columns: auto 1fr; gap: 3px 12px; font-size: .86rem; }
.attrs dt { color: var(--muted); } .attrs dd { margin: 0; overflow-wrap: anywhere; }
.pager { display: flex; gap: 10px; align-items: center; justify-content: center; margin: 16px 0; }
.empty { text-align: center; color: var(--muted); padding: 40px 10px; border: 1px dashed var(--line-2); border-radius: var(--radius); background: var(--surface-2); }
.loading { color: var(--muted); padding: 24px 4px; }
.err { background: var(--bad-soft); color: var(--bad); border: 1px solid var(--bad); border-radius: var(--radius-s); padding: 10px 14px; }
.note { background: var(--sea-soft); color: var(--sea-ink); border-radius: var(--radius-s); padding: 10px 14px; font-size: .9rem; }
.note.warn { background: var(--warn-soft); color: var(--warn); }

/* ---------- revisao ---------- */
.verdicts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.verdict { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line-2); border-radius: 9px; padding: 8px 10px; cursor: pointer; font-weight: 600; font-size: .88rem; background: var(--surface); }
.verdict input { accent-color: var(--sea); }
.verdict:has(input:checked) { border-color: var(--sea); background: var(--sea-soft); color: var(--sea-ink); }
.verdict.correct:has(input:checked) { border-color: var(--ok); background: var(--ok-soft); color: var(--ok); }
.verdict.incorrect:has(input:checked) { border-color: var(--bad); background: var(--bad-soft); color: var(--bad); }
.verdict.partial:has(input:checked), .verdict.needs_review:has(input:checked) { border-color: var(--horizon); background: var(--horizon-soft); color: var(--horizon-ink); }
.history { display: grid; gap: 8px; list-style: none; padding: 0; margin: 0; font-size: .86rem; }
.history li { border-left: 3px solid var(--line-2); padding: 2px 0 2px 10px; }
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th, .table td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table th { color: var(--muted); font-weight: 600; font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; }

/* ---------- comparador ---------- */
.cmp-head { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.cmp-pane { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.cmp-scroll { max-height: 56vh; overflow: auto; padding: 2px; }
.cmp-tray { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 18px; }
.pinned { border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius-s); padding: 10px 12px; display: grid; gap: 6px; }
.pinned + .pinned { margin-top: 10px; }

/* ---------- responsivo ---------- */
@media (max-width: 1280px) {
  .explorer { grid-template-columns: 230px minmax(0, 1fr); }
  .detail { position: fixed; inset: 0 0 0 auto; width: min(560px, 100vw); max-height: none; z-index: 30; border-radius: 0; box-shadow: -10px 0 40px rgba(0, 0, 0, .25); }
  .detail-close { display: inline-flex; }
  .grid.cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 980px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 10px; padding: 12px 14px; }
  .nav { flex-direction: row; flex-wrap: wrap; gap: 2px; }
  .nav a { padding: 7px 10px; }
  .side-foot { display: none; }
  .tech-vs-sci, .lib, .explorer, .explorer.no-detail, .cmp-head, .cmp-tray, .grid.cols-3, .grid.cols-2 { grid-template-columns: minmax(0, 1fr); }
  .lib-list, .filters { position: static; }
  dl.meta-grid { grid-template-columns: 1fr; }
  dl.meta-grid dt { border-bottom: 0; padding-bottom: 0; }
}
@media (max-width: 560px) {
  .grid.cols-4 { grid-template-columns: minmax(0, 1fr); }
  .page-title { font-size: 1.4rem; }
  .verdicts { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: no-preference) { .bar > i { transition: width .5s ease; } }
@media print { .side, .proto-banner { display: none; } .shell { display: block; } }

/* icones em botoes/links e itens da biblioteca */
button svg, .btn svg { width: 16px; height: 16px; flex: none; }
a.lib-item { text-decoration: none; color: inherit; }
a.lib-item strong { color: var(--ink); }
a.btn { text-decoration: none; }

/* controles nativos seguem o tema ESCOLHIDO (nao so o do sistema) */
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }
.row > input[type="number"] { flex: 1; min-width: 0; }
.page-img-wrap a { display: block; cursor: zoom-in; }

/* cores por documento */
.dtag { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: .85rem; }
.dtag::before { content: ""; width: 11px; height: 11px; border-radius: 3px; background: var(--dc, var(--d-ref, #7a8794)); }
.fill-dc { background: var(--dc); }


/* ---- gaveta de evidencia ---- */
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(560px, 100vw); background: var(--surface); border-left: 1px solid var(--line-2);
  box-shadow: -12px 0 30px rgba(0, 0, 0, .18); z-index: 60; display: flex; flex-direction: column; }
.drawer header { padding: 14px 16px; border-bottom: 1px solid var(--line); display: flex; gap: 10px; align-items: start; justify-content: space-between; }
.drawer .body { padding: 14px 16px 30px; overflow: auto; display: grid; gap: 14px; }
.drawer img { max-width: 100%; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.lit { white-space: pre-wrap; font-family: var(--serif); background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; max-height: 260px; overflow: auto; }
.ctx { font-family: var(--mono); font-size: .8rem; color: var(--muted); white-space: pre-wrap; }
.ctx .on { color: var(--ink); background: var(--horizon-soft); }

/* ---- comparação entre entes (4 blocos) ---- */
.entes-form fieldset { border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; margin: 14px 0 10px; display: flex; flex-wrap: wrap; gap: 6px 18px; }
.entes-form legend { padding: 0 6px; font-size: .78rem; color: var(--muted); }
.chk { display: inline-flex; align-items: center; gap: 6px; font-size: .85rem; }
.entes-matrix th[scope="row"] { text-align: left; font-weight: 500; }
.entes-matrix .bloco-row th { background: var(--surface-2); text-align: left; font-size: .76rem; letter-spacing: .03em; text-transform: uppercase; color: var(--muted); }
.entes-matrix td.nv { text-align: center; font-weight: 600; font-size: .82rem; }
.entes-matrix td.nv small { display: block; font-weight: 400; font-size: .64rem; opacity: .8; }
.nv-alto { background: #cfeedd; color: #0d4a2b; } .nv-medio { background: #fbeec2; color: #5b4300; } .nv-baixo { background: #f7d1cf; color: #6d1b17; }
.nv-na { background: var(--surface-2); color: var(--muted); font-style: italic; font-weight: 400; }
:root[data-theme="dark"] .nv-alto { background: #1c5236; color: #d6f5e3; } :root[data-theme="dark"] .nv-medio { background: #665016; color: #fdf1c8; } :root[data-theme="dark"] .nv-baixo { background: #6a2724; color: #fbdcda; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .nv-alto { background: #1c5236; color: #d6f5e3; } :root:not([data-theme="light"]) .nv-medio { background: #665016; color: #fdf1c8; } :root:not([data-theme="light"]) .nv-baixo { background: #6a2724; color: #fbdcda; }
}
.tag-div { margin-left: 8px; font-size: .62rem; padding: 1px 6px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); }
.ente-svg { width: 100%; max-width: 680px; height: auto; display: block; margin: 8px 0 14px; }
.ente-svg.radar { max-width: 360px; }
.ente-lbl { font-size: 12px; fill: var(--ink); } .ente-lbl.mid { text-anchor: middle; font-weight: 700; } .ente-val { font-size: 11px; fill: var(--muted); }
.radar-ring { fill: none; stroke: var(--line); stroke-width: 1; }
.ente-bar, .radar-area { stroke: none; } .radar-area { fill-opacity: .18; stroke-width: 2; }
.ente-c1 { fill: #1f4e8c; stroke: #1f4e8c; background: #1f4e8c; } .ente-c2 { fill: #2e8b57; stroke: #2e8b57; background: #2e8b57; } .ente-c3 { fill: #b5651d; stroke: #b5651d; background: #b5651d; }
.ente-c4 { fill: #7b4ea3; stroke: #7b4ea3; background: #7b4ea3; } .ente-c5 { fill: #c0392b; stroke: #c0392b; background: #c0392b; } .ente-c6 { fill: #17808f; stroke: #17808f; background: #17808f; }
.ente-c7 { fill: #6b7a1a; stroke: #6b7a1a; background: #6b7a1a; } .ente-c8 { fill: #555b66; stroke: #555b66; background: #555b66; }
rect.ente-bar { stroke: none; } polygon.radar-area { stroke-opacity: 1; }
.ente-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: .8rem; margin-bottom: 6px; }
.ente-legend .lg { display: inline-flex; align-items: center; } .ente-legend .sw { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; }

/* ---- administração (privada) ---- */
.adm-login { max-width: 420px; } .adm-login input { width: 100%; }
.adm-table td, .adm-table th { vertical-align: top; } .adm-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.adm-row.s-arquivado { opacity: .78; } .adm-row.s-excluido_logico { opacity: .6; text-decoration: none; }
.adm-reason, .adm-edit { display: grid; gap: 8px; margin-top: 8px; padding: 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); }
.adm-edit label { display: grid; gap: 3px; font-size: .78rem; color: var(--muted); } .adm-edit input, .adm-edit select, .adm-reason input { width: 100%; }
button.danger { border-color: #b3261e; color: #b3261e; } button.danger:hover { background: #b3261e; color: #fff; }
.adm-add summary { cursor: pointer; font-weight: 600; } .adm-add-body { margin-top: 12px; }
pre.code { padding: 8px 10px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 6px; overflow-x: auto; }

/* ---- codificação PPLP ---- */
.cod-top { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; } .cod-top select, .cod-top input { min-width: 200px; }
.cod-body { display: grid; grid-template-columns: minmax(260px, 340px) 1fr; gap: 16px; align-items: start; margin-top: 10px; }
@media (max-width: 900px) { .cod-body { grid-template-columns: 1fr; } }
.cod-list h4 { margin: 14px 0 6px; font-size: .74rem; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.cod-item { width: 100%; display: grid; grid-template-columns: 30px 1fr auto; align-items: center; gap: 8px; padding: 8px 10px; margin-bottom: 4px; text-align: left; border: 1px solid var(--line); background: var(--surface); border-radius: 8px; }
.cod-item.on { border-color: var(--sea); background: color-mix(in srgb, var(--sea), white 92%); }
.cod-n { font-weight: 700; color: var(--muted); font-size: .76rem; } .cod-name { font-size: .82rem; }
.cod-st { font-style: normal; font-size: .64rem; padding: 2px 7px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); }
.cod-st.st-ok { background: #cfeedd; color: #0d4a2b; border-color: transparent; } .cod-st.st-draft { background: #fbeec2; color: #5b4300; border-color: transparent; }
:root[data-theme="dark"] .cod-st.st-ok { background: #1c5236; color: #d6f5e3; } :root[data-theme="dark"] .cod-st.st-draft { background: #665016; color: #fdf1c8; }
.cod-panel { display: grid; gap: 12px; } .cod-hints { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 8px; }
.cod-hint-head { margin-bottom: 4px; } .cod-hint-text { white-space: pre-wrap; } .cod-ctx { margin-top: 8px; display: grid; gap: 6px; } .cod-ctx[hidden] { display: none; } .cod-ctx-p { padding: 6px 8px; border-left: 3px solid var(--line); background: var(--surface); } .cod-ctx-p.cur { border-left-color: var(--accent, #2a78d6); } .cod-ctx-p p { margin: 2px 0; }
.cod-hint { padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); }
.cod-form { display: grid; gap: 10px; } .cod-form fieldset { border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; }
.cod-radios { display: flex; flex-wrap: wrap; gap: 8px 18px; } .cod-radio { display: inline-flex; gap: 6px; align-items: flex-start; font-size: .84rem; } .cod-radio small { display: block; color: var(--muted); font-size: .68rem; }
.cod-form textarea, .cod-form input[type=number] { width: 100%; } .cod-form input[type=number] { max-width: 110px; }
.cod-msg { min-height: 1.2em; color: #b3261e; font-size: .84rem; } .cod-msg.ok { color: #0d6b3a; } .cod-check { font-size: .84rem; }


/* ================= Horizonte — casca, páginas públicas e área restrita ================= */
:root { --d-ref: #7a8794; --g-bg: #f2f5f8; --g-ink: #12263a; --g-muted: #5b6b7c; --g-edge: #9fb0c1; --g-accent: #d9801b; }
:root[data-theme="dark"] { --g-bg: #0b1520; --g-ink: #e8eef4; --g-muted: #93a3b5; --g-edge: #44566b; --g-accent: #f3b13f; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --g-bg: #0b1520; --g-ink: #e8eef4; --g-muted: #93a3b5; --g-edge: #44566b; --g-accent: #f3b13f; } }
body { min-height: 100vh; display: flex; flex-direction: column; }
.top { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 18px; padding: 10px clamp(14px, 3vw, 32px); background: color-mix(in srgb, var(--surface), transparent 8%); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-weight: 800; font-size: 1.15rem; letter-spacing: .01em; }
.nav { display: flex; gap: 4px; flex: 1; overflow-x: auto; scrollbar-width: none; }
.nav a { padding: 8px 14px; border-radius: 99px; text-decoration: none; color: var(--ink-2); font-weight: 600; font-size: .95rem; white-space: nowrap; }
.nav a:hover { background: var(--surface-2); }
.nav a[aria-current="page"] { background: var(--ink); color: var(--paper); }
.top-right { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.ghost { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 99px; border: 1px solid var(--line-2); background: transparent; color: var(--ink-2); font: inherit; font-size: .88rem; font-weight: 600; text-decoration: none; cursor: pointer; }
.ghost:hover { background: var(--surface-2); border-color: var(--sea); }
.ghost svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ghost.icon-only { padding: 7px 9px; } .theme-dot { width: 16px; height: 16px; border-radius: 50%; background: linear-gradient(90deg, var(--ink) 50%, transparent 50%); border: 2px solid var(--ink); }
.lock[aria-current="page"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.subnav { display: flex; gap: 6px; align-items: center; padding: 8px clamp(14px, 3vw, 32px); background: #12263a; color: #e8eef4; overflow-x: auto; }
.subnav[hidden] { display: none; }
.subnav .tag { font-size: .7rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: #f3b13f; margin-right: 8px; white-space: nowrap; }
.subnav a, .subnav button { padding: 5px 13px; border-radius: 99px; border: 1px solid transparent; background: transparent; color: #cfdbe6; text-decoration: none; font: inherit; font-size: .88rem; font-weight: 600; cursor: pointer; white-space: nowrap; }
.subnav a:hover, .subnav button:hover { border-color: #3a526b; } .subnav a[aria-current="page"] { background: #f3b13f; color: #12263a; }
.subnav .push { margin-left: auto; }
.view { flex: 1; width: 100%; max-width: 1360px; margin: 0 auto; padding: 22px clamp(14px, 3vw, 32px) 30px; outline: none; }
.foot { padding: 14px clamp(14px, 3vw, 32px) 22px; color: var(--muted); font-size: .8rem; text-align: center; border-top: 1px solid var(--line); }
.page-head { margin-bottom: 14px; } .page-head h1 { font-size: 1.55rem; } .page-head p { margin: 4px 0 0; color: var(--ink-2); max-width: 70ch; }
button, input, select, textarea { font: inherit; }

/* ---- panorama: mapa e chat lado a lado ---- */
.pano { display: grid; grid-template-columns: minmax(0, 1fr) minmax(380px, 460px); gap: 18px; align-items: start; }
.pano-left { display: grid; gap: 16px; min-width: 0; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); padding: 16px 18px; }
.panel h2 { font-size: 1.05rem; margin-bottom: 2px; } .panel .sub { color: var(--muted); font-size: .86rem; margin: 0 0 10px; }
.ter { position: relative; } .ter-svg { width: 100%; height: auto; max-height: 520px; display: block; }
.ter-uf { fill: var(--surface-2); stroke: var(--line-2); stroke-width: 1; transition: fill .15s; }
.ter-uf.has { fill: color-mix(in srgb, var(--sea), var(--surface) 55%); stroke: var(--sea); cursor: pointer; } .ter-uf.has:hover, .ter-uf.has:focus-visible { fill: color-mix(in srgb, var(--sea), var(--surface) 25%); outline: none; }
.ter-uf.on { fill: var(--horizon); stroke: var(--horizon-ink); }
.ter-tip { position: absolute; left: 8px; top: 6px; font-size: .86rem; font-weight: 600; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 2px 8px; pointer-events: none; } .ter-tip:empty { display: none; }
.ter-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chip-btn { padding: 5px 12px; border-radius: 99px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink-2); font-size: .84rem; font-weight: 600; cursor: pointer; } .chip-btn[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.plans { display: grid; gap: 8px; margin-top: 4px; }
.plan { display: grid; grid-template-columns: 6px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.plan::before { content: ""; align-self: stretch; border-radius: 4px; background: var(--dc, var(--d-ref)); } .plan h3 { font-size: .98rem; } .plan p { margin: 2px 0 0; font-size: .82rem; color: var(--muted); }
.plan .acts { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.btn, a.btn { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); font-weight: 600; font-size: .88rem; text-decoration: none; cursor: pointer; }
.btn:hover { border-color: var(--sea); } .btn.primary, button.primary { background: var(--sea); border-color: var(--sea); color: #fff; } .btn.small, button.small { padding: 4px 10px; font-size: .8rem; }
.empty-state { text-align: center; color: var(--muted); padding: 22px 10px; font-size: .92rem; }

/* chat */
.chat { position: sticky; top: 76px; display: flex; flex-direction: column; height: calc(100vh - 100px); min-height: 520px; padding: 0; overflow: hidden; }
.chat-head { padding: 14px 18px 8px; border-bottom: 1px solid var(--line); } .chat-head h2 { font-size: 1.1rem; } .chat-head p { margin: 2px 0 0; color: var(--muted); font-size: .84rem; }
.chat-log { flex: 1; overflow: auto; padding: 14px 16px; display: flex; flex-direction: column; gap: 12px; scroll-behavior: smooth; }
.msg { max-width: 94%; padding: 10px 13px; border-radius: 14px; font-size: .92rem; line-height: 1.5; } .msg.user { align-self: flex-end; background: var(--sea); color: #fff; border-bottom-right-radius: 4px; }
.msg.bot { align-self: flex-start; background: var(--surface-2); border: 1px solid var(--line); border-bottom-left-radius: 4px; } .msg.bot p { margin: 0 0 8px; }
.msg .tag { display: inline-block; font-size: .68rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--sea-ink); margin-bottom: 4px; }
.cite { display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: 8px; margin: 8px 0; padding: 8px 10px; border-left: 3px solid var(--dc, var(--sea)); background: var(--surface); border-radius: 0 10px 10px 0; font-size: .86rem; }
.cite .num { width: 22px; height: 22px; border-radius: 50%; background: var(--ink); color: var(--paper); font-size: .74rem; font-weight: 700; display: grid; place-items: center; } .cite mark { background: color-mix(in srgb, var(--horizon), transparent 65%); color: inherit; padding: 0 2px; border-radius: 3px; }
.cite-link { background: none; border: 0; padding: 0; color: var(--sea-ink); font: inherit; font-weight: 700; text-decoration: underline; cursor: pointer; }
.chips-q { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 16px 8px; } .chips-q button { padding: 5px 11px; border-radius: 99px; border: 1px solid var(--line-2); background: var(--surface); font-size: .8rem; cursor: pointer; color: var(--ink-2); } .chips-q button:hover { border-color: var(--sea); }
.composer { display: flex; gap: 8px; padding: 10px 14px 14px; border-top: 1px solid var(--line); } .composer textarea { flex: 1; resize: none; border: 1px solid var(--line-2); border-radius: 12px; padding: 9px 12px; background: var(--surface); color: var(--ink); }
.chat-note { padding: 0 16px 12px; margin: 0; color: var(--muted); font-size: .76rem; }
@media (max-width: 1000px) { .pano { grid-template-columns: 1fr; } .chat { position: static; height: 70vh; } }

/* perfil do plano (cubo em linguagem simples) */
.perfil { display: grid; gap: 14px; } .perg { display: grid; gap: 6px; } .perg h3 { font-size: .96rem; }
.opcoes { display: flex; flex-wrap: wrap; gap: 8px; } .opcao { padding: 9px 14px; border: 1px solid var(--line-2); border-radius: 12px; background: var(--surface); cursor: pointer; font-size: .9rem; text-align: left; color: var(--ink); }
.opcao[aria-pressed="true"] { border-color: var(--sea); background: color-mix(in srgb, var(--sea), var(--surface) 88%); box-shadow: inset 0 0 0 1px var(--sea); }
.resultado-perfil { padding: 14px 16px; border-radius: 14px; background: var(--surface-2); border: 1px dashed var(--line-2); } .resultado-perfil h3 { font-size: 1.1rem; color: var(--sea-ink); }

/* ---- mapa de relações ---- */
.mapa { display: grid; grid-template-columns: 250px minmax(0, 1fr) 320px; gap: 12px; height: calc(100vh - 150px); min-height: 560px; }
.mapa-side, .mapa-info { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 14px; overflow: auto; font-size: .88rem; }
.mapa-side h2, .mapa-info h2 { font-size: .98rem; margin-bottom: 6px; } .mapa-side label { display: flex; gap: 8px; align-items: center; margin: 6px 0; } .mapa-side input[type=search] { width: 100%; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); }
.mapa-stage { position: relative; border-radius: 16px; overflow: hidden; border: 1px solid var(--line); background: var(--g-bg); }
.mapa-stage canvas { width: 100%; height: 100%; display: block; cursor: grab; touch-action: none; }
.mapa-tools { position: absolute; right: 10px; top: 10px; display: grid; gap: 6px; } .mapa-tools button { width: 34px; height: 34px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); font-size: 1.1rem; cursor: pointer; }
.mapa-hint { position: absolute; left: 12px; bottom: 10px; font-size: .76rem; color: var(--g-muted); pointer-events: none; }
.legend-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; background: var(--dc, var(--d-ref)); } .legend-line { display: inline-block; width: 22px; border-top: 2px solid var(--g-edge); margin-right: 6px; vertical-align: middle; } .legend-line.dash { border-top-style: dashed; }
.nodelist { max-height: 160px; overflow: auto; margin: 6px 0 0; padding: 0; list-style: none; } .nodelist button { width: 100%; text-align: left; padding: 4px 8px; border: 0; background: none; border-radius: 6px; color: var(--ink); cursor: pointer; } .nodelist button:hover { background: var(--surface-2); }
.rel { padding: 8px 10px; margin: 8px 0; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); } .rel q { display: block; margin: 4px 0; font-family: var(--serif); font-size: .86rem; quotes: none; }
@media (max-width: 1100px) { .mapa { grid-template-columns: 1fr; height: auto; } .mapa-stage { height: 62vh; } }

/* ---- documentos e leitor ---- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; } .inst { margin: 22px 0 8px; font-size: 1.05rem; display: flex; align-items: center; gap: 8px; }
.docc { display: grid; gap: 8px; padding: 16px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); border-top: 5px solid var(--dc, var(--d-ref)); box-shadow: var(--shadow); } .docc h3 { font-size: 1.02rem; } .docc .meta { color: var(--muted); font-size: .84rem; } .docc .acts { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.reader { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 14px; align-items: start; } .reader-page { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 8px; text-align: center; } .reader-page img { max-width: 100%; height: auto; }
.reader-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 10px; } .reader-bar input[type=number] { width: 80px; } .reader-text { white-space: pre-wrap; font-family: var(--serif); font-size: .9rem; max-height: 70vh; overflow: auto; }
@media (max-width: 1000px) { .reader { grid-template-columns: 1fr; } }

/* ---- acesso restrito ---- */
.gate { max-width: 440px; margin: 40px auto; display: grid; gap: 10px; } .gate input[type=password] { width: 100%; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); }
.hub { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; } .hub a { display: grid; gap: 4px; padding: 16px; border-radius: 16px; border: 1px solid var(--line); background: var(--surface); text-decoration: none; color: var(--ink); box-shadow: var(--shadow); } .hub a:hover { border-color: var(--sea); } .hub strong { font-size: 1.02rem; } .hub span { color: var(--muted); font-size: .88rem; }

/* ---- ajuda ---- */
.drawer .how, .drawer dl { margin: 0; } .drawer dt { font-weight: 700; margin-top: 10px; } .drawer dd { margin: 2px 0 0; color: var(--ink-2); font-size: .92rem; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }

.legend-dot.assunto { background: #e0932b; } .mt { margin-top: 14px; } pre.code { padding: 8px 10px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 6px; overflow-x: auto; }
progress { width: 100%; height: 8px; accent-color: var(--sea); margin-top: 8px; } .cod-inline img { max-width: 100%; margin-top: 8px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }

/* ================= identidade ================= */
body { background: var(--mesh), var(--paper); background-attachment: fixed; letter-spacing: -.003em; }
h1, h2, h3, h4 { letter-spacing: -.022em; }
.top { border-bottom: 0; box-shadow: 0 1px 0 var(--line); background: color-mix(in srgb, var(--surface), transparent 12%); }
.top::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: linear-gradient(90deg, transparent, var(--sea), var(--horizon), transparent); opacity: .55; }
.brand { gap: 11px; } .brand span { font-weight: 800; font-size: 1.22rem; letter-spacing: -.035em; }
.brand .wordmark { font-size: 1.02rem; line-height: 1.02; letter-spacing: -.02em; white-space: nowrap; background: linear-gradient(90deg, var(--ink) 55%, var(--sea)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.nav a[aria-current="page"] { background: var(--grad); color: #fff; box-shadow: 0 6px 16px rgba(86, 70, 224, .28); }
.nav a:hover { background: var(--sea-soft); color: var(--sea-ink); }
button.primary, .btn.primary, a.btn.primary { background: var(--grad); border-color: transparent; color: #fff; box-shadow: 0 6px 18px rgba(86, 70, 224, .26); }
button.primary:hover, .btn.primary:hover { filter: brightness(1.06); color: #fff; border-color: transparent; }
.panel, .docc, .viz-card, .mapa-side, .mapa-info, .hub a { border-radius: 20px; }
.ghost.lock { border-color: color-mix(in srgb, var(--sea), transparent 55%); color: var(--sea-ink); }
.ghost.lock[aria-current="page"] { background: var(--grad); color: #fff; border-color: transparent; box-shadow: 0 6px 16px rgba(86, 70, 224, .24); }
.chip-btn[aria-pressed="true"] { background: var(--grad); border-color: transparent; color: #fff; }
.opcao[aria-pressed="true"] { border-color: var(--sea); }
.ter-uf.has { fill: color-mix(in srgb, var(--sea), var(--surface) 62%); stroke: var(--sea); } .ter-uf.on { fill: var(--horizon); stroke: var(--horizon-ink); }
.msg.user { background: var(--grad); }
.subnav { background: linear-gradient(90deg, #0d1330, #1a1450); } .subnav a[aria-current="page"] { background: linear-gradient(135deg, #ff8a6b, #ffb36b); color: #1a1230; }
.subnav .tag { color: #ffb36b; }
.perfil, .resultado-perfil { display: none; }

/* ================= leitor: PDF como é + texto formatado, ampliáveis ================= */
.rd-bar { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; margin-bottom: 10px; }
.rd-bar input[type=number] { width: 78px; padding: 5px 8px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); }
.rd-mode { display: inline-flex; gap: 4px; padding: 3px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--line); } .rd-mode .btn { border: 0; background: transparent; } .rd-mode .btn[aria-pressed="true"] { background: var(--grad); color: #fff; }
.rd-search { margin-left: auto; display: inline-flex; gap: 6px; } .rd-search input { padding: 6px 12px; border-radius: 99px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); min-width: 230px; }
.rd-hits { max-height: 170px; margin: 0 0 10px; padding: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; } .rd-hits:empty { display: none; }
.rd-stage { display: grid; gap: 16px; align-items: start; } .rd-lado { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .rd-img-only, .rd-txt-only { grid-template-columns: minmax(0, 1fr); }
.rd-stage.rd-img > .rd-pane:nth-child(2), .rd-stage.rd-txt > .rd-pane:nth-child(1) { display: none; } .rd-stage.rd-img, .rd-stage.rd-txt { grid-template-columns: minmax(0, 880px); justify-content: center; }
@media (max-width: 1000px) { .rd-lado { grid-template-columns: 1fr; } }
.rd-pane { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow); overflow: hidden; min-width: 0; }
.rd-pane > header { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--line); } .rd-pane > header h2 { font-size: .92rem; }
.rd-img { padding: 14px; background: color-mix(in srgb, var(--surface-2), var(--ink) 4%); text-align: center; min-height: 420px; } .rd-img img { max-width: 100%; height: auto; box-shadow: 0 6px 28px rgba(11, 18, 32, .22); border-radius: 3px; background: #fff; }
.rd-text { padding: 14px; max-height: 82vh; overflow: auto; background: color-mix(in srgb, var(--surface-2), var(--ink) 4%); }
.rd-wait { padding: 40px 16px; color: var(--muted); font-size: .9rem; text-align: center; }
.sheet { max-width: 720px; margin: 0 auto; padding: 44px 52px 30px; background: #fff; color: #1b2230; border-radius: 3px; box-shadow: 0 6px 28px rgba(11, 18, 32, .18); font-family: var(--serif); font-size: 1.12rem; line-height: 1.75; }
.sheet p { margin: 0 0 .85em; text-align: left; hyphens: auto; } .sheet p.li { padding-left: 1.1em; text-indent: -1.1em; } .sheet p.li::before { content: "•"; margin-right: .5em; color: #5646e0; }
.sheet h4 { margin: 1.1em 0 .5em; font-family: var(--sans); font-size: .95rem; letter-spacing: .04em; color: #3f31b8; } .sheet footer { margin-top: 1.6em; text-align: center; color: #8a93a6; font-family: var(--sans); font-size: .8rem; }
.sheet.xl { max-width: 880px; font-size: 1.3rem; padding: 60px 72px 40px; }
.big-overlay { position: fixed; inset: 0; z-index: 80; display: flex; flex-direction: column; background: rgba(7, 11, 20, .92); backdrop-filter: blur(4px); }
.big-bar { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; padding: 10px 16px; color: #e9eef9; } .big-title { font-weight: 700; } .big-zoom { display: inline-flex; gap: 4px; } .big-bar .push { margin-left: auto; }
.big-body { flex: 1; overflow: auto; padding: 8px 16px 28px; text-align: center; } .big-body img { width: 100%; max-width: none; height: auto; background: #fff; border-radius: 3px; box-shadow: 0 10px 40px rgba(0, 0, 0, .5); } .big-body .rd-wait { color: #cfd7ea; }
.big-body.img { text-align: center; }

/* ================= mapa: ampliar, abas e painel explicativo ================= */
.mapa { grid-template-columns: 250px minmax(0, 1fr) 360px; }
.mapa.full { position: fixed; inset: 0; z-index: 70; height: 100vh; min-height: 0; padding: 12px; background: var(--mesh), var(--paper); grid-template-columns: 230px minmax(0, 1fr) 380px; }
body.no-scroll { overflow: hidden; }
.mapa-big { position: absolute; left: 12px; top: 12px; z-index: 2; padding: 7px 14px; border-radius: 99px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); font-weight: 700; font-size: .84rem; cursor: pointer; box-shadow: var(--shadow); }
.mapa-big:hover { border-color: var(--sea); color: var(--sea-ink); }
.mapa-info { display: flex; flex-direction: column; padding: 0; overflow: hidden; }
.mapa-tabs { display: flex; gap: 4px; padding: 8px; border-bottom: 1px solid var(--line); } .mapa-tabs button { flex: 1; padding: 8px 10px; border-radius: 12px; border: 0; background: transparent; color: var(--ink-2); font-weight: 700; cursor: pointer; } .mapa-tabs button[aria-selected="true"] { background: var(--grad); color: #fff; }
.mapa-pane { flex: 1; overflow: auto; padding: 14px; min-height: 0; } .mapa-pane[hidden] { display: none; } .mapa-pane .chat { position: static; height: auto; min-height: 460px; box-shadow: none; border: 0; padding: 0; background: transparent; }
.mapa-pane .chat-log { max-height: 46vh; }
.info-sec { margin: 14px 0; } .info-sec h3 { font-size: .86rem; color: var(--sea-ink); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 6px; }
.info-sec.note { padding: 10px 12px; border-radius: 14px; background: var(--sea-soft); } .facts-list { margin: 6px 0; padding-left: 18px; font-size: .86rem; } .rel q { quotes: none; display: block; margin: 4px 0; font-family: var(--serif); font-size: .88rem; }
@media (max-width: 1100px) { .mapa.full { grid-template-columns: 1fr; grid-template-rows: auto 1fr auto; overflow: auto; } }

/* ================= panorama: seleção múltipla, planos no tempo e comparação na página ================= */
.plan.picked { border-color: var(--sea); background: color-mix(in srgb, var(--sea), var(--surface) 92%); box-shadow: inset 0 0 0 1px var(--sea); }
.plan-pick { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 99px; border: 1px solid var(--line-2); background: var(--surface); font-size: .8rem; font-weight: 700; cursor: pointer; } .plan.picked .plan-pick { background: var(--grad); color: #fff; border-color: transparent; }
.tray header { display: flex; justify-content: space-between; align-items: center; gap: 8px; } .tray-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.tray-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 6px 4px 10px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--line); font-size: .82rem; font-weight: 600; } .tray-chip .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--dc, var(--d-ref)); }
.tray-chip button { width: 22px; height: 22px; padding: 0; border-radius: 50%; border: 0; background: var(--line); color: var(--ink); line-height: 1; cursor: pointer; justify-content: center; }
.tray-body { margin-top: 8px; } .cmp-kind { margin: 0 0 8px; padding: 8px 12px; border-radius: 12px; background: var(--sea-soft); color: var(--sea-ink); font-weight: 600; font-size: .88rem; }
.cmp-body h2 { font-size: 1rem; margin: 16px 0 6px; } #linha-do-tempo .viz { margin-top: 4px; } .viz .viz-mark.sel { filter: drop-shadow(0 2px 6px rgba(86, 70, 224, .4)); }
.ter-uf.on { fill: var(--horizon); stroke: var(--horizon-ink); } .ter-uf.has.on:hover { fill: var(--horizon); }

/* ================= pares (calibração): três passos numa tela ================= */
.ann-start { display: grid; grid-template-columns: minmax(280px, 420px) 1fr; gap: 18px; align-items: start; } @media (max-width: 900px) { .ann-start { grid-template-columns: 1fr; } }
.ann-start-card, .ann-principles, .ann-done, .ann-progress, .ann-unit, .ann-form { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow); }
.ann-start-card { padding: 20px; display: grid; gap: 8px; } .ann-start-card input, .ann-start-card select { padding: 9px 12px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); } .ann-principles { padding: 18px 22px; } .ann-principles li { margin: 6px 0; font-size: .9rem; }
.ann-done { padding: 30px; text-align: center; display: grid; gap: 10px; justify-items: center; }
.ann-progress { position: sticky; top: 64px; z-index: 5; display: grid; grid-template-columns: auto 1fr auto; gap: 16px; align-items: center; padding: 12px 18px; margin-bottom: 14px; } .ann-par { font-size: 1.2rem; margin-right: 8px; } .ann-progress progress { margin: 0; }
.ann-who { display: flex; gap: 8px; align-items: center; } @media (max-width: 800px) { .ann-progress { grid-template-columns: 1fr; position: static; } }
.ann-step { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 12px; margin: 14px 0; } .ann-n { width: 30px; height: 30px; border-radius: 50%; background: var(--grad); color: #fff; font-weight: 800; display: grid; place-items: center; font-size: .9rem; }
.ann-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; } @media (max-width: 900px) { .ann-pair { grid-template-columns: 1fr; } }
.ann-unit { padding: 16px 18px; border-top: 5px solid var(--sea); } .ann-unit.ann-b { border-top-color: var(--horizon); } .ann-unit header { display: flex; gap: 10px; align-items: center; margin-bottom: 8px; }
.ann-tag { width: 30px; height: 30px; border-radius: 10px; background: var(--sea-soft); color: var(--sea-ink); font-weight: 800; display: grid; place-items: center; } .ann-b .ann-tag { background: var(--horizon-soft); color: var(--horizon-ink); }
.ann-ctx { margin: 0 0 8px; font-size: .82rem; color: var(--muted); } .ann-ctx span { font-weight: 700; text-transform: uppercase; letter-spacing: .06em; font-size: .7rem; margin-right: 4px; }
.ann-text { margin: 0 0 12px; padding: 0 0 0 14px; border-left: 3px solid var(--line-2); font-family: var(--serif); font-size: 1.12rem; line-height: 1.65; color: var(--ink); }
.ann-form { padding: 6px 20px 18px; } .ann-field { border: 0; padding: 0; margin: 0 0 10px; min-width: 0; } .ann-field legend { font-weight: 800; font-size: 1rem; margin-bottom: 6px; padding: 0; } .ann-help { margin: 0 0 6px; font-size: .8rem; color: var(--muted); }
.ann-choices { display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); } .cols-3 .ann-choices { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); } .cols-4 .ann-choices { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.ann-opt { position: relative; display: block; cursor: pointer; } .ann-opt input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.ann-card { display: grid; gap: 2px; height: 100%; padding: 10px 12px; border: 1.5px solid var(--line-2); border-radius: 14px; background: var(--surface); transition: border-color .12s, background .12s, box-shadow .12s; } .ann-card strong { font-size: .92rem; } .ann-card small { color: var(--muted); font-size: .76rem; line-height: 1.35; }
.ann-opt:hover .ann-card { border-color: var(--sea); } .ann-opt input:checked + .ann-card { border-color: var(--sea); background: var(--sea-soft); box-shadow: 0 0 0 1px var(--sea); } .ann-opt input:focus-visible + .ann-card { outline: 3px solid var(--focus); outline-offset: 2px; }
.ann-last { display: grid; gap: 10px; } .ann-last textarea { width: 100%; padding: 10px 12px; border-radius: 12px; border: 1.5px solid var(--line-2); background: var(--surface); color: var(--ink); font: inherit; }
.ann-last .row { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; } .ann-last select, .ann-last input[type=number] { padding: 7px 10px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); }
.ann-alert { color: var(--bad); font-weight: 600; min-height: 1.2em; } .ann-prev { padding: 8px 12px; border: 1px solid var(--line); border-radius: 12px; margin: 6px 0; background: var(--surface-2); }

/* ================= envio por arrastar e soltar ================= */
.dz { display: grid; gap: 10px; } .dz-input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.dz-zone { display: grid; justify-items: center; gap: 4px; padding: 34px 18px; border: 2px dashed var(--line-2); border-radius: 22px; background: color-mix(in srgb, var(--sea-soft), transparent 40%); text-align: center; cursor: pointer; transition: border-color .15s, background .15s, transform .15s; }
.dz-zone:hover, .dz-zone.over { border-color: var(--sea); background: var(--sea-soft); transform: translateY(-1px); } .dz-zone strong { font-size: 1.15rem; } .dz-zone span { color: var(--muted); font-size: .9rem; } .dz-ico { font-size: 2rem; color: var(--sea); line-height: 1; }
.dz-ok { font-size: .86rem; } .dz-queue { display: grid; gap: 10px; }
.dz-item { border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px; background: var(--surface); display: grid; gap: 8px; } .dz-item header { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; } .dz-state { font-size: .9rem; }
.dz-form { display: grid; gap: 10px; } .dz-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; } .dz-field { display: grid; gap: 3px; } .dz-field label { font-size: .76rem; font-weight: 700; color: var(--muted); }
.dz-field input, .dz-field select { padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); width: 100%; }
.dz-ev { font-size: .74rem; color: var(--muted); } .dz-ev.miss { color: var(--warn); } .dz-ev em { font-style: normal; font-weight: 700; }
.adm-manual { margin-top: 12px; } .adm-manual summary { cursor: pointer; color: var(--muted); font-size: .88rem; }

/* ================= trechos: leitura confortável ================= */
.prose { font-family: var(--serif); font-size: 1.04rem; line-height: 1.72; color: var(--ink); max-width: none; } .prose p { margin: 0 0 .8em; hyphens: auto; } .prose p:last-child { margin-bottom: 0; } .prose p.li { padding-left: 1.1em; text-indent: -1.1em; } .prose p.li::before { content: "•"; margin-right: .5em; color: var(--sea); }
.prose h5 { margin: .9em 0 .35em; font-family: var(--sans); font-size: .8rem; letter-spacing: .06em; color: var(--sea-ink); }
.evidence, .lit { white-space: normal; max-width: none; } .evidence { padding: 14px 18px; border-left: 4px solid var(--horizon); background: var(--surface-2); border-radius: 0 12px 12px 0; }
.quote .prose { font-size: .95rem; line-height: 1.6; } .exato-box { margin-top: 8px; font-size: .8rem; } .exato-box summary { cursor: pointer; color: var(--muted); } pre.exato { white-space: pre-wrap; font-family: var(--mono); font-size: .8rem; background: var(--surface-2); padding: 10px; border-radius: 8px; border: 1px solid var(--line); overflow-x: auto; }
.cite div > div { hyphens: auto; } .rel q { quotes: none; }

.unit-cite { padding: 10px 12px; border-left: 4px solid var(--horizon); background: var(--surface-2); border-radius: 0 12px 12px 0; margin-bottom: 8px; } .unit-thumb img { width: 100%; border: 1px solid var(--line); border-radius: 6px; background: #fff; display: block; }
mark.hl, .sheet mark { background: color-mix(in srgb, var(--horizon), #fff 55%); color: inherit; padding: 1px 2px; border-radius: 3px; box-decoration-break: clone; } .rd-unit { margin: 0 0 10px; display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; }
.err:empty, .ann-alert:empty, .cod-msg:empty { display: none; }

.dz-impact { margin-top: .75rem; padding: .75rem 1rem; border: 1px solid var(--line, #d8dbe8); border-radius: 12px; }
.dz-impact h4 { margin: 0 0 .4rem; font-size: .95rem; }
.dz-impact-list { margin: 0; padding: 0; list-style: none; font-size: .88rem; display: grid; gap: .25rem; }
.dz-impact-list .warn { color: var(--muted, #5b6075); }

/* rastreabilidade: livro de códigos, adjudicação, diário, dossiê */
.tbl { width: 100%; border-collapse: collapse; font-size: .9rem; }
.tbl th, .tbl td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl thead th { color: var(--muted); font-weight: 600; font-size: .82rem; }
.tbl-wrap { overflow-x: auto; }
.warn-text { color: var(--muted); font-style: italic; }
.hub-group { margin-bottom: 22px; } .hub-group h2 { font-size: 1.02rem; margin: 0 0 10px; color: var(--muted); }
.lc-crit { border: 1px solid var(--line); border-radius: 14px; padding: 10px 14px; margin: 8px 0; background: var(--surface); }
.lc-crit summary { cursor: pointer; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.lc-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; margin-top: 10px; }
.lc-f { display: grid; gap: 4px; font-size: .86rem; } .lc-f span { font-weight: 600; } .lc-f textarea { width: 100%; }
.adj-sides { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; margin: 12px 0; }
.adj-side { border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; background: var(--surface); }
.adj-divergente th { color: var(--bad, #b3261e); }
.cod-evrow { display: grid; gap: 6px; padding: 8px 0; border-bottom: 1px dashed var(--line); } .cod-evrow textarea { width: 100%; }
.cod-rules { margin-top: 10px; border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; } .cod-rules summary { cursor: pointer; font-weight: 600; font-size: .86rem; }
.cod-ai-out { margin-top: 8px; display: grid; gap: 6px; }

/* início da área restrita: grupos com cabeçalho e cartões de mesmo tamanho */
.hub-group { margin: 0 0 30px; }
.hub-head { display: flex; gap: 14px; align-items: center; margin: 0 0 12px; }
.hub-head h2 { font-size: 1.15rem; margin: 0; color: var(--ink); } .hub-head p { margin: 2px 0 0; color: var(--muted); font-size: .88rem; }
.hub-step { flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 12px; background: linear-gradient(135deg, var(--sea), var(--horizon)); color: #fff; font-weight: 700; }
.hub-group .hub { grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 14px; align-items: stretch; }
.hub-group .hub a { align-content: start; min-height: 112px; transition: border-color .15s, transform .15s; }
.hub-group .hub a:hover { transform: translateY(-2px); }

/* documentos (administração): cabeçalho, escopo, abas segmentadas, grupos por projeto, tabela legível e menu «Mais» */
.adm-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.adm-scope { margin: 4px 0 16px; padding: 10px 14px; border-radius: 14px; background: var(--sea-soft); color: var(--sea-ink); border: 1px solid color-mix(in srgb, var(--sea) 35%, transparent); font-size: .9rem; }
.adm-add { margin-bottom: 20px; } .adm-add h3 { margin: 0 0 12px; font-size: 1.05rem; }
.adm-seg { display: inline-flex; padding: 4px; gap: 2px; margin: 4px 0 14px; border-radius: 14px; background: var(--sea-soft); border: 1px solid var(--line); }
.adm-seg button { border: 0; background: transparent; padding: 7px 14px; border-radius: 10px; color: var(--ink-2); font-weight: 600; font-size: .88rem; cursor: pointer; }
.adm-seg button.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.adm-table { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; box-shadow: var(--shadow); border-collapse: separate; border-spacing: 0; }
.adm-table thead th { background: var(--sea-soft); padding: 11px 14px; }
.adm-table td { padding: 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
.adm-table tbody tr:last-child td { border-bottom: 0; } .adm-table tbody tr.adm-row:hover { background: color-mix(in srgb, var(--sea-soft) 45%, transparent); }
.adm-group td { padding: 12px 14px; background: color-mix(in srgb, var(--sea-soft) 70%, var(--surface)); border-bottom: 1px solid var(--line); }
.adm-ghead { display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: center; } .adm-ghead strong { font-size: 1.05rem; }
.adm-doc { display: flex; gap: 12px; align-items: flex-start; } .adm-id { flex: none; min-width: 46px; text-align: center; padding: 4px 8px; border-radius: 10px; background: var(--ink); color: var(--paper); font-weight: 700; font-size: .78rem; letter-spacing: .02em; }
.adm-title { display: block; font-size: 1rem; line-height: 1.3; margin-bottom: 4px; }
.adm-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; color: var(--muted); font-size: .84rem; } .adm-why { margin-top: 6px; font-size: .84rem; color: var(--ink-2); }
.adm-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; min-width: 210px; }
.adm-actions button, .adm-more summary { padding: 6px 12px; border-radius: 10px; font-size: .84rem; }
.adm-more { position: relative; } .adm-more[open] { flex-basis: 100%; } .adm-more summary { list-style: none; cursor: pointer; border: 1px solid var(--line-2); background: var(--surface); } .adm-more summary::-webkit-details-marker { display: none; } .adm-more summary::after { content: ' ▾'; }
.adm-menu { margin-top: 6px; min-width: 170px; display: grid; gap: 2px; padding: 6px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); box-shadow: 0 12px 32px rgba(20, 30, 60, .18); }
.adm-menu button { text-align: left; border: 0; background: transparent; } .adm-menu button:hover { background: var(--sea-soft); } .adm-menu button.danger { color: var(--bad); }
.dz-zone { padding: 28px 18px; } .dz-queue:empty { display: none; }
.dz-project { display: grid; gap: 4px; font-size: .86rem; } .dz-project input { padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); max-width: 420px; }

/* documentos públicos: conjunto de volumes de um mesmo plano */
.docset { margin: 10px 0 26px; padding: 14px 16px 6px; border: 1px solid var(--line); border-radius: 20px; background: color-mix(in srgb, var(--sea-soft) 40%, var(--surface)); }
.docset-head { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; margin-bottom: 12px; } .docset-head h3 { margin: 0; font-size: 1.2rem; }

.oficial { margin-top: 8px; font-size: .86rem; color: var(--ink-2); display: flex; flex-wrap: wrap; gap: 4px 10px; } .oficial a { word-break: break-all; } .oficial.miss { color: var(--muted); font-style: italic; }
.docset > .oficial { margin: -4px 0 12px; }

.adm-sug { display: grid; gap: 6px; } .adm-sug-item { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; padding: 6px 10px; border: 1px dashed var(--line-2); border-radius: 10px; } .adm-sug-item a { font-weight: 600; }

/* Panorama: a coluna da esquerda nunca passa da sua largura (gráficos e tabelas largos rolam dentro do cartão e não ficam sob o chat) */
.pano-left { grid-template-columns: minmax(0, 1fr); } .pano-left > * { min-width: 0; max-width: 100%; }
.pano-left .panel { overflow-x: auto; } .pano-left svg { max-width: 100%; height: auto; }
.tray-body { overflow-x: auto; }

/* aviso flutuante de confirmação */
.toast { position: fixed; left: 50%; bottom: 28px; z-index: 90; display: flex; gap: 10px; align-items: center; max-width: min(92vw, 560px); padding: 12px 18px; border-radius: 16px; background: var(--ink); color: var(--paper); font-weight: 600; box-shadow: 0 16px 44px rgba(10, 15, 40, .35); opacity: 0; transform: translate(-50%, 16px); pointer-events: none; transition: opacity .2s, transform .2s; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast-ico { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--ok); color: #fff; font-size: .85rem; flex: none; }
.toast.warn .toast-ico { background: var(--warn); } .toast.err .toast-ico { background: var(--bad); }
.btn.saved, button.saved { background: var(--ok) !important; color: #fff !important; border-color: var(--ok) !important; }

/* mapa: municípios, trilha de navegação e linha do tempo da União */
.ter-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-height: 34px; margin-bottom: 6px; } .ter-sep { color: var(--muted); } .ter-crumb { font-size: .98rem; }
.ter-stage { min-height: 120px; }
.ter-uf.has-muni { stroke-dasharray: 0; } .ter-uf.has-muni:not(.on) { fill: color-mix(in srgb, var(--sea) 22%, var(--surface)); }
.ter-mun { fill: var(--surface-2); stroke: var(--line-2); stroke-width: .6; } .ter-mun.has { fill: color-mix(in srgb, var(--horizon) 55%, var(--surface)); stroke: var(--horizon-ink); stroke-width: 1; cursor: pointer; }
.ter-mun.has:hover, .ter-mun.has:focus { fill: var(--horizon); outline: none; } .ter-mun.on { fill: var(--sea); stroke: var(--sea-ink); stroke-width: 1.6; }
.ter-pick { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; } .chip-btn.warn { border-style: dashed; }
.chip-btn[aria-pressed="true"] { background: var(--sea); color: #fff; border-color: var(--sea); }
.uni { display: grid; gap: 8px; } .uni-svg { width: 100%; height: auto; display: block; }
.uni-grid { stroke: var(--line); stroke-width: 1; } .uni-yr { fill: var(--muted); font-size: 11px; text-anchor: middle; } .uni-cap { fill: var(--ink-2); font-size: 12px; font-weight: 600; }
.uni-cover { fill: color-mix(in srgb, var(--sea) 28%, transparent); stroke: var(--sea); stroke-width: 1.4; }
.uni-now { stroke: var(--horizon); stroke-width: 1.6; stroke-dasharray: 4 3; } .uni-nowl { fill: var(--horizon-ink); font-size: 11px; font-weight: 700; }
.uni-bar { cursor: pointer; outline: none; } .uni-rect { opacity: .86; stroke: transparent; stroke-width: 2.5; transition: opacity .12s; } .uni-bar:hover .uni-rect, .uni-bar:focus .uni-rect { opacity: 1; stroke: var(--ink); }
.uni-bar.on .uni-rect { opacity: 1; stroke: var(--ink); stroke-width: 3; } .uni-lbl { fill: #fff; font-size: 12px; font-weight: 700; paint-order: stroke; stroke: rgba(0, 0, 0, .35); stroke-width: 2.5px; } .uni-dates { fill: var(--ink-2); font-size: 11px; }
.uni-tip { min-height: 1.3em; font-size: .84rem; color: var(--ink-2); } .uni-noy { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: .86rem; }

/* IA no sistema: bloco rotulado, referências [n] e painel de controle */
.ia-box { margin: 8px 0; padding: 12px 14px; border-radius: 16px; border: 1px solid color-mix(in srgb, var(--sea) 35%, var(--line)); background: linear-gradient(135deg, color-mix(in srgb, var(--sea-soft) 80%, var(--surface)), var(--surface)); }
.ia-tag { font-weight: 700; font-size: .78rem; color: var(--sea-ink); letter-spacing: .02em; margin-bottom: 4px; } .ia-tag small { font-weight: 500; color: var(--muted); }
.ia-text { margin: 0 0 6px; line-height: 1.55; } .ia-points { margin: 0 0 6px; padding-left: 18px; font-size: .92rem; }
.ia-ref { display: inline-grid; place-items: center; min-width: 20px; height: 20px; margin: 0 2px; padding: 0 5px; border-radius: 99px; border: 0; background: var(--sea); color: #fff; font-size: .72rem; font-weight: 700; cursor: pointer; vertical-align: 1px; }
.ia-off { margin: 4px 0; } .ia-toggle { margin: 4px 16px 0; font-size: .84rem; } .cx-explain { margin: 0 0 12px; display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: flex-start; } .cx-explain .ia-box { flex: 1 1 100%; } .ia-sum { margin: 0 0 12px; }
.ia-switches { display: grid; gap: 10px; margin-bottom: 14px; } .ia-sw { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-2); } .ia-sw small { display: block; color: var(--muted); }

.rel-box { margin: 8px 0; padding: 10px 12px; border-radius: 14px; border: 1px dashed var(--line-2); background: var(--surface-2); display: grid; gap: 6px; } .rel-pair { display: grid; gap: 4px; } .rel-chips { display: flex; flex-wrap: wrap; gap: 6px; }

/* Área restrita: menu LATERAL, recolhível (substitui a barra superior) */
.shell { flex: 1; display: grid; grid-template-columns: minmax(0, 1fr); align-items: start; }
.shell > .view { min-width: 0; }
.shell.has-side { grid-template-columns: 248px minmax(0, 1fr); } .shell.has-side.collapsed { grid-template-columns: 60px minmax(0, 1fr); }
.shell .subnav { display: flex; flex-direction: column; align-items: stretch; gap: 2px; padding: 12px 10px 14px; overflow-x: hidden; overflow-y: auto; position: sticky; top: 0; align-self: stretch; max-height: 100vh; min-height: 100%; border-right: 1px solid rgba(255, 255, 255, .08); }
.shell .subnav[hidden] { display: none; }
.subnav .side-head { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-bottom: 8px; padding: 0 4px; }
.subnav .side-head .tag { margin: 0; }
.subnav .side-toggle { padding: 4px 9px; border-radius: 8px; border: 1px solid #3a526b; background: transparent; color: #e8eef4; font-weight: 800; cursor: pointer; line-height: 1; }
.subnav .side-toggle:hover { background: rgba(255, 255, 255, .1); }
.subnav .grp { margin: 12px 8px 4px; font-size: .68rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: #8fa6bd; }
.shell .subnav a, .shell .subnav .side-out { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; white-space: normal; line-height: 1.25; text-align: left; }
.subnav a::before, .subnav .side-out::before { content: attr(data-i); flex: 0 0 24px; height: 24px; display: inline-grid; place-items: center; border-radius: 7px; background: rgba(255, 255, 255, .08); font-size: .76rem; font-weight: 800; }
.subnav a[aria-current="page"]::before { background: rgba(26, 18, 48, .18); }
.subnav .side-out { margin-top: auto; border: 1px solid transparent; } .subnav .side-out:hover { border-color: #3a526b; }
.shell.collapsed .subnav { padding-inline: 8px; }
.shell.collapsed .subnav .tag, .shell.collapsed .subnav .grp { display: none; }
.shell.collapsed .subnav .side-head { justify-content: center; padding: 0; }
.shell.collapsed .subnav a, .shell.collapsed .subnav .side-out { font-size: 0; gap: 0; justify-content: center; padding: 6px 0; }
.shell.collapsed .subnav a::before, .shell.collapsed .subnav .side-out::before { font-size: .76rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (max-width: 860px) {
  .shell.has-side, .shell.has-side.collapsed { grid-template-columns: minmax(0, 1fr); }
  .shell .subnav { position: static; max-height: none; min-height: 0; border-right: 0; border-bottom: 1px solid rgba(255, 255, 255, .08); }
  .shell.collapsed .subnav a, .shell.collapsed .subnav .side-out, .shell.collapsed .subnav .grp { display: none; }
  .shell.collapsed .subnav .side-head { justify-content: space-between; }
  .shell.collapsed .subnav .tag { display: inline; }
}

.cite-box summary { cursor: pointer; font-weight: 700; } .cite-out { display: grid; gap: 8px; margin-top: 8px; } .cite-text { user-select: all; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); }

/* Metas e prazos */
.metas-filters { display: grid; gap: 10px; margin-bottom: 14px; } .metas-filters .row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; } .metas-filters select, .metas-filters input[type=search] { max-width: 100%; }
.chipbtn { padding: 5px 13px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; font-size: .88rem; font-weight: 600; cursor: pointer; } .chipbtn[aria-pressed="true"] { background: var(--sea, #2a78d6); color: #fff; border-color: transparent; }
.metas-sum { margin: 6px 0 14px; } .metas-bars { display: flex; align-items: flex-end; gap: 6px; flex-wrap: wrap; margin: 8px 0; } .metas-bar { display: grid; justify-items: center; gap: 2px; padding: 4px 6px; background: transparent; border: 1px solid transparent; border-radius: 8px; cursor: pointer; color: var(--muted); font-size: .72rem; } .metas-bar:hover { border-color: var(--line); } .metas-bar i { display: block; width: 18px; border-radius: 4px 4px 0 0; background: var(--sea, #2a78d6); }
.metas-list { display: grid; gap: 10px; } .meta-card { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 14px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.meta-year { font-size: 1.7rem; font-weight: 800; letter-spacing: -.02em; display: grid; align-content: start; gap: 4px; } .meta-year .chip { font-size: .62rem; width: max-content; }
.meta-text { margin: 0 0 8px; font-size: 1rem; line-height: 1.5; } .meta-body .row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
@media (max-width: 560px) { .meta-card { grid-template-columns: minmax(0, 1fr); } }

/* Lacunas do acervo */
.lac-legend { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 18px; padding: 0; margin: 8px 0; } .lac-key { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 6px; font-weight: 800; border: 1px solid var(--line); }
.lac-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; margin: 12px 0 18px; }
.lac-tile { display: grid; justify-items: start; gap: 2px; padding: 8px 10px; border-radius: 10px; border: 2px solid var(--line); background: var(--surface); color: var(--ink); text-align: left; font: inherit; cursor: pointer; position: relative; } .lac-tile b { font-size: 1.1rem; } .lac-tile .lac-name { font-size: .72rem; color: var(--muted); } .lac-tile .lac-glyph { position: absolute; top: 6px; right: 9px; font-weight: 800; }
.lac-tile[data-sit="plano_vigente"], .lac-key[data-sit="plano_vigente"] { border-color: #1baf7a; background: rgba(27, 175, 122, .14); } .lac-tile[data-sit="plano_vencido"], .lac-key[data-sit="plano_vencido"] { border-color: #e34948; background: rgba(227, 73, 72, .12); }
.lac-tile[data-sit="plano_sem_vigencia"], .lac-key[data-sit="plano_sem_vigencia"] { border-color: #eda100; background: rgba(237, 161, 0, .14); } .lac-tile[data-sit="so_outros_documentos"], .lac-key[data-sit="so_outros_documentos"] { border-color: #2a78d6; background: rgba(42, 120, 214, .12); }
.lac-tile[data-sit="sem_documento"], .lac-key[data-sit="sem_documento"] { border-style: dashed; color: var(--muted); } .lac-detail h3 { margin: 10px 0 4px; font-size: 1rem; }
.lock[hidden] { display: none; }
/* Menu público com 7 abas e o nome do projeto em duas linhas: aperta o espaçamento em telas de notebook para a última aba não ficar cortada */
@media (max-width: 1440px) and (min-width: 981px) { .top { gap: 10px; } .nav { gap: 0; } .nav a { padding: 8px 9px; font-size: .88rem; } .top-right .ghost { padding-inline: 9px; } }
