*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --color-bg: #ffffff;
    --color-surface: #fcfcfc;
    --color-header: #f7f7f7;
    --color-even: #f9f9f9;
    --color-surface-hover: #f0f0f0;
    --color-text: #0d0d0d;
    --color-text-muted: rgba(60, 60, 67, .78);
    --color-text-secondary: #757575;
    --color-text-tertiary: rgba(60, 60, 67, .56);
    --color-border: rgba(19, 21, 23, 0.1);
    --color-ordered: rgba(0, 0, 0, .014);

    --color-primary: #1a73e8;
    --color-primary-hover: #174ea6;
    --color-primary-border: rgba(26, 115, 232, .12);
    --color-primary-bg: rgba(26, 115, 232, .08);

    --color-success: #16a34a;
    --color-warning: #f59e0b;
    --color-danger: #ef4444;
    --color-info: #3b82f6;

    --color-success-bg: rgba(22, 163, 74, .12);
    --color-warning-bg: rgba(245, 158, 11, .12);
    --color-danger-bg: rgba(239, 68, 68, .12);
    --color-info-bg: rgba(59, 130, 246, .12);

    --chart-palette-1: #2563eb;
    --chart-palette-2: #16a34a;
    --chart-palette-3: #f59e0b;
    --chart-palette-4: #7c3aed;
    --chart-palette-5: #dc2626;
    --chart-palette-6: #0891b2;
    --chart-palette-7: #db2777;
    --chart-palette-8: #4f46e5;
    --chart-palette-9: #65a30d;
    --chart-palette-10: #ea580c;

    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 22px;

    --font-base: "Google Sans Flex", sans-serif;
    --font-mono: "SF Mono", "Fira Code", "Cascadia Code", monospace;

    --header-h: 72px;

    --shadow-xs: 0 1px 2px rgba(0, 0, 0, .06);
    --shadow-sm: 0 1px 4px rgba(0, 0, 0, .08), 0 0 0 1px rgba(0, 0, 0, .04);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, .10), 0 0 0 1px rgba(0, 0, 0, .04);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, .14), 0 0 0 1px rgba(0, 0, 0, .04);
    --shadow-xl: 0 20px 60px rgba(0, 0, 0, .18), 0 0 0 1px rgba(0, 0, 0, .04);

    --transition: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 280ms cubic-bezier(0.4, 0, 0.2, 1);

    --font-size-base: 16px;

    --is-dark: none;
    --is-light: block;
}

/* Modo Alto Contraste (WCAG) — acionado pelo botão de acessibilidade (data-contrast="high"),
   independente do tema claro/escuro. Esquema preto sobre branco, bordas sólidas, links sublinhados
   e foco reforçado. Sobrepõe também o tema escuro quando ambos estão ativos. */
:root[data-contrast="high"] {
    --color-bg: #ffffff;
    --color-surface: #ffffff;
    --color-header: #ffffff;
    --color-even: #f0f0f0;
    --color-surface-hover: #e0e0e0;
    --color-text: #000000;
    --color-text-muted: #000000;
    --color-text-secondary: #1a1a1a;
    --color-text-tertiary: #1a1a1a;
    --color-border: #000000;
    --color-ordered: rgba(0, 0, 0, .05);
    --color-primary: #0b3d91;
    --color-primary-hover: #06285f;
    --color-primary-border: #0b3d91;
    --color-primary-bg: #e6eefc;
    --color-success: #0a6b2e;
    --color-warning: #8a5a00;
    --color-danger: #a10000;
    --color-info: #0b3d91;
    --color-success-bg: #dff5e6;
    --color-warning-bg: #fbf0d9;
    --color-danger-bg: #fbe0e0;
    --color-info-bg: #e6eefc;
    --shadow-xs: 0 0 0 1px #000;
    --shadow-sm: 0 0 0 1px #000;
    --shadow-md: 0 0 0 1px #000;
    --shadow-lg: 0 0 0 2px #000;
    --shadow-xl: 0 0 0 2px #000;
    --is-dark: none;
    --is-light: block;
}

:root[data-contrast="high"] a {
    text-decoration: underline;
}

:root[data-contrast="high"] *:focus-visible {
    outline: 3px solid #000;
    outline-offset: 2px;
}

:root[data-contrast="high"] .btn,
:root[data-contrast="high"] .icon-btn,
:root[data-contrast="high"] .a11y-btn,
:root[data-contrast="high"] .form-input,
:root[data-contrast="high"] .data-table th,
:root[data-contrast="high"] .data-table td,
:root[data-contrast="high"] .table-container,
:root[data-contrast="high"] .revenue-card,
:root[data-contrast="high"] .card {
    border: 1px solid #000 !important;
}

[data-theme="dark"] {
    --color-bg: #121212;
    --color-surface: #171717;
    --color-header: #1e1e1e;
    --color-even: #191919;
    --color-surface-hover: #242424;
    --color-text: #f5f5f5;
    --color-text-muted: rgba(235, 235, 245, .72);
    --color-text-secondary: rgba(235, 235, 245, .55);
    --color-text-tertiary: rgba(235, 235, 245, .36);
    --color-border: rgba(255, 255, 255, .09);
    --color-ordered: rgba(235, 235, 235, .014);

    --color-success: #3dd68c;
    --color-warning: #f9b44e;
    --color-danger: #f66f81;
    --color-info: #60a5fa;

    --color-success-bg: rgba(61, 214, 140, .12);
    --color-warning-bg: rgba(249, 180, 78, .12);
    --color-danger-bg: rgba(246, 111, 129, .12);
    --color-info-bg: rgba(96, 165, 250, .12);

    --chart-palette-4: #a78bfa;

    --shadow-xs: 0 1px 2px rgba(0, 0, 0, .3);
    --shadow-sm: 0 1px 4px rgba(0, 0, 0, .35), 0 0 0 1px rgba(255, 255, 255, .04);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, .4), 0 0 0 1px rgba(255, 255, 255, .04);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, .5), 0 0 0 1px rgba(255, 255, 255, .04);
    --shadow-xl: 0 20px 60px rgba(0, 0, 0, .6), 0 0 0 1px rgba(255, 255, 255, .04);

    --is-dark: block;
    --is-light: none;
}

/* Theme-aware scrollbars */
* {
    scrollbar-color: color-mix(in srgb, var(--color-text-tertiary) 55%, transparent) var(--color-surface);
    scrollbar-width: thin;
}

::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--color-surface);
}

::-webkit-scrollbar-thumb {
    background: color-mix(in srgb, var(--color-text-tertiary) 55%, transparent);
    border: 2px solid var(--color-surface);
    border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover {
    background: color-mix(in srgb, var(--color-text-muted) 70%, transparent);
}

::-webkit-scrollbar-corner {
    background: var(--color-surface);
}

#icon-sun {
    display: var(--is-light);
}

#icon-moon {
    display: var(--is-dark);
}

body {
    font-family: var(--font-base);
    background-color: var(--color-bg);
    color: var(--color-text);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    font-size: var(--font-size-base);
    letter-spacing: -0.015rem;
    overflow-x: hidden;
    transition: background var(--transition-slow), color var(--transition-slow);
}

a {
    color: var(--color-primary);
    text-decoration: none;
}

a:hover {
    color: var(--color-primary-hover);
}

/* ============================================================
   UTILITY CLASSES
============================================================ */
.flex {
    display: flex;
}

.flex-col {
    display: flex;
    flex-direction: column;
}

.flex-1 {
    flex: 1;
}

.items-center {
    align-items: center;
}

.items-start {
    align-items: flex-start;
}

.justify-between {
    justify-content: space-between;
}

.justify-center {
    justify-content: center;
}

.justify-end {
    justify-content: flex-end;
}

.gap-4 {
    gap: 4px;
}

.gap-6 {
    gap: 6px;
}

.gap-8 {
    gap: 8px;
}

.gap-10 {
    gap: 10px;
}

.gap-12 {
    gap: 12px;
}

.gap-16 {
    gap: 16px;
}

.gap-20 {
    gap: 20px;
}

.gap-24 {
    gap: 24px;
}

.wrap {
    flex-wrap: wrap;
}

.grid-auto-2 {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

/* ============================================================
   KPI / REVENUE CARD (global — usado em Receitas e na vitrine da Home)
============================================================ */
.revenue-card-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.revenue-card {
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    background: var(--color-surface);
    padding: 16px;
}

.revenue-card-label {
    display: block;
    color: var(--color-text-tertiary);
    font-size: .78rem;
    font-weight: 700;
    text-transform: uppercase;
}

.revenue-card-value {
    display: block;
    margin-top: 8px;
    color: var(--color-text);
    font-size: 1.45rem;
    font-weight: 800;
    letter-spacing: 0;
}

.revenue-card-note {
    display: block;
    margin-top: 8px;
    color: var(--color-text-muted);
    font-size: .86rem;
}

.revenue-card.is-good .revenue-card-value { color: var(--color-success); }
.revenue-card.is-alert .revenue-card-value { color: var(--color-warning); }

.revenue-bar-track {
    height: 10px;
    border-radius: 99px;
    background: var(--color-header);
    overflow: hidden;
}

.revenue-bar-fill {
    height: 100%;
    border-radius: inherit;
    background: var(--color-primary);
    display: block;
}

/* Card-link de destaque da Home: reusa a chrome de `.card` + o KPI acima. */
.home-destaque {
    display: flex;
    flex-direction: column;
    color: inherit;
    text-decoration: none;
    transition: border-color var(--transition), background var(--transition);
}

.home-destaque:hover {
    border-color: var(--color-primary-border);
    background: var(--color-surface-hover);
}

.home-destaque__body {
    padding: 0 18px 18px;
}

.home-destaque__bar {
    margin-top: 12px;
}

/* ============================================================
   Destaques da Home — card maior (~1/3) com visualização própria
   por indicador: barra (Receitas), segmentos (Despesas), stack
   + legenda (Servidores). Cores vêm das variáveis do tema.
============================================================ */
.destaques-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

.home-destaque .card-header {
    justify-content: flex-start;
    padding: 18px 18px 0;
    cursor: inherit;
}

.home-destaque .card-header-icon {
    width: 42px;
    height: 42px;
    margin-bottom: 0;
    border: none;
}

.home-destaque__arrow {
    margin-left: auto;
    display: flex;
    color: var(--color-text-tertiary);
    transition: transform var(--transition), color var(--transition);
}

.home-destaque__arrow svg {
    width: 17px;
    height: 17px;
}

.home-destaque:hover .home-destaque__arrow {
    color: var(--color-primary);
    transform: translate(2px, -2px);
}

.home-destaque__body {
    padding: 16px 18px 18px;
}

.kpi-num {
    font-size: 1.7rem;
    font-weight: 700;
    line-height: 1;
    letter-spacing: -.02em;
    color: var(--color-text);
    font-variant-numeric: tabular-nums;
}

.kpi-label {
    display: block;
    margin-top: 5px;
    font-size: .72rem;
    color: var(--color-text-secondary);
    text-transform: uppercase;
    letter-spacing: .04em;
}

/* Viz: barra de progresso (Receitas) */
.home-destaque .bar {
    height: 7px;
    margin-top: 14px;
    border-radius: 999px;
    background: var(--color-border);
    overflow: hidden;
}

.home-destaque .bar > span {
    display: block;
    height: 100%;
    border-radius: inherit;
}

.home-destaque .note {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    margin-top: 10px;
    font-size: .75rem;
    color: var(--color-text-muted);
}

.home-destaque .note b {
    font-weight: 600;
    color: var(--color-text);
}

/* Viz: segmentos empilhados por linha (Despesas) */
.home-destaque .seg {
    display: grid;
    gap: 8px;
    margin-top: 14px;
}

.home-destaque .seg-row {
    display: grid;
    grid-template-columns: 66px 1fr auto;
    align-items: center;
    gap: 9px;
    font-size: .72rem;
}

.home-destaque .seg-row .sl {
    color: var(--color-text-secondary);
}

.home-destaque .seg-row .st {
    height: 6px;
    border-radius: 999px;
    background: var(--color-border);
    overflow: hidden;
}

.home-destaque .seg-row .st > span {
    display: block;
    height: 100%;
    border-radius: inherit;
}

.home-destaque .seg-row .sv {
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    color: var(--color-text);
}

/* Viz: barra empilhada + legenda (Servidores) */
.home-destaque .stack {
    display: flex;
    height: 8px;
    margin-top: 14px;
    border-radius: 999px;
    overflow: hidden;
}

.home-destaque .stack > span {
    display: block;
    height: 100%;
}

.home-destaque .legend {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 11px;
}

.home-destaque .legend span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: .72rem;
    color: var(--color-text-muted);
}

.home-destaque .legend i {
    width: 9px;
    height: 9px;
    border-radius: 3px;
    display: inline-block;
}

@media (max-width: 960px) {
    .revenue-card-grid {
        grid-template-columns: 1fr;
    }
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.col-span-2 {
    grid-column: span 2;
}

.w-full {
    width: 100%;
}

.h-full {
    height: 100%;
}

.min-w-0 {
    min-width: 0;
}

.text-sm {
    font-size: .82rem;
}

.text-xs {
    font-size: .74rem;
}

.text-base {
    font-size: .9rem;
}

.text-lg {
    font-size: 1.05rem;
}

.text-xl {
    font-size: 1.25rem;
}

.text-2xl {
    font-size: 1.5rem;
}

.font-medium {
    font-weight: 500;
}

.font-semibold {
    font-weight: 600;
}

.font-bold {
    font-weight: 700;
}

.tnum {
    font-feature-settings: "tnum";
    font-variant-numeric: tabular-nums;
}

.text-muted {
    color: var(--color-text-muted);
}

.text-secondary {
    color: var(--color-text-secondary);
}

.text-tertiary {
    color: var(--color-text-tertiary);
}

.text-primary {
    color: var(--color-primary);
}

.text-success {
    color: var(--color-success);
}

.text-warning {
    color: var(--color-warning);
}

.text-danger {
    color: var(--color-danger);
}

.text-right {
    text-align: right;
}

.text-left {
    text-align: left;
}

.text-center {
    text-align: center;
}

.overflow-hidden {
    overflow: hidden;
}

.overflow-auto {
    overflow: auto;
}

.truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nowrap {
    white-space: nowrap;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
}

.mt-4 {
    margin-top: 4px;
}

.mt-8 {
    margin-top: 8px;
}

.mt-12 {
    margin-top: 12px;
}

.mt-16 {
    margin-top: 16px;
}

.mt-24 {
    margin-top: 24px;
}

.mb-4 {
    margin-bottom: 4px;
}

.mb-8 {
    margin-bottom: 8px;
}

.mb-12 {
    margin-bottom: 12px;
}

.mb-16 {
    margin-bottom: 16px;
}

.mb-24 {
    margin-bottom: 24px;
}

.p-4 {
    padding: 4px;
}

.p-8 {
    padding: 8px;
}

.p-12 {
    padding: 12px;
}

.p-16 {
    padding: 16px;
}

.p-20 {
    padding: 20px;
}

.rounded-sm {
    border-radius: var(--radius-sm);
}

.rounded-md {
    border-radius: var(--radius-md);
}

.rounded-lg {
    border-radius: var(--radius-lg);
}

.rounded-full {
    border-radius: 999px;
}

.border {
    border: 1px solid var(--color-border);
}

.border-top {
    border-top: 1px solid var(--color-border);
}

.border-bottom {
    border-bottom: 1px solid var(--color-border);
}

.bg-surface {
    background: var(--color-surface);
}

.bg-header {
    background: var(--color-header);
}

.bg-even {
    background: var(--color-even);
}

.shadow-sm {
    box-shadow: var(--shadow-sm);
}

.shadow-md {
    box-shadow: var(--shadow-md);
}

.shadow-lg {
    box-shadow: var(--shadow-lg);
}

.pointer {
    cursor: pointer;
}

.select-none {
    user-select: none;
}

.relative {
    position: relative;
}

.absolute {
    position: absolute;
}

.sticky {
    position: sticky;
}

.fixed {
    position: fixed;
}

.inset-0 {
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
}

.z-10 {
    z-index: 10;
}

.z-100 {
    z-index: 100;
}

.z-200 {
    z-index: 200;
}

.z-1000 {
    z-index: 1000;
}

.z-5000 {
    z-index: 5000;
}

.z-9999 {
    z-index: 9999;
}

/* ============================================================
   HEADER
============================================================ */
.header {
    position: sticky;
    top: 0;
    z-index: 1000;
    height: var(--header-h);
    background: var(--color-header);
    border-bottom: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    padding: 0 16px;
    gap: 8px;
    transition: background var(--transition-slow);
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    flex-shrink: 0;
    margin-right: 4px;
}

.header-logo-mark {
    width: 56px;
    height: 56px;
    background: #fff;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border: 1px solid var(--color-border);
}

.header-logo-mark svg {
    width: 24px;
    height: 24px;
    stroke: var(--color-primary);
    fill: none;
}

.header-logo-mark img {
    width: 48px;
    height: 48px;
    object-fit: contain;
}

.header-project-info {
    display: flex;
    flex-direction: column;
    line-height: 1;
    gap: 2px;
}

.header-project-name {
    font-weight: 700;
    font-size: .95rem;
    color: var(--color-text);
    letter-spacing: -.025em;
    white-space: nowrap;
}

.header-project-caption {
    font-weight: 500;
    font-size: .75rem;
    color: var(--color-text-tertiary);
    letter-spacing: -.01em;
    white-space: nowrap;
}

/* Search no header */
.header-search {
    flex: 1;
    max-width: 360px;
    position: relative;
}

.header-search-input {
    width: 100%;
    height: 34px;
    padding: 0 36px 0 34px;
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border);
    background: var(--color-surface);
    color: var(--color-text);
    font-family: var(--font-base);
    font-size: .84rem;
    outline: none;
    transition: border-color var(--transition), box-shadow var(--transition);
    letter-spacing: -.01em;
}

.header-search-input::placeholder {
    color: var(--color-text-tertiary);
}

.header-search-input:focus {
    border-color: var(--color-primary);
}

.header-search-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--color-text-tertiary);
    pointer-events: none;
    display: flex;
    width: 16px;
    height: 16px;
}

.header-search-kbd {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--color-header);
    border: 1px solid var(--color-border);
    border-radius: 5px;
    padding: 1px 6px;
    font-size: .7rem;
    color: var(--color-text-tertiary);
    font-family: var(--font-mono);
    pointer-events: none;
}

/* Nav */
.header-nav {
    display: flex;
    align-items: center;
    gap: 2px;
}

.header-nav-link {
    padding: 5px 10px;
    border-radius: var(--radius-sm);
    font-size: .84rem;
    color: var(--color-text-secondary);
    transition: background var(--transition), color var(--transition);
    font-weight: 500;
    white-space: nowrap;
    text-decoration: none;
    gap: 4px;
    display: flex;
    align-items: center;
}

.header-nav-link:hover,
.header-nav-link.active {
    background: var(--color-surface-hover);
    color: var(--color-text);
}

/* Actions */
.header-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: auto;
    flex-shrink: 0;
}

/* Icon button */
.icon-btn {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    border: none;
    background: transparent;
    cursor: pointer;
    color: var(--color-text-secondary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background var(--transition), color var(--transition);
    flex-shrink: 0;
}

.icon-btn svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.75;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.icon-btn:hover {
    background: var(--color-surface-hover);
    color: var(--color-text);
}

/* Accessibility font size buttons */
.header-a11y {
    display: flex;
    align-items: center;
    gap: 2px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    padding: 2px;
    background: var(--color-surface);
}

.a11y-btn {
    width: 28px;
    height: 24px;
    border: none;
    background: transparent;
    cursor: pointer;
    color: var(--color-text-secondary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    font-family: var(--font-base);
    font-weight: 700;
    transition: background var(--transition), color var(--transition);
}

.a11y-btn:hover {
    background: var(--color-surface-hover);
    color: var(--color-text);
}

.a11y-btn svg {
    width: 20px;
    height: 20px;
}

/* More dropdown */
.header-dropdown {
    position: relative;
}

.header-dropdown-panel {
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    min-width: 210px;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px) scale(.98);
    transform-origin: top right;
    transition: all var(--transition);
    z-index: 500;
}

.header-dropdown-panel.open {
    opacity: 1;
    visibility: visible;
    transform: none;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 14px;
    width: 100%;
    font-size: .85rem;
    color: var(--color-text-muted);
    background: none;
    border: none;
    cursor: pointer;
    font-family: var(--font-base);
    text-align: left;
    text-decoration: none;
    transition: background var(--transition), color var(--transition);
    letter-spacing: -.01em;
}

.dropdown-item svg {
    width: 14px;
    height: 14px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.75;
    stroke-linecap: round;
    stroke-linejoin: round;
    flex-shrink: 0;
}

.dropdown-item:hover {
    background: var(--color-surface-hover);
    color: var(--color-text);
}

.dropdown-item.danger:hover {
    background: var(--color-danger-bg);
    color: var(--color-danger);
}

.dropdown-separator {
    height: 1px;
    background: var(--color-border);
    margin: 4px 0;
}

.dropdown-label {
    padding: 8px 14px 4px;
    font-size: .7rem;
    font-weight: 600;
    color: var(--color-text-tertiary);
    text-transform: uppercase;
    letter-spacing: .06em;
}

.mobile-link,
.mobile-search {
    display: none;
}

.mobile-nav {
    display: none;
    position: fixed;
    top: var(--header-h);
    left: 0;
    right: 0;
    background: var(--color-header);
    border-bottom: 1px solid var(--color-border);
    padding: 8px 12px 14px;
    z-index: 999;
    flex-direction: column;
    gap: 2px;
}

.mobile-nav.open {
    display: flex;
}

.mobile-nav-link {
    padding: 10px 12px;
    border-radius: var(--radius-md);
    color: var(--color-text-secondary);
    font-size: .9rem;
    font-weight: 500;
    text-decoration: none;
    transition: background var(--transition), color var(--transition);
}

.mobile-nav-link:hover {
    background: var(--color-surface-hover);
    color: var(--color-text);
}

@media (max-width: 900px) {
    .header-nav {
        display: none;
    }

    .page-tabs-bar {
        display: block !important;
    }

    .mobile-link {
        display: flex;
    }

    .header-search {
        max-width: 200px;
    }
}

@media (max-width: 600px) {
    .header-search {
        display: none;
    }

    .mobile-search {
        display: flex;
    }
}

/* ============================================================
   BREADCRUMBS
============================================================ */
.breadcrumbs {
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 8px 20px;
    font-size: .78rem;
    color: var(--color-text-tertiary);
    border-bottom: 1px solid var(--color-border);
    overflow-x: auto;
    white-space: nowrap;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.breadcrumbs::-webkit-scrollbar {
    display: none;
}

.breadcrumbs-item {
    display: flex;
    align-items: center;
    gap: 2px;
    color: var(--color-text-secondary);
    text-decoration: none;
    padding: 3px 6px;
    border-radius: var(--radius-sm);
    transition: background var(--transition), color var(--transition);
}

a.breadcrumbs-item:hover {
    background: var(--color-surface-hover);
    color: var(--color-text);
}

.breadcrumbs-item svg {
    width: 13px;
    height: 13px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.75;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.breadcrumbs-sep {
    color: var(--color-text-tertiary);
    width: 1rem;
    height: 1rem;
}

.breadcrumbs-sep svg {
    width: 100%;
    height: 100%;
}

.breadcrumbs-current {
    padding: 3px 6px;
    color: var(--color-text);
    font-weight: 500;
}

/* ============================================================
   COMMAND MENU
============================================================ */
.cmd-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .5);
    z-index: 9000;
    display: none;
    align-items: flex-start;
    justify-content: center;
    padding-top: 80px;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.cmd-overlay.open {
    display: flex;
    animation: fade-in 120ms ease;
}

.cmd-panel {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    width: 100%;
    max-width: 560px;
    overflow: hidden;
    animation: cmd-in 180ms cubic-bezier(.34, 1.56, .64, 1);
}

@keyframes cmd-in {
    from {
        opacity: 0;
        transform: scale(.95) translateY(-8px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

.cmd-search-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--color-border);
}

.cmd-search-wrap svg {
    width: 17px;
    height: 17px;
    stroke: var(--color-text-tertiary);
    fill: none;
    stroke-width: 1.75;
    stroke-linecap: round;
    stroke-linejoin: round;
    flex-shrink: 0;
}

.cmd-input {
    flex: 1;
    background: none;
    border: none;
    outline: none;
    font-family: var(--font-base);
    font-size: .95rem;
    color: var(--color-text);
    letter-spacing: -.015em;
}

.cmd-input::placeholder {
    color: var(--color-text-tertiary);
}

.cmd-esc,
.cmd-alt {
    background: var(--color-header);
    border: 1px solid var(--color-border);
    border-radius: 5px;
    padding: 2px 8px;
    font-size: .72rem;
    color: var(--color-text-tertiary);
    font-family: var(--font-mono);
    cursor: pointer;
    flex-shrink: 0;
    transition: background var(--transition);
}

.cmd-esc:hover,
.cmd-alt:hover,
a:hover .cmd-alt {
    background: var(--color-surface-hover);
}

.cmd-results {
    max-height: 420px;
    overflow-y: auto;
    padding: 6px;
}

.cmd-group-label {
    padding: 8px 10px 4px;
    font-size: .7rem;
    font-weight: 600;
    color: var(--color-text-tertiary);
    text-transform: uppercase;
    letter-spacing: .07em;
}

.cmd-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: background var(--transition);
}

.cmd-item:hover,
.cmd-item.selected {
    background: var(--color-surface-hover);
}

.cmd-item-icon {
    width: 30px;
    height: 30px;
    border-radius: var(--radius-sm);
    background: var(--color-header);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .95rem;
    flex-shrink: 0;
    border: 1px solid var(--color-border);
    color: var(--color-text-secondary);
}

.cmd-item-icon svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.75;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.cmd-item.selected .cmd-item-icon {
    color: var(--color-primary);
    border-color: var(--color-primary-border);
    background: var(--color-primary-bg);
}

.cmd-item-label {
    flex: 1;
    font-size: .87rem;
    color: var(--color-text-muted);
    letter-spacing: -.01em;
}

.cmd-item-meta {
    font-size: .72rem;
    color: var(--color-text-tertiary);
    font-family: var(--font-mono);
}

.cmd-empty {
    padding: 48px 20px;
    text-align: center;
    color: var(--color-text-tertiary);
    font-size: .88rem;
}

/* ============================================================
   MENU HUB (landing de menu → grade de seções/submenus)
============================================================ */
.menu-hub-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-top: 18px;
}

.menu-hub-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    background: var(--color-surface);
    padding: 16px;
    color: inherit;
    text-decoration: none;
    transition: background var(--transition), border-color var(--transition);
}

.menu-hub-card:hover {
    background: var(--color-surface-hover);
    border-color: var(--color-primary-border);
}

.menu-hub-card-title {
    display: block;
    color: var(--color-text);
    font-size: 1rem;
}

.menu-hub-card-desc {
    display: block;
    margin-top: 6px;
    color: var(--color-text-muted);
    font-size: .88rem;
    line-height: 1.45;
}

.menu-hub-card-cta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    border-radius: 99px;
    border: 1px solid var(--color-border);
    background: var(--color-header);
    color: var(--color-text-muted);
    padding: 5px 11px;
    font-size: .76rem;
    font-weight: 700;
    white-space: nowrap;
    transition: color var(--transition), border-color var(--transition);
}

.menu-hub-card:hover .menu-hub-card-cta {
    color: var(--color-primary);
    border-color: var(--color-primary-border);
}

.menu-hub-card-cta svg {
    width: 15px;
    height: 15px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
}

@media (max-width: 960px) {
    .menu-hub-grid {
        grid-template-columns: 1fr;
    }
}

/* ============================================================
   PAGE SECTION TABS
============================================================ */
.page-tabs-bar {
    position: sticky;
    top: var(--header-h);
    z-index: 100;
    background: var(--color-bg);
    border-bottom: 1px solid var(--color-border);
    padding: 0 20px;
    overflow-x: auto;
    -ms-overflow-style: none;
    scrollbar-width: none;
    display: none;
}

.page-tabs-bar::-webkit-scrollbar {
    display: none;
}

.page-tabs-inner {
    display: flex;
    gap: 0;
    min-width: max-content;
}

.page-tab {
    padding: 0 14px;
    height: 42px;
    font-size: .84rem;
    font-weight: 500;
    color: var(--color-text-secondary);
    border: none;
    border-bottom: 2px solid transparent;
    background: none;
    cursor: pointer;
    font-family: var(--font-base);
    white-space: nowrap;
    transition: color var(--transition), border-color var(--transition);
    letter-spacing: -.01em;
    display: flex;
    align-items: center;
}

.page-tab:hover {
    color: var(--color-text);
}

.page-tab.active {
    color: var(--color-primary);
    border-bottom-color: var(--color-primary);
    font-weight: 600;
}

/* ============================================================
   MAIN LAYOUT
============================================================ */
.main-wrapper {
    max-width: 1460px;
    margin: 0 auto;
    width: 95%;
    padding: 40px 20px;
}

.section {
    margin-bottom: 64px;
    scroll-margin-top: calc(var(--header-h) + 48px);
}

.section-heading {
    margin-bottom: 24px;
}

/* ============================================================
   PAGE HEADER (HERO)
============================================================ */
.page-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    padding: 30px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    background:
        linear-gradient(135deg, color-mix(in srgb, var(--color-primary-bg) 72%, transparent), transparent 58%),
        var(--color-surface);
    box-shadow: var(--shadow-sm);
}

.page-header .btn {
    margin-top: 16px;
}

.page-header-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--color-primary);
    font-size: .8rem;
    font-weight: 700;
    margin-bottom: 12px;
}

.page-header-eyebrow svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.8;
}

.page-header-title {
    font-size: clamp(2rem, 4vw, 3.5rem);
    line-height: 1;
    letter-spacing: 0;
    margin-bottom: 14px;
}

.page-header-lead {
    max-width: 760px;
    color: var(--color-text-muted);
    font-size: 1rem;
    line-height: 1.75;
}

@media (max-width: 760px) {
    .page-header {
        grid-template-columns: 1fr;
        display: grid;
        align-items: start;
        padding: 20px;
    }
}

.section-title {
    font-size: 1.3rem;
    font-weight: 700;
    letter-spacing: -.03em;
    margin-bottom: 3px;
}

.section-subtitle {
    font-size: .84rem;
    color: var(--color-text-tertiary);
}

.demo-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 12px;
}

/* ============================================================
   NOTIFY TOASTS
============================================================ */
#notify-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
    width: 340px;
}

.toast {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 13px 14px;
    box-shadow: var(--shadow-lg);
    pointer-events: all;
    position: relative;
    animation: toast-in 240ms cubic-bezier(.34, 1.56, .64, 1);
    overflow: hidden;
}

.toast.removing {
    animation: toast-out 200ms ease forwards;
}

.toast-stripe {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    border-radius: 99px 0 0 99px;
    display: none;
}

.toast.success .toast-stripe {
    background: var(--color-success);
}

.toast.error .toast-stripe {
    background: var(--color-danger);
}

.toast.warn .toast-stripe {
    background: var(--color-warning);
}

.toast.info .toast-stripe {
    background: var(--color-info);
}

.toast-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    margin-top: 1px;
}

.toast-icon svg {
    width: 18px;
    height: 18px;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    fill: none;
}

.toast.success .toast-icon {
    color: var(--color-success);
}

.toast.error .toast-icon {
    color: var(--color-danger);
}

.toast.warn .toast-icon {
    color: var(--color-warning);
}

.toast.info .toast-icon {
    color: var(--color-info);
}

.toast-body {
    flex: 1;
    min-width: 0;
}

.toast-title {
    font-weight: 600;
    font-size: .86rem;
    color: var(--color-text);
    line-height: 1.3;
}

.toast-message {
    font-size: .8rem;
    color: var(--color-text-muted);
    margin-top: 2px;
    line-height: 1.4;
}

.toast-close {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--color-text-tertiary);
    padding: 0;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    flex-shrink: 0;
    transition: background var(--transition), color var(--transition);
}

.toast-close svg {
    width: 13px;
    height: 13px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
}

.toast-close:hover {
    background: var(--color-surface-hover);
    color: var(--color-text);
}

@keyframes toast-in {
    from {
        opacity: 0;
        transform: translateX(24px) scale(.97);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

@keyframes toast-out {
    to {
        opacity: 0;
        transform: translateX(32px);
    }
}

/* ============================================================
   CONTENT DIVIDER
============================================================ */
.divider {
    border: none;
    border-top: 1px solid var(--color-border);
    margin: 20px 0;
}

.divider-dashed {
    border: none;
    border-top: 1px dashed var(--color-border);
    margin: 20px 0;
}

.divider-labeled {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 20px 0;
    color: var(--color-text-tertiary);
    font-size: .78rem;
    letter-spacing: .02em;
}

.divider-labeled::before,
.divider-labeled::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--color-border);
}

.divider-accent {
    border: none;
    border-top: 2px solid var(--color-primary);
    width: 36px;
    margin: 20px 0;
    border-radius: 99px;
}

/* ============================================================
   CODE SNIPPET
============================================================ */
.code-block {
    background: #0f1117;
    border: 1px solid rgba(255, 255, 255, .07);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.code-block-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, .06);
    background: #0a0c10;
}

.code-block-lang {
    font-size: .74rem;
    color: rgba(255, 255, 255, .35);
    font-family: var(--font-mono);
    letter-spacing: .04em;
}

.code-block-dots {
    display: flex;
    gap: 5px;
}

.code-block-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.code-block-dot.red {
    background: #ff5f57;
}

.code-block-dot.yellow {
    background: #febc2e;
}

.code-block-dot.green {
    background: #28c840;
}

.code-block-copy {
    font-size: .72rem;
    padding: 3px 10px;
    border-radius: 5px;
    border: 1px solid rgba(255, 255, 255, .1);
    background: rgba(255, 255, 255, .05);
    cursor: pointer;
    color: rgba(255, 255, 255, .4);
    font-family: var(--font-base);
    transition: all var(--transition);
}

.code-block-copy:hover {
    border-color: rgba(255, 255, 255, .25);
    color: rgba(255, 255, 255, .75);
}

.code-block pre {
    padding: 18px;
    overflow-x: auto;
    font-family: var(--font-mono);
    font-size: .82rem;
    line-height: 1.7;
    color: #abb2bf;
}

.tok-kw {
    color: #c678dd;
}

.tok-fn {
    color: #61afef;
}

.tok-str {
    color: #98c379;
}

.tok-num {
    color: #d19a66;
}

.tok-cm {
    color: #5c6370;
    font-style: italic;
}

.tok-cls {
    color: #e5c07b;
}

.tok-op {
    color: #56b6c2;
}

/* ============================================================
   CARD
============================================================ */
.card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.card-header {
    padding: 14px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border: none;
    background-color: transparent;
    text-align: inherit;
    border-radius: var(--radius-lg);
    cursor: pointer;
}

.card-header-icon {
    flex-shrink: 0;
    width: 52px;
    height: 52px;
    border-radius: var(--radius-lg);
    background: var(--color-primary-bg);
    border: 1px solid var(--color-primary-border);
    color: var(--color-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}

.card-header-icon svg {
    width: 22px;
    height: 22px;
}

.card-header-title {
    font-weight: 600;
    font-size: .92rem;
    color: var(--color-text);
}

.card-header-desc {
    font-size: .78rem;
    color: var(--color-text-tertiary);
    margin-top: 1px;
}

.card {
    position: relative;
    user-select: none;
    cursor: pointer;
}

.card .card-body {
    position: static;
}

.card .card-body ul {
    list-style: none;
    padding-left: 0;
    margin: 0;
    border-top: 1px solid var(--color-border);
    visibility: hidden;
    transform: scale(0.96) translateY(-4px);
    opacity: 0;
    transform-origin: top center;
    transition: transform var(--transition), opacity var(--transition), visibility var(--transition);
    position: absolute;
    top: 100%;
    left: -1px;
    width: calc(100% + 2px);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-top: none;
    border-radius: 0 0 var(--border-radius, 8px) var(--border-radius, 8px);
    z-index: 21;
    pointer-events: none;
    overflow: hidden;
}

.card.show {
    overflow: visible;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.card.show .card-body ul {
    visibility: visible;
    transform: scale(1) translateY(0);
    opacity: 1;
    pointer-events: auto;
}

.card .card-body ul li {
    display: flex;
    align-items: center;
    border-top: 1px solid var(--color-border);
    padding: 8px 18px;
    font-size: .92rem;
    color: var(--color-text);
    transition: background 0.15s ease;
}

.card .card-body ul li:hover {
    background: var(--color-surface-hover, rgba(0, 0, 0, 0.04));
}

.card .card-body ul li a {
    color: var(--color-text);
    text-decoration: none;
    width: 100%;
}

.card.show {
    z-index: 20;
    position: relative;
}

.backdrop {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 10;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    background: rgba(0, 0, 0, 0.08);
}

.backdrop.active {
    display: block;
}

.card-footer {
    padding: 12px 18px;
    border-top: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--color-even);
}

.card-metric {
    font-size: 2.2rem;
    font-weight: 800;
    letter-spacing: -.05em;
    line-height: 1;
}

/* ============================================================
   SKELETON LOADING
============================================================ */
@keyframes shimmer {
    0% {
        background-position: -600px 0;
    }

    100% {
        background-position: 600px 0;
    }
}

.skeleton {
    background: linear-gradient(90deg,
            var(--color-border) 0px,
            var(--color-surface-hover) 40%,
            var(--color-border) 80%);
    background-size: 600px 100%;
    animation: shimmer 1.4s infinite linear;
    border-radius: var(--radius-sm);
    display: block;
}

.skeleton-text {
    height: 14px;
    border-radius: 4px;
}

.skeleton-text.sm {
    height: 11px;
}

.skeleton-text.lg {
    height: 18px;
}

.skeleton-text.xl {
    height: 24px;
}

.skeleton-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    flex-shrink: 0;
}

.skeleton-badge {
    height: 20px;
    width: 56px;
    border-radius: 99px;
}

.skeleton-btn {
    height: 34px;
    border-radius: var(--radius-md);
}

.skeleton-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 18px;
}

.skeleton-img {
    border-radius: var(--radius-md);
    aspect-ratio: 16 / 9;
}

/* ============================================================
   TELAS LEGISLATIVAS — cards, acordeão de pauta e placar de votação
   Só tokens var(--color-*) → respeita default/dark/alto-contraste.

   O prefixo é `leg-` (legislativo). Até 2026-07-21 era o prefixo da integração externa que
   alimentava estas telas e que saiu na Fase 7 (2026-07-20) — sobra sem significado. A troca
   varreu cinco blades e ~70 seletores e NÃO mudou aparência nenhuma: foi renomeação pura,
   classe por classe, blade e CSS na mesma leva. O prefixo antigo não existe mais no repo.

   O que JÁ saiu daqui: o skeleton (.leg-sk-*), o estado de erro de rede (.leg-error) e o
   scroll infinito (.leg-sentinel/.leg-loadmore). Eles existiam porque a origem era uma API
   externa com timeout; lendo o banco local, não há espera para preencher.
============================================================ */
.page-header-updated { display: inline-block; margin-top: 8px; color: var(--color-text-secondary); font-size: .82rem; font-weight: 600; }

.leg-external { border: 1px solid var(--color-border); border-radius: var(--radius-lg); background: var(--color-surface); padding: 22px; }
.leg-external p { margin: 0 0 14px; color: var(--color-text-muted); line-height: 1.6; }

.leg-toolbar { margin-bottom: 18px; }
.leg-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.leg-chip { border: 1px solid var(--color-border); background: var(--color-surface); color: var(--color-text-muted); border-radius: 999px; padding: 5px 12px; font-size: .82rem; font-weight: 600; cursor: pointer; transition: color var(--transition), background var(--transition), border-color var(--transition); }
.leg-chip.is-active { background: var(--color-primary-bg); border-color: var(--color-primary); color: var(--color-primary); }
.leg-search .form-input { min-width: 240px; }

.leg-card-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }

/* Grade de cards DENTRO do .table-container (Proposições e Emendas da Câmara) — vira matriz
   contínua, do jeito que uma tabela é.
   O motivo é o mesmo do acordeão das Atas: a moldura já é do container. Card com borda e raio
   próprios desenha caixa dentro de caixa, e o `gap` de 16px abre corredores de fundo que
   picotam a leitura.
   As bordas ficam só ENTRE as células — nunca na moldura externa, que já existe, nem colada
   na toolbar (border-bottom) ou na paginação (border-top), onde virariam 2px:
     • coluna: hairline à DIREITA de quem está na coluna esquerda (:nth-child(odd));
     • linha:  hairline no TOPO de quem começa na 2ª linha em diante (:nth-child(n+3)).
   O `:last-of-type` cobre o número ÍMPAR de cards: o último fica sozinho na linha, e sem isso
   sobraria um risco vertical ao lado de uma célula vazia. */
.table-container .leg-card-grid { gap: 0; }
.table-container .leg-card { border: 0; border-radius: 0; }
.table-container .leg-card:nth-child(odd) { border-right: 1px solid var(--color-border); }
.table-container .leg-card:nth-child(n+3) { border-top: 1px solid var(--color-border); }
.table-container .leg-card:last-of-type:nth-child(odd) { border-right: 0; }
.leg-card { border: 1px solid var(--color-border); border-radius: var(--radius-lg); background: var(--color-surface); padding: 18px 20px; display: flex; flex-direction: column; }
.leg-card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.leg-card-title { font-weight: 700; color: var(--color-text); font-size: 1.02rem; }
.leg-card-sub { color: var(--color-text-tertiary); font-size: .84rem; margin-top: 3px; }
.leg-card-valor { flex-shrink: 0; font-weight: 800; color: var(--color-text); font-size: 1.05rem; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.leg-card-objeto { color: var(--color-text-muted); font-size: .9rem; line-height: 1.55; margin: 12px 0 0; }
.leg-card-meta { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 18px; margin: 14px 0 0; padding: 14px 0 0; border-top: 1px solid var(--color-border); }
.leg-card-meta dt { color: var(--color-text-tertiary); font-weight: 650; font-size: .72rem; text-transform: uppercase; letter-spacing: .02em; }
.leg-card-meta dd { color: var(--color-text); font-size: .88rem; margin: 2px 0 0; }
.leg-badge { align-self: flex-start; margin-top: 14px; font-size: .74rem; font-weight: 750; border-radius: 999px; padding: 3px 10px; color: var(--color-text-muted); background: var(--color-header); box-shadow: inset 0 0 0 1px var(--color-border); }
.leg-badge.is-success { color: var(--color-success); background: var(--color-success-bg); box-shadow: none; }
.leg-badge.is-warning { color: var(--color-warning); background: var(--color-warning-bg); box-shadow: none; }
.leg-badge.is-danger { color: var(--color-danger); background: var(--color-danger-bg); box-shadow: none; }
.leg-badge.is-info { color: var(--color-info); background: var(--color-info-bg); box-shadow: none; }
.leg-none { margin-top: 16px; padding: 22px; text-align: center; color: var(--color-text-muted); border: 1.5px dashed var(--color-border); border-radius: var(--radius-lg); }

/* Acordeão (molde .ppa-program-card): resumo clicável + corpo que abre com tabela dentro.
   É <details>/<summary> nativo — abre sem JS. Antes era <button> + max-height animado por
   JavaScript, e o estado vinha de uma classe `.open`; hoje quem manda é o atributo [open]
   do próprio elemento. A animação de altura se perdeu na troca: não dá para animar um
   <details> sem JS, e abrir instantâneo vale mais que animar. */
.leg-acc-list { display: grid; gap: 12px; }
.leg-acc-card { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-lg); overflow: hidden; }
.leg-acc-summary { display: flex; align-items: center; justify-content: space-between; gap: 18px; width: 100%; padding: 16px 18px; cursor: pointer; border: 0; background: transparent; color: var(--color-text); text-align: left; font: inherit; transition: color var(--transition); list-style: none; }
/* Esconde o triângulo padrão do <details> — o chevron do .leg-acc-actions faz esse papel. */
.leg-acc-summary::-webkit-details-marker { display: none; }
.leg-acc-summary::marker { content: ''; }
.leg-acc-summary:hover { color: var(--color-primary); }
.leg-acc-main { min-width: 0; display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; }
.leg-acc-title { color: var(--color-text); font-size: 1rem; font-weight: 700; line-height: 1.35; word-break: break-word; }
.leg-acc-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; color: var(--color-text-tertiary); font-size: .8rem; }
.leg-acc-badge { flex-shrink: 0; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: var(--color-primary); background: var(--color-primary-bg); border-radius: 999px; padding: 3px 10px; }
.leg-acc-actions { display: flex; align-items: center; justify-content: flex-end; gap: 12px; flex-shrink: 0; margin-left: auto; }
.leg-acc-count { color: var(--color-text-tertiary); font-size: .8rem; white-space: nowrap; }
.leg-acc-actions svg { display: block; width: 18px; height: 18px; flex-shrink: 0; color: var(--color-text-tertiary); transition: transform var(--transition), color var(--transition); }
.leg-acc-card[open] .leg-acc-actions svg { transform: rotate(180deg); }
.leg-acc-body { background: color-mix(in srgb, var(--color-surface) 96%, var(--color-primary-bg)); }
.leg-acc-card[open] .leg-acc-body { border-top: 1px solid var(--color-border); }

/* Acordeão DENTRO do .table-container (hoje: Atas das Sessões) — vira lista contínua.
   Solto na página (Ordem do Dia), cada card precisa da própria moldura para se separar do
   fundo. Dentro do container, a moldura já é dele: repetir borda e raio em cada card desenha
   uma caixa dentro da outra, e o `gap` abre faixas de fundo que fatiam a lista sem motivo.
   Por isso a regra é ESCOPADA — não é uma preferência estética global, é consequência de
   onde a lista está.
   A borda fica só ENTRE os cards (`+`), nunca nas pontas: a toolbar já fecha em cima com
   `border-bottom` e a paginação embaixo com `border-top`. Uma borda no primeiro ou no último
   encostaria numa dessas e desenharia 2px onde o resto da tela tem 1. */
.table-container .leg-acc-list { gap: 0; }
.table-container .leg-acc-card { border: 0; border-radius: 0; }
.table-container .leg-acc-card + .leg-acc-card { border-top: 1px solid var(--color-border); }
.leg-acc-table-wrap { width: 100%; overflow-x: auto; }
.leg-acc-table { width: 100%; border-collapse: collapse; font-size: .84rem; }
.leg-acc-table th, .leg-acc-table td { padding: 11px 14px; border-bottom: 1px solid var(--color-border); vertical-align: top; text-align: left; }
.leg-acc-table thead th { background: var(--color-header); color: var(--color-text-tertiary); font-size: .72rem; font-weight: 700; letter-spacing: .02em; text-transform: uppercase; white-space: nowrap; }
.leg-acc-table tbody tr:hover td { background: var(--color-surface-hover); }
.leg-acc-table tbody tr:last-child td { border-bottom: 0; }
.leg-acc-item-title { color: var(--color-text); font-weight: 600; line-height: 1.35; }
.leg-acc-item-ementa { color: var(--color-text-muted); font-size: .82rem; line-height: 1.5; margin-top: 4px; }
.leg-acc-empty { padding: 20px; color: var(--color-text-muted); text-align: center; }

/* Execução das emendas — funil empenhado → liquidado → pago (dimensão 17).
   Uma cor só para as três barras: é o mesmo dinheiro em três estágios, não três categorias.
   A marca usa --chart-palette-1, o token de gráfico da casa (5,17:1 sobre o branco). No tema
   escuro a paleta de gráficos não tem passo próprio — herda o mesmo azul e fica em 3,47:1,
   acima do mínimo de 3:1 que a WCAG pede para MARCA gráfica (o texto ao lado usa tokens de
   texto, então nada de legível depende dessa cor). Passos escuros da paleta são dívida do
   design system, não desta tela. */
.emd-exec-chart { margin: 18px 0 0; }
.emd-exec-chart-titulo { font-size: .86rem; font-weight: 700; color: var(--color-text); display: block; margin-bottom: 12px; }
.emd-exec-chart-sub { display: block; font-size: .78rem; font-weight: 400; color: var(--color-text-muted); margin-top: 2px; }
.emd-exec-bars { display: flex; flex-direction: column; gap: 10px; }
.emd-exec-row { display: grid; grid-template-columns: minmax(120px, 1fr) minmax(0, 3fr) minmax(150px, auto); align-items: center; gap: 14px; }
.emd-exec-rotulo { font-size: .84rem; font-weight: 600; color: var(--color-text); }
.emd-exec-nota { display: block; font-size: .74rem; font-weight: 400; color: var(--color-text-muted); margin-top: 1px; }
/* Trilho recessivo: uma sombra do fundo, não uma moldura — a barra é que carrega o dado. */
.emd-exec-track { position: relative; height: 14px; border-radius: 999px; background: var(--color-surface-hover); overflow: hidden; }
/* Ponta arredondada só no fim do dado; a base fica reta, ancorada no zero. */
.emd-exec-bar { height: 100%; min-width: 3px; border-radius: 0 4px 4px 0; background: var(--chart-palette-1); }
.emd-exec-valor { font-size: .86rem; font-weight: 700; color: var(--color-text); text-align: right; font-variant-numeric: tabular-nums; }
.emd-exec-valor .emd-exec-nota { text-align: right; }
@media (max-width: 640px) {
    .emd-exec-row { grid-template-columns: 1fr auto; }
    .emd-exec-track { grid-column: 1 / -1; order: 3; }
}

/* Atas das sessões (PNTP 20.6). Reaproveitam o acordeão .leg-acc-* da Ordem do Dia; só o
   corpo é diferente, porque aqui o conteúdo é PROSA e não tabela. */
.ata-docs { display: flex; flex-wrap: wrap; gap: 8px; padding: 14px 16px 0; }
/* Medida de leitura: 70ch. Ata é o texto mais longo do portal, e uma linha que atravessa um
   monitor de 27" faz o olho perder onde recomeça — o motivo de jornal ter colunas. */
.ata-texto { max-width: 70ch; padding: 14px 16px; color: var(--color-text); font-size: .88rem; line-height: 1.65; text-align: justify; }
.ata-presenca { padding: 0 16px 16px; }
.ata-presenca-titulo { margin: 0 0 2px; font-size: .82rem; font-weight: 700; letter-spacing: .02em; text-transform: uppercase; color: var(--color-text-tertiary); }
.ata-presenca-resumo { margin: 0 0 10px; color: var(--color-text-muted); font-size: .84rem; }
.ata-presenca .leg-acc-table-wrap { border: 1px solid var(--color-border); border-radius: var(--radius-md); }
.leg-acc-body > .leg-none { margin: 14px 16px; }
.leg-vote { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.leg-vote-res { font-weight: 700; border-radius: 999px; padding: 2px 9px; font-size: .74rem; white-space: nowrap; }
.leg-vote-res.aprovado { color: var(--color-success); background: var(--color-success-bg); }
.leg-vote-res.rejeitado { color: var(--color-danger); background: var(--color-danger-bg); }
.leg-vote-res.neutro { color: var(--color-text-muted); background: var(--color-surface-hover); }
.leg-vote-nums { color: var(--color-text-tertiary); font-size: .8rem; white-space: nowrap; }

@media (max-width: 720px) {
    .leg-card-grid { grid-template-columns: 1fr; }
    /* Uma coluna: o divisor vertical não tem o que separar e viraria um risco na borda
       direita de cada card. A separação passa a ser só horizontal, do 2º card em diante. */
    .table-container .leg-card:nth-child(odd) { border-right: 0; }
    .table-container .leg-card:nth-child(n+2) { border-top: 1px solid var(--color-border); }
    .leg-card-meta { grid-template-columns: 1fr; }
    .leg-acc-summary { align-items: flex-start; flex-wrap: wrap; }
    .leg-acc-actions { width: 100%; justify-content: space-between; margin-left: 0; }
}

/* ============================================================
   EMPTY STATE
============================================================ */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 56px 24px;
    text-align: center;
    background: var(--color-surface);
    border: 1.5px dashed var(--color-border);
    border-radius: var(--radius-lg);
}

.empty-state-icon {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-lg);
    background: var(--color-header);
    border: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}

.empty-state-icon svg {
    width: 22px;
    height: 22px;
    stroke: var(--color-text-tertiary);
    fill: none;
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.empty-state-title {
    font-weight: 600;
    font-size: .95rem;
    margin-bottom: 5px;
}

.empty-state-desc {
    color: var(--color-text-secondary);
    font-size: .84rem;
    max-width: 280px;
    line-height: 1.55;
}

.empty-state-actions {
    margin-top: 18px;
    display: flex;
    gap: 8px;
}

/* ============================================================
   FILE UPLOADER
============================================================ */
.file-drop {
    border: 2px dashed var(--color-border);
    border-radius: var(--radius-lg);
    padding: 36px 24px;
    text-align: center;
    cursor: pointer;
    transition: border-color var(--transition), background var(--transition);
    background: var(--color-surface);
}

.file-drop:hover,
.file-drop.dragover {
    border-color: var(--color-primary);
    background: rgba(255, 94, 0, .03);
}

.file-drop-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    background: var(--color-header);
    border: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 14px;
}

.file-drop-icon svg {
    width: 20px;
    height: 20px;
    stroke: var(--color-text-tertiary);
    fill: none;
    stroke-width: 1.75;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.file-drop-title {
    font-size: .9rem;
    font-weight: 500;
    color: var(--color-text-muted);
    margin-bottom: 4px;
}

.file-drop-title strong {
    color: var(--color-primary);
    font-weight: 600;
}

.file-drop-hint {
    font-size: .76rem;
    color: var(--color-text-tertiary);
}

.file-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 10px;
}

.file-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    background: var(--color-header);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
}

.file-item-icon {
    width: 30px;
    height: 30px;
    border-radius: var(--radius-sm);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .85rem;
    flex-shrink: 0;
}

.file-item-name {
    flex: 1;
    font-size: .84rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--color-text-muted);
}

.file-item-size {
    font-size: .74rem;
    color: var(--color-text-tertiary);
    flex-shrink: 0;
}

.file-item-del {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--color-text-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    width: 22px;
    height: 22px;
    transition: background var(--transition), color var(--transition);
}

.file-item-del svg {
    width: 13px;
    height: 13px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
}

.file-item-del:hover {
    background: var(--color-danger-bg);
    color: var(--color-danger);
}

/* ============================================================
   FILTER BAR
============================================================ */
.filter-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 11px;
    border-radius: 99px;
    font-size: .8rem;
    border: 1px solid var(--color-border);
    background: var(--color-surface);
    cursor: pointer;
    transition: all var(--transition);
    color: var(--color-text-secondary);
    font-family: var(--font-base);
    font-weight: 500;
    letter-spacing: -.01em;
}

.filter-chip:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
}

.filter-chip.active {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: #fff;
}

.filter-chip-count {
    font-size: .7rem;
    padding: 1px 5px;
    border-radius: 99px;
    background: rgba(255, 255, 255, .22);
    font-weight: 600;
}

.filter-chip:not(.active) .filter-chip-count {
    background: var(--color-header);
    color: var(--color-text-tertiary);
}

/* ============================================================
   IMAGE PICKER
============================================================ */
.image-picker-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 8px;
}

.image-picker-item {
    position: relative;
    cursor: pointer;
    border-radius: var(--radius-md);
    overflow: hidden;
    aspect-ratio: 1;
    border: 2px solid transparent;
    transition: border-color var(--transition), transform var(--transition);
}

.image-picker-item:hover {
    transform: scale(1.02);
}

.image-picker-item.selected {
    border-color: var(--color-primary);
}

.image-picker-inner {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
}

.image-picker-check {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 20px;
    height: 20px;
    background: var(--color-primary);
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 4px rgba(0, 0, 0, .25);
}

.image-picker-check svg {
    width: 11px;
    height: 11px;
    stroke: #fff;
    fill: none;
    stroke-width: 2.5;
}

.image-picker-item.selected .image-picker-check {
    display: flex;
}

/* ============================================================
   INLINE CTA
============================================================ */
.inline-cta {
    background: linear-gradient(135deg, var(--color-primary-border) 0%, var(--color-primary-bg) 100%);
    border: 1px solid var(--color-primary-border);
    border-radius: var(--radius-lg);
    padding: 22px 24px;
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
}

.inline-cta-icon {
    width: 44px;
    height: 44px;
    background: var(--color-primary-bg);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.inline-cta-icon svg {
    width: 22px;
    height: 22px;
    color: var(--color-primary);
}

.inline-cta-content {
    flex: 1;
    min-width: 180px;
}

.inline-cta-title {
    font-weight: 700;
    font-size: .95rem;
    margin-bottom: 3px;
}

.inline-cta-desc {
    font-size: .82rem;
    color: var(--color-text-muted);
    line-height: 1.45;
}

.inline-cta-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

/* ============================================================
   CHARTS
============================================================ */
.chart-wrap {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 18px;
}

.chart-title {
    font-weight: 600;
    font-size: .86rem;
    color: var(--color-text-muted);
    margin-bottom: 16px;
    letter-spacing: -.01em;
}

.chart-wrap canvas {
    display: block;
    max-width: 100%;
}

.chart-grid {
    display: grid;
    grid-template-columns: minmax(280px, .85fr) minmax(360px, 1.15fr);
    gap: 16px;
}

.chart-card {
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    background: var(--color-surface);
    padding: 16px;
    min-width: 0;
}

.chart-heading-title {
    font-weight: 800;
    color: var(--color-text);
}

.chart-heading-subtitle {
    margin-top: 4px;
    color: var(--color-text-tertiary);
    font-size: .84rem;
}

.chart-donut-layout {
    display: grid;
    grid-template-columns: 170px 1fr;
    align-items: center;
    gap: 18px;
    margin-top: 18px;
}

.chart-donut {
    width: 170px;
    aspect-ratio: 1;
    border-radius: 50%;
    background: conic-gradient(var(--donut));
    position: relative;
}

.chart-donut::after {
    content: "";
    position: absolute;
    inset: 36px;
    border-radius: 50%;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
}

.chart-legend {
    display: grid;
    gap: 0;
}

.chart-legend-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    background: transparent;
    padding: 7px 8px;
    color: var(--color-text-muted);
    font-size: .86rem;
    text-align: left;
    transition: background .15s ease, border-color .15s ease, color .15s ease;
}

button.chart-legend-item {
    cursor: pointer;
}

.chart-legend-item:hover,
.chart-legend-item.is-active {
    border-color: var(--color-border);
    background: var(--color-header);
    color: var(--color-text);
}

.chart-legend-item span:first-child {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.chart-legend-item strong {
    flex: 0 0 auto;
}

.chart-swatch {
    width: 10px;
    height: 10px;
    border-radius: 2px;
    background: var(--swatch);
    flex: 0 0 auto;
}

.chart-line-wrap {
    position: relative;
}

.chart-line {
    width: 100%;
    height: 240px;
    margin-top: 12px;
}

.chart-line text {
    fill: var(--color-text-tertiary);
    font-size: 11px;
}

.chart-line .axis {
    stroke: var(--color-border);
    stroke-width: 1;
}

.chart-line .grid {
    stroke: var(--color-border);
    stroke-width: 1;
    opacity: .65;
}

.chart-line .line {
    fill: none;
    stroke: var(--chart-color, var(--chart-palette-1));
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.chart-line .point {
    fill: var(--chart-color, var(--chart-palette-1));
    stroke: var(--color-surface);
    stroke-width: 3;
    cursor: pointer;
}

.chart-tooltip {
    position: absolute;
    z-index: 5;
    min-width: 132px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-surface);
    color: var(--color-text);
    box-shadow: var(--shadow-lg);
    padding: 8px 10px;
    font-size: .78rem;
    pointer-events: none;
    transform: translate(-50%, calc(-100% - 10px));
}

.chart-tooltip strong {
    display: block;
    margin-top: 2px;
    font-size: .9rem;
}

@media (max-width: 860px) {
    .chart-grid {
        grid-template-columns: 1fr;
    }

    .chart-donut-layout {
        grid-template-columns: 1fr;
        justify-items: center;
    }

    .chart-legend {
        width: 100%;
    }
}

/* ============================================================
   PROGRESS STEPS
============================================================ */
.steps {
    display: flex;
    align-items: flex-start;
    position: relative;
}

.step {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

.step:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 17px;
    left: 50%;
    width: 100%;
    height: 2px;
    background: var(--color-border);
    z-index: 0;
    transition: background var(--transition-slow);
}

.step.done:not(:last-child)::after {
    background: var(--color-primary);
}

.step-circle {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 2px solid var(--color-border);
    background: var(--color-surface);
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .78rem;
    font-weight: 700;
    color: var(--color-text-tertiary);
    transition: all var(--transition-slow);
}

.step-circle svg {
    width: 14px;
    height: 14px;
    stroke: #fff;
    fill: none;
    stroke-width: 2.5;
}

.step.done .step-circle {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: #fff;
}

.step.active .step-circle {
    border-color: var(--color-primary);
    color: var(--color-primary);
    background: var(--color-surface);
    box-shadow: 0 0 0 3px rgba(255, 94, 0, .15);
}

.step-label {
    font-size: .74rem;
    margin-top: 7px;
    color: var(--color-text-tertiary);
    text-align: center;
    line-height: 1.3;
}

.step.done .step-label,
.step.active .step-label {
    color: var(--color-text-muted);
    font-weight: 500;
}

/* ============================================================
   SECTION HEADER (para tabela)
============================================================ */
.section-bar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 12px;
}

.section-bar-title {
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: -.025em;
    flex: 1;
    min-width: 120px;
}

.section-bar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

/* ============================================================
   TABLE
============================================================ */
.table-container {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.table-scroll {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .85rem;
}

.data-table thead th {
    background: var(--color-header);
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    font-size: .75rem;
    color: var(--color-text-secondary);
    white-space: nowrap;
    border-bottom: 1px solid var(--color-border);
    cursor: pointer;
    user-select: none;
    transition: background var(--transition);
    letter-spacing: .01em;
}

.data-table thead th:hover {
    background: var(--color-surface-hover);
}

.sort-icon {
    display: inline-flex;
    align-items: center;
    margin-left: 4px;
    opacity: .3;
    vertical-align: middle;
}

.sort-icon svg {
    width: 11px;
    height: 11px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
}

th.sorted-asc .sort-icon,
th.sorted-desc .sort-icon {
    opacity: 1;
    color: var(--color-primary);
}

.data-table tbody td {
    padding: 12px 16px;
    line-height: 1.45;
    border-bottom: 1px solid var(--color-border);
    vertical-align: middle;
    color: var(--color-text-muted);
}

/* Respiro nas pontas: conteúdo não cola na borda do container. */
.data-table thead th:first-child,
.data-table tbody td:first-child {
    padding-left: 20px;
}

.data-table thead th:last-child,
.data-table tbody td:last-child {
    padding-right: 20px;
}

.data-table th.text-right,
.data-table td.text-right {
    text-align: right;
}

.data-table th.nowrap,
.data-table td.nowrap {
    white-space: nowrap;
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

.data-table tbody tr:nth-child(even) td {
    background: var(--color-even);
}

.data-table tbody tr:hover td {
    background: var(--color-surface-hover);
}

.table-empty-row td {
    text-align: center;
    padding: 40px;
    color: var(--color-text-tertiary);
}

/* Table toolbar */
.table-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 12px 20px;
    border-bottom: 1px solid var(--color-border);
    flex-wrap: nowrap;
}

.table-toolbar-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
    flex: 1 1 auto;
    min-width: 0;
    margin-left: auto;
}

.table-toolbar-control {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: .78rem;
    color: var(--color-text-tertiary);
}

.table-toolbar-control .form-input {
    width: 74px;
    height: 32px;
    font-size: .8rem;
}

.table-toolbar-control .form-input.is-sm {
    width: 84px;
}

.table-toolbar-control .form-input.is-md {
    width: 128px;
}

.table-toolbar-search {
    position: relative;
    display: inline-flex;
    align-items: center;
    flex: 0 1 260px;
    min-width: 180px;
    max-width: 320px;
}

.table-toolbar-search-icon {
    position: absolute;
    left: 9px;
    color: var(--color-text-tertiary);
    display: flex;
    pointer-events: none;
}

.table-toolbar-search .form-input {
    padding-left: 32px;
    width: 100%;
    height: 32px;
    font-size: .8rem;
}

.table-toolbar-downloads {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

@media (max-width: 720px) {
    .table-toolbar {
        align-items: flex-start;
        flex-wrap: wrap;
    }

    .table-toolbar-actions {
        justify-content: flex-start;
        width: 100%;
        margin-left: 0;
    }

    .table-toolbar-search {
        width: 100%;
        flex-basis: 100%;
    }

    .table-toolbar-downloads,
    .table-toolbar-search .form-input {
        width: 100%;
    }

    .table-toolbar-downloads .btn {
        flex: 1 1 88px;
        justify-content: center;
    }
}

.table-tabs {
    display: flex;
    gap: 4px;
}

.table-tab {
    padding: 5px 12px;
    border-radius: 99px;
    font-size: .78rem;
    border: 1px solid var(--color-border);
    background: none;
    cursor: pointer;
    color: var(--color-text-secondary);
    transition: all var(--transition);
    font-family: var(--font-base);
    font-weight: 500;
}

.table-tab.active {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: #fff;
}

.table-tab:hover:not(.active) {
    background: var(--color-surface-hover);
    color: var(--color-text);
}

/* Pagination */
.pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    border-top: 1px solid var(--color-border);
    flex-wrap: wrap;
    gap: 8px;
    background: var(--color-header);
}

.pagination-info {
    font-size: .78rem;
    color: var(--color-text-tertiary);
}

.pagination-pages {
    display: flex;
    gap: 3px;
}

.page-btn {
    width: 30px;
    height: 30px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--color-border);
    background: var(--color-surface);
    cursor: pointer;
    font-size: .78rem;
    color: var(--color-text-secondary);
    transition: all var(--transition);
    font-family: var(--font-base);
    display: flex;
    align-items: center;
    justify-content: center;
}

.page-btn svg {
    width: 12px;
    height: 12px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
}

.page-btn:hover:not(:disabled):not(.active) {
    border-color: var(--color-primary);
    color: var(--color-primary);
}

.page-btn.active {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: #fff;
    font-weight: 600;
}

.page-btn:disabled {
    opacity: .35;
    cursor: not-allowed;
}

/* ============================================================
   BADGES
============================================================ */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 99px;
    font-size: .73rem;
    font-weight: 600;
    letter-spacing: .01em;
    white-space: nowrap;
}

.badge-default {
    background: var(--color-header);
    color: var(--color-text-secondary);
    border: 1px solid var(--color-border);
}

.badge-primary {
    background: rgba(26, 115, 232, .12);
    color: var(--color-primary);
}

.badge-success {
    background: var(--color-success-bg);
    color: var(--color-success);
}

.badge-warning {
    background: var(--color-warning-bg);
    color: var(--color-warning);
}

.badge-danger {
    background: var(--color-danger-bg);
    color: var(--color-danger);
}

.badge-info {
    background: var(--color-info-bg);
    color: var(--color-info);
}

.badge-dot::before {
    content: '';
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: currentColor;
    display: inline-block;
}

/* ============================================================
   BUTTONS
============================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 0 16px;
    height: 36px;
    border-radius: 999rem;
    border: 1px solid transparent;
    font-family: var(--font-base);
    font-size: .85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
    letter-spacing: -.01em;
    text-decoration: none;
    white-space: nowrap;
    flex-shrink: 0;
}

.btn svg {
    width: 15px;
    height: 15px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.75;
    stroke-linecap: round;
    stroke-linejoin: round;
    flex-shrink: 0;
}

.btn-xs {
    height: 26px;
    padding: 0 9px;
    font-size: .75rem;
}

.btn-sm {
    height: 30px;
    padding: 0 12px;
    font-size: .8rem;
}

.btn-lg {
    height: 42px;
    padding: 0 22px;
    font-size: .95rem;
}

.btn-xl {
    height: 48px;
    padding: 0 28px;
    font-size: 1rem;
}

.btn-square {
    padding: 0;
    width: 36px;
}

.btn-square.btn-sm {
    width: 30px;
}

.btn-square.btn-lg {
    width: 42px;
}

.btn-primary {
    background: var(--color-primary);
    color: #fff;
    border-color: var(--color-primary);
    box-shadow: 0 1px 3px rgba(26, 115, 232, .3), 0 1px 1px rgba(0, 0, 0, .08);
}

.btn-primary:hover {
    background: var(--color-primary-hover);
    border-color: var(--color-primary-hover);
    color: #fff;
}

.btn-primary:active {
    transform: scale(.95);
}

.btn-secondary {
    background: var(--color-surface);
    color: var(--color-text-muted);
    border-color: var(--color-border);
    box-shadow: var(--shadow-xs);
}

.btn-secondary:hover {
    background: var(--color-surface-hover);
    color: var(--color-text);
    border-color: rgba(0, 0, 0, .15);
}

.btn-ghost {
    background: transparent;
    color: var(--color-text-secondary);
    border-color: transparent;
}

.btn-ghost:hover {
    background: var(--color-surface-hover);
    color: var(--color-text);
}

.btn-success {
    background: var(--color-success);
    color: #fff;
    border-color: var(--color-success);
    box-shadow: 0 1px 3px rgba(22, 163, 74, .3);
}

.btn-success:hover {
    filter: brightness(1.08);
    color: #fff;
    transform: translateY(-1px);
}

.btn-danger {
    background: var(--color-danger);
    color: #fff;
    border-color: var(--color-danger);
    box-shadow: 0 1px 3px rgba(239, 68, 68, .3);
}

.btn-danger:hover {
    filter: brightness(1.08);
    color: #fff;
    transform: translateY(-1px);
}

.btn-warning {
    background: var(--color-warning);
    color: #fff;
    border-color: var(--color-warning);
    box-shadow: 0 1px 3px rgba(245, 158, 11, .3);
}

.btn-warning:hover {
    filter: brightness(1.08);
    color: #fff;
    transform: translateY(-1px);
}

.btn-outline {
    background: transparent;
    color: var(--color-primary);
    border-color: var(--color-primary);
}

.btn-outline:hover {
    background: var(--color-primary);
    color: #fff;
}

.btn:disabled {
    opacity: .45;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* Button Group */
.btn-group {
    display: inline-flex;
}

.btn-group .btn {
    border-radius: 0;
    border-right-width: 0;
}

.btn-group .btn:first-child {
    border-radius: var(--radius-md) 0 0 var(--radius-md);
}

.btn-group .btn:last-child {
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    border-right-width: 1px;
}

.btn-group .btn-primary+.btn-primary {
    border-left: 1px solid rgba(255, 255, 255, .2);
}

/* Utility buttons */
.util-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    height: 28px;
    padding: 0 10px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--color-border);
    background: var(--color-surface);
    color: var(--color-text-secondary);
    cursor: pointer;
    font-size: .78rem;
    font-family: var(--font-base);
    transition: all var(--transition);
    font-weight: 500;
}

.util-btn svg {
    width: 13px;
    height: 13px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.75;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.util-btn:hover {
    background: var(--color-surface-hover);
    color: var(--color-text);
}

.util-btn.destructive:hover {
    border-color: var(--color-danger);
    color: var(--color-danger);
    background: var(--color-danger-bg);
}

/* Social buttons */
.btn-social {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    height: 38px;
    padding: 0 16px;
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border);
    background: var(--color-surface);
    font-family: var(--font-base);
    font-size: .85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
    color: var(--color-text);
    letter-spacing: -.01em;
    box-shadow: var(--shadow-xs);
}

.btn-social svg {
    width: 17px;
    height: 17px;
    flex-shrink: 0;
}

.btn-social:hover {
    background: var(--color-surface-hover);
    box-shadow: var(--shadow-sm);
    transform: translateY(-1px);
}

/* ============================================================
   FORM CONTROLS
============================================================ */
.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    font-size: .8rem;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--color-text-muted);
    letter-spacing: -.01em;
}

.form-label-optional {
    font-weight: 400;
    color: var(--color-text-tertiary);
    margin-left: 4px;
}

.form-hint {
    font-size: .74rem;
    color: var(--color-text-tertiary);
    margin-top: 4px;
    line-height: 1.4;
}

.form-hint.error {
    color: var(--color-danger);
}

.form-hint.success {
    color: var(--color-success);
}

/* Input */
.input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.input-prefix-icon,
.input-suffix-icon {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: var(--color-text-tertiary);
    pointer-events: none;
    display: flex;
}

.input-prefix-icon {
    left: 11px;
}

.input-suffix-icon {
    right: 11px;
}

.input-prefix-icon svg,
.input-suffix-icon svg {
    width: 15px;
    height: 15px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.75;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.input-suffix-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: var(--color-text-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    padding: 3px;
    transition: color var(--transition), background var(--transition);
}

.input-suffix-btn svg {
    width: 15px;
    height: 15px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.75;
}

.input-suffix-btn:hover {
    color: var(--color-text);
    background: var(--color-surface-hover);
}

.form-input {
    width: 100%;
    height: 38px;
    padding: 0 12px;
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border);
    background: var(--color-surface);
    color: var(--color-text);
    font-family: var(--font-base);
    font-size: .88rem;
    outline: none;
    transition: border-color var(--transition), box-shadow var(--transition);
    letter-spacing: -.01em;
    appearance: none;
}

.form-input::placeholder {
    color: var(--color-text-tertiary);
}

.form-input:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(255, 94, 0, .1);
}

.form-input.has-prefix {
    padding-left: 34px;
}

.form-input.has-suffix {
    padding-right: 34px;
}

.form-input.state-error {
    border-color: var(--color-danger);
}

.form-input.state-error:focus {
    box-shadow: 0 0 0 3px rgba(239, 68, 68, .12);
}

.form-input.state-success {
    border-color: var(--color-success);
}

.form-input.state-success:focus {
    box-shadow: 0 0 0 3px rgba(22, 163, 74, .12);
}

/* Textarea */
.form-textarea {
    width: 100%;
    padding: 10px 12px;
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border);
    background: var(--color-surface);
    color: var(--color-text);
    font-family: var(--font-base);
    font-size: .88rem;
    outline: none;
    resize: vertical;
    min-height: 96px;
    transition: border-color var(--transition), box-shadow var(--transition);
    letter-spacing: -.01em;
    line-height: 1.5;
}

.form-textarea::placeholder {
    color: var(--color-text-tertiary);
}

.form-textarea:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(255, 94, 0, .1);
}

/* Select */
.form-select {
    width: 100%;
    height: 38px;
    padding: 0 32px 0 12px;
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border);
    background: var(--color-surface);
    color: var(--color-text);
    font-family: var(--font-base);
    font-size: .88rem;
    outline: none;
    appearance: none;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    transition: border-color var(--transition), box-shadow var(--transition);
    letter-spacing: -.01em;
}

.form-select:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(255, 94, 0, .1);
}

/* Checkbox & Radio */
.check-wrap,
.radio-wrap {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    cursor: pointer;
    margin-bottom: 8px;
    padding: 1px 0;
}

.check-input,
.radio-input {
    width: 16px;
    height: 16px;
    margin-top: 1px;
    accent-color: var(--color-primary);
    cursor: pointer;
    flex-shrink: 0;
}

.check-label,
.radio-label {
    font-size: .85rem;
    color: var(--color-text-muted);
    line-height: 1.4;
}

.check-label small,
.radio-label small {
    display: block;
    font-size: .75rem;
    color: var(--color-text-tertiary);
    margin-top: 1px;
}

/* Radio card */
.radio-card-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.radio-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: border-color var(--transition), background var(--transition);
    background: var(--color-surface);
}

.radio-card:hover {
    background: var(--color-surface-hover);
}

.radio-card.selected {
    border-color: var(--color-primary);
    background: rgba(255, 94, 0, .03);
}

.radio-card-body {
    flex: 1;
}

.radio-card-title {
    font-size: .87rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}

.radio-card-desc {
    font-size: .76rem;
    color: var(--color-text-tertiary);
    margin-top: 2px;
}

/* Toggle */
.toggle-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.toggle-input {
    display: none;
}

.toggle-track {
    width: 40px;
    height: 22px;
    border-radius: 99px;
    background: var(--color-border);
    position: relative;
    transition: background var(--transition-slow);
    flex-shrink: 0;
    border: 1.5px solid transparent;
}

.toggle-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #fff;
    position: absolute;
    top: 1px;
    left: 1px;
    transition: transform var(--transition-slow), box-shadow var(--transition);
    box-shadow: 0 1px 4px rgba(0, 0, 0, .25);
}

.toggle-input:checked+.toggle-track {
    background: var(--color-primary);
}

.toggle-input:checked+.toggle-track .toggle-thumb {
    transform: translateX(18px);
}

.toggle-label {
    font-size: .86rem;
    color: var(--color-text-muted);
}

/* Slider */
.form-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 4px;
    border-radius: 99px;
    background: var(--color-border);
    outline: none;
    cursor: pointer;
}

.form-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--color-primary);
    cursor: pointer;
    box-shadow: 0 0 0 3px rgba(255, 94, 0, .18), 0 1px 3px rgba(0, 0, 0, .2);
    transition: box-shadow var(--transition);
}

.form-slider::-webkit-slider-thumb:hover {
    box-shadow: 0 0 0 5px rgba(255, 94, 0, .2), 0 1px 3px rgba(0, 0, 0, .2);
}

.form-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--color-primary);
    cursor: pointer;
    border: none;
    box-shadow: 0 0 0 3px rgba(255, 94, 0, .18);
}

.slider-labels {
    display: flex;
    justify-content: space-between;
    font-size: .72rem;
    color: var(--color-text-tertiary);
    margin-top: 5px;
}

/* Progress bar */
.progress-track {
    height: 5px;
    border-radius: 99px;
    background: var(--color-border);
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    border-radius: 99px;
    background: var(--color-primary);
    transition: width 500ms cubic-bezier(.4, 0, .2, 1);
}

.progress-fill.success {
    background: var(--color-success);
}

.progress-fill.warning {
    background: var(--color-warning);
}

.progress-fill.danger {
    background: var(--color-danger);
}

.progress-fill.info {
    background: var(--color-info);
}

/* Rich text editor */
.rte {
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.rte-toolbar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 1px;
    padding: 6px 8px;
    border-bottom: 1px solid var(--color-border);
    background: var(--color-header);
}

.rte-btn {
    width: 28px;
    height: 28px;
    border: none;
    background: none;
    cursor: pointer;
    border-radius: var(--radius-sm);
    color: var(--color-text);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background var(--transition), color var(--transition);
    font-size: .84rem;
    font-weight: 700;
    font-family: var(--font-base);
}

.rte-btn svg {
    width: 14px;
    height: 14px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.75;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.rte-btn:hover,
.rte-btn.active {
    background: var(--color-surface-hover);
    color: var(--color-primary);
}

.rte-sep {
    width: 1px;
    height: 18px;
    background: var(--color-border);
    margin: 0 3px;
}

.rte-body {
    min-height: 110px;
    padding: 12px;
    background: var(--color-surface);
    outline: none;
    font-family: var(--font-base);
    font-size: .88rem;
    line-height: 1.6;
    color: var(--color-text);
}

/* Multi-select */
.multi-select {
    position: relative;
}

.ms-trigger {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 5px;
    min-height: 38px;
    padding: 5px 10px;
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border);
    background: var(--color-surface);
    cursor: pointer;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.ms-trigger:focus-within,
.ms-trigger.open {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(255, 94, 0, .1);
}

.ms-placeholder {
    font-size: .88rem;
    color: var(--color-text-tertiary);
    flex: 1;
    pointer-events: none;
}

.ms-arrow {
    margin-left: auto;
    color: var(--color-text-tertiary);
    flex-shrink: 0;
    transition: transform var(--transition);
}

.ms-arrow svg {
    width: 14px;
    height: 14px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
}

.ms-trigger.open .ms-arrow {
    transform: rotate(180deg);
}

.ms-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 7px;
    border-radius: 99px;
    font-size: .75rem;
    font-weight: 500;
    background: rgba(255, 94, 0, .12);
    color: var(--color-primary);
    border: 1px solid rgba(255, 94, 0, .2);
}

.ms-tag-del {
    background: none;
    border: none;
    cursor: pointer;
    color: inherit;
    padding: 0;
    line-height: 1;
    font-size: .85rem;
    opacity: .7;
    display: flex;
    align-items: center;
    transition: opacity var(--transition);
}

.ms-tag-del:hover {
    opacity: 1;
}

.ms-dropdown {
    position: absolute;
    top: calc(100% + 5px);
    left: 0;
    right: 0;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    z-index: 300;
    max-height: 210px;
    overflow-y: auto;
    padding: 4px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-4px);
    transition: all var(--transition);
}

.ms-dropdown.open {
    opacity: 1;
    visibility: visible;
    transform: none;
}

.ms-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: .85rem;
    color: var(--color-text-muted);
    transition: background var(--transition);
}

.ms-option:hover {
    background: var(--color-surface-hover);
}

.ms-option input[type="checkbox"] {
    accent-color: var(--color-primary);
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

/* Tags input */
.tags-field {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 5px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 7px 10px;
    background: var(--color-surface);
    min-height: 38px;
    cursor: text;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.tags-field:focus-within {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(255, 94, 0, .1);
}

.tag-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 99px;
    font-size: .76rem;
    font-weight: 500;
    background: var(--color-header);
    border: 1px solid var(--color-border);
    color: var(--color-text-muted);
}

.tag-item.primary {
    background: rgba(255, 94, 0, .1);
    border-color: rgba(255, 94, 0, .2);
    color: var(--color-primary);
}

.tag-del {
    background: none;
    border: none;
    cursor: pointer;
    color: inherit;
    padding: 0;
    font-size: .9rem;
    line-height: 1;
    opacity: .6;
    display: flex;
    align-items: center;
    transition: opacity var(--transition);
}

.tag-del:hover {
    opacity: 1;
}

.tags-input {
    border: none;
    background: none;
    outline: none;
    font-family: var(--font-base);
    font-size: .86rem;
    color: var(--color-text);
    flex: 1;
    min-width: 80px;
}

.tags-input::placeholder {
    color: var(--color-text-tertiary);
}

/* Tooltip */
.tooltip-wrap {
    position: relative;
    display: inline-flex;
}

.tooltip {
    position: absolute;
    bottom: calc(100% + 7px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--color-text);
    color: var(--color-bg);
    padding: 5px 10px;
    border-radius: var(--radius-sm);
    font-size: .74rem;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity var(--transition);
    z-index: 1000;
    letter-spacing: 0;
}

.tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: var(--color-text);
}

.tooltip-wrap:hover .tooltip {
    opacity: 1;
}

/* Generic dropdown */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-panel {
    position: absolute;
    top: calc(100% + 5px);
    left: 0;
    min-width: 170px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-4px);
    transition: all var(--transition);
    z-index: 300;
    overflow: hidden;
    padding: 4px;
}

.dropdown-panel.open {
    opacity: 1;
    visibility: visible;
    transform: none;
}

/* Verification code */
.verify-group {
    display: flex;
    align-items: center;
    gap: 6px;
}

.verify-sep {
    width: 12px;
    height: 2px;
    background: var(--color-border);
    border-radius: 1px;
    flex-shrink: 0;
}

.verify-input {
    width: 42px;
    height: 50px;
    text-align: center;
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius-md);
    font-size: 1.3rem;
    font-weight: 700;
    background: var(--color-surface);
    color: var(--color-text);
    outline: none;
    transition: border-color var(--transition), box-shadow var(--transition);
    font-family: var(--font-mono);
}

.verify-input:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(255, 94, 0, .12);
}

.verify-input.filled {
    border-color: var(--color-success);
    background: var(--color-success-bg);
}

/* Video player */
.video-player {
    background: #000;
    border-radius: var(--radius-lg);
    overflow: hidden;
    position: relative;
    aspect-ratio: 16 / 9;
}

.video-bg {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0f1117 0%, #1a1a2e 50%, #0d1117 100%);
    position: relative;
}

.video-bg::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at center, rgba(255, 94, 0, .08) 0%, transparent 70%);
}

.video-play-btn {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: rgba(255, 94, 0, .9);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    transition: transform var(--transition), background var(--transition), box-shadow var(--transition);
    box-shadow: 0 4px 24px rgba(255, 94, 0, .45);
    position: relative;
    z-index: 1;
}

.video-play-btn svg {
    width: 26px;
    height: 26px;
    fill: #fff;
    margin-left: 3px;
}

.video-play-btn:hover {
    transform: scale(1.07);
    background: var(--color-primary);
    box-shadow: 0 6px 30px rgba(255, 94, 0, .6);
}

.video-controls {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, .75));
    padding: 24px 14px 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    opacity: 0;
    transition: opacity var(--transition-slow);
}

.video-player:hover .video-controls {
    opacity: 1;
}

.video-progress {
    flex: 1;
    height: 3px;
    background: rgba(255, 255, 255, .25);
    border-radius: 99px;
    cursor: pointer;
    position: relative;
}

.video-progress-fill {
    height: 100%;
    background: var(--color-primary);
    border-radius: 99px;
    pointer-events: none;
}

.video-time {
    font-size: .72rem;
    color: rgba(255, 255, 255, .65);
    font-family: var(--font-mono);
}

.vid-ctrl-btn {
    background: none;
    border: none;
    color: rgba(255, 255, 255, .8);
    cursor: pointer;
    display: flex;
    align-items: center;
    padding: 3px;
    transition: color var(--transition);
    border-radius: 4px;
}

.vid-ctrl-btn svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.75;
}

.vid-ctrl-btn:hover {
    color: #fff;
}

/* ============================================================
   MODAL
============================================================ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .45);
    z-index: 4000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.modal-overlay.open {
    display: flex;
}

.modal {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    width: 100%;
    max-width: 490px;
    max-height: 90vh;
    overflow-y: auto;
    animation: modal-in 200ms cubic-bezier(.34, 1.56, .64, 1);
}

@keyframes modal-in {
    from {
        opacity: 0;
        transform: scale(.96) translateY(8px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px;
    border-bottom: 1px solid var(--color-border);
    gap: 12px;
}

.modal-title {
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: -.02em;
}

.modal-close {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--color-text-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: var(--radius-sm);
    transition: background var(--transition), color var(--transition);
}

.modal-close svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
}

.modal-close:hover {
    background: var(--color-surface-hover);
    color: var(--color-text);
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    padding: 14px 20px;
    border-top: 1px solid var(--color-border);
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    background: var(--color-even);
}

/* ============================================================
   PESQUISA DE SATISFAÇÃO (modal global — PNTP 15.6)
============================================================ */
/* Estrelas: radios (submissão + teclado + funciona sem JS) desenhados com o
   ícone `star` do rickiezera/icons. Os inputs vêm em ordem decrescente (5→1) e
   o flex row-reverse os exibe de 1 a 5 — é o que permite acender as estrelas à
   esquerda da apontada/escolhida só com CSS (`:hover ~ label`, `:checked ~ label`). */
.ps-stars {
    display: flex;
    flex-direction: row-reverse;
    justify-content: flex-end;
    gap: 6px;
    margin-bottom: 6px;
}

.ps-stars input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.ps-stars label {
    display: inline-flex;
    padding: 2px;
    border-radius: var(--radius-sm);
    color: var(--color-text-tertiary);
    cursor: pointer;
    transition: color var(--transition), transform var(--transition);
}

.ps-stars label svg {
    width: 30px;
    height: 30px;
    stroke: currentColor;
    stroke-width: 1.5;
    fill: none;
    transition: fill var(--transition);
}

/* Acesa = contorno e miolo amarelos. Vale para a nota escolhida... */
.ps-stars input:checked ~ label {
    color: var(--color-warning);
}

.ps-stars input:checked ~ label svg {
    fill: currentColor;
}

/* ...mas, com o mouse sobre o grupo, a escolha anterior apaga: quem manda é o hover,
   senão as estrelas acima da apontada ficariam acesas. As duas regras abaixo têm a
   mesma especificidade da de cima — a ordem no arquivo é que decide. */
.ps-stars:hover input:checked ~ label {
    color: var(--color-text-tertiary);
}

.ps-stars:hover input:checked ~ label svg {
    fill: none;
}

.ps-stars:hover label:hover,
.ps-stars:hover label:hover ~ label {
    color: var(--color-warning);
}

.ps-stars:hover label:hover svg,
.ps-stars:hover label:hover ~ label svg {
    fill: currentColor;
}

.ps-stars label:hover {
    transform: scale(1.12);
}

.ps-stars input:focus-visible + label {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

.ps-nota-hint {
    font-size: .8rem;
    color: var(--color-text-secondary);
    min-height: 1.2em;
}

/* ============================================================
   AUTH
============================================================ */
.auth-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    padding: 36px 32px;
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow-md);
}

.auth-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 22px;
}

.auth-logo-mark {
    width: 46px;
    height: 46px;
    background: var(--color-primary);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(255, 94, 0, .35);
}

.auth-logo-mark svg {
    width: 26px;
    height: 26px;
    stroke: #fff;
    fill: none;
    stroke-width: 1.75;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.auth-title {
    font-size: 1.4rem;
    font-weight: 800;
    text-align: center;
    letter-spacing: -.04em;
    margin-bottom: 3px;
}

.auth-sub {
    text-align: center;
    color: var(--color-text-tertiary);
    font-size: .84rem;
    margin-bottom: 24px;
}

.auth-footer {
    text-align: center;
    margin-top: 18px;
    font-size: .82rem;
    color: var(--color-text-tertiary);
}

.pw-strength-track {
    height: 3px;
    border-radius: 99px;
    background: var(--color-border);
    margin-top: 6px;
    overflow: hidden;
}

.pw-strength-fill {
    height: 100%;
    border-radius: 99px;
    transition: width .35s, background .35s;
}

@keyframes fade-in {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* ============================================================
   RESPONSIVE
============================================================ */
@media (max-width: 860px) {
    .grid-2 {
        grid-template-columns: 1fr;
    }

    .grid-3 {
        grid-template-columns: 1fr 1fr;
    }

    .grid-4 {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 600px) {
    .main-wrapper {
        padding: 24px 14px;
    }

    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
    }

    .auth-card {
        padding: 24px 18px;
    }

    .steps {
        flex-direction: column;
        gap: 4px;
    }

    .step::after {
        display: none;
    }

    .step {
        flex-direction: row;
        gap: 12px;
    }

    .step-label {
        margin-top: 0;
    }

    #notify-container {
        width: calc(100vw - 24px);
        right: 12px;
    }
}

footer address {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.ft-root {
    background: var(--color-header);
    color: var(--color-text);
    border-top: 1px solid var(--color-border);
    font-size: .875rem;
    line-height: 1.6;
    padding: 0;
    margin: 0
}

.ft-main {
    max-width: 1440px;
    margin: 0 auto;
    padding: 48px 24px 32px;
    display: grid;
    grid-template-columns: 1.6fr 1fr 1.2fr;
    gap: 40px
}

.ft-col-title {
    font-size: .6875rem;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--color-text);
    margin-bottom: 14px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--color-border)
}

.ft-brand-name {
    font-size: 1rem;
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: 2px
}

.ft-cnpj {
    font-size: .875rem;
    color: var(--color-text);
}

.ft-addr {
    font-size: .8125rem;
    color: var(--color-text);
    line-height: 1.2;
    display: flex;
    align-items: center;
    justify-content: flex-start;
}

.ft-addr svg {
    width: 1rem;
    height: 1rem;
    vertical-align: -2px;
    margin-right: 6px;
}

.ft-contact-row {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: .8125rem;
    color: var(--color-text);
}

.ft-contact-row svg {
    width: .875rem;
    height: .875rem;
    color: var(--color-text);
    flex-shrink: 0
}

.ft-contact-row a {
    color: var(--color-text);
    text-decoration: none
}

.ft-contact-row a:hover {
    color: #5cb8ff
}

.ft-hours {
    margin-top: 10px;
    font-size: .75rem;
    color: var(--color-text);
    display: flex;
    align-items: flex-start;
    gap: 6px
}

.ft-hours svg {
    width: .875rem;
    height: .875rem;
    margin-top: 1px;
    flex-shrink: 0
}

.ft-links {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 2px
}

.ft-links li a {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--color-text);
    text-decoration: none;
    padding: 5px 0;
    font-size: .8125rem;
    border-radius: 4px;
    transition: color .15s
}

.ft-links li a:hover {
    color: var(--color-text-secondary)
}

.ft-links li a svg {
    width: .875rem;
    height: .875rem;
    color: var(--color-text);
    flex-shrink: 0;
    width: 16px;
    text-align: center
}

.ft-social-row {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    flex-wrap: wrap
}

.ft-social-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 6px;
    background: rgba(255, 255, 255, .06);
    border: 1px solid var(--color-border);
    color: var(--color-text);
    text-decoration: none;
    transition: background .15s, color .15s;
}

.ft-social-btn:hover {
    color: var(--color-text);
}

.ft-social-btn svg {
    width: 24px;
    height: 24px
}

.ft-update-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 14px;
    padding: 8px 16px;
    border-radius: 99px;
    background: var(--color-success-bg);
    font-size: .6875rem;
    color: var(--color-success);
    font-weight: 500;
}

.ft-update-badge svg {
    width: .75rem;
    height: .75rem
}

.ft-sep {
    border: none;
    border-top: 1px solid var(--color-border);
    margin: 0
}

.ft-bottom {
    max-width: 1440px;
    margin: 0 auto;
    padding: 16px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    font-size: .875rem;
}

.ft-copyrights {
    display: flex;
    flex-direction: column;
    gap: 2px
}

.ft-copy {
    color: var(--color-text)
}

.ft-copy a {
    color: var(--color-text);
    text-decoration: none
}

.ft-copy a:hover {
    color: var(--color-text-secondary)
}

.ft-bottom-links {
    display: flex;
    align-items: center;
    gap: 0;
    flex-wrap: wrap
}

.ft-bottom-links a {
    color: var(--color-text);
    text-decoration: none;
    padding: 3px 10px;
    border-right: 1px solid var(--color-border);
    white-space: nowrap;
    transition: color .15s
}

.ft-bottom-links a:last-child {
    border-right: none
}

.ft-bottom-links a:hover {
    color: var(--color-text-secondary)
}

.ft-logo-box {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px
}

.ft-brand-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: flex-start;
    justify-content: center;
    line-height: 1.2;
}

.ft-logo-placeholder {
    width: 56px;
    height: 56px;
    background: #fff;
    border-radius: 12px;
    border: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0
}

.ft-logo-placeholder img {
    width: 48px;
    height: 48px;
    object-fit: contain;
}

.ft-col {
    display: grid;
    gap: 28px
}

@media(max-width:780px) {
    .ft-main {
        grid-template-columns: 1fr 1fr;
        gap: 28px
    }

    .ft-social-btn:hover {
        grid-column: 1/-1;
        grid-template-columns: 1fr 1fr
    }
}

@media(max-width:520px) {
    .ft-main {
        grid-template-columns: 1fr;
        padding: 32px 16px 24px;
        gap: 24px
    }

    .ft-col {
        grid-template-columns: 1fr
    }

    .ft-bottom {
        flex-direction: column;
        align-items: flex-start;
        padding: 14px 16px
    }

    .ft-bottom-links {
        flex-direction: column;
        gap: 0;
        align-items: flex-start;
    }

    .ft-bottom-links a {
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, .06);
        padding: 6px 0
    }

    .ft-bottom-links a:last-child {
        border-bottom: none
    }
}

.hero {
    background: linear-gradient(135deg, var(--color-primary) 0%, #0a2f6a 100%);
    border-radius: var(--radius-xl);
    padding: 48px 40px;
    color: #fff;
    position: relative;
    overflow: hidden;
    margin-bottom: 40px;
}

.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 60% 80% at 90% 50%, rgba(255, 255, 255, .06) 0%, transparent 70%),
        url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    pointer-events: none;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 5px 13px;
    border-radius: 99px;
    background: rgba(255, 255, 255, .12);
    border: 1px solid rgba(255, 255, 255, .18);
    font-size: .74rem;
    font-weight: 600;
    letter-spacing: .05em;
    text-transform: uppercase;
    margin-bottom: 20px;
    color: rgba(255, 255, 255, .9);
}

.hero-badge svg {
    width: 13px;
    height: 13px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.75;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.hero-title {
    font-size: clamp(1.5rem, 3vw, 2.2rem);
    font-weight: 800;
    letter-spacing: -.04em;
    line-height: 1.15;
    margin-bottom: 14px;
    color: #fff;
}

.hero-desc {
    font-size: .96rem;
    line-height: 1.7;
    color: rgba(255, 255, 255, .78);
    max-width: 640px;
}

.hero-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 28px;
}

.legal-meta-pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 6px 13px;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, .1);
    border: 1px solid rgba(255, 255, 255, .15);
    font-size: .78rem;
    font-weight: 500;
    color: rgba(255, 255, 255, .85);
}

.legal-meta-pill svg {
    width: 13px;
    height: 13px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.75;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* ── Layout ── */
.legal-layout {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 28px;
    align-items: start;
}

/* ── Table of contents ── */
.legal-toc {
    position: sticky;
    top: calc(var(--header-h) + 16px);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.legal-toc-header {
    padding: 13px 16px;
    border-bottom: 1px solid var(--color-border);
    background: var(--color-header);
    font-weight: 700;
    font-size: .78rem;
    color: var(--color-text-secondary);
    letter-spacing: .05em;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 7px;
}

.legal-toc-header svg {
    width: 13px;
    height: 13px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.75;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.legal-toc-list {
    list-style: none;
    padding: 8px 0;
    margin: 0;
}

.legal-toc-item a {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 7px 16px;
    font-size: .8rem;
    color: var(--color-text-secondary);
    text-decoration: none;
    transition: background var(--transition), color var(--transition);
    line-height: 1.35;
}

.legal-toc-item a:hover {
    background: var(--color-surface-hover);
    color: var(--color-primary);
}

.legal-toc-item a.active {
    color: var(--color-primary);
    font-weight: 600;
    background: rgba(0, 63, 136, .05);
}

.toc-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 4px;
    background: var(--color-header);
    border: 1px solid var(--color-border);
    font-size: .64rem;
    font-weight: 700;
    color: var(--color-text-tertiary);
    flex-shrink: 0;
    font-family: var(--font-mono);
}

.legal-toc-item a.active .toc-num {
    background: rgba(0, 63, 136, .12);
    border-color: rgba(0, 63, 136, .2);
    color: var(--color-primary);
}

/* ── Article ── */
.legal-article {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.legal-article-header {
    padding: 22px 28px;
    border-bottom: 1px solid var(--color-border);
    background: var(--color-header);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.legal-article-title {
    font-weight: 700;
    font-size: 1.1rem;
    letter-spacing: -.025em;
}

.legal-article-body {
    padding: 0;
}

/* ── Sections ── */
.legal-section {
    padding: 28px 28px 0;
    scroll-margin-top: calc(var(--header-h) + 24px);
}

.legal-section:last-of-type {
    padding-bottom: 28px;
}

.legal-section+.legal-section {
    border-top: 1px solid var(--color-border);
    margin-top: 28px;
}

.legal-section-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: var(--radius-sm);
    background: rgba(0, 63, 136, .08);
    border: 1px solid rgba(0, 63, 136, .15);
    font-size: .72rem;
    font-weight: 800;
    color: var(--color-primary);
    font-family: var(--font-mono);
    flex-shrink: 0;
}

.legal-section-heading {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}

.legal-section-title {
    font-size: .98rem;
    font-weight: 700;
    letter-spacing: -.02em;
    color: var(--color-text);
}

.legal-section-body p {
    font-size: .88rem;
    line-height: 1.75;
    color: var(--color-text-muted);
    margin-bottom: 12px;
}

.legal-section-body p:last-child {
    margin-bottom: 0;
}

.legal-section-body ul {
    list-style: none;
    padding: 0;
    margin: 0 0 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.legal-section-body ul li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: .88rem;
    line-height: 1.65;
    color: var(--color-text-muted);
    padding: 10px 14px;
    background: var(--color-header);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
}

.legal-section-body ul li::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--color-primary);
    flex-shrink: 0;
    margin-top: 8px;
    opacity: .6;
}

/* ── Highlight box ── */
.legal-highlight {
    background: rgba(0, 63, 136, .04);
    border: 1px solid rgba(0, 63, 136, .12);
    border-left: 3px solid var(--color-primary);
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    padding: 14px 16px;
    font-size: .85rem;
    line-height: 1.65;
    color: var(--color-text-muted);
    margin: 14px 0;
}

.legal-highlight strong {
    color: var(--color-primary);
}

/* ── Footer ── */
.legal-article-footer {
    padding: 16px 28px;
    border-top: 1px solid var(--color-border);
    background: var(--color-even);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
}

.legal-update-note {
    font-size: .78rem;
    color: var(--color-text-tertiary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.legal-update-note svg {
    width: 13px;
    height: 13px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.75;
    stroke-linecap: round;
    stroke-linejoin: round;
    flex-shrink: 0;
}

/* ── Responsive ── */
@media (max-width: 860px) {
    .legal-layout {
        grid-template-columns: 1fr;
    }

    .legal-toc {
        position: static;
    }
}

@media (max-width: 600px) {
    .hero {
        padding: 30px 20px;
    }

    .hero-title {
        font-size: 1.4rem;
    }

    .legal-section {
        padding: 20px 18px 0;
    }

    .legal-section:last-of-type {
        padding-bottom: 20px;
    }

    .legal-article-header,
    .legal-article-footer {
        padding: 16px 18px;
    }
}

.hero {
    background: linear-gradient(135deg, var(--color-primary) 0%, #0a2f6a 100%);
    border-radius: var(--radius-xl);
    padding: 48px 40px;
    color: #fff;
    position: relative;
    overflow: hidden;
    margin-bottom: 40px;
}

.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 60% 80% at 90% 50%, rgba(255, 255, 255, .06) 0%, transparent 70%),
        url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    pointer-events: none;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 5px 13px;
    border-radius: 99px;
    background: rgba(255, 255, 255, .12);
    border: 1px solid rgba(255, 255, 255, .18);
    font-size: .74rem;
    font-weight: 600;
    letter-spacing: .05em;
    text-transform: uppercase;
    margin-bottom: 20px;
    color: rgba(255, 255, 255, .9);
}

.hero-badge svg {
    width: 13px;
    height: 13px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.75;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.hero-title {
    font-size: clamp(1.5rem, 3vw, 2.2rem);
    font-weight: 800;
    letter-spacing: -.04em;
    line-height: 1.15;
    margin-bottom: 14px;
    color: #fff;
}

.hero-desc {
    font-size: .96rem;
    line-height: 1.7;
    color: rgba(255, 255, 255, .78);
    max-width: 640px;
}

.hero-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 28px;
}

.legal-meta-pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 6px 13px;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, .1);
    border: 1px solid rgba(255, 255, 255, .15);
    font-size: .78rem;
    font-weight: 500;
    color: rgba(255, 255, 255, .85);
}

.legal-meta-pill svg {
    width: 13px;
    height: 13px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.75;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* ── Layout ── */
.legal-layout {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 28px;
    align-items: start;
}

/* ── Sidebar (alphabet nav) ── */
.legal-toc {
    position: sticky;
    top: calc(var(--header-h) + 16px);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.legal-toc-header {
    padding: 13px 16px;
    border-bottom: 1px solid var(--color-border);
    background: var(--color-header);
    font-weight: 700;
    font-size: .78rem;
    color: var(--color-text-secondary);
    letter-spacing: .05em;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 7px;
}

.legal-toc-header svg {
    width: 13px;
    height: 13px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.75;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.hero {
    background: linear-gradient(135deg, var(--color-primary) 0%, #0a2f6a 100%);
    border-radius: var(--radius-xl);
    padding: 48px 40px;
    color: #fff;
    position: relative;
    overflow: hidden;
    margin-bottom: 40px;
}

.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 60% 80% at 90% 50%, rgba(255, 255, 255, .06) 0%, transparent 70%),
        url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    pointer-events: none;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 5px 13px;
    border-radius: 99px;
    background: rgba(255, 255, 255, .12);
    border: 1px solid rgba(255, 255, 255, .18);
    font-size: .74rem;
    font-weight: 600;
    letter-spacing: .05em;
    text-transform: uppercase;
    margin-bottom: 20px;
    color: rgba(255, 255, 255, .9);
}

.hero-badge svg {
    width: 13px;
    height: 13px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.75;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.hero-title {
    font-size: clamp(1.5rem, 3vw, 2.2rem);
    font-weight: 800;
    letter-spacing: -.04em;
    line-height: 1.15;
    margin-bottom: 14px;
    color: #fff;
}

.hero-desc {
    font-size: .96rem;
    line-height: 1.7;
    color: rgba(255, 255, 255, .78);
    max-width: 640px;
}

.hero-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 28px;
}

.legal-meta-pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 6px 13px;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, .1);
    border: 1px solid rgba(255, 255, 255, .15);
    font-size: .78rem;
    font-weight: 500;
    color: rgba(255, 255, 255, .85);
}

.legal-meta-pill svg {
    width: 13px;
    height: 13px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.75;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* ── Two-column layout ── */
.legal-layout {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 28px;
    align-items: start;
}

/* ── Sidebar / TOC ── */
.legal-toc {
    position: sticky;
    top: calc(var(--header-h) + 16px);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.legal-toc-header {
    padding: 13px 16px;
    border-bottom: 1px solid var(--color-border);
    background: var(--color-header);
    font-weight: 700;
    font-size: .78rem;
    color: var(--color-text-secondary);
    letter-spacing: .05em;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 7px;
}

.legal-toc-header svg {
    width: 13px;
    height: 13px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.75;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* TOC list (Termos / Política) */
.legal-toc-list {
    list-style: none;
    padding: 8px 0;
    margin: 0;
}

.legal-toc-item a {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 7px 16px;
    font-size: .8rem;
    color: var(--color-text-secondary);
    text-decoration: none;
    transition: background var(--transition), color var(--transition);
    line-height: 1.35;
}

.legal-toc-item a:hover {
    background: var(--color-surface-hover);
    color: var(--color-primary);
}

.legal-toc-item a.active {
    color: var(--color-primary);
    font-weight: 600;
    background: var(--color-primary-bg);
}

.toc-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 4px;
    background: var(--color-header);
    border: 1px solid var(--color-border);
    font-size: .64rem;
    font-weight: 700;
    color: var(--color-text-tertiary);
    flex-shrink: 0;
    font-family: var(--font-mono);
}

.legal-toc-item a.active .toc-num {
    background: var(--color-primary-bg);
    border-color: var(--color-primary-border);
    color: var(--color-primary);
}

/* TOC count badge */
.toc-count {
    margin-left: auto;
    font-size: .68rem;
    font-weight: 600;
    padding: 1px 7px;
    border-radius: 99px;
    background: var(--color-header);
    border: 1px solid var(--color-border);
    color: var(--color-text-tertiary);
    letter-spacing: 0;
}

/* ── Glossary: search inside sidebar ── */
.glossary-search-wrap {
    padding: 10px 10px 6px;
    border-bottom: 1px solid var(--color-border);
    position: relative;
}

.glossary-search-wrap svg {
    position: absolute;
    left: 19px;
    top: 50%;
    transform: translateY(-50%);
    width: 13px;
    height: 13px;
    stroke: var(--color-text-tertiary);
    fill: none;
    stroke-width: 1.75;
    stroke-linecap: round;
    stroke-linejoin: round;
    pointer-events: none;
    margin-top: 2px;
}

.glossary-search {
    width: 100%;
    height: 30px;
    padding: 0 10px 0 30px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-bg);
    color: var(--color-text);
    font-family: var(--font-base);
    font-size: .78rem;
    outline: none;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.glossary-search::placeholder {
    color: var(--color-text-tertiary);
}

.glossary-search:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 2px var(--color-primary-bg);
}

/* ── Glossary: alphabet grid ── */
.alpha-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 3px;
    padding: 10px;
}

.alpha-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 30px;
    border-radius: var(--radius-sm);
    border: none;
    background: none;
    font-family: var(--font-base);
    font-size: .76rem;
    font-weight: 700;
    cursor: pointer;
    color: var(--color-text-secondary);
    transition: background var(--transition), color var(--transition);
    text-transform: uppercase;
    letter-spacing: .02em;
}

.alpha-btn:hover:not(:disabled) {
    background: var(--color-surface-hover);
    color: var(--color-primary);
}

.alpha-btn.active {
    background: var(--color-primary);
    color: #fff;
}

.alpha-btn:disabled {
    opacity: .28;
    cursor: not-allowed;
}

/* ── Article ── */
.legal-article {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.legal-article-header {
    padding: 16px 22px;
    border-bottom: 1px solid var(--color-border);
    background: var(--color-header);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.legal-article-title {
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: -.02em;
}

/* ── Legal sections (Termos / Política) ── */
.legal-section {
    padding: 28px 28px 0;
    scroll-margin-top: calc(var(--header-h) + 24px);
}

.legal-section:last-of-type {
    padding-bottom: 28px;
}

.legal-section+.legal-section {
    border-top: 1px solid var(--color-border);
    margin-top: 28px;
}

.legal-section-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: var(--radius-sm);
    background: var(--color-primary-bg);
    border: 1px solid var(--color-primary-border);
    font-size: .72rem;
    font-weight: 800;
    color: var(--color-primary);
    font-family: var(--font-mono);
    flex-shrink: 0;
}

.legal-section-heading {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}

.legal-section-title {
    font-size: .98rem;
    font-weight: 700;
    letter-spacing: -.02em;
    color: var(--color-text);
}

.legal-section-body p {
    font-size: .88rem;
    line-height: 1.75;
    color: var(--color-text-muted);
    margin-bottom: 12px;
}

.legal-section-body p:last-child {
    margin-bottom: 0;
}

.legal-section-body ul {
    list-style: none;
    padding: 0;
    margin: 0 0 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.legal-section-body ul li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: .88rem;
    line-height: 1.65;
    color: var(--color-text-muted);
    padding: 10px 14px;
    background: var(--color-header);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
}

.legal-section-body ul li::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--color-primary);
    flex-shrink: 0;
    margin-top: 8px;
    opacity: .6;
}

/* ── Highlight boxes ── */
.legal-highlight {
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    padding: 14px 16px;
    font-size: .85rem;
    line-height: 1.65;
    color: var(--color-text-muted);
    margin: 14px 0;
}

.legal-highlight.primary,
.legal-highlight:not([class*=" "]):not([class*=info]):not([class*=success]):not([class*=warning]):not([class*=danger]) {
    background: var(--color-primary-bg);
    border: 1px solid var(--color-primary-border);
    border-left: 3px solid var(--color-primary);
}

.legal-highlight.info {
    background: var(--color-info-bg);
    border: 1px solid rgba(59, 130, 246, .15);
    border-left: 3px solid var(--color-info);
}

.legal-highlight.success {
    background: var(--color-success-bg);
    border: 1px solid rgba(22, 163, 74, .15);
    border-left: 3px solid var(--color-success);
}

.legal-highlight.warning {
    background: var(--color-warning-bg);
    border: 1px solid rgba(245, 158, 11, .15);
    border-left: 3px solid var(--color-warning);
}

.legal-highlight strong {
    color: var(--color-text);
}

/* ── Rights grid (Política) ── */
.legal-rights-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 8px;
    margin: 14px 0;
}

.legal-right-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    background: var(--color-header);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    font-size: .82rem;
    line-height: 1.5;
    color: var(--color-text-muted);
    transition: border-color var(--transition);
}

.legal-right-item:hover {
    border-color: var(--color-primary-border);
}

.legal-right-icon {
    width: 28px;
    height: 28px;
    border-radius: var(--radius-sm);
    background: var(--color-primary-bg);
    border: 1px solid var(--color-primary-border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-primary);
    flex-shrink: 0;
}

.legal-right-icon svg {
    width: 13px;
    height: 13px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* ── DPO contact box (Política) ── */
.dpo-contact-box {
    background: var(--color-primary-bg);
    border: 1.5px solid var(--color-primary-border);
    border-radius: var(--radius-lg);
    padding: 22px 20px;
    display: flex;
    align-items: flex-start;
    gap: 16px;
    flex-wrap: wrap;
    margin-top: 14px;
}

.dpo-icon {
    width: 46px;
    height: 46px;
    border-radius: var(--radius-md);
    background: var(--color-primary-bg);
    border: 1px solid var(--color-primary-border);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--color-primary);
}

.dpo-icon svg {
    width: 22px;
    height: 22px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.75;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.dpo-body {
    flex: 1;
    min-width: 180px;
}

.dpo-title {
    font-weight: 700;
    font-size: .9rem;
    margin-bottom: 4px;
    color: var(--color-text);
}

.dpo-sub {
    font-size: .79rem;
    color: var(--color-text-tertiary);
    margin-bottom: 10px;
}

.dpo-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* ── Glossary: letter groups ── */
.letter-group {
    scroll-margin-top: calc(var(--header-h) + 24px);
    border-bottom: 1px solid var(--color-border);
}

.letter-group:last-child {
    border-bottom: none;
}

.letter-group-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 22px 12px;
    background: var(--color-even);
    border-bottom: 1px solid var(--color-border);
    position: sticky;
    top: var(--header-h);
    z-index: 10;
}

.letter-label {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    background: var(--color-primary);
    color: #fff;
    font-size: .78rem;
    font-weight: 800;
    letter-spacing: .04em;
    flex-shrink: 0;
    font-family: var(--font-mono);
}

.letter-group-title {
    font-weight: 700;
    font-size: .88rem;
    color: var(--color-text-secondary);
    letter-spacing: -.01em;
}

.letter-group-count {
    margin-left: auto;
    font-size: .72rem;
    color: var(--color-text-tertiary);
    font-weight: 500;
}

/* ── Glossary: items ── */
.glossary-item {
    padding: 16px 22px;
    border-bottom: 1px solid var(--color-border);
    transition: background var(--transition);
}

.glossary-item:last-child {
    border-bottom: none;
}

.glossary-item:hover {
    background: var(--color-surface-hover);
}

.glossary-item-title {
    font-size: .95rem;
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: 5px;
    letter-spacing: -.015em;
}

.glossary-item-desc {
    font-size: .84rem;
    color: var(--color-text-secondary);
    line-height: 1.65;
}

/* ── Glossary: search highlight ── */
mark.search-hl {
    background: var(--color-primary-bg);
    color: var(--color-primary);
    border-radius: 2px;
    padding: 0 1px;
    font-weight: 600;
}

/* ── Glossary: empty state ── */
.glossary-empty {
    padding: 56px 24px;
    text-align: center;
    color: var(--color-text-tertiary);
    font-size: .88rem;
}

.glossary-empty svg {
    width: 36px;
    height: 36px;
    stroke: var(--color-border);
    fill: none;
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-linejoin: round;
    margin: 0 auto 12px;
    display: block;
}

/* ── Accessibility: feature cards ── */
.acc-features {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
    margin-bottom: 40px;
}

.acc-feature-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 22px 20px;
    transition: box-shadow var(--transition), border-color var(--transition);
}

.acc-feature-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--color-primary-border);
}

.acc-feature-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    background: var(--color-primary-bg);
    border: 1px solid var(--color-primary-border);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 14px;
    color: var(--color-primary);
}

.acc-feature-icon svg {
    width: 22px;
    height: 22px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.75;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.acc-feature-title {
    font-weight: 700;
    font-size: .92rem;
    margin-bottom: 6px;
    color: var(--color-text);
}

.acc-feature-desc {
    font-size: .82rem;
    color: var(--color-text-secondary);
    line-height: 1.55;
}

/* ── Accessibility: section blocks ── */
.acc-block {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: 24px;
}

.acc-block-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 18px 20px;
    border-bottom: 1px solid var(--color-border);
    background: var(--color-header);
}

.acc-block-icon {
    font-size: 1.3rem;
    flex-shrink: 0;
}

.acc-block-title {
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: -.02em;
}

.acc-block-body {
    padding: 22px 20px;
}

/* ── Accessibility: shortcut table ── */
.acc-shortcut-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .84rem;
}

.acc-shortcut-table thead th {
    background: var(--color-header);
    padding: 10px 14px;
    text-align: left;
    font-weight: 600;
    font-size: .74rem;
    color: var(--color-text-secondary);
    border-bottom: 1px solid var(--color-border);
    letter-spacing: .01em;
}

.acc-shortcut-table tbody td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--color-border);
    vertical-align: middle;
    color: var(--color-text-muted);
}

.acc-shortcut-table tbody tr:last-child td {
    border-bottom: none;
}

.acc-shortcut-table tbody tr:nth-child(even) td {
    background: var(--color-even);
}

.acc-shortcut-table tbody tr:hover td {
    background: var(--color-surface-hover);
}

kbd {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 2px 8px;
    border-radius: 5px;
    background: var(--color-header);
    border: 1px solid var(--color-border);
    border-bottom-width: 2px;
    font-family: var(--font-mono);
    font-size: .74rem;
    font-weight: 600;
    color: var(--color-text-muted);
    white-space: nowrap;
}

.key-combo {
    display: flex;
    align-items: center;
    gap: 3px;
    flex-wrap: wrap;
}

/* ── Accessibility: screen readers list ── */
.acc-reader-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.acc-reader-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: var(--color-header);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
}

.acc-reader-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--color-success);
    flex-shrink: 0;
}

.acc-reader-name {
    font-weight: 600;
    font-size: .86rem;
    color: var(--color-text);
    flex: 1;
}

.acc-reader-note {
    font-size: .76rem;
    color: var(--color-text-tertiary);
}

/* ── Accessibility: contact CTA ── */
.acc-contact-cta {
    background: var(--color-primary-bg);
    border: 1.5px solid var(--color-primary-border);
    border-radius: var(--radius-lg);
    padding: 28px 24px;
    display: flex;
    align-items: flex-start;
    gap: 18px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.acc-contact-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    background: var(--color-primary-bg);
    border: 1px solid var(--color-primary-border);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--color-primary);
}

.acc-contact-icon svg {
    width: 24px;
    height: 24px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.75;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.acc-contact-body {
    flex: 1;
    min-width: 200px;
}

.acc-contact-title {
    font-weight: 700;
    font-size: 1rem;
    margin-bottom: 6px;
    letter-spacing: -.02em;
}

.acc-contact-desc {
    font-size: .84rem;
    color: var(--color-text-secondary);
    margin-bottom: 16px;
    line-height: 1.55;
}

.acc-contact-channels {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.acc-contact-row {
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: .84rem;
    color: var(--color-text-muted);
}

.acc-contact-row svg {
    width: 15px;
    height: 15px;
    stroke: var(--color-primary);
    fill: none;
    stroke-width: 1.75;
    stroke-linecap: round;
    stroke-linejoin: round;
    flex-shrink: 0;
}

.acc-contact-row a {
    color: var(--color-primary);
    font-weight: 500;
}

.acc-contact-row a:hover {
    color: var(--color-primary-hover);
}

/* ── Shared article footer ── */
.legal-article-footer {
    padding: 16px 22px;
    border-top: 1px solid var(--color-border);
    background: var(--color-even);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
}

.legal-update-note {
    font-size: .78rem;
    color: var(--color-text-tertiary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.legal-update-note svg {
    width: 13px;
    height: 13px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.75;
    stroke-linecap: round;
    stroke-linejoin: round;
    flex-shrink: 0;
}

/* ── Accessibility: standard pills (hero area) ── */
.hero-standards {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 28px;
}

.acc-standard-pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 14px;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, .1);
    border: 1px solid rgba(255, 255, 255, .15);
    font-size: .8rem;
    font-weight: 600;
    color: #fff;
    text-decoration: none;
    transition: background var(--transition);
}

.acc-standard-pill:hover {
    background: rgba(255, 255, 255, .18);
    color: #fff;
}

.acc-standard-pill svg {
    width: 14px;
    height: 14px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.75;
    stroke-linecap: round;
    stroke-linejoin: round;
    flex-shrink: 0;
}

/* ── Responsive ── */
@media (max-width: 860px) {
    .legal-layout {
        grid-template-columns: 1fr;
    }

    .legal-toc {
        position: static;
    }

    .alpha-grid {
        grid-template-columns: repeat(9, 1fr);
    }
}

@media (max-width: 600px) {
    .hero {
        padding: 30px 20px;
    }

    .hero-title {
        font-size: 1.4rem;
    }

    .legal-section {
        padding: 20px 18px 0;
    }

    .legal-section:last-of-type {
        padding-bottom: 20px;
    }

    .legal-article-header,
    .legal-article-footer {
        padding: 16px 18px;
    }

    .legal-rights-grid {
        grid-template-columns: 1fr;
    }

    .alpha-grid {
        grid-template-columns: repeat(7, 1fr);
    }

    .browser-row {
        grid-template-columns: 1fr;
        gap: 6px;
    }
}

/* ── Institutional pages: shared executive / legislative patterns ── */
.institutional-page {
    color: var(--color-text);
}

.institutional-heading,
.structure-card-header,
.structure-card-body,
.authority-profile {
    display: flex;
    justify-content: space-between;
    gap: 20px;
}

.institutional-heading {
    align-items: flex-start;
}

.institutional-summary,
.org-branch,
.structure-list,
.authority-list {
    display: grid;
    gap: 16px;
}

.institutional-summary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.summary-item,
.org-node,
.structure-card,
.structure-law,
.structure-manager,
.institutional-note,
.authority-card,
.contact-item,
.authority-photo {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
}

.summary-item {
    padding: 20px;
    display: grid;
    gap: 4px;
}

.summary-value {
    font-size: 1.5rem;
    font-weight: 700;
}

.summary-label {
    font-size: .82rem;
    color: var(--color-text-secondary);
}

.org-chart {
    display: grid;
    gap: 28px;
    border-radius: var(--radius-lg);
}

.org-node {
    min-height: 126px;
    padding: 18px;
    display: grid;
    align-content: center;
    justify-items: start;
    gap: 8px;
    text-decoration: none;
    color: inherit;
    position: relative;
}

.org-node strong {
    font-size: .98rem;
}

.org-node small {
    color: var(--color-text-secondary);
    line-height: 1.5;
}

.org-node-root {
    width: min(100%, 420px);
    justify-self: center;
    border-color: var(--color-primary-border);
}

.org-branch {
    position: relative;
}

.org-branch::before {
    content: '';
    position: absolute;
    top: -14px;
    left: 50%;
    width: 1px;
    height: 14px;
    background: var(--color-border);
}

.org-branch-two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.org-branch-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.org-node-link:hover,
.structure-manager:hover {
    border-color: var(--color-primary-border);
    box-shadow: var(--shadow-md);
}

.structure-card,
.authority-card {
    padding: 20px;
    scroll-margin-top: calc(var(--header-h) + 24px);
}

.structure-card-header {
    align-items: flex-start;
    margin-bottom: 18px;
}

.structure-card h3,
.structure-copy h4 {
    margin: 10px 0 0;
    letter-spacing: 0;
}

.structure-card h3 {
    font-size: 1.05rem;
}

.structure-copy h4 {
    font-size: .88rem;
    text-transform: uppercase;
    color: var(--color-text-secondary);
}

.structure-copy {
    flex: 1;
}

.structure-copy p,
.authority-main p {
    margin: 10px 0 0;
    color: var(--color-text-secondary);
    line-height: 1.7;
}

.structure-manager {
    width: 25%;
    padding: 14px 16px;
    display: grid;
    gap: 3px;
    color: inherit;
    text-decoration: none;
}

.structure-manager span,
.structure-law-label {
    font-size: .76rem;
    color: var(--color-text-tertiary);
}

.structure-manager strong {
    font-size: .88rem;
}

.structure-law {
    width: 25%;
    padding: 16px;
    display: grid;
    align-content: start;
    gap: 10px;
}

.structure-law-label,
.contact-item span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.structure-law-label svg,
.contact-item span svg {
    width: 15px;
    height: 15px;
}

.text-link {
    color: var(--color-primary);
    font-size: .84rem;
    font-weight: 600;
    text-decoration: none;
}

.text-link:hover {
    text-decoration: underline;
}

.institutional-note {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 18px;
    color: var(--color-text-secondary);
}

.institutional-note svg {
    width: 18px;
    height: 18px;
    color: var(--color-primary);
    flex-shrink: 0;
}

.institutional-note p {
    margin: 0;
    line-height: 1.6;
}

.authority-profile {
    align-items: stretch;
}

.authority-photo {
    width: 178px;
    min-width: 178px;
    aspect-ratio: 3 / 4;
    min-height: 0;
    margin: 0;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 10px;
    align-self: flex-start;
    overflow: hidden;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, .04), rgba(255, 255, 255, 0)),
        var(--color-header);
}

.authority-photo img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    border-radius: inherit;
}

.authority-photo span {
    width: 84px;
    height: 84px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: var(--color-primary-bg);
    color: var(--color-primary);
    border: 1px solid var(--color-primary-border);
    font-size: 1.25rem;
    font-weight: 700;
}

.authority-photo figcaption {
    color: var(--color-text-tertiary);
    font-size: .78rem;
}

.authority-main {
    flex: 1;
    display: grid;
    align-content: start;
    justify-items: start;
    gap: 10px;
}

.authority-main h3 {
    margin: 0;
    font-size: 1.12rem;
    letter-spacing: 0;
}

.authority-contact-grid {
    margin-top: 18px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.contact-item {
    padding: 14px 16px;
    display: grid;
    gap: 7px;
}

.contact-item span {
    font-size: .76rem;
    color: var(--color-text-tertiary);
}

.contact-item strong {
    font-size: .88rem;
    line-height: 1.55;
    word-break: break-word;
}

.contact-wide {
    grid-column: span 2;
}

/* ── Executive organizational structure redesign ── */
.orgz-page {
    padding-top: 32px;
}

.orgz-hero {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 24px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
}

.orgz-hero-copy h1 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--color-text);
    margin: 0 0 4px;
    letter-spacing: 0;
}

.orgz-hero-copy p {
    font-size: .82rem;
    color: var(--color-text-secondary);
    line-height: 1.55;
    max-width: 520px;
    margin: 0;
}

.orgz-stats {
    display: flex;
    gap: 24px;
    margin-top: 16px;
    flex-wrap: wrap;
}

.orgz-stat {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.orgz-stat strong {
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--color-text);
    line-height: 1;
}

.orgz-stat span {
    font-size: .72rem;
    color: var(--color-text-tertiary);
}

.orgz-hero-actions {
    display: flex;
    align-items: flex-end;
    flex-shrink: 0;
}

.orgz-notice {
    border: 1px solid var(--color-border);
    border-left: 3px solid var(--color-text-tertiary);
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    background: var(--color-surface);
    padding: 10px 14px;
    font-size: .78rem;
    color: var(--color-text-secondary);
    margin: 0 0 28px;
    line-height: 1.55;
}

.orgz-notice strong {
    color: var(--color-text);
}

.orgz-section {
    margin-bottom: 32px;
}

.orgz-section-label {
    font-size: .7rem;
    font-weight: 600;
    color: var(--color-text-tertiary);
    text-transform: uppercase;
    letter-spacing: .06em;
    margin: 0 0 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.orgz-section-label::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--color-border);
}

.orgz-chart {
    display: grid;
    gap: 20px;
}

.orgz-root,
.orgz-l2-node,
.orgz-unit-card,
.orgz-detail {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
}

.orgz-root {
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 14px;
    max-width: 460px;
    margin: 0 auto;
    position: relative;
    margin-bottom: 20px;
}

.orgz-root::after,
.orgz-l2-node::after {
    content: '';
    position: absolute;
    bottom: -21px;
    left: 50%;
    transform: translateX(-50%);
    width: 1px;
    height: 20px;
    background: var(--color-border);
}

.orgz-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: .8rem;
    font-weight: 600;
    flex-shrink: 0;
    background: var(--color-header);
    color: var(--color-text-secondary);
    border: 1px solid var(--color-border);
}

.orgz-avatar svg {
    width: 18px;
    height: 18px;
}

.orgz-avatar-primary {
    background: var(--color-primary-bg);
    color: var(--color-primary);
    border-color: var(--color-primary-border);
}

.orgz-avatar-square {
    border-radius: var(--radius-md);
}

.orgz-node-text {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.orgz-node-text strong {
    font-size: .9rem;
    font-weight: 600;
    color: var(--color-text);
    line-height: 1.25;
}

.orgz-node-text small {
    font-size: .76rem;
    color: var(--color-text-tertiary);
    line-height: 1.35;
}

.orgz-pill {
    font-size: .66rem;
    border-radius: 999px;
    padding: 2px 8px;
    font-weight: 600;
    margin-left: auto;
    flex-shrink: 0;
    background: var(--color-header);
    color: var(--color-text-secondary);
    border: 1px solid var(--color-border);
}

.orgz-pill-primary {
    background: var(--color-primary-bg);
    color: var(--color-primary);
    border-color: var(--color-primary-border);
}

.orgz-l2-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    position: relative;
}

.orgz-l2-row::before {
    content: '';
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    width: calc(50% + 12px);
    height: 20px;
    border-top: 1px solid var(--color-border);
    border-left: 1px solid var(--color-border);
    border-right: 1px solid var(--color-border);
    pointer-events: none;
}

.orgz-l2-node {
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
    margin-bottom: 20px;
}

.orgz-unit-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    position: relative;
}

.orgz-unit-grid::before {
    content: '';
    position: absolute;
    top: -20px;
    left: 5%;
    width: 90%;
    height: 20px;
    border-top: 1px solid var(--color-border);
    border-left: 1px solid var(--color-border);
    border-right: 1px solid var(--color-border);
    pointer-events: none;
}

.orgz-unit-card {
    padding: 14px;
    color: inherit;
    text-decoration: none;
    display: grid;
    gap: 6px;
    transition: border-color var(--transition), box-shadow var(--transition);
    scroll-margin-top: calc(var(--header-h) + 24px);
}

.orgz-unit-card:hover,
.orgz-detail:hover {
    border-color: var(--color-primary-border);
}

.orgz-unit-card strong {
    font-size: .8rem;
    font-weight: 600;
    color: var(--color-text);
    line-height: 1.35;
}

.orgz-code {
    font-size: .68rem;
    color: var(--color-text-tertiary);
    font-family: var(--font-mono);
}

.orgz-manager,
.orgz-detail-manager {
    font-size: .74rem;
    color: var(--color-text-secondary);
    display: flex;
    align-items: center;
    gap: 5px;
    min-width: 0;
}

.orgz-manager.is-empty,
.orgz-detail-manager.is-empty,
.orgz-body-col .is-empty {
    color: var(--color-text-tertiary);
}

.orgz-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
    background: var(--color-border);
}

.orgz-dot.is-ok {
    background: var(--color-success);
}

.orgz-detail-section {
    margin-top: 36px;
}

.orgz-detail-list {
    display: grid;
    gap: 10px;
}

.orgz-detail {
    overflow: hidden;
    scroll-margin-top: calc(var(--header-h) + 24px);
}

.orgz-detail-header {
    padding: 14px 18px;
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    border: 0;
    background: transparent;
    color: var(--color-text);
    cursor: pointer;
    font: inherit;
    text-align: left;
    transition: background var(--transition), color var(--transition);
}

.orgz-detail-header:hover {
    background: var(--color-header);
}

.orgz-detail-code {
    font-size: .68rem;
    color: var(--color-text-tertiary);
    font-family: var(--font-mono);
    flex-shrink: 0;
    width: 54px;
}

.orgz-detail-name {
    font-size: .84rem;
    font-weight: 600;
    color: var(--color-text);
    flex: 1;
    min-width: 0;
}

.orgz-chevron {
    width: 18px;
    height: 18px;
    color: var(--color-text-tertiary);
    transition: transform var(--transition), color var(--transition);
    flex-shrink: 0;
    display: inline-flex;
}

.orgz-chevron svg {
    display: block;
    width: 18px;
    height: 18px;
}

.orgz-detail.open .orgz-chevron {
    transform: rotate(180deg);
}

.orgz-detail-body {
    max-height: 0;
    overflow: hidden;
    border-top: 0;
    background: color-mix(in srgb, var(--color-surface) 96%, var(--color-primary-bg));
    transition: max-height var(--transition-slow);
}

.orgz-detail.open .orgz-detail-body {
    border-top: 1px solid var(--color-border);
}

.orgz-body-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.orgz-body-col {
    padding: 16px 18px;
}

.orgz-body-col+.orgz-body-col {
    border-left: 1px solid var(--color-border);
}

.orgz-body-label {
    display: block;
    font-size: .68rem;
    color: var(--color-text-tertiary);
    text-transform: uppercase;
    letter-spacing: .05em;
    font-weight: 600;
    margin-bottom: 6px;
}

.orgz-body-col p,
.orgz-manager-link {
    font-size: .78rem;
    color: var(--color-text-secondary);
    line-height: 1.6;
    margin: 0;
}

.orgz-body-col strong {
    color: var(--color-text);
}

.orgz-mono {
    font-family: var(--font-mono);
    font-size: .72rem !important;
}

.orgz-manager-link {
    display: inline-grid;
    gap: 2px;
    text-decoration: none;
}

.orgz-manager-link:hover strong {
    color: var(--color-primary);
}

.orgz-contact-row {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    border-top: 1px solid var(--color-border);
}

.orgz-contact-cell {
    padding: 12px 18px;
    border-right: 1px solid var(--color-border);
    min-width: 0;
}

.orgz-contact-cell:last-child {
    border-right: none;
}

.orgz-contact-cell span {
    font-size: .68rem;
    color: var(--color-text-tertiary);
    margin-bottom: 3px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.orgz-contact-cell span svg {
    width: 13px;
    height: 13px;
}

.orgz-contact-cell strong {
    display: block;
    font-size: .72rem;
    color: var(--color-text);
    font-weight: 600;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

@media (max-width: 1080px) {
    .org-branch-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .orgz-unit-grid,
    .orgz-contact-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .orgz-contact-cell:nth-child(2n) {
        border-right: none;
    }

    .orgz-contact-cell:nth-child(n + 3) {
        border-top: 1px solid var(--color-border);
    }

    .structure-card-header,
    .structure-card-body,
    .institutional-heading {
        flex-direction: column;
    }

    .structure-manager,
    .structure-law {
        width: 100%;
    }
}

@media (max-width: 900px) {
    .authority-profile {
        flex-direction: column;
    }

    .authority-photo {
        width: min(100%, 178px);
        min-width: 0;
    }
}

@media (max-width: 760px) {

    .institutional-summary,
    .org-branch-two,
    .org-branch-grid,
    .authority-contact-grid {
        grid-template-columns: 1fr;
    }

    .contact-wide {
        grid-column: span 1;
    }

    .org-chart {
        padding: 18px;
    }

    .orgz-page {
        padding-top: 24px;
    }

    .orgz-hero,
    .orgz-l2-row,
    .orgz-body-grid,
    .orgz-contact-row {
        grid-template-columns: 1fr;
    }

    .orgz-hero {
        display: grid;
        padding: 20px;
    }

    .orgz-hero-actions {
        align-items: stretch;
    }

    .orgz-hero-actions .btn {
        width: 100%;
    }

    .orgz-l2-row::before,
    .orgz-unit-grid::before,
    .orgz-root::after,
    .orgz-l2-node::after {
        display: none;
    }

    .orgz-unit-grid {
        grid-template-columns: 1fr;
    }

    .orgz-body-col+.orgz-body-col,
    .orgz-contact-cell {
        border-left: none;
        border-right: none;
    }

    .orgz-body-col+.orgz-body-col,
    .orgz-contact-cell+.orgz-contact-cell {
        border-top: 1px solid var(--color-border);
    }

    .orgz-detail-header {
        align-items: flex-start;
        gap: 8px;
        flex-wrap: wrap;
    }

    .orgz-detail-code {
        width: auto;
    }

    .orgz-detail-name {
        flex-basis: calc(100% - 70px);
    }

    .orgz-detail-manager {
        order: 3;
        flex-basis: 100%;
    }

    .orgz-chevron {
        margin-left: auto;
    }
}
