:root {
    color-scheme: light;
    --ink-950: #101828;
    --ink-900: #162033;
    --ink-800: #273348;
    --ink-700: #3f4b5f;
    --ink-600: #5d6879;
    --ink-500: #667386;
    --ink-300: #c8ced7;
    --ink-200: #dfe3e8;
    --ink-100: #eef0f3;
    --ink-50: #f7f8fa;
    --paper: #ffffff;
    --canvas: #f5f7fa;
    --navy: #16213c;
    --navy-soft: #263657;
    --lime: #b8d84b;
    --lime-dark: #627b16;
    --blue: #3867d6;
    --green: #17825c;
    --orange: #c76b16;
    --red: #c53b42;
    --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.05);
    --shadow-md: 0 12px 32px rgba(16, 24, 40, 0.08);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 18px;
    font-family: Inter, Aptos, "Segoe UI", Arial, sans-serif;
}

* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
}

html {
    background: var(--canvas);
}

body {
    margin: 0;
    color: var(--ink-900);
    background: var(--canvas);
    font-size: 15px;
    -webkit-font-smoothing: antialiased;
}

button,
input {
    font: inherit;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

a {
    color: inherit;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
summary:focus-visible,
[tabindex="0"]:focus-visible {
    outline: 3px solid rgba(56, 103, 214, 0.28);
    outline-offset: 2px;
}

.app-frame {
    min-height: 100vh;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    display: grid;
    grid-template-columns: minmax(250px, 1fr) auto minmax(250px, 1fr);
    align-items: center;
    min-height: 72px;
    padding: 0 28px;
    color: var(--paper);
    background: var(--navy);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.topbar-brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    width: fit-content;
    text-decoration: none;
}

.brand-symbol {
    display: inline-grid;
    place-items: center;
    width: 38px;
    height: 38px;
    color: var(--navy);
    background: var(--lime);
    border-radius: 11px;
    font-size: 20px;
    font-weight: 800;
    letter-spacing: -0.06em;
}

.topbar-brand > span:last-child,
.login-brand > span:last-child {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.topbar-brand strong,
.login-brand strong {
    font-size: 15px;
    line-height: 1.1;
    letter-spacing: -0.01em;
}

.topbar-brand small,
.login-brand small {
    color: rgba(255, 255, 255, 0.6);
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.topbar-context {
    display: flex;
    align-items: center;
    gap: 14px;
    color: rgba(255, 255, 255, 0.63);
    font-size: 12px;
}

.environment-label {
    padding: 6px 10px;
    color: #e6efbf;
    background: rgba(184, 216, 75, 0.13);
    border: 1px solid rgba(184, 216, 75, 0.22);
    border-radius: 999px;
}

.topbar-divider {
    width: 1px;
    height: 18px;
    background: rgba(255, 255, 255, 0.15);
}

.user-menu {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
}

.user-avatar {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    color: var(--paper);
    background: var(--navy-soft);
    border: 1px solid rgba(255, 255, 255, 0.13);
    border-radius: 50%;
    font-size: 13px;
    font-weight: 700;
}

.user-copy {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 82px;
}

.user-copy strong {
    font-size: 13px;
    font-weight: 650;
}

.user-copy small {
    color: rgba(255, 255, 255, 0.52);
    font-size: 11px;
}

.user-menu form {
    margin-left: 6px;
}

.user-menu button {
    padding: 7px 10px;
    color: rgba(255, 255, 255, 0.72);
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 7px;
    font-size: 12px;
    cursor: pointer;
}

.user-menu button:hover {
    color: var(--paper);
    border-color: rgba(255, 255, 255, 0.32);
}

.topbar-action {
    margin-right: 6px;
    padding: 7px 10px;
    color: rgba(255, 255, 255, 0.72);
    border-radius: 7px;
    font-size: 12px;
    text-decoration: none;
}

.topbar-action:hover {
    color: var(--paper);
    background: rgba(255, 255, 255, 0.08);
}

.dashboard-shell {
    display: grid;
    grid-template-columns: 238px minmax(0, 1fr);
    min-height: calc(100vh - 72px);
}

.dashboard-nav {
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding: 24px 16px 18px;
    background: #edf1f6;
    border-right: 1px solid var(--ink-200);
}

.nav-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 8px 12px;
}

.nav-heading span {
    color: var(--ink-600);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}

.nav-heading strong {
    color: var(--ink-500);
    font-size: 11px;
    font-weight: 600;
}

.dashboard-nav nav {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 4px;
}

.nav-item {
    display: grid;
    grid-template-columns: 4px minmax(0, 1fr);
    gap: 12px;
    align-items: stretch;
    width: 100%;
    padding: 10px 11px 10px 8px;
    color: var(--ink-700);
    text-align: left;
    background: transparent;
    border: 0;
    border-radius: 10px;
    cursor: pointer;
}

.nav-item:hover {
    color: var(--ink-950);
    background: rgba(255, 255, 255, 0.68);
}

.nav-item.active {
    color: var(--ink-950);
    background: var(--paper);
    box-shadow: var(--shadow-sm);
}

.nav-item > span:last-child {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 3px;
}

.nav-item strong {
    overflow: hidden;
    font-size: 13px;
    font-weight: 650;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nav-item small {
    color: var(--ink-500);
    font-size: 10px;
}

.nav-mark {
    display: block;
    width: 4px;
    min-height: 32px;
    background: var(--ink-300);
    border-radius: 99px;
}

.nav-item.active .accent-indigo { background: #5968c5; }
.nav-item.active .accent-blue { background: #3b72d9; }
.nav-item.active .accent-cyan { background: #2b94b8; }
.nav-item.active .accent-teal { background: #20937f; }
.nav-item.active .accent-orange { background: #d27b27; }
.nav-item.active .accent-violet { background: #8065c8; }
.nav-item.active .accent-purple { background: #9a5eb5; }
.nav-item.active .accent-rose { background: #c65b73; }
.nav-item.active .accent-red { background: #cc565a; }
.nav-item.active .accent-slate { background: #657386; }
.nav-item.active .accent-green { background: #3b966b; }

.nav-note {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 18px;
    padding: 13px;
    background: rgba(255, 255, 255, 0.55);
    border: 1px solid var(--ink-200);
    border-radius: 10px;
}

.status-dot,
.source-status > span,
.preview-pill > span {
    display: block;
    flex: 0 0 auto;
    width: 8px;
    height: 8px;
    background: var(--lime-dark);
    border-radius: 50%;
    box-shadow: 0 0 0 4px rgba(120, 149, 31, 0.11);
}

.source-status.cached > span,
.preview-pill.cached > span {
    background: var(--orange);
    box-shadow: 0 0 0 4px rgba(223, 160, 73, 0.13);
}

.nav-note > div {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 2px;
}

.nav-note strong {
    font-size: 11px;
}

.nav-note small {
    overflow: hidden;
    color: var(--ink-500);
    font-size: 10px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dashboard-content {
    min-width: 0;
    padding: 28px clamp(24px, 3vw, 44px) 48px;
}

.page-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 32px;
    max-width: 1500px;
    margin: 0 auto 24px;
}

.eyebrow,
.section-kicker {
    color: var(--lime-dark);
    font-size: 11px;
    font-weight: 750;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.page-heading h1 {
    margin: 7px 0 8px;
    color: var(--ink-950);
    font-size: clamp(25px, 2.5vw, 36px);
    line-height: 1.12;
    letter-spacing: -0.035em;
}

.page-heading p {
    max-width: 730px;
    margin: 0;
    color: var(--ink-600);
    font-size: 14px;
    line-height: 1.6;
}

.preview-pill {
    display: flex;
    align-items: center;
    gap: 9px;
    flex: 0 0 auto;
    margin-top: 7px;
    padding: 8px 12px;
    color: var(--ink-700);
    background: var(--paper);
    border: 1px solid var(--ink-200);
    border-radius: 999px;
    box-shadow: var(--shadow-sm);
    font-size: 11px;
    font-weight: 650;
}

.question-answer-panel {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    max-width: 1500px;
    margin: 0 auto 18px;
    overflow: hidden;
    background: var(--paper);
    border: 1px solid var(--ink-200);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.question-picker {
    min-width: 0;
    padding: 24px 26px 20px;
}

.question-picker label {
    display: block;
    margin-bottom: 10px;
    color: var(--ink-700);
    font-size: 12px;
    font-weight: 650;
}

.question-combo {
    width: 100%;
}

.question-combo .dxbl-text-edit-input {
    min-height: 46px;
    color: var(--ink-950);
    font-size: 14px;
}

.view-contract {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 11px;
    color: var(--ink-500);
    font-size: 10px;
}

.view-contract code {
    padding: 3px 7px;
    color: var(--ink-700);
    background: var(--ink-50);
    border: 1px solid var(--ink-200);
    border-radius: 5px;
    font-family: "Cascadia Code", Consolas, monospace;
    font-size: 10px;
}

/*
    The per-question rule panel. Collapsed by default so it never competes
    with the answer, and rendered only for questions whose Section view model
    carries a governed rule.
*/
.question-rule {
    margin: 0 24px 20px;
    background: var(--ink-50);
    border: 1px solid var(--ink-200);
    border-radius: var(--radius-sm);
}

.question-rule > summary {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 12px;
    color: var(--ink-700);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.01em;
    cursor: pointer;
    list-style: none;
    user-select: none;
}

.question-rule > summary::-webkit-details-marker {
    display: none;
}

.question-rule > summary:hover {
    color: var(--ink-950);
}

.question-rule > summary:focus-visible {
    outline: 2px solid var(--blue);
    outline-offset: -2px;
    border-radius: var(--radius-sm);
}

.question-rule-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    color: var(--paper);
    background: var(--ink-500);
    border-radius: 50%;
    font-size: 10px;
    font-weight: 700;
    font-style: italic;
    font-family: Georgia, "Times New Roman", serif;
}

.question-rule[open] > summary {
    border-bottom: 1px solid var(--ink-200);
}

.question-rule[open] .question-rule-mark {
    background: var(--blue);
}

.question-rule-body {
    padding: 12px;
}

.question-rule-body p {
    margin: 0;
    color: var(--ink-700);
    font-size: 12px;
    line-height: 1.65;
}

.question-rule-body p + p {
    margin-top: 9px;
}

.question-rule-defaults span {
    margin-right: 7px;
    padding: 2px 7px;
    color: var(--ink-700);
    background: var(--paper);
    border: 1px solid var(--ink-200);
    border-radius: 5px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.question-rule-source {
    color: var(--ink-500);
    font-size: 10px;
}

.question-unavailable-badge {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 3px 9px;
    color: #8a3b12;
    background: #fff4e8;
    border: 1px solid #f3c99e;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.loading-value {
    opacity: 0.55;
}

.selection-value {
    max-width: 280px;
    font-size: clamp(24px, 2.5vw, 34px) !important;
    line-height: 1.05 !important;
}

.dashboard-empty-state {
    display: flex;
    align-items: center;
    gap: 18px;
    max-width: 1500px;
    min-height: 170px;
    margin: 0 auto;
    padding: 28px 30px;
    color: var(--ink-600);
    background: var(--paper);
    border: 1px dashed var(--ink-300);
    border-radius: var(--radius-lg);
}

.dashboard-empty-state h2 {
    margin: 5px 0 7px;
    color: var(--ink-950);
    font-size: 20px;
    letter-spacing: -0.025em;
}

.dashboard-empty-state p {
    max-width: 660px;
    margin: 0;
    font-size: 13px;
    line-height: 1.6;
}

.dashboard-disabled-state {
    border-color: #e5b77d;
    background: #fffaf3;
}

.dashboard-disabled-state .empty-state-mark {
    color: #9a4d16;
    background: #ffead3;
}

.empty-state-mark {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    color: var(--indigo);
    background: var(--indigo-soft);
    border-radius: 14px;
    font-size: 21px;
    font-weight: 750;
}

.dashboard-filters {
    max-width: 1500px;
    margin: 0 auto 18px;
    padding: 18px 20px 20px;
    background: var(--paper);
    border: 1px solid var(--ink-200);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.filters-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 15px;
}

.filters-heading h2 {
    margin: 3px 0 0;
    color: var(--ink-950);
    font-size: 16px;
    letter-spacing: -0.02em;
}

.clear-filters {
    min-height: 34px;
    padding: 7px 12px;
    color: var(--ink-700);
    background: var(--paper);
    border: 1px solid var(--ink-300);
    border-radius: 7px;
    font: inherit;
    font-size: 11px;
    font-weight: 650;
    cursor: pointer;
}

.clear-filters:hover:not(:disabled) {
    color: var(--navy);
    background: var(--ink-50);
    border-color: var(--ink-400);
}

.clear-filters:disabled {
    opacity: 0.45;
    cursor: default;
}

.filter-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.filter-field {
    min-width: 0;
}

.filter-field label {
    display: block;
    margin-bottom: 7px;
    color: var(--ink-600);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.035em;
    text-transform: none;
}

.filter-combo {
    width: 100%;
}

.filter-combo .dxbl-text-edit-input {
    min-height: 39px;
    color: var(--ink-900);
    font-size: 12px;
}

.metric-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
    max-width: 1500px;
    margin: 0 auto 18px;
}

.metric-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: space-between;
    gap: 14px;
    min-height: 104px;
    padding: 18px 18px 16px;
    overflow: hidden;
    background: var(--paper);
    border: 1px solid var(--ink-200);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.metric-card::before {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--ink-300);
    content: "";
}

.metric-card.tone-positive::before { background: #37a777; }
.metric-card.tone-warning::before { background: #dfa049; }
.metric-card.tone-critical::before { background: #d85a60; }

.metric-card > div {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.metric-card span {
    color: var(--ink-600);
    font-size: 11px;
    font-weight: 600;
}

.metric-card strong {
    color: var(--ink-950);
    font-size: 26px;
    line-height: 1;
    letter-spacing: -0.035em;
    overflow-wrap: anywhere;
    font-variant-numeric: tabular-nums;
}

.metric-card small {
    color: var(--ink-500);
    font-size: 12px;
    text-align: left;
    line-height: 1.5;
}

.tone-positive small { color: var(--green); }
.tone-warning small { color: var(--orange); }
.tone-critical small { color: var(--red); }

.ranking-panel {
    max-width: 1500px;
    margin: 0 auto 18px;
    padding: 20px 22px 22px;
    background: linear-gradient(135deg, #f7f9fc 0%, var(--paper) 72%);
    border: 1px solid var(--ink-200);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.ranking-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 16px;
}

.ranking-heading h2 {
    margin: 4px 0 0;
    color: var(--ink-950);
    font-size: 18px;
    letter-spacing: -0.02em;
}

.ranking-heading > small {
    color: var(--ink-500);
    font-size: 10px;
}

.ranking-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.ranking-card {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr);
    align-items: center;
    gap: 13px;
    min-height: 86px;
    padding: 14px;
    background: var(--paper);
    border: 1px solid var(--ink-200);
    border-radius: var(--radius-md);
}

.ranking-position {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    color: var(--paper);
    background: var(--navy);
    border-radius: 50%;
    font-size: 15px;
    font-weight: 800;
}

.rank-2 .ranking-position { background: #526481; }
.rank-3 .ranking-position { background: #7b879b; }

.ranking-content,
.ranking-content > div:first-child {
    min-width: 0;
}

.ranking-content > div:first-child {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
}

.ranking-content strong {
    overflow: hidden;
    color: var(--ink-900);
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ranking-content > div:first-child > span {
    flex: 0 0 auto;
    color: var(--ink-950);
    font-size: 12px;
    font-weight: 750;
}

.ranking-track {
    height: 5px;
    margin-top: 12px;
    overflow: hidden;
    background: var(--ink-100);
    border-radius: 999px;
}

.ranking-track > span {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, var(--navy), var(--lime));
    border-radius: inherit;
}

.outcome-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 5px 12px;
    margin-top: 9px;
    color: var(--ink-600);
    font-size: 10px;
}

.outcome-legend span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.outcome-legend i {
    width: 7px;
    height: 7px;
    border-radius: 50%;
}

.outcome-track {
    display: flex;
    height: 7px;
    margin-top: 7px;
    overflow: hidden;
    background: var(--ink-100);
    border-radius: 999px;
}

.outcome-track > span {
    height: 100%;
}

.outcome-track .successful,
.outcome-legend .successful {
    background: var(--lime);
}

.outcome-track .failed,
.outcome-legend .failed {
    background: var(--red);
}

.records-panel {
    max-width: 1500px;
    margin: 0 auto;
    overflow: hidden;
    background: var(--paper);
    border: 1px solid var(--ink-200);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.records-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 21px 24px 18px;
    border-bottom: 1px solid var(--ink-100);
}

.records-header h2 {
    margin: 4px 0 0;
    color: var(--ink-950);
    font-size: 18px;
    letter-spacing: -0.02em;
}

.records-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    min-width: 0;
}

.export-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 34px;
    padding: 7px 12px;
    color: var(--paper);
    background: var(--navy);
    border: 1px solid var(--navy);
    border-radius: 7px;
    font-size: 11px;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
    transition:
        background-color 120ms ease,
        border-color 120ms ease,
        transform 120ms ease;
}

.export-button:hover:not(.disabled) {
    color: var(--paper);
    background: #26395f;
    border-color: #26395f;
    transform: translateY(-1px);
}

.export-button > span {
    font-size: 15px;
    line-height: 1;
}

.export-button.disabled {
    opacity: 0.45;
    cursor: default;
    pointer-events: none;
}

.source-status {
    display: flex;
    align-items: center;
    gap: 9px;
    max-width: 360px;
    padding: 7px 10px;
    overflow: hidden;
    color: var(--ink-500);
    background: var(--ink-50);
    border: 1px solid var(--ink-100);
    border-radius: 7px;
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: normal;
    overflow-wrap: anywhere;
}

.source-status > span {
    width: 6px;
    height: 6px;
    box-shadow: none;
}

.records-grid {
    border: 0 !important;
}

.records-grid .dxbl-grid-header-row {
    background: #f8f9fa;
}

.records-grid .dxbl-grid-header-row > td {
    color: var(--ink-600);
    font-size: 10px;
    font-weight: 750;
    letter-spacing: 0.045em;
    text-transform: uppercase;
}

.records-grid .dxbl-grid-table > tbody > tr > td {
    height: 50px;
    color: var(--ink-700);
    font-size: 12px;
}

.records-grid .dxbl-grid-table > tbody > tr > td:first-child {
    color: var(--ink-950);
    font-family: "Cascadia Code", Consolas, monospace;
    font-size: 11px;
    font-weight: 650;
}

.question-table-scroll {
    width: 100%;
    max-height: min(72vh, 760px);
    overflow: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
    border-top: 1px solid var(--ink-100);
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.dashboard-loading-state,
.dashboard-refresh-state {
    position: relative;
    width: 100%;
    max-width: 1500px;
    margin: 0 auto 12px;
    overflow: hidden;
    box-sizing: border-box;
    color: var(--ink-700);
    background: var(--paper);
    border: 1px solid var(--ink-200);
    border-radius: var(--radius-md);
}

.dashboard-loading-state {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 14px;
    min-height: 92px;
    padding: 20px 22px 24px;
}

.dashboard-loading-state div {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.dashboard-loading-state strong {
    color: var(--ink-950);
    font-size: 14px;
}

.dashboard-loading-state small {
    color: var(--ink-500);
    font-size: 11px;
}

.dashboard-refresh-state {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 10px;
    min-height: 42px;
    padding: 10px 14px 13px;
    font-size: 11px;
    font-weight: 650;
}

.dashboard-refresh-copy {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 2px;
}

.dashboard-refresh-copy strong {
    overflow: hidden;
    color: var(--ink-800);
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.loading-quip {
    display: block;
    overflow: hidden;
    color: var(--ink-500);
    font-size: 10px;
    font-weight: 500;
    text-overflow: ellipsis;
    white-space: nowrap;
    animation: loading-quip-in 280ms ease-out;
}

.dashboard-loading-spinner {
    width: 22px;
    height: 22px;
    border: 3px solid var(--ink-100);
    border-top-color: var(--navy);
    border-right-color: var(--lime);
    border-radius: 50%;
    animation: dashboard-spin 800ms linear infinite;
}

.dashboard-refresh-state .dashboard-loading-spinner {
    width: 16px;
    height: 16px;
    border-width: 2px;
}

.dashboard-loading-progress {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    height: 4px;
    overflow: hidden;
    background: var(--ink-100);
}

.dashboard-loading-progress > span {
    display: block;
    width: 38%;
    height: 100%;
    background: linear-gradient(90deg, var(--navy), var(--lime));
    animation: dashboard-progress 1.25s ease-in-out infinite;
}

@keyframes dashboard-spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes dashboard-progress {
    from {
        transform: translateX(-105%);
    }

    to {
        transform: translateX(365%);
    }
}

@keyframes loading-quip-in {
    from {
        opacity: 0;
        transform: translateY(3px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.question-records-table {
    width: max-content;
    min-width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.question-records-table th,
.question-records-table td {
    min-width: 130px;
    padding: 14px 16px;
    border-right: 1px solid var(--ink-100);
    border-bottom: 1px solid var(--ink-100);
    text-align: left;
    white-space: nowrap;
}

.question-records-table th {
    position: sticky;
    top: 0;
    z-index: 1;
    color: var(--ink-600);
    background: #f8f9fa;
    font-size: 10px;
    font-weight: 750;
    letter-spacing: 0.045em;
    text-transform: uppercase;
}

.table-sort-button {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    padding: 0;
    color: inherit;
    background: transparent;
    border: 0;
    font: inherit;
    letter-spacing: inherit;
    text-align: left;
    text-transform: inherit;
    cursor: pointer;
}

.table-header-line {
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.table-header-line .table-sort-button {
    flex: 1;
    min-width: 0;
}

.column-filter-menu {
    position: relative;
    flex: 0 0 auto;
    color: var(--ink-400);
}

.column-filter-menu summary {
    display: grid;
    width: 24px;
    height: 24px;
    place-items: center;
    margin: -5px -5px -5px 0;
    border-radius: 5px;
    cursor: pointer;
    list-style: none;
}

.column-filter-menu summary::-webkit-details-marker {
    display: none;
}

.column-filter-menu summary:hover,
.column-filter-menu summary:focus-visible,
.column-filter-menu[open] summary,
.column-filter-menu.active summary {
    color: var(--navy);
    background: var(--ink-100);
}

.column-filter-menu summary:focus-visible {
    outline: 2px solid var(--navy);
    outline-offset: 2px;
}

.column-filter-menu summary svg {
    width: 14px;
    height: 14px;
    fill: currentColor;
}

.column-filter-panel {
    position: absolute;
    top: calc(100% + 8px);
    right: -6px;
    z-index: 10;
    display: grid;
    gap: 10px;
    width: 260px;
    padding: 14px;
    color: var(--ink-700);
    background: var(--paper);
    border: 1px solid var(--ink-200);
    border-radius: 8px;
    box-shadow: 0 14px 34px rgba(17, 32, 60, 0.18);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: normal;
    text-transform: none;
    white-space: normal;
}

.question-records-table th:has(.column-filter-menu[open]) {
    z-index: 4;
}

.column-filter-heading {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
}

.column-filter-heading strong {
    color: var(--ink-900);
    font-size: 11px;
}

.column-filter-heading small {
    color: var(--ink-500);
    font-size: 10px;
    font-weight: 500;
    white-space: nowrap;
}

.column-filter-search {
    display: grid;
}

.column-filter-search input {
    width: 100%;
    height: 34px;
    padding: 0 10px;
    color: var(--ink-800);
    background: var(--paper);
    border: 1px solid var(--ink-200);
    border-radius: 6px;
    font: inherit;
    font-weight: 500;
}

.column-filter-search input:focus {
    border-color: var(--navy);
    outline: 2px solid color-mix(in srgb, var(--navy) 18%, transparent);
}

.column-filter-options {
    display: grid;
    gap: 2px;
    max-height: 240px;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-right: 4px;
}

.column-filter-option {
    display: grid;
    grid-template-columns: 16px minmax(0, 1fr);
    align-items: center;
    gap: 8px;
    min-height: 30px;
    padding: 4px 6px;
    border-radius: 5px;
    cursor: pointer;
}

.column-filter-option:hover {
    background: var(--ink-100);
}

.column-filter-option input {
    width: 15px;
    height: 15px;
    margin: 0;
    accent-color: var(--navy);
}

.column-filter-option span {
    overflow: hidden;
    color: var(--ink-700);
    font-weight: 500;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.column-filter-empty {
    padding: 12px 6px;
    color: var(--ink-500);
    font-weight: 500;
    text-align: center;
}

.column-filter-panel button {
    justify-self: start;
    padding: 0;
    color: var(--navy);
    background: transparent;
    border: 0;
    font: inherit;
    cursor: pointer;
}

.column-filter-panel button:hover,
.column-filter-panel button:focus-visible {
    text-decoration: underline;
}

.table-sort-button:hover,
.table-sort-button:focus-visible {
    color: var(--ink-950);
}

.table-sort-button:focus-visible {
    outline: 2px solid var(--navy);
    outline-offset: 5px;
}

.table-sort-indicator {
    color: var(--ink-400);
    font-size: 13px;
    line-height: 1;
}

.question-records-table th[aria-sort="ascending"] .table-sort-indicator,
.question-records-table th[aria-sort="descending"] .table-sort-indicator {
    color: var(--navy);
}

.question-records-table td {
    color: var(--ink-700);
    background: var(--paper);
    font-size: 12px;
}

.question-records-table tbody tr:nth-child(even) td {
    background: #fbfcfd;
}

.question-records-table th:last-child,
.question-records-table td:last-child {
    border-right: 0;
}

.question-records-table .table-empty-cell {
    height: 96px;
    color: var(--ink-500);
    text-align: center;
}

.question-records-table .record-text-list-cell {
    min-width: 250px;
    max-width: 420px;
    white-space: normal;
    vertical-align: top;
}

.record-text-list {
    margin: 0;
    padding-left: 16px;
    overflow-wrap: anywhere;
}

.record-text-list li + li {
    margin-top: 6px;
}

.question-records-table .contract-expand-column {
    position: sticky;
    left: 0;
    z-index: 2;
    min-width: 108px;
    background: var(--paper);
}

.question-records-table th.contract-expand-column {
    z-index: 3;
    background: #f8f9fa;
}

.contract-expand-button {
    padding: 5px 9px;
    border: 1px solid var(--ink-100);
    border-radius: 5px;
    color: var(--navy);
    background: var(--paper);
    cursor: pointer;
    white-space: nowrap;
}

.question-records-table .contract-detail-row td {
    padding: 14px;
    white-space: normal;
    background: #f8f9fa;
}

.contract-detail-list {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.contract-detail-card {
    flex: 1 1 260px;
    max-width: 440px;
    padding: 12px;
    border: 1px solid var(--ink-100);
    border-radius: 6px;
    background: var(--paper);
}

.contract-detail-card h4 {
    margin: 0 0 10px;
    color: var(--navy);
}

.contract-detail-card dl {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 12px;
    margin: 0;
}

.contract-detail-card dt {
    color: var(--ink-500);
    font-size: 10px;
}

.contract-detail-card dd {
    margin: 0;
    overflow-wrap: anywhere;
}

.question-table-pager {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 18px;
    min-height: 56px;
    padding: 10px 14px;
    color: var(--ink-600);
    background: #fbfcfd;
    border-top: 1px solid var(--ink-100);
    font-size: 11px;
}

.question-table-pager label,
.table-page-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.question-table-pager select {
    min-width: 70px;
    height: 32px;
    padding: 0 26px 0 9px;
    color: var(--ink-800);
    background: var(--paper);
    border: 1px solid var(--ink-200);
    border-radius: 6px;
    font: inherit;
    font-weight: 650;
}

.table-page-summary {
    text-align: center;
}

.table-page-controls button {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    padding: 0;
    color: var(--ink-700);
    background: var(--paper);
    border: 1px solid var(--ink-200);
    border-radius: 6px;
    font-size: 17px;
    line-height: 1;
    cursor: pointer;
}

.table-page-controls button:hover:not(:disabled) {
    color: var(--paper);
    background: var(--navy);
    border-color: var(--navy);
}

.table-page-controls button:disabled {
    opacity: 0.38;
    cursor: default;
}

.table-page-controls > span {
    min-width: 84px;
    color: var(--ink-700);
    text-align: center;
}

@media (prefers-reduced-motion: reduce) {
    .dashboard-loading-spinner,
    .dashboard-loading-progress > span {
        animation-duration: 2.5s;
    }

    .loading-quip {
        animation: none;
    }
}

.login-shell {
    display: grid;
    place-items: center;
    min-height: 100vh;
    padding: 40px 20px;
    background:
        linear-gradient(rgba(22, 33, 60, 0.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(22, 33, 60, 0.025) 1px, transparent 1px),
        #f5f6f8;
    background-size: 32px 32px;
}

.login-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: min(100%, 430px);
}

.login-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    width: fit-content;
    margin-bottom: 24px;
    color: var(--ink-950);
    text-decoration: none;
}

.login-brand small {
    color: var(--ink-500);
}

.login-card {
    width: 100%;
    padding: 34px;
    background: var(--paper);
    border: 1px solid var(--ink-200);
    border-radius: 16px;
    box-shadow: 0 18px 50px rgba(16, 24, 40, 0.10);
}

.login-card::before {
    display: block;
    width: 44px;
    height: 4px;
    margin-bottom: 24px;
    background: var(--lime);
    border-radius: 99px;
    content: "";
}

.login-kicker {
    color: var(--ink-500);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.login-copy h1 {
    margin: 7px 0 7px;
    color: var(--ink-950);
    font-size: 28px;
    line-height: 1.2;
    letter-spacing: -0.035em;
}

.login-copy p {
    margin: 0 0 26px;
    color: var(--ink-600);
    font-size: 13px;
    line-height: 1.55;
}

.login-error {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-bottom: 18px;
    padding: 12px 14px;
    color: #8f252b;
    background: #fff1f1;
    border: 1px solid #f0c7c9;
    border-radius: var(--radius-sm);
    font-size: 12px;
}

.login-error strong {
    font-size: 12px;
}

.login-error span {
    color: #a64a50;
    font-size: 11px;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.login-form label {
    display: flex;
    flex-direction: column;
    gap: 7px;
    color: var(--ink-700);
    font-size: 12px;
    font-weight: 650;
}

.login-form input:not([type="checkbox"]) {
    height: 44px;
    padding: 0 12px;
    color: var(--ink-950);
    background: var(--paper);
    border: 1px solid var(--ink-300);
    border-radius: 7px;
    font-size: 13px;
    transition: border-color 140ms ease, box-shadow 140ms ease;
}

.login-form input:not([type="checkbox"])::placeholder {
    color: #a1a9b5;
}

.login-form input:not([type="checkbox"]):focus {
    border-color: #5c78bd;
    box-shadow: 0 0 0 4px rgba(56, 103, 214, 0.10);
    outline: none;
}

.login-form button {
    height: 44px;
    margin-top: 5px;
    padding: 0 16px;
    color: var(--paper);
    background: var(--navy);
    border: 0;
    border-radius: 7px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}

.login-form button:hover {
    background: #223052;
}

.login-options {
    display: flex !important;
    flex-direction: row !important;
    align-items: center;
    gap: 8px !important;
    width: fit-content;
    color: var(--ink-600) !important;
    font-weight: 500 !important;
    cursor: pointer;
}

.login-options input,
.role-option input {
    width: 15px;
    height: 15px;
    accent-color: var(--navy);
}

.validation-message {
    color: var(--red);
    font-size: 10px;
    font-weight: 500;
}

.login-session-note {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-top: 24px;
    padding-top: 18px;
    color: var(--ink-500);
    border-top: 1px solid var(--ink-100);
    font-size: 10px;
}

.login-session-note .status-dot {
    width: 6px;
    height: 6px;
    box-shadow: 0 0 0 3px rgba(120, 149, 31, 0.10);
}

.login-footer {
    margin-top: 18px;
    color: var(--ink-500);
    font-size: 10px;
}

.admin-page {
    min-height: calc(100vh - 72px);
    padding: 34px clamp(24px, 4vw, 58px) 56px;
}

.admin-page > .page-heading {
    max-width: 1500px;
}

.back-link {
    margin-top: 8px;
    padding: 9px 12px;
    color: var(--ink-700);
    background: var(--paper);
    border: 1px solid var(--ink-200);
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
    font-size: 12px;
    font-weight: 650;
    text-decoration: none;
}

.admin-grid {
    display: grid;
    grid-template-columns: minmax(320px, 420px) minmax(0, 1fr);
    gap: 18px;
    max-width: 1500px;
    margin: 0 auto;
    align-items: start;
}

.user-form-card,
.user-list-card {
    min-width: 0;
    overflow: hidden;
    background: var(--paper);
    border: 1px solid var(--ink-200);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.user-form-card {
    padding: 24px;
}

.admin-card-heading {
    padding: 23px 24px 19px;
}

.user-form-card .admin-card-heading {
    padding: 0 0 20px;
}

.admin-card-heading h2 {
    margin: 5px 0 5px;
    color: var(--ink-950);
    font-size: 19px;
    letter-spacing: -0.025em;
}

.admin-card-heading p {
    margin: 0;
    color: var(--ink-500);
    font-size: 11px;
    line-height: 1.5;
}

.user-create-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.user-create-form > label:not(.role-option) {
    display: flex;
    flex-direction: column;
    gap: 7px;
    color: var(--ink-700);
    font-size: 11px;
    font-weight: 650;
}

.user-create-form input:not([type="checkbox"]) {
    height: 42px;
    padding: 0 11px;
    color: var(--ink-950);
    background: var(--paper);
    border: 1px solid var(--ink-300);
    border-radius: 7px;
    font-size: 12px;
}

.user-create-form input:not([type="checkbox"]):focus {
    border-color: #5c78bd;
    box-shadow: 0 0 0 4px rgba(56, 103, 214, 0.10);
    outline: none;
}

.role-option {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px;
    color: var(--ink-700);
    background: var(--ink-50);
    border: 1px solid var(--ink-100);
    border-radius: 8px;
    cursor: pointer;
}

.role-option input {
    flex: 0 0 auto;
    margin-top: 2px;
}

.role-option > span {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.role-option strong {
    font-size: 11px;
}

.role-option small {
    color: var(--ink-500);
    font-size: 10px;
    line-height: 1.4;
}

.user-create-form button {
    height: 43px;
    color: var(--paper);
    background: var(--navy);
    border: 0;
    border-radius: 7px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

.user-create-form button:disabled {
    opacity: 0.58;
    cursor: wait;
}

.user-success {
    margin-bottom: 18px;
    padding: 11px 13px;
    color: #116344;
    background: #edf9f3;
    border: 1px solid #bee6d2;
    border-radius: 8px;
    font-size: 11px;
}

.users-grid {
    border-top: 1px solid var(--ink-100) !important;
}

.system-message {
    width: min(100% - 32px, 520px);
    margin: 90px auto;
    padding: 34px;
    text-align: center;
    background: var(--paper);
    border: 1px solid var(--ink-200);
    border-radius: 16px;
}

.system-message-code {
    color: var(--lime-dark);
    font-size: 11px;
    font-weight: 750;
    letter-spacing: 0.1em;
}

.system-message h1 {
    margin: 8px 0;
    font-size: 26px;
}

.system-message p {
    margin: 0 0 20px;
    color: var(--ink-600);
}

.system-message a {
    color: var(--blue);
    font-weight: 650;
}

#blazor-error-ui {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 1000;
    display: none;
    padding: 12px 42px 12px 14px;
    color: var(--paper);
    background: #9e2d34;
    border-radius: 8px;
    box-shadow: var(--shadow-md);
    font-size: 12px;
}

#blazor-error-ui a {
    margin-left: 8px;
    color: var(--paper);
    font-weight: 700;
}

#blazor-error-ui .dismiss {
    position: absolute;
    top: 9px;
    right: 12px;
    cursor: pointer;
}

.blazor-error-boundary {
    margin: 24px;
    padding: 16px;
    color: #8f252b;
    background: #fff1f1;
    border: 1px solid #f0c7c9;
    border-radius: 10px;
}

.blazor-error-boundary::after {
    content: "An unexpected error occurred.";
}

@media (max-width: 1100px) {
    .topbar {
        grid-template-columns: 1fr auto;
    }

    .topbar-context {
        display: none;
    }

    .dashboard-shell {
        grid-template-columns: 228px minmax(0, 1fr);
    }

    .dashboard-content {
        padding-right: 26px;
        padding-left: 26px;
    }

    .metric-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .filter-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .ranking-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .admin-grid {
        grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
    }
}

@media (max-width: 820px) {
    .topbar {
        min-height: 64px;
        padding: 0 16px;
    }

    .user-copy {
        display: none;
    }

    .dashboard-shell {
        display: block;
        min-height: calc(100vh - 64px);
    }

    .dashboard-nav {
        padding: 12px 14px;
        border-right: 0;
        border-bottom: 1px solid var(--ink-200);
    }

    .nav-heading,
    .nav-note {
        display: none;
    }

    .dashboard-nav nav {
        flex-direction: row;
        overflow-x: auto;
        scrollbar-width: thin;
    }

    .nav-item {
        flex: 0 0 auto;
        grid-template-columns: 4px auto;
        width: auto;
        min-width: 155px;
    }

    .dashboard-content {
        padding-top: 26px;
    }

    .question-answer-panel {
        grid-template-columns: minmax(0, 1fr);
    }

    .question-table-pager {
        grid-template-columns: 1fr auto;
    }

    .table-page-summary {
        grid-column: 1 / -1;
        grid-row: 2;
        text-align: left;
    }

    .admin-grid {
        grid-template-columns: minmax(0, 1fr);
    }

}

@media (max-width: 580px) {
    .topbar-brand small,
    .today-label,
    .user-avatar {
        display: none;
    }

    .user-menu {
        gap: 0;
    }

    .dashboard-content {
        padding: 22px 15px 38px;
    }

    .admin-page {
        padding: 22px 15px 38px;
    }

    .page-heading {
        display: block;
    }

    .preview-pill {
        width: fit-content;
        margin-top: 15px;
    }

    .question-picker {
        padding: 20px 18px 17px;
    }

    .ranking-heading {
        align-items: flex-start;
        flex-direction: column;
        gap: 6px;
    }

    .ranking-content > div:first-child {
        align-items: flex-start;
        flex-direction: column;
        gap: 4px;
    }

    .metric-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .filter-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .dashboard-filters {
        padding: 17px;
    }

    .dashboard-empty-state {
        align-items: flex-start;
        padding: 22px 18px;
    }

    .metric-card {
        min-height: 88px;
    }

    .records-header {
        align-items: flex-start;
        flex-direction: column;
        gap: 12px;
        padding: 18px;
    }

    .records-actions {
        align-items: stretch;
        flex-direction: column;
        width: 100%;
    }

    .export-button {
        width: 100%;
    }

    .source-status {
        max-width: 100%;
    }

    .question-table-pager {
        grid-template-columns: minmax(0, 1fr);
        gap: 10px;
        padding: 12px;
    }

    .table-page-summary {
        grid-column: auto;
        grid-row: auto;
    }

    .table-page-controls {
        justify-content: space-between;
    }

    .login-card {
        padding: 28px 22px;
    }

    .login-brand {
        margin-bottom: 20px;
    }
}

/* Workspace navigation and progressive disclosure. */
.skip-link {
    position: fixed;
    top: 8px;
    left: 16px;
    z-index: 100;
    padding: 12px 18px;
    color: var(--navy);
    background: white;
    border-radius: 8px;
    transform: translateY(-160%);
}
.skip-link:focus { transform: translateY(0); }
.mobile-area-picker { display: none; }
.preview-pill.neutral > span { background: var(--ink-500); box-shadow: none; }
.source-details summary { cursor: pointer; font-size: 12px; color: var(--ink-600); }
.source-details code { display: block; margin-top: 8px; overflow-wrap: anywhere; }
.question-shortcuts { display: grid; gap: 10px; margin-top: 22px; }
.question-shortcuts button {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    width: 100%;
    min-height: 48px;
    padding: 12px 16px;
    color: var(--ink-800);
    background: var(--paper);
    border: 1px solid var(--ink-200);
    border-radius: 10px;
    text-align: left;
    line-height: 1.5;
    cursor: pointer;
}
.question-shortcuts button:hover { border-color: var(--blue); background: #f5f8ff; }
.question-shortcuts button > span:last-child { color: var(--blue); }
.dashboard-empty-state > div { flex: 1; min-width: 0; }
.table-scope-note { margin: 0; padding: 0 24px 16px; font-size: 12px; line-height: 1.6; color: var(--ink-600); }
.question-records-table td { font-variant-numeric: tabular-nums; }
@media (min-width: 821px) {
    .dashboard-nav { position: sticky; top: 72px; height: calc(100dvh - 72px); overflow-y: auto; }
    .nav-item { padding-top: 9px; padding-bottom: 9px; }
}
@media (max-width: 820px) {
    .dashboard-nav nav { display: none; }
    .mobile-area-picker { display: flex; align-items: center; gap: 14px; font-size: 12px; font-weight: 650; color: var(--ink-600); }
    .mobile-area-picker select { flex: 1; min-width: 0; min-height: 44px; padding: 8px 12px; color: var(--ink-900); background: white; border: 1px solid var(--ink-300); border-radius: 8px; font: inherit; font-size: 16px; }
    .clear-filters, .table-page-controls button, .topbar-action, .user-menu button { min-height: 44px; }
}
@media (max-width: 580px) {
    .topbar { grid-template-columns: minmax(0, 1fr) auto; gap: 8px; padding: 8px 12px; }
    .topbar-brand { gap: 8px; min-width: 0; }
    .topbar-brand strong { font-size: 13px; line-height: 1.3; }
    .brand-symbol { flex-shrink: 0; width: 32px; height: 32px; }
    .topbar-action, .user-menu button { padding: 6px 8px; }
    .dashboard-empty-state { display: block; }
    .empty-state-mark { margin-bottom: 16px; }
    .question-rule { margin: 0 18px 18px; }
    .question-combo .dxbl-text-edit-input, .filter-combo .dxbl-text-edit-input, .login-form input:not([type="checkbox"]) { font-size: 16px; }
    .table-scope-note { padding: 0 18px 16px; }
}

.page-heading h1:focus { outline: none; }
.dashboard-empty-state { align-items: flex-start; }
/* N26 executive overview and contract evidence. */
.budget-executive {
    display:grid;
    gap:24px;
    /* Same centred column as the filters, metrics and records panels. */
    max-width:1500px;
    margin:12px auto 28px;
    color:#24344b
}
.budget-executive-heading,.budget-section-heading,.budget-company-card>header {
    display:flex;
    justify-content:space-between;
    align-items:center;
    gap:20px
}
.budget-executive-heading h2 {
    margin:5px 0 8px;
    font-size:clamp(24px,3vw,34px)
}
.budget-executive-heading p {
    max-width:760px;
    color:#627086
}
.budget-status {
    border-radius:30px;
    padding:9px 14px;
    font-size:12px;
    white-space:nowrap;
    background:#e8f6ed;
    color:#216947
}
.budget-status.review {
    background:#fff1dc;
    color:#805317
}
.budget-total-grid {
    display:grid;
    grid-template-columns:1.25fr 1fr 1fr;
    gap:18px
}
.budget-total-card {
    display:grid;
    gap:12px;
    border:1px solid #dce3eb;
    border-radius:16px;
    padding:25px;
    background:#fff;
    box-shadow:0 4px 16px #20355008
}
.budget-total-card.primary {
    background:#163651;
    color:white;
    border-color:#163651
}
.budget-total-card strong {
    font-size:clamp(23px,2.5vw,36px);
    overflow-wrap:anywhere;
    letter-spacing:-.7px
}
.budget-total-card small {
    opacity:.75;
    line-height:1.5
}
.budget-evidence-strip {
    display:flex;
    gap:25px;
    flex-wrap:wrap;
    color:#657389;
    font-size:13px
}
.budget-evidence-strip strong {
    color:#24344b
}
.budget-review-notice {
    background:#fff8eb;
    border:1px solid #ecd4a7;
    border-radius:12px;
    padding:20px
}
.budget-month-panel,.budget-company-panel {
    background:white;
    border:1px solid #dce3eb;
    border-radius:16px;
    padding:24px;
    min-width:0
}
.budget-section-heading h3 {
    margin:5px 0;
    font-size:21px
}
.budget-chart-legend {
    display:flex;
    gap:15px;
    font-size:12px
}
.budget-chart-legend i {
    display:inline-block;
    width:9px;
    height:9px;
    margin-right:6px;
    border-radius:2px
}
.budget-chart-legend .existing,.budget-bar-existing {
    background:#234d70
}
.budget-chart-legend .new-sales,.budget-bar-new {
    background:#47b99a
}
.budget-month-chart {
    height:265px;
    display:grid;
    grid-template-columns:repeat(12,minmax(35px,1fr));
    gap:12px;
    overflow-x:auto;
    padding:24px 0 0
}
.budget-month-bar {
    display:flex;
    flex-direction:column;
    align-items:center;
    gap:8px;
    font-size:12px
}
.budget-bar-value {
    font-size:11px;
    color:#657389
}
.budget-bar-track {
    display:flex;
    flex-direction:column;
    justify-content:flex-end;
    width:68%;
    height:165px;
    border-bottom:1px solid #dce3eb
}
.budget-bar-track i {
    display:block;
    width:100%;
    flex-shrink:0
}
.budget-month-bar small {
    font-size:10px;
    color:#805317
}
.budget-month-details {
    margin-top:18px
}
.budget-month-details summary,.budget-developer summary {
    cursor:pointer
}
.budget-company-card {
    border:1px solid #e0e6ed;
    border-radius:12px;
    margin-top:18px;
    overflow:hidden
}
.budget-company-card>header {
    background:#f3f6fa;
    padding:18px
}
.budget-company-card h4 {
    margin:0;
    font-size:16px
}
.budget-developer {
    padding:18px;
    border-top:1px solid #e0e6ed
}
.budget-developer summary {
    display:flex;
    justify-content:space-between;
    gap:15px
}
.budget-developer summary small {
    display:block;
    color:#657389;
    margin-top:5px
}
.budget-developer-amount {
    font-weight:700;
    white-space:nowrap
}
.budget-income-lines {
    padding:20px 0;
    display:grid;
    gap:12px
}
.budget-income-lines>div {
    display:flex;
    justify-content:space-between;
    gap:15px
}
.budget-income-lines small {
    color:#657389
}
.budget-month-table-scroll {
    overflow:auto;
    max-width:100%
}
.budget-month-table {
    width:100%;
    border-collapse:collapse;
    font-size:12px
}
.budget-month-table th,.budget-month-table td {
    padding:11px 12px;
    border-bottom:1px solid #e2e8f0;
    text-align:right;
    white-space:nowrap
}
.budget-month-table th:first-child,.budget-month-table td:first-child {
    text-align:left
}
.budget-month-table th {
    color:#627086;
    background:#f6f8fa
}
.budget-contract-evidence {
    padding:20px;
    max-width:1100px;
    white-space:normal
}
.budget-evidence-facts {
    display:grid;
    grid-template-columns:repeat(auto-fit,minmax(170px,1fr));
    gap:20px;
    margin-bottom:20px
}
.budget-evidence-facts span {
    display:block;
    font-size:12px;
    color:#657389;
    margin-bottom:7px
}
.budget-contract-evidence h4 {
    margin-top:20px
}
.budget-empty {
    padding:20px;
    color:#657389
}
@media(max-width:800px) {
    .budget-total-grid {
        grid-template-columns:1fr
    }
    .budget-executive-heading,.budget-section-heading {
        align-items:flex-start;
        flex-direction:column
    }
    .budget-month-panel,.budget-company-panel {
        padding:16px
    }
    .budget-month-chart {
        gap:8px;
        grid-template-columns:repeat(12,45px)
    }
    .budget-company-card>header {
        align-items:flex-start;
        flex-direction:column;
        gap:8px
    }
    .budget-evidence-strip {
        gap:12px
    }
    .budget-developer summary {
        flex-wrap:wrap
    }
}
.budget-records-table .contract-expand-column {
    width: 148px;
    min-width: 148px;
    max-width: 148px;
    box-sizing: border-box;
}
.budget-records-table tr:not(.contract-detail-row) > :nth-child(4) {
    position: sticky;
    left: 148px;
    z-index: 2;
    background: var(--paper);
    box-shadow: 2px 0 3px #20355010;
}
.budget-records-table thead tr > :nth-child(4) {
    z-index: 3;
    background: #f8f9fa;
}
