[hidden] {
    display: none !important;
}

:root {
    color-scheme: light;
    --ink: #17202a;
    --muted: #62707f;
    --line: #dfe5ea;
    --surface: #ffffff;
    --canvas: #f3f6f8;
    --brand: #6f162d;
    --brand-dark: #4d0e20;
    --focus: #1769aa;
    --surface-raised: #ffffff;
    --surface-subtle: #f7f8fa;
    --ink-soft: #344252;
    --shadow: 0 1rem 2.6rem rgba(23, 32, 42, 0.1);
    --green: #177245;
    --green-bg: #e7f5ed;
    --yellow: #8a5b00;
    --yellow-bg: #fff4ce;
    --red: #a12631;
    --red-bg: #fdebed;
    --gray: #5e6874;
    --gray-bg: #edf0f3;
    --blue: #1769aa;
    --blue-bg: #e8f2fb;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    min-height: 100vh;
    color: var(--ink);
    background: var(--canvas);
}

a { color: var(--brand); text-underline-offset: 0.2em; }
a:hover { color: var(--brand-dark); }

button,
input,
select { font: inherit; }

button,
input,
select,
a { outline-offset: 3px; }

:focus-visible { outline: 3px solid var(--focus); }

.auth-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 2rem 1rem;
    background:
        radial-gradient(circle at 15% 10%, rgba(111, 22, 45, 0.12), transparent 28rem),
        var(--canvas);
}

.auth-card,
.welcome-panel {
    width: min(100%, 32rem);
    padding: clamp(1.5rem, 5vw, 2.5rem);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 1rem;
    box-shadow: 0 1.2rem 3rem rgba(23, 32, 42, 0.08);
}

.brand-lockup,
.app-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.brand-lockup div { display: grid; }
.brand-lockup span { color: var(--muted); }

.brand-mark {
    display: inline-grid;
    place-items: center;
    width: 2.5rem;
    height: 2.5rem;
    color: #fff;
    background: var(--brand);
    border-radius: 0.75rem;
    font-weight: 800;
}

.eyebrow {
    margin: 0 0 1rem;
    color: var(--brand);
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

h1 { margin: 1.5rem 0 0.5rem; font-size: clamp(1.75rem, 5vw, 2.35rem); line-height: 1.1; }
.intro, .welcome-panel > p { color: var(--muted); line-height: 1.6; }

label { display: block; margin: 1rem 0 0.4rem; font-weight: 700; }

input {
    width: 100%;
    min-height: 3rem;
    padding: 0.7rem 0.8rem;
    border: 1px solid #aeb9c3;
    border-radius: 0.55rem;
    background: #fff;
}

select {
    width: 100%;
    min-height: 2.75rem;
    padding: 0.62rem 2rem 0.62rem 0.75rem;
    color: var(--ink);
    border: 1px solid #aeb9c3;
    border-radius: 0.55rem;
    background: var(--surface);
}

button {
    min-height: 2.75rem;
    padding: 0.65rem 1rem;
    border: 1px solid transparent;
    border-radius: 0.55rem;
    color: #fff;
    background: var(--brand);
    cursor: pointer;
    font-weight: 750;
}

.auth-card button { width: 100%; margin-top: 1.25rem; }
button:hover { background: var(--brand-dark); }
button:disabled { cursor: wait; opacity: 0.65; }

.button-secondary {
    min-height: 2.25rem;
    color: var(--brand);
    background: #fff;
    border-color: #c7cfd6;
}
.button-secondary:hover { color: #fff; }

.alert {
    margin: 1rem 0;
    padding: 0.8rem;
    color: #721c24;
    background: #fbeaec;
    border: 1px solid #e8bdc3;
    border-radius: 0.55rem;
}

.privacy-note { margin: 1.25rem 0 0; color: var(--muted); font-size: 0.85rem; }

.google-auth-button,
.auth-link-button {
    min-height: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.7rem;
    margin-top: 1.25rem;
    padding: 0.7rem 1rem;
    color: var(--ink);
    background: var(--surface);
    border: 1px solid #cfd6df;
    border-radius: 0.65rem;
    box-shadow: 0 0.25rem 0.7rem rgba(23, 32, 42, 0.06);
    font-weight: 750;
    text-decoration: none;
}
.google-auth-button:hover,
.auth-link-button:hover { color: var(--ink); border-color: #9ca8b6; background: var(--surface-subtle); }
.google-mark { width: 1.5rem; height: 1.5rem; display: inline-grid; place-items: center; color: #4285f4; border: 1px solid #d8dde5; border-radius: 50%; font-weight: 850; }
.oauth-caption { margin: 0.55rem 0 0; color: var(--muted); font-size: 0.72rem; text-align: center; }
.oauth-divider { display: flex; align-items: center; gap: 0.7rem; margin: 1.15rem 0 0; color: var(--muted); font-size: 0.7rem; }
.oauth-divider::before, .oauth-divider::after { height: 1px; flex: 1; content: ""; background: var(--line); }
.pending-icon { width: 3rem; height: 3rem; display: grid; place-items: center; margin-top: 1.5rem; color: #157347; background: #e4f6ec; border-radius: 1rem; font-size: 1.4rem; font-weight: 850; }

.admin-users-shell { max-width: 72rem; }
.admin-users-heading h1 { margin-top: 0.3rem; }
.admin-users-heading > p:last-child { color: var(--muted); }
.notice { margin: 1rem 0; padding: 0.8rem 1rem; color: #174d36; background: #e7f6ee; border: 1px solid #bce5cf; border-radius: 0.7rem; }
.empty-admin-state { display: grid; gap: 0.3rem; padding: 2rem; color: var(--muted); background: var(--surface); border: 1px solid var(--line); border-radius: 1rem; text-align: center; }
.empty-admin-state strong { color: var(--ink); }
.registration-list { display: grid; gap: 0.8rem; }
.registration-card { display: grid; grid-template-columns: minmax(14rem, 1fr) minmax(22rem, 1.2fr); align-items: center; gap: 1rem; padding: 1rem; background: var(--surface); border: 1px solid var(--line); border-radius: 1rem; box-shadow: 0 0.55rem 1.5rem rgba(23, 32, 42, 0.06); }
.registration-identity { display: flex; align-items: center; gap: 0.8rem; min-width: 0; }
.registration-identity > span:last-child { display: grid; gap: 0.15rem; min-width: 0; }
.registration-identity small { overflow: hidden; color: var(--muted); text-overflow: ellipsis; }
.user-initial { width: 2.7rem; height: 2.7rem; display: inline-grid; place-items: center; flex: 0 0 auto; color: #fff; background: var(--premium-gradient, var(--brand)); border-radius: 0.8rem; font-weight: 850; }
.registration-actions { display: flex; align-items: end; justify-content: flex-end; gap: 0.6rem; }
.registration-actions form:first-child { display: grid; grid-template-columns: minmax(12rem, 1fr) auto; align-items: end; gap: 0.55rem; flex: 1; }
.registration-actions label { margin: 0; font-size: 0.72rem; }
.registration-actions select { margin-top: 0.3rem; }
.button-danger-subtle { color: #a12631; background: #fff; border-color: #efc7cc; }
.button-danger-subtle:hover { color: #fff; background: #a12631; }

@media (max-width: 52rem) {
    .registration-card { grid-template-columns: 1fr; }
    .registration-actions { align-items: stretch; flex-direction: column; }
    .registration-actions form:first-child { grid-template-columns: 1fr; }
}

.app-header {
    min-height: 4.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.75rem clamp(1rem, 4vw, 3rem);
    background: #fff;
    border-bottom: 1px solid var(--line);
}

.app-brand { color: var(--ink); text-decoration: none; }
.session-actions { display: flex; align-items: center; gap: 1rem; color: var(--muted); }
.session-actions form { margin: 0; }
.app-shell { padding: clamp(1rem, 5vw, 4rem); }
.welcome-panel { width: min(100%, 64rem); }

.status-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    margin: 2rem 0 0;
}
.status-grid div { padding: 1rem; background: var(--canvas); border-radius: 0.6rem; }
.status-grid dt { color: var(--muted); font-size: 0.8rem; font-weight: 700; text-transform: uppercase; }
.status-grid dd { margin: 0.35rem 0 0; overflow-wrap: anywhere; }
.status-dot { display: inline-block; width: 0.6rem; height: 0.6rem; background: #238636; border-radius: 50%; }

@media (max-width: 48rem) {
    .app-header, .session-actions { align-items: flex-start; flex-direction: column; }
    .status-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; }
}

/* Insights list-first workspace */

.skip-link {
    position: fixed;
    z-index: 100;
    top: 0.5rem;
    left: 0.5rem;
    padding: 0.7rem 1rem;
    color: #fff;
    background: var(--brand);
    border-radius: 0.5rem;
    transform: translateY(-150%);
}

.skip-link:focus { transform: translateY(0); }

.glass-surface {
    background: rgba(255, 255, 255, 0.86);
    background: color-mix(in srgb, var(--surface) 86%, transparent);
    border-color: color-mix(in srgb, var(--line) 82%, transparent);
    -webkit-backdrop-filter: blur(22px) saturate(140%);
    backdrop-filter: blur(22px) saturate(140%);
}

.insights-header {
    position: sticky;
    z-index: 30;
    top: 0;
    min-height: 4.25rem;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: clamp(1rem, 3vw, 2.5rem);
    padding: 0.65rem clamp(1rem, 3vw, 2.5rem);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 0.4rem 1.6rem rgba(23, 32, 42, 0.06);
}

.brand-name { display: grid; line-height: 1.05; }
.brand-name small { margin-top: 0.18rem; color: var(--muted); font-size: 0.68rem; font-weight: 750; letter-spacing: 0.12em; text-transform: uppercase; }

.primary-nav { display: flex; align-items: center; gap: 0.25rem; }
.primary-nav a {
    padding: 0.6rem 0.8rem;
    color: var(--ink-soft);
    border-radius: 0.55rem;
    font-size: 0.9rem;
    font-weight: 720;
    text-decoration: none;
}
.primary-nav a:hover { color: var(--brand); background: var(--surface-subtle); }
.primary-nav a[aria-current="page"] { color: var(--brand); background: color-mix(in srgb, var(--brand) 10%, var(--surface)); }

.compact-session { justify-content: flex-end; gap: 0.65rem; }
.compact-session input { display: none; }
.user-chip { display: grid; line-height: 1.15; text-align: right; }
.user-chip strong { max-width: 12rem; overflow: hidden; font-size: 0.82rem; text-overflow: ellipsis; white-space: nowrap; }
.user-chip small { color: var(--muted); font-size: 0.7rem; text-transform: capitalize; }

.icon-button {
    min-width: 2.5rem;
    min-height: 2.5rem;
    display: inline-grid;
    place-items: center;
    padding: 0;
    color: var(--ink);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 0.65rem;
    font-size: 1.25rem;
}
.icon-button:hover { color: var(--brand); background: var(--surface-subtle); }
.compact-button { min-height: 2.5rem; padding: 0.45rem 0.7rem; }

.insights-shell {
    width: min(100%, 112rem);
    margin: 0 auto;
    padding: clamp(1.25rem, 3vw, 2.75rem) clamp(0.85rem, 3vw, 2.5rem) 5rem;
}

.page-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 2rem;
    margin-bottom: 1.4rem;
}
.page-heading h1 { margin: 0.2rem 0 0.5rem; }
.page-heading p:not(.eyebrow) { max-width: 48rem; margin: 0; color: var(--muted); line-height: 1.55; }
.action-link { display: inline-grid; place-items: center; flex: 0 0 auto; text-decoration: none; }

.filter-dock {
    position: sticky;
    z-index: 20;
    top: 4.85rem;
    padding: 1rem;
    border: 1px solid var(--line);
    border-radius: 0.85rem;
    box-shadow: 0 0.8rem 2.2rem rgba(23, 32, 42, 0.08);
}
.filter-heading,
.panel-heading,
.dialog-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}
.filter-heading { margin-bottom: 0.75rem; }
.filter-heading h2,
.panel-heading h2,
.dialog-header h2,
.rule-explainer h2 { margin: 0; font-size: 1.2rem; }
.filter-heading p { margin: 0.2rem 0 0; color: var(--muted); font-size: 0.8rem; }
.text-button,
.data-table th button {
    min-height: auto;
    padding: 0;
    color: var(--brand);
    background: transparent;
    border: 0;
    text-align: left;
}
.text-button:hover,
.data-table th button:hover { color: var(--brand-dark); background: transparent; text-decoration: underline; }

.filter-form {
    display: grid;
    grid-template-columns: repeat(7, minmax(9rem, 1fr));
    gap: 0.7rem;
    align-items: end;
}
.filter-form label { min-width: 0; margin: 0; color: var(--ink-soft); font-size: 0.72rem; font-weight: 780; }
.filter-form select,
.filter-form input[type="search"] { min-height: 2.65rem; margin-top: 0.3rem; font-size: 0.84rem; }
.actor-analysis {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: minmax(10rem, 0.8fr) minmax(22rem, 1.5fr) minmax(14rem, 1fr);
    align-items: center;
    gap: 0.75rem 1rem;
    padding: 0.75rem;
    background: var(--surface-subtle);
    border: 1px solid var(--line);
    border-radius: 0.85rem;
}
.actor-analysis-intro { display: flex; align-items: center; gap: 0.65rem; min-width: 0; }
.actor-analysis-intro > span:last-child { display: grid; gap: 0.1rem; }
.actor-analysis-intro strong { color: var(--ink); font-size: 0.8rem; }
.actor-analysis-intro small { color: var(--muted); font-size: 0.68rem; font-weight: 560; line-height: 1.35; }
.filter-step {
    width: 1.75rem;
    height: 1.75rem;
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
    color: #fff;
    background: var(--premium-blue, var(--brand));
    border-radius: 0.55rem;
    font-size: 0.72rem;
    font-weight: 850;
}
.actor-mode-switch {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.4rem;
    padding: 0.25rem;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 0.75rem;
}
.actor-mode-switch button {
    min-height: 2.8rem;
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.45rem 0.6rem;
    color: var(--muted);
    background: transparent;
    border: 1px solid transparent;
    border-radius: 0.58rem;
    text-align: left;
}
.actor-mode-switch button:hover { color: var(--ink); background: var(--surface-subtle); }
.actor-mode-switch button[aria-pressed="true"] {
    color: var(--premium-blue, var(--brand));
    background: #eef1ff;
    border-color: #d9e0ff;
    box-shadow: 0 0.2rem 0.55rem rgba(51, 91, 255, 0.1);
}
.actor-mode-switch button > span:last-child { display: grid; min-width: 0; }
.actor-mode-switch strong { color: inherit; font-size: 0.75rem; }
.actor-mode-switch small { color: var(--muted); font-size: 0.62rem; font-weight: 600; }
.actor-mode-icon {
    width: 1.65rem;
    height: 1.65rem;
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
    border: 1px solid currentColor;
    border-radius: 0.48rem;
    font-size: 0.65rem;
    font-weight: 850;
}
.actor-picker select { margin-top: 0.18rem; }
.actor-mode-help {
    grid-column: 2 / -1;
    display: flex;
    align-items: center;
    gap: 0.45rem;
    margin: -0.25rem 0 0;
    color: var(--muted);
    font-size: 0.67rem;
    font-weight: 600;
    line-height: 1.35;
}
.actor-help-icon {
    width: 1rem;
    height: 1rem;
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
    color: var(--premium-blue, var(--brand));
    border: 1px solid currentColor;
    border-radius: 50%;
    font-size: 0.62rem;
    font-weight: 850;
}
.search-field { grid-column: span 2; }
.advanced-filters { grid-column: 1 / -1; border-top: 1px solid var(--line); }
.advanced-filters summary { width: max-content; margin-top: 0.55rem; color: var(--brand); cursor: pointer; font-size: 0.8rem; font-weight: 750; }
.advanced-grid { display: grid; grid-template-columns: repeat(4, minmax(10rem, 1fr)); gap: 0.75rem; padding-top: 0.75rem; }

.result-status { min-height: 1.5rem; margin: 1rem 0 0.5rem; color: var(--muted); font-size: 0.84rem; }
.result-status.error { color: var(--red); font-weight: 700; }

.summary-grid {
    display: grid;
    grid-template-columns: repeat(8, minmax(8.5rem, 1fr));
    gap: 0.75rem;
    margin: 0.7rem 0 1rem;
}
.metric-card {
    min-height: 7.2rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 1rem;
    background: var(--surface-raised);
    border: 1px solid var(--line);
    border-radius: 0.8rem;
}
.metric-card small { color: var(--muted); font-size: 0.7rem; font-weight: 780; letter-spacing: 0.04em; text-transform: uppercase; }
.metric-card strong { font-size: clamp(1.35rem, 2vw, 1.8rem); font-variant-numeric: tabular-nums; }
.metric-card span { color: var(--muted); font-size: 0.72rem; }

.data-panel {
    background: var(--surface-raised);
    border: 1px solid var(--line);
    border-radius: 0.9rem;
    box-shadow: 0 0.5rem 1.8rem rgba(23, 32, 42, 0.05);
    overflow: hidden;
}
.panel-heading { padding: 1rem 1.1rem; border-bottom: 1px solid var(--line); }
.panel-heading .eyebrow,
.dialog-header .eyebrow { margin-bottom: 0.25rem; }
.result-count { color: var(--muted); font-size: 0.82rem; font-variant-numeric: tabular-nums; }
.table-scroll { max-width: 100%; overflow: auto; }

.data-table {
    width: 100%;
    min-width: 80rem;
    border-collapse: collapse;
    color: var(--ink-soft);
    font-size: 0.79rem;
    font-variant-numeric: tabular-nums;
}
.data-table th {
    position: sticky;
    z-index: 1;
    top: 0;
    padding: 0.7rem 0.65rem;
    color: var(--muted);
    background: var(--surface-subtle);
    border-bottom: 1px solid var(--line);
    font-size: 0.68rem;
    letter-spacing: 0.035em;
    text-align: left;
    text-transform: uppercase;
    white-space: nowrap;
}
.data-table td { padding: 0.7rem 0.65rem; background: var(--surface-raised); border-bottom: 1px solid var(--line); vertical-align: middle; }
.data-table tbody tr:hover td { background: var(--surface-subtle); }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table .numeric { text-align: right; }

.semaphore-badge,
.quality-badge,
.trend-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.28rem 0.48rem;
    color: var(--gray);
    background: var(--gray-bg);
    border: 1px solid color-mix(in srgb, currentColor 22%, transparent);
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 800;
    white-space: nowrap;
}
.semaphore-badge.green,
.quality-badge.ok { color: var(--green); background: var(--green-bg); }
.semaphore-badge.yellow { color: var(--yellow); background: var(--yellow-bg); }
.semaphore-badge.red,
.quality-badge.error { color: var(--red); background: var(--red-bg); }
.quality-badge.warning { color: var(--yellow); background: var(--yellow-bg); }
.trend-badge.up { color: var(--green); background: var(--green-bg); }
.trend-badge.down { color: var(--red); background: var(--red-bg); }
.semaphore-dot { width: 0.6rem; height: 0.6rem; display: inline-block; flex: 0 0 auto; background: var(--gray); border: 1px solid currentColor; border-radius: 50%; }
.semaphore-dot.green { background: var(--green); }
.semaphore-dot.yellow { background: #d69b16; }
.semaphore-dot.red { background: var(--red); }
.semaphore-dot.gray { background: var(--gray); }

.detail-button { min-height: 2.1rem; padding: 0.38rem 0.6rem; font-size: 0.72rem; }
.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }

.pagination { min-height: 3.5rem; display: flex; align-items: center; justify-content: flex-end; gap: 0.7rem; padding: 0.75rem 1rem; border-top: 1px solid var(--line); }
.pagination button { min-height: 2.25rem; padding: 0.4rem 0.7rem; }
.pagination span { color: var(--muted); font-size: 0.78rem; }

.skeleton-line { display: block; width: 6rem; height: 0.8rem; background: linear-gradient(90deg, var(--gray-bg), var(--surface-subtle), var(--gray-bg)); background-size: 200% 100%; border-radius: 0.3rem; animation: skeleton 1.2s linear infinite; }
@keyframes skeleton { to { background-position: -200% 0; } }

.empty-state,
.error-state { padding: 2.5rem 1rem; color: var(--muted); text-align: center; }
.error-state { color: var(--red); }

.detail-dialog {
    width: min(96vw, 80rem);
    max-height: 92vh;
    padding: 0;
    color: var(--ink);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 1rem;
    box-shadow: 0 2rem 5rem rgba(0, 0, 0, 0.28);
}
.detail-dialog::backdrop { background: rgba(10, 15, 22, 0.58); }
.dialog-header { position: sticky; z-index: 2; top: 0; padding: 1rem 1.2rem; border-bottom: 1px solid var(--line); }
.dialog-body { display: grid; gap: 1rem; padding: 1.2rem; }
.detail-summary { display: grid; grid-template-columns: repeat(6, minmax(8rem, 1fr)); gap: 0.65rem; }
.detail-section { padding: 1rem; background: var(--surface-raised); border: 1px solid var(--line); border-radius: 0.75rem; }
.detail-section h3 { margin: 0 0 0.8rem; font-size: 1rem; }
.detail-section .data-table { min-width: 48rem; }
.polling-unit-list { display: grid; gap: 0.7rem; }
.polling-unit { padding: 0.9rem; background: var(--surface-subtle); border: 1px solid var(--line); border-radius: 0.65rem; }
.polling-unit header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 0.6rem; }
.acta-link { font-weight: 720; }

.rule-layout { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(18rem, 0.75fr); gap: 1rem; }
.rule-list { display: grid; gap: 0.75rem; padding: 1rem; }
.rule-card { display: grid; grid-template-columns: 1fr auto; gap: 0.5rem 1rem; padding: 1rem; background: var(--surface-subtle); border: 1px solid var(--line); border-radius: 0.7rem; }
.rule-card h3 { margin: 0; font-size: 1rem; }
.rule-card p { margin: 0.2rem 0 0; color: var(--muted); font-size: 0.82rem; }
.rule-threshold { align-self: center; color: var(--brand); font-size: 1.7rem; font-weight: 850; font-variant-numeric: tabular-nums; }
.rule-explainer { padding: 1rem; }
.semantic-list { display: grid; gap: 0.8rem; padding: 0; list-style: none; }
.semantic-list li { display: grid; grid-template-columns: auto 7rem 1fr; align-items: center; gap: 0.55rem; color: var(--muted); font-size: 0.82rem; }
.semantic-list strong { color: var(--ink); }
.notice { margin-top: 1rem; padding: 0.85rem; color: var(--ink-soft); background: var(--blue-bg); border: 1px solid color-mix(in srgb, var(--blue) 25%, var(--line)); border-radius: 0.6rem; font-size: 0.8rem; line-height: 1.5; }

:root[data-theme="dark"] {
    color-scheme: dark;
    --ink: #f2f5f7;
    --ink-soft: #d6dde3;
    --muted: #aab6c1;
    --line: #34414c;
    --surface: #182129;
    --surface-raised: #1d2831;
    --surface-subtle: #222f39;
    --canvas: #10171d;
    --brand: #e989a2;
    --brand-dark: #f2adc0;
    --focus: #75bfff;
    --green: #78d7a6;
    --green-bg: #163d2b;
    --yellow: #f2c864;
    --yellow-bg: #463817;
    --red: #ff9aa3;
    --red-bg: #4b2228;
    --gray: #c0c8cf;
    --gray-bg: #303b45;
    --blue: #8ccaff;
    --blue-bg: #17364e;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme]) {
        color-scheme: dark;
        --ink: #f2f5f7; --ink-soft: #d6dde3; --muted: #aab6c1; --line: #34414c;
        --surface: #182129; --surface-raised: #1d2831; --surface-subtle: #222f39; --canvas: #10171d;
        --brand: #e989a2; --brand-dark: #f2adc0; --focus: #75bfff;
        --green: #78d7a6; --green-bg: #163d2b; --yellow: #f2c864; --yellow-bg: #463817;
        --red: #ff9aa3; --red-bg: #4b2228; --gray: #c0c8cf; --gray-bg: #303b45;
        --blue: #8ccaff; --blue-bg: #17364e;
    }
}

@media (max-width: 82rem) {
    .filter-form { grid-template-columns: repeat(5, minmax(8rem, 1fr)); }
    .actor-analysis { grid-template-columns: minmax(11rem, 0.7fr) minmax(20rem, 1.3fr) minmax(13rem, 1fr); }
    .summary-grid { grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 64rem) {
    .insights-header { grid-template-columns: auto 1fr; }
    .primary-nav { grid-column: 1 / -1; grid-row: 2; overflow-x: auto; }
    .compact-session { grid-column: 2; grid-row: 1; }
    .filter-dock { position: relative; top: auto; }
    .filter-form { grid-template-columns: repeat(3, minmax(8rem, 1fr)); }
    .actor-analysis { grid-template-columns: 1fr 1.6fr; }
    .actor-picker { grid-column: 1 / -1; }
    .actor-mode-help { grid-column: 1 / -1; margin-top: 0; }
    .advanced-grid { grid-template-columns: repeat(2, minmax(10rem, 1fr)); }
    .detail-summary { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 42rem) {
    .insights-header { position: relative; grid-template-columns: 1fr auto; align-items: start; }
    .user-chip { display: none; }
    .compact-session { align-items: center; flex-direction: row; }
    .primary-nav { width: 100%; }
    .primary-nav a { flex: 0 0 auto; }
    .page-heading { align-items: stretch; flex-direction: column; gap: 1rem; }
    .filter-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .actor-analysis { grid-template-columns: 1fr; padding: 0.65rem; }
    .actor-mode-switch,
    .actor-picker,
    .actor-mode-help { grid-column: 1; }
    .actor-mode-switch button { min-height: 3rem; }
    .search-field { grid-column: 1 / -1; }
    .advanced-grid { grid-template-columns: 1fr; }
    .summary-grid { grid-template-columns: repeat(2, 1fr); }
    .rule-layout { grid-template-columns: 1fr; }
    .detail-summary { grid-template-columns: repeat(2, 1fr); }
    .pagination { justify-content: space-between; }
}

@media (prefers-contrast: more) {
    :root { --line: #5a6570; }
    .data-panel, .metric-card, .filter-dock, .detail-section { border-width: 2px; }
    .semaphore-badge, .quality-badge, .trend-badge { border-width: 2px; }
}

@media (prefers-reduced-transparency: reduce) {
    .glass-surface { background: var(--surface) !important; -webkit-backdrop-filter: none; backdrop-filter: none; }
}

.reduced-transparency .glass-surface {
    background: var(--surface) !important;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
}

@media (prefers-reduced-motion: reduce) {
    .skeleton-line { animation: none; }
}

/* Premium dashboard direction */

:root {
    --brand: #335bff;
    --brand-dark: #2447d8;
    --canvas: #f3f5fa;
    --surface-subtle: #f6f7fb;
    --ink: #0e121b;
    --ink-soft: #303846;
    --muted: #8993a3;
    --line: #e6e9f0;
    --focus: #335bff;
    --premium-red: #fb3748;
    --premium-orange: #fa7319;
    --premium-blue: #335bff;
    --premium-black: #0e121b;
    --premium-gradient: linear-gradient(135deg, #335bff 0%, #7d5cff 48%, #fa7319 100%);
}

body {
    background:
        radial-gradient(circle at 78% -10%, rgba(51, 91, 255, 0.1), transparent 25rem),
        var(--canvas);
}

.dashboard-frame {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 17rem minmax(0, 1fr);
}

.insights-sidebar {
    position: sticky;
    z-index: 40;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 1.25rem 1rem;
    background: var(--surface);
    border-right: 1px solid var(--line);
}

.sidebar-brand { min-height: 3.5rem; padding: 0 0.65rem; }
.brand-mark {
    color: #fff;
    background: var(--premium-gradient);
    border-radius: 0.85rem;
    box-shadow: 0 0.55rem 1.2rem rgba(51, 91, 255, 0.24);
}

.workspace-chip {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    margin: 1rem 0.4rem 1.4rem;
    padding: 0.7rem;
    background: var(--surface-subtle);
    border: 1px solid var(--line);
    border-radius: 0.85rem;
}
.workspace-chip > span:last-child { min-width: 0; display: grid; line-height: 1.25; }
.workspace-chip small { color: var(--muted); font-size: 0.65rem; }
.workspace-chip strong { overflow: hidden; color: var(--ink-soft); font-size: 0.75rem; text-overflow: ellipsis; white-space: nowrap; }
.workspace-symbol {
    width: 2rem;
    height: 2rem;
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
    color: #fff;
    background: var(--premium-black);
    border-radius: 0.55rem;
    font-size: 0.65rem;
    font-weight: 850;
}

.primary-nav {
    display: flex;
    flex: 1;
    flex-direction: column;
    align-items: stretch;
    gap: 0.3rem;
}
.primary-nav p { margin: 1.1rem 0.7rem 0.35rem; color: var(--muted); font-size: 0.62rem; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; }
.primary-nav a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-height: 2.8rem;
    padding: 0.6rem 0.75rem;
    color: #687384;
    border: 1px solid transparent;
    border-radius: 0.7rem;
    font-size: 0.82rem;
    font-weight: 720;
}
.primary-nav a:hover { color: var(--ink); background: var(--surface-subtle); }
.primary-nav a[aria-current="page"] {
    color: var(--premium-blue);
    background: #e8edff;
    border-color: #dde5ff;
}
.nav-glyph {
    width: 1.55rem;
    height: 1.55rem;
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
    border: 1.5px solid currentColor;
    border-radius: 0.46rem;
    font-size: 0.82rem;
    font-weight: 800;
}

.sidebar-footnote {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    margin-top: auto;
    padding: 0.85rem;
    color: var(--muted);
    background: var(--surface-subtle);
    border-radius: 0.75rem;
}
.sidebar-footnote > span:last-child { display: grid; }
.sidebar-footnote strong { color: var(--ink-soft); font-size: 0.72rem; }
.sidebar-footnote small { margin-top: 0.12rem; font-size: 0.62rem; }
.official-dot { width: 0.65rem; height: 0.65rem; flex: 0 0 auto; background: #20a66a; border: 3px solid #daf5e8; border-radius: 50%; box-sizing: content-box; }

.dashboard-workspace { min-width: 0; }
.insights-header {
    position: sticky;
    top: 0;
    min-height: 4.5rem;
    display: grid;
    grid-template-columns: 1fr auto;
    padding: 0.65rem clamp(1rem, 2.5vw, 2rem);
}
.topbar-context { display: grid; align-content: center; line-height: 1.2; }
.topbar-kicker { color: var(--muted); font-size: 0.65rem; font-weight: 750; letter-spacing: 0.08em; text-transform: uppercase; }
.topbar-context strong { margin-top: 0.15rem; font-size: 0.88rem; }
.user-avatar { width: 2.35rem; height: 2.35rem; display: inline-grid; place-items: center; color: #fff; background: var(--premium-black); border-radius: 0.75rem; font-size: 0.78rem; font-weight: 850; }

.insights-shell {
    width: min(100%, 120rem);
    padding: clamp(1.5rem, 3vw, 2.7rem) clamp(1rem, 3vw, 2.5rem) 5rem;
}
.page-heading { margin-bottom: 1.7rem; }
.page-heading h1 { margin-top: 0.3rem; font-size: clamp(2rem, 3vw, 3rem); letter-spacing: -0.045em; }
.page-heading .eyebrow { color: var(--premium-blue); }

.primary-action {
    min-height: 2.9rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.7rem 1.1rem;
    color: #fff;
    background: linear-gradient(180deg, #2d3340, var(--premium-black));
    border: 1px solid #06080c;
    border-radius: 0.7rem;
    box-shadow: 0 0.5rem 1rem rgba(14, 18, 27, 0.16);
    font-size: 0.82rem;
    font-weight: 780;
    text-decoration: none;
}
.primary-action:hover { color: #fff; transform: translateY(-1px); }

.filter-dock {
    top: 5.2rem;
    padding: 1rem 1.1rem;
    border-radius: 1rem;
    box-shadow: 0 0.9rem 2.2rem rgba(28, 38, 58, 0.08);
}
.filter-form select,
.filter-form input[type="search"] { border-color: #dfe3eb; border-radius: 0.65rem; box-shadow: 0 1px 0 rgba(14, 18, 27, 0.02); }
.filter-form select:hover,
.filter-form input[type="search"]:hover { border-color: #bdc5d3; }

.overview-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(19rem, 25rem);
    gap: 0.9rem;
    margin: 0.7rem 0 1rem;
}
.summary-grid {
    grid-template-columns: repeat(4, minmax(8.5rem, 1fr));
    margin: 0;
}
.metric-card {
    position: relative;
    min-height: 8rem;
    overflow: hidden;
    padding: 1.05rem;
    border-radius: 1rem;
    box-shadow: 0 0.45rem 1.3rem rgba(31, 41, 61, 0.045);
}
.metric-card::before { position: absolute; top: 0; right: 0; left: 0; height: 0.22rem; content: ""; background: var(--premium-blue); }
.metric-card:nth-child(4n + 2)::before { background: #7c5cff; }
.metric-card:nth-child(4n + 3)::before { background: var(--premium-orange); }
.metric-card:nth-child(4n + 4)::before { background: var(--premium-red); }
.metric-card strong { color: var(--premium-black); letter-spacing: -0.035em; }

.data-panel { border-radius: 1rem; box-shadow: 0 0.6rem 1.8rem rgba(31, 41, 61, 0.05); }
.distribution-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 10rem;
    grid-template-rows: auto 1fr;
    align-items: center;
    gap: 0.7rem;
    padding: 1.1rem;
}
.distribution-copy h2 { margin: 0.2rem 0 0.35rem; font-size: 1.05rem; }
.distribution-copy p:not(.eyebrow) { margin: 0; color: var(--muted); font-size: 0.72rem; line-height: 1.5; }
.distribution-copy .eyebrow { margin-bottom: 0.3rem; color: var(--premium-blue); }
.donut-chart {
    width: 9.5rem;
    aspect-ratio: 1;
    display: grid;
    place-items: center;
    justify-self: end;
    position: relative;
    background: transparent;
    border-radius: 50%;
    box-shadow: inset 0 0 0 1px rgba(14, 18, 27, 0.04);
}
.donut-chart svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; transform: rotate(-90deg); }
.donut-chart circle { fill: none; stroke-width: 7; }
.donut-chart .chart-track { stroke: #e9ecf2; }
.donut-chart > span { z-index: 1; grid-area: 1 / 1; display: grid; text-align: center; }
.donut-chart strong { color: var(--premium-black); font-size: 1.3rem; letter-spacing: -0.04em; }
.donut-chart small { color: var(--muted); font-size: 0.6rem; }
.chart-legend { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.4rem 0.75rem; padding-top: 0.75rem; border-top: 1px solid var(--line); }
.chart-legend span { display: flex; align-items: center; gap: 0.4rem; color: var(--muted); font-size: 0.68rem; }
.chart-swatch { width: 0.55rem; height: 0.55rem; flex: 0 0 auto; border-radius: 0.18rem; }
.chart-swatch.chart-blue { background: #335bff; }
.chart-swatch.chart-orange { background: #fa7319; }
.chart-swatch.chart-amber { background: #ffb14a; }
.chart-swatch.chart-purple { background: #8a5bff; }
.chart-swatch.chart-red { background: #fb3748; }
.chart-swatch.chart-gray { background: #aeb6c3; }

.panel-heading { padding: 1.15rem 1.25rem; }
.data-table th { background: #f8f9fc; }
.data-table td { padding-top: 0.78rem; padding-bottom: 0.78rem; }
.detail-button { color: #fff; background: var(--premium-black); }
.detail-button:hover { background: var(--premium-blue); }

:root[data-theme="dark"] {
    --brand: #6f8cff;
    --brand-dark: #9aabff;
    --premium-blue: #6f8cff;
    --premium-black: #f4f6fa;
}
:root[data-theme="dark"] .primary-nav a[aria-current="page"] { background: #223260; border-color: #314781; }
:root[data-theme="dark"] .actor-mode-switch button[aria-pressed="true"] { background: #223260; border-color: #314781; }
:root[data-theme="dark"] .metric-card strong,
:root[data-theme="dark"] .donut-chart strong { color: var(--ink); }
:root[data-theme="dark"] .primary-action { color: #0e121b; background: #f4f6fa; border-color: #fff; }
:root[data-theme="dark"] .data-table th { background: var(--surface-subtle); }

.workspace-project-link { color: inherit; text-decoration: none; transition: border-color 160ms ease, transform 160ms ease; }
.workspace-project-link:hover { border-color: var(--premium-blue); transform: translateY(-1px); }
.project-center { max-width: 94rem; }
.project-grid { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(28rem, 1.1fr); gap: 1rem; align-items: start; }
.project-list-panel, .project-create-panel { overflow: hidden; }
.project-card-list { display: grid; gap: 0.75rem; padding: 0 1.15rem 1.15rem; }
.project-card { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem; border: 1px solid var(--line); border-radius: 1rem; background: var(--surface-subtle); }
.project-card.is-active { border-color: color-mix(in srgb, var(--premium-blue) 60%, var(--line)); box-shadow: inset 3px 0 0 var(--premium-blue); }
.project-card h3 { margin: 0.3rem 0 0.2rem; font-size: 1rem; }
.project-card p { margin: 0; color: var(--muted); }
.project-card small { display: block; margin-top: 0.55rem; color: var(--muted); }
.project-card-actions, .project-form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.project-status { color: var(--premium-blue); font-size: 0.65rem; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; }
.project-empty { padding: 1.2rem; margin: 0 1.15rem 1.15rem; border: 1px dashed var(--line); border-radius: 1rem; color: var(--muted); }
.project-empty strong { color: var(--ink); }
.project-form { display: grid; gap: 0.9rem; padding: 0 1.15rem 1.25rem; }
.project-form label { display: grid; gap: 0.38rem; font-size: 0.78rem; font-weight: 750; }
.project-form label small { color: var(--muted); font-size: 0.67rem; font-weight: 500; line-height: 1.45; }
.project-form input, .project-form select { width: 100%; min-height: 3rem; padding: 0.7rem 0.8rem; border: 1px solid var(--line); border-radius: 0.8rem; color: var(--ink); background: var(--surface); font: inherit; }
.project-form select[multiple] { min-height: 7rem; }
.project-form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.75rem; }
.form-alert { margin-bottom: 1rem; padding: 0.9rem 1rem; border: 1px solid color-mix(in srgb, var(--premium-red) 45%, var(--line)); border-radius: 0.9rem; color: #9c2430; background: color-mix(in srgb, var(--premium-red) 8%, var(--surface)); }

.perspective-command { margin-bottom: 1rem; padding: 1.2rem; border-top: 3px solid var(--premium-blue); }
.perspective-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.perspective-heading h2 { margin: 0.15rem 0 0.35rem; font-size: clamp(1.25rem, 2vw, 1.75rem); }
.perspective-heading p:not(.eyebrow) { max-width: 55rem; margin: 0; color: var(--muted); line-height: 1.55; }
.perspective-facts { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0.65rem; margin-top: 1rem; }
.perspective-facts article { min-width: 0; padding: 0.85rem; border: 1px solid var(--line); border-radius: 0.85rem; background: var(--surface-subtle); }
.perspective-facts small { display: block; margin-bottom: 0.35rem; color: var(--muted); font-size: 0.65rem; font-weight: 800; letter-spacing: 0.07em; text-transform: uppercase; }
.perspective-facts strong { display: block; overflow-wrap: anywhere; font-size: 0.85rem; line-height: 1.35; }
.resolution-stack { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 0.4rem; }
.table-resolution { min-width: 9rem; justify-content: flex-start; }
.resolution-badge, .priority-badge { display: inline-flex; align-items: center; width: fit-content; padding: 0.35rem 0.55rem; border: 1px solid #b9ddc9; border-radius: 999px; color: #17633d; background: #edf9f2; font-size: 0.62rem; font-weight: 850; letter-spacing: 0.055em; line-height: 1.2; text-transform: uppercase; }
.resolution-badge.rival { border-color: #cbd5ff; color: #334aa6; background: #f0f3ff; }
.resolution-badge.is-warning { border-color: #f2c996; color: #8a4b0c; background: #fff7e9; }
.perspective-warning { margin: 0.85rem 0 0; padding: 0.7rem 0.8rem; border-radius: 0.75rem; color: #71430e; background: #fff7e9; font-size: 0.74rem; line-height: 1.5; }
.context-callout { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; padding: 1rem 1.1rem; border: 1px solid var(--line); border-radius: 1rem; background: var(--surface); }
.context-callout p { margin: 0.2rem 0 0; color: var(--muted); font-size: 0.78rem; }
.context-callout.needs-configuration { border-color: #f2c996; background: #fffaf1; }
.filter-form select[data-context-locked="true"] { color: var(--ink-soft); background: var(--surface-subtle); opacity: 0.8; cursor: not-allowed; }
.priority-badge.p1 { border-color: #f2b7bd; color: #982833; background: #fff0f2; }
.priority-badge.p2 { border-color: #f2c996; color: #8a4b0c; background: #fff7e9; }
.priority-badge.p3 { border-color: #cbd5ff; color: #334aa6; background: #f0f3ff; }
.priority-badge.p4 { border-color: var(--line); color: var(--muted); background: var(--surface-subtle); }
.identity-onboarding { gap: 0.75rem; }
.onboarding-step { display: grid; gap: 0.8rem; margin: 0; padding: 0.9rem; border: 1px solid var(--line); border-radius: 0.9rem; background: var(--surface-subtle); }
.onboarding-step legend { padding: 0 0.35rem; color: var(--ink); font-size: 0.78rem; font-weight: 850; }
.onboarding-step legend span { display: inline-grid; width: 1.55rem; height: 1.55rem; place-items: center; margin-right: 0.35rem; border-radius: 0.5rem; color: #fff; background: var(--premium-blue); }
.onboarding-step > small { color: var(--muted); font-size: 0.68rem; line-height: 1.45; }
.onboarding-step.rival-step { border-color: color-mix(in srgb, var(--premium-orange) 45%, var(--line)); }
.panel-heading .configuration-impact { margin-top: 0.65rem; padding: 0.65rem 0.75rem; border-radius: 0.7rem; color: #71430e; background: #fff7e9; font-size: 0.7rem; line-height: 1.45; }

@media (prefers-color-scheme: dark) {
    :root:not([data-theme]) { --brand: #6f8cff; --brand-dark: #9aabff; --premium-blue: #6f8cff; --premium-black: #f4f6fa; }
    :root:not([data-theme]) .primary-nav a[aria-current="page"] { background: #223260; border-color: #314781; }
    :root:not([data-theme]) .metric-card strong,
    :root:not([data-theme]) .donut-chart strong { color: var(--ink); }
    :root:not([data-theme]) .primary-action { color: #0e121b; background: #f4f6fa; border-color: #fff; }
    :root:not([data-theme]) .data-table th { background: var(--surface-subtle); }
}

@media (max-width: 88rem) {
    .dashboard-frame { grid-template-columns: 5.4rem minmax(0, 1fr); }
    .insights-sidebar { padding-inline: 0.7rem; }
    .sidebar-brand { justify-content: center; }
    .sidebar-brand .brand-name,
    .workspace-chip,
    .primary-nav p,
    .primary-nav a > span:last-child,
    .sidebar-footnote > span:last-child { display: none; }
    .primary-nav a { justify-content: center; padding-inline: 0.5rem; }
    .sidebar-footnote { justify-content: center; }
    .overview-layout { grid-template-columns: 1fr; }
    .distribution-card { grid-template-columns: 1fr 10rem; }
    .perspective-facts { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 64rem) {
    .insights-header { grid-template-columns: 1fr auto; }
    .primary-nav { grid-column: auto; grid-row: auto; overflow: visible; }
    .compact-session { grid-column: auto; grid-row: auto; }
    .filter-dock { position: relative; top: auto; }
    .summary-grid { grid-template-columns: repeat(2, 1fr); }
    .project-grid { grid-template-columns: 1fr; }
    .perspective-heading { flex-direction: column; }
    .resolution-stack { justify-content: flex-start; }
}

@media (max-width: 42rem) {
    .dashboard-frame { display: block; }
    .insights-sidebar { position: sticky; height: auto; flex-direction: row; align-items: center; gap: 0.5rem; padding: 0.55rem 0.7rem; border-right: 0; border-bottom: 1px solid var(--line); }
    .sidebar-brand { min-height: auto; padding: 0; }
    .sidebar-brand .brand-mark { width: 2.25rem; height: 2.25rem; }
    .primary-nav { min-width: 0; flex-direction: row; justify-content: flex-end; overflow-x: auto; }
    .primary-nav a { min-height: 2.35rem; flex: 0 0 auto; }
    .sidebar-footnote { display: none; }
    .insights-header { position: sticky; grid-template-columns: 1fr auto; padding-block: 0.5rem; }
    .topbar-context { display: none; }
    .user-avatar { display: none; }
    .overview-layout { display: block; }
    .distribution-card { margin-top: 0.8rem; grid-template-columns: 1fr 8rem; }
    .donut-chart { width: 7.5rem; }
    .summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .project-form-row { grid-template-columns: 1fr; }
    .project-card { align-items: flex-start; flex-direction: column; }
    .perspective-facts { grid-template-columns: 1fr; }
    .context-callout { align-items: flex-start; flex-direction: column; }
}
[data-result-provenance]:empty { display: none; }
.result-provenance { margin-top: 1rem; border-top: 1px solid var(--border, #e5e7eb); padding-top: .75rem; font-size: .875rem; }
.result-provenance p { margin: .4rem 0; overflow-wrap: anywhere; }
.configuration-history { margin-top: 1.5rem; }
.configuration-history-list, .history-empty { padding: 0 1.5rem 1.5rem; }
.configuration-revision { padding: 1rem 0; border-top: 1px solid var(--border, #e5e7eb); }
.configuration-revision summary { cursor: pointer; font-weight: 600; }
.configuration-revision p { margin: .5rem 0; overflow-wrap: anywhere; }
/* Administrative source review: scoped, read-only and usable without JavaScript. */
.history-review-header { background: var(--surface); }
.history-review-shell { max-width: 94rem; margin: 0 auto; padding: clamp(1rem, 3vw, 2.5rem); }
.history-review-shell .page-heading { align-items: flex-start; }
.history-review-panel { min-width: 0; margin-bottom: 1.1rem; padding: 1.35rem; background: var(--surface-raised); border: 1px solid var(--line); border-radius: 1rem; }
.history-review-panel h2 { margin: 0.4rem 0 0.8rem; font-size: 1.2rem; }
.history-review-panel h2 small { font-size: 0.85rem; color: var(--muted); }
.history-review-panel p { color: var(--ink-soft); line-height: 1.6; }
.history-review-label { display: inline-block; flex-shrink: 0; padding: 0.4rem 0.65rem; border: 1px solid var(--line); border-radius: 0.55rem; background: var(--surface-subtle); color: var(--ink-soft); font-size: 0.75rem; }
.history-review-filters { display: grid; grid-template-columns: minmax(15rem, 1.3fr) minmax(12rem, 1fr) auto auto; gap: 1rem; align-items: end; }
.history-review-filters label { display: grid; gap: 0.45rem; margin: 0; font-weight: 700; font-size: 0.85rem; }
.history-review-filters input, .history-review-filters select { min-width: 0; width: 100%; min-height: 3rem; margin: 0; padding: 0.7rem 0.8rem; border: 1px solid var(--line); border-radius: 0.65rem; color: var(--ink); background: var(--surface); }
.history-review-filters input::placeholder { color: var(--muted); opacity: 1; }
.history-review-filters select { padding-right: 2rem; }
.history-review-filters button { min-height: 3rem; }
.history-review-filters a { align-self: center; font-size: 0.85rem; }
.history-review-muted { font-size: 0.8rem; color: var(--muted); }
.history-review-context { display: flex; align-items: center; flex-wrap: wrap; gap: 1rem; margin-top: 1.4rem; }
.history-review-context h2 { margin: 0; }
.history-review-counts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; margin: 1.3rem 0; }
.history-review-counts > div { border-left: 3px solid var(--brand); padding: 0.1rem 0.8rem; }
.history-review-counts dt { font-size: 0.78rem; color: var(--muted); }
.history-review-counts dd { margin: 0.3rem 0 0; color: var(--ink); font-size: 1.6rem; font-weight: 750; }
.history-review-provenance { margin-top: 1rem; overflow-wrap: anywhere; }
.history-review-provenance summary { cursor: pointer; color: var(--brand); font-weight: 650; padding: 0.5rem 0; }
.history-review-provenance dt { font-weight: 650; margin-top: 0.7rem; }
.history-review-provenance dd { margin: 0.25rem 0; color: var(--ink-soft); }
.history-review-provenance code, .history-review-code { display: block; overflow-wrap: anywhere; white-space: normal; font-size: 0.8rem; }
.history-review-pending { margin-top: 1.25rem; padding: 0.9rem 1.1rem; border: 1px solid var(--line); border-radius: 0.75rem; background: var(--surface-subtle); }
.history-review-pending h3 { margin: 0; font-size: 1rem; }
.history-review-pending li { margin: 0.55rem 0; line-height: 1.5; color: var(--ink-soft); }
.history-review-pending p { font-size: 0.85rem; }
.history-review-table-panel { padding: 0; overflow: hidden; }
.history-review-table-panel .panel-heading { flex-wrap: wrap; }
.history-review-table { min-width: 58rem; }
.history-review-table tbody th, .history-review-options tbody th, .history-review-votes tbody th { position: static; text-transform: none; white-space: normal; font-size: inherit; letter-spacing: normal; color: var(--ink); background: var(--surface-raised); }
.history-review-filename { max-width: 18rem; overflow-wrap: anywhere; }
.history-review-options { min-width: 34rem; }
.history-review-votes { min-width: 65rem; }
.history-review-caption { padding: 0.65rem; text-align: left; font-size: 0.8rem; color: var(--muted); }
.history-review-pagination { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 1.5rem; margin: 1.5rem 0 2.5rem; font-size: 0.85rem; }
.history-review-pagination a { padding: 0.65rem; }
.history-evidence-form { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1rem; margin-top: 1.2rem; }
.history-evidence-form label { display: grid; align-content: start; gap: 0.5rem; margin: 0; font-size: 0.88rem; }
.history-evidence-form input, .history-evidence-form select, .history-evidence-form textarea { width: 100%; min-width: 0; min-height: 3rem; padding: 0.7rem 0.8rem; border: 1px solid var(--line); border-radius: 0.65rem; background: var(--surface); color: var(--ink); font: inherit; }
.history-evidence-form textarea { resize: vertical; }
.history-evidence-form input::placeholder { color: var(--muted); }
.history-evidence-wide { grid-column: 1 / -1; }
.history-evidence-entry { padding: 1rem 0; border-top: 1px solid var(--line); overflow-wrap: anywhere; }
.history-evidence-entry h3 { font-size: 1.05rem; margin: 0; }
.history-evidence-entry:target { outline: 2px solid var(--brand); outline-offset: 0.4rem; }
.history-evidence-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.history-review-attestations { min-width: 0; border: 1px solid var(--line); border-radius: 0.65rem; padding: 0.85rem; }
.history-evidence-form .history-review-attestations label { display: flex; align-items: flex-start; gap: 0.7rem; margin: 0.65rem 0; font-weight: 500; }
.history-evidence-form .history-review-attestations input { flex: 0 0 1.1rem; width: 1.1rem; min-height: 1.1rem; height: 1.1rem; margin: 0.15rem 0 0; padding: 0; }
@media (max-width: 60rem) {
    .history-review-filters { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
    .history-review-counts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 42rem) {
    .history-review-shell .page-heading { flex-direction: column; gap: 0.75rem; }
    .history-evidence-form { grid-template-columns: minmax(0, 1fr); }
    .history-review-filters { grid-template-columns: minmax(0, 1fr); }
    .history-review-header .session-actions { flex-direction: row; flex-wrap: wrap; align-items: center; }
    .history-review-counts { gap: 1rem 0.5rem; }
    .history-review-panel { padding: 1rem; }
    .history-review-table-panel { padding: 0; }
}
