/* Shared Integra Cidade palette. Semantic colors work in both offline themes. */
:root,[data-theme=dark]{color-scheme:dark;--theme-base:#141414;--theme-surface:#1d1f22;--theme-soft:#282c32;--theme-border:#3b424c;--theme-text:#faf9f0;--theme-muted:#b7c0ce;--theme-blue:#003ce5;--theme-mint:#1cff88;--theme-accent-text:#91b4ff;--theme-success-text:#1cff88;--theme-accent-border:#628cf9;--theme-warning:#ffd18a;--theme-violet:#d0b6ff}
[data-theme=light]{color-scheme:light;--theme-base:#faf9f0;--theme-surface:#ffffff;--theme-soft:#eef2f9;--theme-border:#cbd3df;--theme-text:#182235;--theme-muted:#526176;--theme-blue:#003ce5;--theme-mint:#1cff88;--theme-accent-text:#0036ce;--theme-success-text:#006b39;--theme-accent-border:#003ce5;--theme-warning:#854400;--theme-violet:#6035a1}
:root{--bg:var(--theme-base);--paper:var(--theme-base);--ink:var(--theme-text);--ivory:var(--theme-text);--muted:var(--theme-muted);--line:var(--theme-border);--border:var(--theme-border);--green:var(--theme-success-text);--mint:var(--theme-mint);--cyan:var(--theme-accent-text);--blue:var(--theme-blue);--skin-panel:var(--theme-surface);--skin-soft:var(--theme-soft)}
html{background:var(--theme-base)!important}.theme-loading body{visibility:hidden}body{color:var(--theme-text)}
.theme-toggle{display:inline-flex;align-items:center;justify-content:center;gap:7px;flex-shrink:0;min-width:40px;min-height:40px;padding:8px 11px;background:var(--theme-soft);border:1px solid var(--theme-border);border-radius:10px;color:var(--theme-text);font:600 12px Arial,sans-serif;cursor:pointer}.theme-toggle svg{width:22px;height:22px;fill:currentColor}.theme-toggle:hover{border-color:var(--theme-blue);color:var(--theme-accent-text)}.theme-toggle:focus-visible{outline:3px solid var(--theme-accent-border);outline-offset:3px}
.header-right{gap:10px}.header .theme-toggle{position:relative;z-index:3}.btn.primary,.button-primary{background:var(--theme-blue);border-color:var(--theme-blue);color:#fff}.btn.primary:hover,.button-primary:hover{background:#002878;color:#fff}.btn.primary:focus-visible{outline-color:var(--theme-mint)}
.sidebar nav button.active{background:var(--theme-blue);color:#fff;border-color:var(--theme-blue)}.sidebar nav button.active:before{background:var(--theme-mint)}
.person-card-actions .review-confirmed,.tracking-confirmado{color:var(--theme-warning)}.person-card-actions .review-justified,.tracking-justificado{color:var(--theme-success-text)}.person-card-actions .review-legal,.tracking-encaminhado{color:var(--theme-accent-text)}
.review-state.review-confirmed{color:var(--theme-warning);background:color-mix(in srgb,var(--theme-warning) 12%,var(--theme-surface))}.review-state.review-justified{color:var(--theme-success-text);background:color-mix(in srgb,var(--theme-mint) 12%,var(--theme-surface))}.review-state.review-legal{color:var(--theme-accent-text);background:color-mix(in srgb,var(--theme-blue) 10%,var(--theme-surface))}
.person-card-actions .review-confirmed{background:color-mix(in srgb,var(--theme-warning) 8%,var(--theme-surface));border-color:var(--theme-warning)}.person-card-actions .review-justified{background:color-mix(in srgb,var(--theme-mint) 8%,var(--theme-surface));border-color:var(--theme-success-text)}.person-card-actions .review-legal{background:color-mix(in srgb,var(--theme-blue) 8%,var(--theme-surface));border-color:var(--theme-accent-border)}
.person-links>summary{background:var(--theme-soft);color:var(--theme-text)}.person-links>summary>span:last-child{background:var(--theme-blue);color:#fff;border-color:var(--theme-blue)}
[data-theme=light] .brand img{filter:invert(1);mix-blend-mode:multiply}[data-theme=light] .sidebar{background:var(--theme-surface)}
[data-theme=light] .button-ivory{background:var(--theme-text);color:#fff}[data-theme=light] .hero h1 em,[data-theme=light] .hero h1 span{background-image:linear-gradient(110deg,#006b39,#003ce5);-webkit-background-clip:text;background-clip:text;color:transparent}
.progress-ring-track{stroke:var(--theme-border)}.progress-wave path{stroke:var(--theme-accent-text)}.progress-wave circle{fill:var(--theme-success-text)}.progress-ring stop:first-child{stop-color:var(--theme-mint)}.progress-ring stop:last-child{stop-color:var(--theme-blue)}.progress-ring stop:nth-child(2){stop-color:#00b3ba}
[data-theme=light] .badge.red{color:#9e2633;background:#fff0f1;border-color:#d29199}[data-theme=light] .person-status.attention{color:#854400;background:#fff4df;border-color:#ddb87f}
[data-theme=light] .tracking-status{background:var(--theme-surface)}[data-theme=light] .tracking-status:hover{background:var(--theme-soft)}
@media(max-width:600px){.theme-toggle{min-width:34px;min-height:34px;padding:6px}.theme-toggle span{display:none}.header-right{gap:6px}.header .theme-toggle{position:absolute;right:18px;top:15px}.header{padding-top:35px}.workspace>header .breadcrumb{max-width:38%;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}}
@media print{.theme-toggle{display:none!important}}
:root,[data-theme=dark]{--theme-danger:#ffaaaa}[data-theme=light]{--theme-danger:#a92636}
.flow-result-tabs button[aria-selected=true],.view-switch button[aria-pressed=true],.review-filter.selected{background:var(--theme-blue);color:#fff;border-color:var(--theme-blue)}
.button-ivory{background:var(--theme-text);color:var(--theme-base)}
.skin-department-chart>svg>circle:first-child,.roles-donut>circle:first-child{stroke:var(--theme-border)}
[data-theme=light] .flow-source{background:var(--theme-surface);border-color:var(--theme-border)}[data-theme=light] .panel,[data-theme=light] .skin-metric{background:var(--theme-surface)}
.roles-center-number{fill:var(--theme-text)}.roles-center-label{fill:var(--theme-muted)}.person-links .links-chevron{color:inherit;background:color-mix(in srgb,#fff 16%,transparent)}
@media(hover:none){.sidebar [data-menu-label]::after{display:none}}
@media(max-width:600px){.header{display:grid;grid-template-columns:minmax(0,1fr) auto auto;gap:8px;height:105px;padding:16px 6%}.header .brand{grid-column:1;grid-row:1}.header .brand img{width:clamp(95px,30vw,120px);height:45px}.header nav{display:none}.header .header-cta{grid-column:2;grid-row:1;font-size:11px;padding:0 12px;min-height:42px;gap:8px}.header .theme-toggle{position:static;grid-column:3;grid-row:1}}
[data-theme=classic]{color-scheme:dark;--theme-base:#050f16;--theme-surface:#091c27;--theme-soft:#102a38;--theme-border:#203f50;--theme-text:#f5f7fa;--theme-muted:#adc2d3;--theme-blue:#0864f7;--theme-mint:#0ceb92;--theme-accent-text:#38cdff;--theme-success-text:#00dfb3;--theme-accent-border:#2b6075}
.theme-selector{display:inline-flex;align-items:center;gap:2px;padding:3px;border:1px solid var(--theme-border);border-radius:11px;background:var(--theme-surface);flex-shrink:0}
.theme-selector .theme-toggle{display:grid;place-items:center;min-width:32px;min-height:32px;padding:5px;border:1px solid transparent;border-radius:7px;background:transparent;color:var(--theme-muted)}
.theme-selector .theme-toggle[aria-pressed=true]{background:var(--theme-soft);color:var(--theme-accent-text);border-color:var(--theme-accent-border)}.theme-selector .theme-toggle:hover{color:var(--theme-text);background:var(--theme-soft)}
.header .theme-selector{position:relative;z-index:3}
[data-theme=classic] .skin-department-segment:nth-of-type(2){stroke:#00dfb3}[data-theme=classic] .skin-department-segment:nth-of-type(3){stroke:#00b9de}[data-theme=classic] .skin-department-segment:nth-of-type(4){stroke:#078bff}[data-theme=classic] .skin-department-segment:nth-of-type(5){stroke:#1255e8}
[data-theme=classic] .skin-unit-link:nth-child(1)>i{background:#00dfb3!important}[data-theme=classic] .skin-unit-link:nth-child(2)>i{background:#00b9de!important}[data-theme=classic] .skin-unit-link:nth-child(3)>i{background:#078bff!important}[data-theme=classic] .skin-unit-link:nth-child(4)>i{background:#1255e8!important}
@media(max-width:600px){.header .theme-selector{position:static;grid-column:3;grid-row:1}.theme-selector{gap:0;padding:2px}.theme-selector .theme-toggle{min-width:29px;min-height:30px;padding:4px}.theme-selector svg{width:20px;height:20px}.header{padding-inline:16px;gap:6px;grid-template-columns:minmax(70px,1fr) auto auto}.header .brand img{width:clamp(75px,22vw,110px)}.header .header-cta{padding:0 9px;gap:4px;font-size:10px}.workspace>header{gap:6px}.workspace>header .breadcrumb{min-width:0;flex:1;max-width:none}.header-right .portable-status{max-width:90px!important;padding:6px!important}.header-right{gap:4px}}
@media print{.theme-selector{display:none!important}}
/* Light-theme contrast: expanded links and bright brand colors are not body text. */
html[data-theme=light] .person-links>summary>span:last-child :is(.when-open,.when-closed,.links-chevron){color:inherit}
html[data-theme=light] .origin-record .record-amount,html[data-theme=light] .origin-record .source-label.prefeitura,html[data-theme=light] .origin-record .source-label.organograma{color:var(--theme-accent-text)}
html[data-theme=light][data-surface=panel] .person-links>summary>span:last-child{background:var(--theme-blue);color:#fff}
html[data-theme=light][data-surface=panel] .person-links .origin-record .record-amount{color:var(--theme-accent-text)}

/* Blue identity for light-theme people and links, including hover/open states. */
html[data-theme=light][data-surface=panel] .person-avatar{background:#e8efff;color:var(--theme-accent-text)}
html[data-theme=light][data-surface=panel] .person-card .person-links .origin-record[data-source=prefeitura]{--record-accent:var(--theme-blue)}
html[data-theme=light][data-surface=panel] .person-links>summary:hover>span:last-child,html[data-theme=light][data-surface=panel] .person-links[open]>summary:hover>span:last-child{background:#002878;color:#fff;border-color:#002878}
/* People avatars use dark blue rather than neon green in dark presentations. */
html[data-theme=dark][data-surface=panel] :is(.person-card-header,.review-dialog-person) .person-avatar,html[data-theme=classic][data-surface=panel] :is(.person-card-header,.review-dialog-person) .person-avatar{background:#002878;color:#fff}

/* Document metadata and a distinct action to open the original evidence. */
.record-evidence{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:12px;margin-top:16px;padding-top:14px;border-top:1px solid var(--theme-border)}
.record-evidence-file{min-width:0;flex:1 1 180px;display:flex;flex-direction:column;gap:3px;font-size:11px;line-height:1.5;color:var(--theme-muted);overflow-wrap:anywhere}.record-evidence-file small{font-size:10px}
html[data-theme] .record-evidence>button.evidence-button{display:inline-flex;align-items:center;justify-content:center;gap:8px;flex:0 0 auto;min-height:40px;padding:10px 15px;border:1px solid #003ce5;border-radius:8px;background:#003ce5;color:#fff!important;font-size:12px;font-weight:600;line-height:1.4;text-decoration:none;box-shadow:0 3px 9px #003ce51f;cursor:pointer}
html[data-theme] .record-evidence>button.evidence-button:hover{background:#002878;border-color:#002878;color:#fff!important}
html[data-theme] .record-evidence>button.evidence-button:focus-visible{outline:2px solid var(--theme-accent-text);outline-offset:3px}
.record-evidence .evidence-button .google-icon{width:18px;height:18px;flex-shrink:0}

/* Identify the selected person before the original document. */
.evidence-context{margin:14px 0 18px;padding:14px 16px;border:1px solid var(--theme-border);border-left:3px solid var(--theme-accent-text);border-radius:9px;background:var(--theme-soft);min-width:0}
.evidence-person-name{display:block;color:var(--theme-text);font-size:14px;line-height:1.5;overflow-wrap:anywhere;margin-bottom:8px}
.evidence-context-label{display:block;font-size:10px;color:var(--theme-muted);margin-bottom:5px}
#evidence-dialog .evidence-context .engine-raw{margin:0;max-height:140px;overflow:auto;white-space:pre-wrap;overflow-wrap:anywhere;font-size:11px;line-height:1.6;background:transparent;color:var(--theme-text)}
