/* Camada visual da area publica. O painel administrativo continua usando somente style.css. */
:root {
    --pt-primary: #0b2d5c;
    --pt-primary-strong: #082347;
    --pt-primary-soft: #e8eef7;
    --pt-accent: #d9aa3c;
    --pt-accent-ink: #082347;
    --pt-ink: #1b2533;
    --pt-muted: #5a6778;
    --pt-line: #e1e6ed;
    --pt-surface: #ffffff;
    --pt-canvas: #f4f7fb;
    --pt-progress: #8a5a00;
    --pt-progress-soft: #fff3d6;
    --pt-done: #16683f;
    --pt-done-soft: #e2f4ea;
    --pt-stopped: #a12b2b;
    --pt-stopped-soft: #fbe9e9;
    --pt-neutral-soft: #edf0f4;
    --pt-radius: 14px;
    --pt-shadow: 0 1px 2px rgba(20, 35, 60, .05), 0 6px 18px rgba(20, 35, 60, .05);
}

main a { color: var(--pt-primary); }

:focus-visible {
    outline: 3px solid #2f6fc4;
    outline-offset: 2px;
    border-radius: 4px;
}

main h1, main h2, main h3 { color: var(--pt-ink); letter-spacing: -.012em; }

/* Pagina inicial */
.pt-hero { background: linear-gradient(180deg, var(--pt-primary-soft), var(--pt-canvas)); padding-block: 3.25rem 2.5rem; }
.pt-hero h1 { font-size: clamp(1.9rem, 4vw, 2.75rem); font-weight: 800; color: var(--pt-primary-strong); margin-bottom: .6rem; text-wrap: balance; }
.pt-hero-lead { font-size: 1.125rem; color: var(--pt-muted); max-width: 40rem; margin-bottom: 1.5rem; }
.pt-eyebrow { display: block; font-size: .8125rem; font-weight: 700; color: var(--pt-primary); margin-bottom: .5rem; }
.pt-search { display: flex; gap: .5rem; background: var(--pt-surface); padding: .5rem; border: 1px solid var(--pt-line); border-radius: 16px; box-shadow: var(--pt-shadow); max-width: 46rem; }
.pt-search-field { position: relative; flex: 1; }
.pt-search-field i { position: absolute; left: 1rem; top: 50%; transform: translateY(-50%); color: var(--pt-muted); pointer-events: none; }
.pt-search-field input { border: 0; padding: .7rem .75rem .7rem 2.6rem; font-size: 1.0625rem; background: transparent; }
.pt-search-field input:focus { box-shadow: none; }
.pt-search:focus-within { border-color: var(--pt-primary); }
.pt-btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; border-radius: 10px; font-weight: 600; padding: .6rem 1.1rem; border: 1px solid transparent; text-decoration: none; white-space: nowrap; cursor: pointer; font-size: .9375rem; }
.pt-btn-primary { background: var(--pt-primary); color: #fff; }
.pt-btn-primary:hover { background: var(--pt-primary-strong); color: #fff; }
.pt-btn-outline { background: var(--pt-surface); color: var(--pt-ink); border-color: var(--pt-line); }
.pt-btn-outline:hover { border-color: #bcc6d3; background: var(--pt-canvas); color: var(--pt-ink); }
.pt-btn-sm { padding: .35rem .7rem; font-size: .8125rem; border-radius: 8px; }
.pt-hero-note { display: flex; flex-wrap: wrap; gap: .35rem 1.25rem; margin-top: 1rem; font-size: .875rem; color: var(--pt-muted); }
.pt-hero-note span { display: inline-flex; align-items: center; gap: .4rem; }

.pt-section { padding-block: 1.75rem; }
.pt-section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.pt-section-head h2 { font-size: 1.3125rem; font-weight: 700; margin: 0; }
.pt-section-head a { font-size: .9rem; font-weight: 600; text-decoration: none; white-space: nowrap; }

.pt-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(245px, 1fr)); gap: .75rem; }
.pt-tile {
    display: flex; align-items: center; gap: .8rem;
    background: var(--pt-surface); border: 1px solid var(--pt-line); border-radius: var(--pt-radius);
    padding: .85rem 1rem; color: var(--pt-ink); text-decoration: none;
    transition: border-color .15s, box-shadow .15s, transform .15s;
}
.pt-tile:hover { border-color: var(--pt-primary); box-shadow: var(--pt-shadow); transform: translateY(-1px); color: var(--pt-ink); }
.pt-tile-icon { flex-shrink: 0; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 10px; background: var(--pt-primary-soft); color: var(--pt-primary); }
.pt-tile-name { flex: 1; font-weight: 600; font-size: .9375rem; line-height: 1.3; }
.pt-tile-count { font-size: .8125rem; font-weight: 700; color: var(--pt-muted); font-variant-numeric: tabular-nums; }

.pt-highlight {
    display: flex; align-items: center; gap: 1rem;
    background: var(--pt-surface); border: 1px solid var(--pt-line); border-left: 4px solid var(--pt-accent); border-radius: var(--pt-radius);
    padding: 1rem 1.25rem; color: var(--pt-ink); text-decoration: none;
}
.pt-highlight:hover { box-shadow: var(--pt-shadow); color: var(--pt-ink); }
.pt-highlight-icon { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 11px; background: var(--pt-progress-soft); color: var(--pt-progress); flex-shrink: 0; }
.pt-highlight strong { display: block; font-size: 1.0625rem; }
.pt-highlight small { color: var(--pt-muted); font-size: .875rem; }
.pt-highlight-count { margin-left: auto; font-size: 1.5rem; font-weight: 800; color: var(--pt-progress); font-variant-numeric: tabular-nums; }

.pt-years { display: flex; flex-wrap: wrap; gap: .5rem; }
.pt-year { padding: .35rem .85rem; background: var(--pt-surface); border: 1px solid var(--pt-line); border-radius: 999px; color: var(--pt-ink); font-weight: 600; font-size: .875rem; text-decoration: none; font-variant-numeric: tabular-nums; }
.pt-year:hover { border-color: var(--pt-primary); color: var(--pt-primary); }

/* Chips */
.chip { display: inline-flex; align-items: center; padding: .14rem .6rem; border-radius: 999px; font-size: .75rem; font-weight: 700; line-height: 1.5; white-space: nowrap; }
.chip-type { background: var(--pt-primary-soft); color: var(--pt-primary); border-radius: 7px; letter-spacing: .02em; }
.chip-progress { background: var(--pt-progress-soft); color: var(--pt-progress); }
.chip-done { background: var(--pt-done-soft); color: var(--pt-done); }
.chip-stopped { background: var(--pt-stopped-soft); color: var(--pt-stopped); }
.chip-neutral { background: var(--pt-neutral-soft); color: var(--pt-muted); }

/* Lista de documentos */
.doc-list { display: flex; flex-direction: column; gap: .6rem; }
.doc-row {
    position: relative; display: flex; align-items: center; gap: 1rem;
    background: var(--pt-surface); border: 1px solid var(--pt-line); border-radius: var(--pt-radius);
    padding: 1rem 1.15rem; transition: border-color .15s, box-shadow .15s;
}
.doc-row:hover { border-color: var(--pt-primary); box-shadow: var(--pt-shadow); }
.doc-row-icon { flex-shrink: 0; align-self: flex-start; width: 42px; height: 42px; display: grid; place-items: center; border-radius: 11px; background: var(--pt-primary-soft); color: var(--pt-primary); }
.doc-row-body { flex: 1; min-width: 0; }
.doc-row-chips { display: flex; flex-wrap: wrap; gap: .35rem; margin-bottom: .3rem; }
.doc-row-title { font-size: 1.0625rem; font-weight: 700; margin: 0 0 .2rem; }
.doc-row-title a { color: var(--pt-ink); text-decoration: none; }
.doc-row:hover .doc-row-title a { color: var(--pt-primary); }
.doc-row-summary { color: var(--pt-muted); font-size: .9375rem; line-height: 1.45; margin: 0 0 .35rem; overflow-wrap: anywhere; }
.doc-row-meta { display: flex; flex-wrap: wrap; gap: .15rem 1rem; list-style: none; margin: 0; padding: 0; font-size: .8125rem; color: var(--pt-muted); }
.doc-row-meta li { display: inline-flex; align-items: center; gap: .35rem; }
.doc-row-arrow { color: #a9b3c0; font-size: .8125rem; }

.mini-trail { display: flex; align-items: center; flex-shrink: 0; }
.mini-dot { width: 10px; height: 10px; border-radius: 50%; background: #d7dde5; position: relative; }
.mini-dot + .mini-dot { margin-left: 12px; }
.mini-dot + .mini-dot::before { content: ""; position: absolute; right: 100%; top: 4px; width: 12px; height: 2px; background: #d7dde5; }
.mini-dot.is-done, .mini-dot.is-current { background: var(--pt-primary); }
.mini-dot.is-done + .mini-dot::before { background: var(--pt-primary); }
.mini-dot.is-current { box-shadow: 0 0 0 3px var(--pt-primary-soft); }
.mini-dot.is-stopped { background: var(--pt-muted); }

/* Consulta */
.pt-page-head { padding-block: 2rem 1rem; }
.pt-page-head h1 { font-size: clamp(1.6rem, 3vw, 2.1rem); font-weight: 800; color: var(--pt-primary-strong); margin-bottom: .25rem; }
.pt-page-head p { color: var(--pt-muted); margin: 0; }
.pt-filter { background: var(--pt-surface); border: 1px solid var(--pt-line); border-radius: var(--pt-radius); padding: 1rem 1.15rem; margin-bottom: 1.25rem; }
.pt-filter .form-label { font-size: .8125rem; font-weight: 600; color: var(--pt-muted); margin-bottom: .25rem; }
.pt-filter .form-control, .pt-filter .form-select { border-color: var(--pt-line); border-radius: 10px; }
.pt-filter summary { cursor: pointer; font-size: .875rem; font-weight: 600; color: var(--pt-primary); width: fit-content; }
.pt-results-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: .75rem; }
.pt-active-filters { display: flex; flex-wrap: wrap; gap: .35rem; }
.pt-empty { background: var(--pt-surface); border: 1px dashed #c9d2dd; border-radius: var(--pt-radius); padding: 3rem 1.5rem; text-align: center; color: var(--pt-muted); }
.pt-empty i { font-size: 1.75rem; display: block; margin-bottom: .75rem; color: #a9b3c0; }
.pt-pagination .page-link { border-radius: 8px; border-color: var(--pt-line); color: var(--pt-ink); }
.pt-pagination .page-item.active .page-link { background: var(--pt-primary); border-color: var(--pt-primary); color: #fff; }

/* Documento */
.doc-hero { background: var(--pt-canvas); border-bottom: 1px solid var(--pt-line); padding-block: 1.25rem 1.75rem; }
.pt-breadcrumb { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; list-style: none; padding: 0; margin: 0 0 .9rem; font-size: .875rem; color: var(--pt-muted); }
.pt-breadcrumb a { text-decoration: none; }
.pt-breadcrumb a:hover { text-decoration: underline; }
.pt-breadcrumb li + li::before { content: "\f054"; font: var(--fa-font-solid); font-size: .625rem; margin-right: .4rem; color: #a9b3c0; }
.doc-hero h1 { font-size: clamp(1.7rem, 3.4vw, 2.4rem); font-weight: 800; color: var(--pt-primary); margin: .5rem 0 .6rem; overflow-wrap: anywhere; }
.doc-hero-summary { font-size: 1.0625rem; line-height: 1.6; max-width: 54rem; margin-bottom: 1.5rem; overflow-wrap: anywhere; }
.doc-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1.5rem; }

.trail { display: flex; list-style: none; margin: 0; padding: 0; max-width: 46rem; }
.trail-step { position: relative; flex: 1; display: flex; flex-direction: column; align-items: center; text-align: center; gap: .45rem; min-width: 0; }
.trail-step:not(:last-child)::after { content: ""; position: absolute; top: 17px; left: calc(50% + 18px); right: calc(-50% + 18px); height: 3px; border-radius: 2px; background: #dde3ea; }
.trail-step.is-done:not(:last-child)::after { background: var(--pt-primary); }
.trail-node { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; font-size: .875rem; background: var(--pt-surface); border: 2px solid #dde3ea; color: #8d98a6; position: relative; z-index: 1; }
.trail-label { font-size: .8125rem; font-weight: 600; color: var(--pt-muted); line-height: 1.25; }
.is-done > .trail-node { background: var(--pt-primary); border-color: var(--pt-primary); color: #fff; }
.is-done > .trail-label { color: var(--pt-ink); }
.is-current > .trail-node { border-color: var(--pt-primary); color: var(--pt-primary); box-shadow: 0 0 0 4px var(--pt-primary-soft); }
.is-current > .trail-label { color: var(--pt-primary); font-weight: 700; }
.is-stopped > .trail-node { background: var(--pt-muted); border-color: var(--pt-muted); color: #fff; }
.is-stopped > .trail-label { color: var(--pt-ink); font-weight: 700; }
.is-skipped > .trail-node { border-style: dashed; }

.doc-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 2rem; padding-block: 1.75rem 1rem; align-items: start; }
.doc-block { margin-bottom: 2rem; }
.doc-block > h2 { display: flex; align-items: center; gap: .55rem; font-size: 1.125rem; font-weight: 700; margin-bottom: .8rem; }
.doc-block > h2 i { color: var(--pt-primary); font-size: 1rem; }
.doc-count { margin-left: .15rem; font-size: .8125rem; font-weight: 700; color: var(--pt-muted); }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline-item { position: relative; display: flex; gap: .9rem; padding-bottom: 1.1rem; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item:not(:last-child)::before { content: ""; position: absolute; left: 7px; top: 18px; bottom: 0; width: 2px; background: var(--pt-line); }
.timeline-dot { flex-shrink: 0; width: 16px; height: 16px; margin-top: 3px; border-radius: 50%; background: var(--pt-surface); border: 3px solid #b8c4d3; position: relative; z-index: 1; }
.timeline-item.is-latest .timeline-dot { border-color: var(--pt-primary); background: var(--pt-primary); box-shadow: 0 0 0 3px var(--pt-primary-soft); }
.timeline-title { font-weight: 600; line-height: 1.35; }
.timeline-item.is-latest .timeline-title { color: var(--pt-primary); }
.timeline-date { font-size: .8125rem; color: var(--pt-muted); }
.pt-note { color: var(--pt-muted); font-size: .9375rem; margin: 0; }

.pt-card { background: var(--pt-surface); border: 1px solid var(--pt-line); border-radius: var(--pt-radius); overflow: hidden; }
.ficha { margin: 0; }
.ficha > div { display: grid; grid-template-columns: 42% 1fr; gap: .5rem; padding: .65rem 1rem; border-top: 1px solid var(--pt-line); font-size: .9rem; }
.ficha > div:first-child { border-top: 0; }
.ficha dt { font-weight: 600; color: var(--pt-muted); }
.ficha dd { margin: 0; overflow-wrap: anywhere; }
.votes { display: grid; grid-template-columns: repeat(3, 1fr); text-align: center; }
.votes > div { padding: .8rem .4rem; border-left: 1px solid var(--pt-line); }
.votes > div:first-child { border-left: 0; }
.votes strong { display: block; font-size: 1.375rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.votes span { font-size: .75rem; color: var(--pt-muted); }
.votes .is-yes strong { color: var(--pt-done); }
.votes .is-no strong { color: var(--pt-stopped); }
.author { display: flex; align-items: center; gap: .7rem; padding: .8rem 1rem; }
.author-avatar { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; background: var(--pt-primary-soft); color: var(--pt-primary); flex-shrink: 0; }
.author a { font-weight: 600; text-decoration: none; overflow-wrap: anywhere; }

.file-list { list-style: none; margin: 0; padding: 0; }
.file-row { display: flex; align-items: center; gap: .8rem; padding: .7rem 1rem; border-top: 1px solid var(--pt-line); }
.file-list .file-row:first-child { border-top: 0; }
.file-icon { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 9px; background: var(--pt-stopped-soft); color: var(--pt-stopped); flex-shrink: 0; }
.file-body { flex: 1; min-width: 0; }
.file-name { display: block; font-weight: 600; font-size: .9375rem; overflow-wrap: anywhere; line-height: 1.3; }
.file-meta { font-size: .8125rem; color: var(--pt-muted); }
.file-actions { display: flex; gap: .35rem; flex-shrink: 0; }
.file-more summary { padding: .7rem 1rem; border-top: 1px solid var(--pt-line); cursor: pointer; font-weight: 600; font-size: .9rem; color: var(--pt-primary); }
.hash { font-size: .75rem; overflow-wrap: anywhere; color: var(--pt-muted); }

/* Paginas institucionais herdadas */
.institutional-hero { background: linear-gradient(180deg, var(--pt-primary-soft), var(--pt-canvas)); color: var(--pt-ink); padding-block: 2.5rem 1.5rem; }
.institutional-hero h1 { color: var(--pt-primary-strong); font-weight: 800; }
.institutional-hero p { color: var(--pt-muted); }
.content-panel { border-radius: var(--pt-radius); border-color: var(--pt-line); box-shadow: none; }

/* Modos do menu de acessibilidade */
body.high-contrast .pt-hero,
body.high-contrast .pt-search,
body.high-contrast .pt-tile,
body.high-contrast .pt-tile-icon,
body.high-contrast .pt-highlight,
body.high-contrast .pt-highlight-icon,
body.high-contrast .pt-filter,
body.high-contrast .pt-card,
body.high-contrast .pt-empty,
body.high-contrast .pt-year,
body.high-contrast .doc-hero,
body.high-contrast .doc-row,
body.high-contrast .doc-row-icon,
body.high-contrast .chip,
body.high-contrast .file-icon,
body.high-contrast .author-avatar,
body.high-contrast .trail-node,
body.high-contrast .pt-btn {
    background: #000 !important;
    color: #fff !important;
    border-color: #fff !important;
    box-shadow: none !important;
}
body.high-contrast h1, body.high-contrast h2, body.high-contrast h3,
body.high-contrast .trail-label, body.high-contrast .timeline-title, body.high-contrast .timeline-date,
body.high-contrast .pt-hero-lead, body.high-contrast .pt-hero-note, body.high-contrast .pt-eyebrow,
body.high-contrast .pt-tile-name, body.high-contrast .pt-tile-count, body.high-contrast .pt-highlight-count, body.high-contrast .pt-highlight small,
body.high-contrast .doc-row-summary, body.high-contrast .doc-row-meta, body.high-contrast .file-meta, body.high-contrast .ficha dt, body.high-contrast .votes span,
body.high-contrast .pt-note, body.high-contrast .pt-page-head p, body.high-contrast .form-label { color: #fff !important; }
body.high-contrast .doc-row-title a, body.high-contrast .pt-section-head a, body.high-contrast body.high-contrast .author a, body.high-contrast .pt-breadcrumb a { color: #ffea00 !important; }
body.high-contrast .is-done > .trail-node, body.high-contrast .is-current > .trail-node { background: #ffea00 !important; color: #000 !important; border-color: #ffea00 !important; }
body.high-contrast .trail-step:not(:last-child)::after, body.high-contrast .timeline-item::before { background: #fff !important; }
body.high-contrast .mini-dot, body.high-contrast .mini-dot::before { background: #fff !important; }
body.high-contrast .pt-breadcrumb, body.high-contrast .doc-count, body.high-contrast .doc-block > h2 i { color: #fff !important; }
body.high-contrast input::placeholder { color: #fff !important; opacity: 1; }

@media (max-width: 991.98px) {
    .doc-layout { grid-template-columns: minmax(0, 1fr); gap: .5rem; }
    .mini-trail { display: none; }
}

@media (max-width: 575.98px) {
    .pt-search { flex-direction: column; }
    .pt-search .pt-btn { width: 100%; }
    .doc-row { padding: .9rem; gap: .75rem; }
    .doc-row-icon { width: 36px; height: 36px; }
    .doc-row-arrow { display: none; }
    .file-row { flex-wrap: wrap; }
    .file-actions { width: 100%; padding-left: 2.9rem; }

    .trail { flex-direction: column; gap: .75rem; }
    .trail-step { flex-direction: row; text-align: left; gap: .75rem; }
    .trail-step:not(:last-child)::after { top: 34px; bottom: -14px; left: 17px; right: auto; width: 3px; height: auto; }
}

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