:root {
    --navy: #123c69;
    --blue: #2367a7;
    --green: #487f35;
    --gold: #c6922d;
    --ink: #172330;
    --muted: #647184;
    --line: #dce4ec;
    --bg: #f4f7f9;
    --panel: #ffffff;
    --danger: #b73737;
    --shadow: 0 1px 2px rgba(18, 60, 105, .06), 0 8px 22px rgba(18, 60, 105, .045);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { color-scheme: light; }
body {
    margin: 0;
    color: var(--ink);
    background: var(--bg);
    font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.45;
    -webkit-font-smoothing: antialiased;
}
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
a:focus-visible,
button:focus-visible,
summary:focus-visible {
    outline: 3px solid var(--blue);
    outline-offset: 3px;
}
.skip-link {
    position: fixed;
    left: 1rem;
    top: -100px;
    z-index: 9999;
    padding: .7rem 1rem;
    border-radius: 6px;
    background: white;
    color: var(--navy);
    font-weight: 800;
    box-shadow: var(--shadow);
}
.skip-link:focus { top: 1rem; }
h1, h2, h3, h4 { line-height: 1.2; }
h1, h2 { margin: 0; }
h1 { color: var(--navy); font-size: clamp(1.75rem, 2.5vw, 2.45rem); }
h2 { color: var(--navy); font-size: 1.1rem; margin-bottom: 1rem; }
h3 { color: var(--navy); font-size: 1rem; }
h4 { color: var(--navy); font-size: .92rem; }
table { width: 100%; border-collapse: collapse; font-size: .94rem; font-variant-numeric: tabular-nums; }
th, td { padding: .85rem .7rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { color: var(--muted); background: #f7f9fb; font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; }
tbody tr:last-child td, tbody tr:last-child th { border-bottom: 0; }
tbody tr:hover td, tbody tr:hover th { background: #f8fbfd; }
tfoot th, tfoot td { border-top: 2px solid #cbd5df; border-bottom: 0; background: #f2f6f9; color: var(--navy); }
.table-wrap { width: 100%; overflow-x: auto; }
.table-wrap table { min-width: 780px; }
.compact-table-wrap table { min-width: 0; }
.compact-table-wrap th:nth-child(n+2), .compact-table-wrap td:nth-child(n+2) { text-align: right; }
small { color: var(--muted); }

.shell { display: grid; grid-template-columns: 280px 1fr; min-height: 100vh; }
.sidebar {
    background: var(--navy);
    color: white;
    display: flex;
    flex-direction: column;
    padding: 1.2rem;
    gap: 1rem;
}
.brand, .auth-brand {
    display: flex;
    align-items: center;
    gap: .75rem;
    color: inherit;
}
.brand:hover { text-decoration: none; }
.brand-with-logo {
    align-items: flex-start;
    flex-direction: column;
    gap: .65rem;
}
.sidebar-logo-card {
    display: inline-flex;
    align-items: center;
    width: 100%;
    max-width: 210px;
    padding: .45rem .55rem;
    background: white;
    border-radius: 6px;
}
.sidebar-logo {
    display: block;
    width: 100%;
    height: auto;
}
.brand-mark {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--green), #74a94f);
    color: white;
    font-weight: 800;
}
.brand small { display: block; color: #cbd7e3; }
.nav-drawer > summary { display: none; }
.nav-drawer:not([open]) > .nav { display: grid; }
.nav { display: grid; gap: .25rem; margin-top: 1rem; }
.nav a {
    color: #edf5ff;
    padding: .75rem .8rem;
    border-radius: 8px;
}
.nav a:hover, .nav a.active { background: rgba(255,255,255,.14); text-decoration: none; }
.nav a.active { box-shadow: inset 4px 0 0 #9bc47c; }
.nav-section {
    margin-top: .15rem;
    border-top: 1px solid rgba(255,255,255,.14);
}
.nav-section > summary {
    padding: .7rem .8rem;
    color: #cbd7e3;
    cursor: pointer;
    font-size: .78rem;
    font-weight: 800;
    list-style: none;
    text-transform: uppercase;
}
.nav-section > summary::-webkit-details-marker { display: none; }
.nav-section > summary::after { content: "+"; float: right; color: white; font-size: 1rem; line-height: .8; }
.nav-section[open] > summary::after { content: "−"; }
.nav-section > div { display: grid; gap: .2rem; padding-left: .55rem; }
.nav-section > div a { padding-top: .62rem; padding-bottom: .62rem; font-size: .9rem; }
.sidebar-user {
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid rgba(255,255,255,.18);
    display: grid;
    gap: .25rem;
}
.sidebar-user small { color: #cbd7e3; }
.sidebar a:focus-visible, .sidebar button:focus-visible, .sidebar summary:focus-visible { outline-color: white; }
.signout-form { margin: .25rem 0 0; }
.signout-form button {
    display: inline-flex;
    align-items: center;
    appearance: none;
    border: 0;
    padding: 0;
    background: transparent;
    color: white;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}
.signout-form button:hover { text-decoration: underline; }
.main { width: 100%; max-width: 1680px; margin-inline: auto; padding: 2rem; min-width: 0; }

.auth-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 1rem;
    background:
        radial-gradient(circle at 80% 15%, rgba(79,138,58,.36), transparent 34%),
        linear-gradient(145deg, #0d3155, #185284 62%, #2f6f3b);
}
.auth-page > .alert { width: min(520px, 100%); margin-bottom: 0; }
.auth-card {
    width: min(520px, 100%);
    background: white;
    border-top: 6px solid var(--green);
    border-radius: 8px;
    padding: 2rem;
    box-shadow: var(--shadow);
}
.auth-card p { color: var(--muted); }
.auth-brand {
    display: block;
    color: var(--navy);
    margin-bottom: 1.2rem;
}
.auth-logo {
    display: block;
    width: min(300px, 100%);
    height: auto;
}
.auth-card h1 { margin-bottom: 1.25rem; }
.auth-card h1 + p { margin-top: -.5rem; margin-bottom: 1.25rem; }
.auth-method-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 2px;
    margin: 0 0 1.25rem;
    padding: 3px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f3f6f8;
}
.auth-method-tabs a {
    display: grid;
    place-items: center;
    min-height: 42px;
    padding: .55rem .75rem;
    border-radius: 6px;
    color: var(--muted);
    font-weight: 800;
}
.auth-method-tabs a:hover { text-decoration: none; color: var(--navy); }
.auth-method-tabs a.active {
    color: var(--navy);
    background: white;
    box-shadow: 0 1px 3px rgba(18, 60, 105, .12);
}
.auth-secondary-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    margin-top: 1rem;
}
.auth-secondary-actions form { margin: 0; }
.remember-device-dialog {
    position: relative;
    inset: auto;
    margin: auto;
    border: 0;
    color: var(--ink);
}
.remember-device-dialog::backdrop { background: rgba(9, 31, 51, .5); }
.remember-device-actions { display: grid; gap: .65rem; margin: 1.25rem 0 .8rem; }
.mfa-setup-layout {
    min-height: calc(100vh - 4rem);
    display: grid;
    place-items: center;
}
.mfa-qr {
    display: grid;
    place-items: center;
    width: fit-content;
    min-height: 224px;
    margin: 0 auto 1.25rem;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: white;
}
.mfa-qr img,
.mfa-qr canvas { display: block; max-width: 100%; height: auto; }
.setup-key-label { margin-top: 0; }
.secret-key {
    display: block;
    padding: .8rem 1rem;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #f6f8fa;
    color: var(--navy);
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 1.05rem;
    letter-spacing: .08em;
    line-height: 1.5;
    overflow-wrap: anywhere;
    user-select: all;
}
.auth-brand-text {
    display: grid;
    gap: .18rem;
    min-width: 0;
    padding-top: .1rem;
}
.auth-brand-text strong {
    display: block;
    line-height: 1.22;
    font-size: 1.04rem;
}
.auth-subtitle {
    display: block;
    color: var(--muted);
    font-size: .9rem;
    font-weight: 700;
}

.page-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
}
.page-intro { margin: .4rem 0 0; color: var(--muted); max-width: 760px; }
.allocation-project-title { max-width: 1050px; font-weight: 650; }
.eyebrow {
    margin: 0 0 .25rem;
    color: var(--green);
    font-size: .78rem;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}
.panel, .stat {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
}
.panel { padding: 1.25rem; margin-bottom: 1.25rem; overflow: visible; }
.panel-head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 1rem; margin-bottom: .75rem; }
.panel-head h2 { margin-bottom: 0; }
.subfolder-panel { border-top: 4px solid var(--green); }
.subfolder-table .subfolder-name { display: block; color: var(--navy); font-weight: 800; }
.subfolder-table td:first-child small { display: block; margin-top: .2rem; }
.funding-editor-panel { padding: .85rem 1rem; }
.funding-editor-form {
    display: grid;
    grid-template-columns: minmax(220px, 320px) minmax(260px, 1fr) auto;
    align-items: end;
    gap: .75rem;
}
.funding-editor-form small { grid-column: 1 / -1; align-self: center; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 1rem; margin-bottom: 1.25rem; }
.stat { padding: 1.1rem; border-top: 4px solid var(--green); }
.status-card { color: var(--ink); }
.status-card { transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease; }
.status-card:hover { text-decoration: none; transform: translateY(-1px); border-color: #c8d4df; }
.status-card.selected {
    outline: 3px solid rgba(35, 103, 167, .22);
    box-shadow: 0 0 0 1px var(--blue), var(--shadow);
}
.status-card.red { border-top-color: var(--danger); }
.status-card.red strong, .badge.red { color: var(--danger); font-weight: 800; }
.status-card.green { border-top-color: var(--green); }
.status-card.muted { border-top-color: var(--muted); }
.reimbursement-form { overflow: visible; }
.reimbursement-form table input { min-width: 110px; }
.request-header-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: .75rem;
    margin: 1rem 0;
}
.request-header-grid > div {
    display: grid;
    gap: .2rem;
    padding: .85rem;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fbfdff;
}
.request-header-grid span {
    color: var(--muted);
    font-size: .76rem;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
}
.request-header-grid strong { color: var(--navy); }
.over-budget { background: #fff0f0; }
.over-budget .balance { color: var(--danger); font-weight: 800; }
.section-heading { padding-top: .5rem; border-top: 1px solid var(--line); }
.section-heading h2 { margin-bottom: 0; }
.empty-state {
    padding: 1.25rem;
    border: 1px dashed #b9c5d1;
    border-radius: 8px;
    background: #fbfdff;
    color: var(--muted);
    text-align: center;
}
.stat span { display: block; color: var(--muted); font-size: .82rem; text-transform: uppercase; font-weight: 700; }
.stat strong { display: block; margin-top: .25rem; color: var(--navy); font-size: 1.7rem; }

.form { display: grid; gap: 1rem; }
.grid-form { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: end; }
.form > *, .grid-form > *, .allocation-picker-control > *, .expense-row-grid > * { min-width: 0; }
.span-2 { grid-column: span 2; }
label { display: grid; gap: .35rem; color: var(--ink); font-weight: 700; font-size: .9rem; }
input, select, textarea {
    width: 100%;
    min-width: 0;
    border: 1px solid #8493a3;
    border-radius: 8px;
    padding: .72rem .8rem;
    color: var(--ink);
    background: white;
    font: inherit;
}
textarea { resize: vertical; }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 1; }
input[readonly], input:disabled, select:disabled, textarea:disabled { background: #eef2f5; color: #586576; }
input[type="checkbox"], input[type="radio"] {
    width: 1.05rem;
    height: 1.05rem;
    min-height: 0;
    flex: 0 0 auto;
    padding: 0;
    accent-color: var(--green);
}
input:focus, select:focus, textarea:focus {
    outline: 3px solid var(--blue);
    outline-offset: 2px;
    border-color: var(--blue);
}
.inline-form { grid-template-columns: 1fr auto auto; align-items: end; }
.allocation-picker-control {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: .75rem;
}
.filters { display: grid; grid-template-columns: 1fr 220px auto; gap: .75rem; margin-bottom: 1rem; }
.allocation-filters { grid-template-columns: minmax(240px, 1fr) auto auto; align-items: center; }
.request-filters { grid-template-columns: minmax(220px, 1fr) 180px 190px minmax(220px, 1fr) 150px 150px auto; align-items: center; }
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: .65rem 1rem;
    background: white;
    color: var(--navy);
    font: inherit;
    font-weight: 800;
    cursor: pointer;
    transition: background-color .16s ease, border-color .16s ease, color .16s ease, box-shadow .16s ease;
}
.button:hover { text-decoration: none; border-color: var(--blue); background: #f7faff; }
.button.primary { background: var(--green); border-color: var(--green); color: white; }
.button.primary:hover { background: #3f702f; border-color: #3f702f; }
.button.danger { border-color: #d99b9b; color: var(--danger); background: #fffafa; }
.button.danger:hover { border-color: var(--danger); background: #fff0f0; }
.button.small { min-height: 34px; padding: .45rem .7rem; font-size: .82rem; }
.button:disabled { opacity: .5; cursor: not-allowed; }
.actions { display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; }
.actions form { margin: 0; }
td.actions { display: table-cell; white-space: nowrap; }
td.actions > a, td.actions > form { display: inline-flex; vertical-align: middle; margin: .1rem .15rem .1rem 0; }

.queue-filter {
    margin: .3rem 0 0;
    color: var(--blue);
    font-size: .85rem;
    font-weight: 700;
}
.dashboard-request-table-wrap table { min-width: 1180px; table-layout: fixed; }
.dashboard-col-grant { width: 12%; }
.dashboard-col-project { width: 24%; }
.dashboard-col-subgrantee { width: 14%; }
.dashboard-col-amount { width: 11%; }
.dashboard-col-reviewer { width: 18%; }
.dashboard-col-status { width: 21%; }
.dashboard-request-table td { vertical-align: top; overflow-wrap: anywhere; }
.dashboard-request-table td > small { display: block; margin-top: .25rem; }
.dashboard-request-table td:nth-child(4) a { color: var(--ink); font-weight: 800; }
.dashboard-request-table th:nth-child(4), .dashboard-request-table td:nth-child(4) { text-align: right; }
.dashboard-inline-control {
    display: grid;
    grid-template-columns: minmax(150px, 1fr) auto;
    gap: .4rem;
    align-content: start;
    align-items: stretch;
    min-width: 0;
}
.dashboard-inline-control label {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
.dashboard-inline-control select { min-width: 0; min-height: 38px; padding: .55rem .6rem; font-size: .85rem; }
.dashboard-inline-control .button { min-height: 38px; white-space: nowrap; }
.dashboard-inline-control .policy-note { grid-column: 1 / -1; margin: 0; line-height: 1.25; }
.dashboard-intake-deadline,
.dashboard-control-spacer {
    grid-column: 1 / -1;
    display: block;
    min-height: 2.4em;
    color: var(--muted);
    line-height: 1.2;
}
.dashboard-current-value {
    grid-column: 1 / -1;
    display: grid;
    align-content: start;
    gap: .15rem;
    min-height: 52px;
    margin: 0;
    color: var(--ink);
    line-height: 1.25;
}
.dashboard-current-value span {
    color: var(--muted);
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
}
.dashboard-current-value strong { color: var(--navy); font-size: .84rem; }
.policy-callout.compact { padding: .75rem .9rem; margin: .75rem 0; }
.example-only-notice { border: 2px solid #b45309; background: #fff7ed; color: #7c2d12; }
.example-form { min-width: 0; margin-top: .5rem; padding: 0; border: 0; }
.example-form:disabled { opacity: 1; }
.example-form input:disabled,
.example-form textarea:disabled { color: var(--ink); background: #f8fafc; -webkit-text-fill-color: var(--ink); opacity: 1; }
.example-details { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.dashboard-summary-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.dashboard-summary-stats .stat { border-top-color: var(--navy); background: #f9fbfc; }

.badge {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: .25rem .55rem;
    border-radius: 999px;
    font-size: .78rem;
    font-weight: 800;
    background: #edf2f7;
    color: #334155;
    white-space: nowrap;
}
.badge.blue { background: #d9ecff; color: #15548a; }
.badge.green { background: #e0f1dc; color: #2e6c25; }
.badge.amber { background: #fff1ce; color: #8a610d; }
.badge.red { background: #ffe0e0; color: #9f2a2a; }
.badge.purple { background: #eee4ff; color: #673ab0; }
.badge.muted { background: #eef1f5; color: #596476; }
.user-security-badge { margin-top: .3rem; }
.user-allocation-assignment {
    display: grid;
    gap: .8rem;
    margin: 0;
    padding: 1rem;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f8fafc;
}
.user-allocation-assignment[hidden] { display: none; }
.user-allocation-assignment legend { padding: 0 .35rem; color: var(--navy); font-weight: 800; }
.user-allocation-assignment .policy-note { margin: 0; }
.user-allocation-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .55rem; }
.user-allocation-option {
    min-width: 0;
    padding: .75rem;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: white;
}
.user-allocation-option[hidden] { display: none; }
.user-allocation-option span { min-width: 0; overflow-wrap: anywhere; }
.user-allocation-option small { display: block; margin-top: .2rem; color: var(--muted); font-weight: 600; }
.user-allocation-list .empty-state { grid-column: 1 / -1; margin: 0; }
.status-cell { width: 1%; }
.status-cell .badge { font-size: .82rem; font-weight: 900; white-space: normal; min-width: 190px; }

.detail-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(320px, .9fr); gap: 1.25rem; align-items: start; }
.details { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; margin: 0 0 1rem; }
.details div { border-bottom: 1px solid var(--line); padding-bottom: .55rem; }
.details dt { color: var(--muted); font-size: .78rem; font-weight: 800; text-transform: uppercase; }
.details dd { margin: .15rem 0 0; }
.timeline, .file-list, .history-grid, .plain-list { display: grid; gap: .75rem; }
.timeline-item, .history-grid div, .file-list a {
    display: grid;
    gap: .25rem;
    padding: .8rem;
    border: 1px solid var(--line);
    border-left: 4px solid var(--blue);
    border-radius: 8px;
    background: #fbfdff;
}
.timeline-item.internal { border-left-color: var(--gold); background: #fffaf0; }
.timeline-item span, .history-grid span, .file-list span { color: var(--muted); font-size: .82rem; }
.timeline-item p, .history-grid p { margin: .25rem 0 0; }
.plain-list { padding-left: 1.1rem; }
.workflow-stage-list { display: grid; gap: .65rem; margin: 0; padding-left: 1.5rem; }
.workflow-stage-list li { padding-left: .25rem; }
.workflow-stage-list-wide { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 1.5rem; }
.workflow-stage-list-wide .badge { white-space: normal; }
.workflow-stages-panel { border-top: 4px solid var(--navy); }

.autosave-status {
    margin: 0 0 .85rem;
    padding: .65rem .8rem;
    border-left: 3px solid var(--green);
    background: #f3f8f1;
    color: var(--muted);
    font-size: .9rem;
}

.session-warning-dialog {
    width: min(92vw, 34rem);
    border: 1px solid var(--line);
    border-top: 5px solid var(--green);
    border-radius: 6px;
    padding: 1.5rem;
    color: var(--ink);
    box-shadow: 0 20px 50px rgba(8, 34, 59, .28);
}
.session-warning-dialog::backdrop { background: rgba(8, 34, 59, .58); }
.session-warning-dialog h2 { margin-top: 0; color: var(--navy); }
.session-warning-dialog .actions { margin: 1rem 0; }
.session-warning-dialog small { color: var(--muted); }

.save-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: grid;
    place-items: center;
    padding: 1rem;
    background: rgba(8, 34, 59, .56);
    cursor: wait;
}
.save-overlay[hidden] { display: none; }
.save-overlay-box {
    width: min(92vw, 28rem);
    padding: 1.5rem;
    border-top: 5px solid var(--green);
    border-radius: 6px;
    background: var(--panel);
    color: var(--ink);
    text-align: center;
    box-shadow: 0 20px 50px rgba(8, 34, 59, .28);
    cursor: default;
}
.save-overlay-box h2 { margin: .75rem 0 .35rem; color: var(--navy); }
.save-overlay-box p { margin: 0 0 1rem; color: var(--muted); }
.save-spinner {
    display: inline-block;
    width: 2.25rem;
    height: 2.25rem;
    border: 4px solid #dce6da;
    border-top-color: var(--green);
    border-radius: 50%;
    animation: save-spin .8s linear infinite;
}
@keyframes save-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .save-spinner { animation-duration: 1.8s; } }
.budget-editor {
    padding: 1rem;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fbfdff;
}
.budget-editor .panel-head h2 { margin-bottom: 0; }
.check-row, .checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: .55rem;
    font-weight: 700;
    line-height: 1.4;
}
.check-row input, .checkbox-label input {
    margin-top: .2rem;
}
.expense-entry-section, .document-upload-section {
    padding: 1rem;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f8fafc;
}
.expense-entry-section > .panel-head, .document-upload-section > .panel-head { margin-bottom: .85rem; }
.expense-rows { display: grid; gap: .75rem; }
.expense-row {
    display: grid;
    gap: .75rem;
    padding: .9rem;
    border: 1px solid #d5dee7;
    border-left: 4px solid var(--blue);
    border-radius: 8px;
    background: white;
}
.expense-row-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    color: var(--navy);
}
.expense-row-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .7rem .85rem;
    align-items: end;
}
.revision-total {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: .75rem;
    padding: .75rem .85rem;
    border-top: 2px solid var(--navy);
    background: #f1f5f8;
    color: var(--navy);
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}
.revision-total strong { font-size: 1.1rem; }
.document-keep-list {
    display: grid;
    gap: .55rem;
    margin: 0 0 .85rem;
    padding: .85rem 1rem 1rem;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fbfdff;
}
.document-keep-list legend { padding: 0 .35rem; color: var(--navy); font-weight: 800; }
.draft-list { display: grid; gap: .6rem; }
.draft-list article {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: .75rem .85rem;
    border: 1px solid var(--line);
    border-left: 4px solid var(--blue);
    border-radius: 8px;
    background: #fbfdff;
}
.draft-list article > div:first-child { min-width: 0; }
.draft-list article strong, .draft-list article span { display: block; }
.draft-list article > div:first-child span { margin-top: .2rem; color: var(--muted); font-size: .82rem; }
.budget-version-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .75rem;
    margin-top: .75rem;
}
.cert-box {
    display: grid;
    gap: .75rem;
    padding: 1rem;
    border: 1px solid #d8e6d4;
    border-radius: 8px;
    background: #f8fcf6;
}
.cert-box h2 { margin-bottom: 0; }
.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: .45rem .85rem;
    padding: .8rem;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fbfdff;
}
.check-list {
    display: grid;
    gap: .55rem;
    padding-left: 1.1rem;
    margin: 0;
}
.check-list li { padding-left: .15rem; }
.prepared-fields {
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid var(--line);
}
.policy-callout {
    margin-bottom: 1.25rem;
    padding: 1rem 1.1rem;
    border: 1px solid #d7e6ef;
    border-left: 4px solid var(--blue);
    border-radius: 8px;
    background: #f4faff;
    color: var(--ink);
}
.policy-list {
    display: grid;
    gap: .85rem;
    margin: 0;
    padding-left: 1.2rem;
}
.policy-list li { padding-left: .15rem; }
.danger-list li::marker { color: var(--danger); }
.policy-section h3 {
    margin: 1.5rem 0 .65rem;
    padding-top: 1rem;
    border-top: 1px solid var(--line);
    color: var(--navy);
}
.policy-table { min-width: 1040px !important; }
.policy-table th:first-child { width: 18%; }
.policy-table tbody th {
    color: var(--navy);
    font-size: .88rem;
    text-transform: none;
    letter-spacing: 0;
}
.entity-action-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    margin-bottom: 1.25rem;
}
.entity-action-card {
    position: relative;
    display: grid;
    align-content: space-between;
    gap: 1rem;
    min-height: 285px;
    padding: 1.25rem;
    border: 1px solid var(--line);
    border-top: 4px solid var(--blue);
    border-radius: 8px;
    background: white;
    box-shadow: var(--shadow);
}
.entity-action-card.primary-card { border-top-color: var(--green); }
.entity-action-card h2 { margin-bottom: .55rem; }
.entity-action-card p:not(.eyebrow) { margin: 0; color: var(--muted); }
.agreement-checklist-panel { border-top: 4px solid var(--gold); }
.agreement-checklist {
    display: grid;
    gap: .8rem;
    margin: 0;
    padding-left: 1.65rem;
}
.agreement-checklist li { padding-left: .25rem; }
.agreement-checklist li::marker { color: var(--navy); font-weight: 900; }
.legal-language {
    padding: 1rem;
    border: 1px solid var(--line);
    border-left: 4px solid var(--blue);
    border-radius: 8px;
    background: #fbfdff;
}
.legal-language h3 { margin: 0 0 .45rem; color: var(--navy); }
.legal-language p { margin: 0; }
.legal-language h3:not(:first-child) { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.document-upload-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .85rem;
    margin-top: 1rem;
}

.saved-draft-attachments {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.saved-draft-attachments:empty {
  display: none;
}

.saved-draft-attachments ul {
  display: grid;
  gap: 8px;
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
}

.saved-draft-attachments li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}

.saved-draft-attachments li span {
  min-width: 0;
  overflow-wrap: anywhere;
}
.document-upload-card {
    display: grid;
    gap: .75rem;
    align-content: space-between;
    padding: 1rem;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fbfdff;
    scroll-margin-top: 1rem;
}
.document-upload-card:target { outline: 3px solid rgba(35,103,167,.2); border-color: var(--blue); }
.draft-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem;
    border: 1px solid #d7e6ef;
    border-radius: 8px;
    background: #f8fbfd;
}
.draft-controls p { margin: .25rem 0 0; color: var(--muted); }
.submit-row { display: flex; justify-content: flex-end; }
.required-packet-box {
    margin-top: 1rem;
    padding: 1rem 1.1rem;
    border: 1px solid #d7e6ef;
    border-radius: 8px;
    background: #f8fbfd;
}
.required-packet-box h3 { margin: 0 0 .75rem; color: var(--navy); }
.document-actions { align-items: stretch; }
.policy-note { margin: 1rem 0 0; color: var(--muted); font-size: .9rem; }
.notification-panel {
    background: #f8fcf6;
    border: 1px solid #d8e6d4;
    border-top: 4px solid var(--green);
    border-radius: 8px;
    box-shadow: var(--shadow);
    margin-bottom: 1.25rem;
    padding: 1.1rem;
}
.notification-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: .9rem;
}
.notification-head h2 { margin-bottom: 0; }
.notification-list { display: grid; gap: .75rem; }
.notification-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 1rem;
    align-items: center;
    padding: .85rem;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: white;
}
.notification-item strong { display: block; color: var(--navy); margin: .3rem 0 .15rem; }
.notification-item p { margin: 0 0 .2rem; color: var(--ink); }
.notification-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .45rem;
    color: var(--muted);
    font-size: .82rem;
}
.notification-actions {
    display: flex;
    gap: .45rem;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
}
.timeline-meta {
    display: inline-flex;
    flex-wrap: wrap;
    gap: .25rem;
    color: var(--muted);
    font-size: .82rem;
}
.expense-review-table, .checklist-review-table { min-width: 1180px !important; }
.expense-review-table td:nth-child(3) { min-width: 260px; }
.expense-review-table td:nth-child(6), .checklist-review-table td:nth-child(4) { min-width: 220px; }
.expense-review-table p, .checklist-review-table p { margin: .3rem 0; }
.evidence-links { display: grid; gap: .4rem; }
.evidence-links a { display: block; overflow-wrap: anywhere; }
.review-controls { display: grid; gap: .4rem; }
.review-controls select, .review-controls input, .review-controls textarea,
.checklist-review-table select, .checklist-review-table input, .checklist-review-table textarea {
    min-width: 190px;
    padding: .55rem .6rem;
    font-size: .84rem;
}
.readiness-list { display: grid; gap: .65rem; }
.readiness-item {
    display: grid;
    grid-template-columns: 120px minmax(0, 1fr);
    gap: .85rem;
    align-items: start;
    padding: .85rem 0;
    border-bottom: 1px solid var(--line);
}
.readiness-item:last-child { border-bottom: 0; }
.readiness-item p { margin: .25rem 0 0; color: var(--muted); }
.resource-section { margin-bottom: 1.5rem; }
.resource-section > .panel-head { margin-bottom: .75rem; }
.resource-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}
.resource-grid > .empty-state { grid-column: 1 / -1; }
.resource-card {
    display: grid;
    align-content: space-between;
    gap: 1rem;
    min-height: 245px;
    padding: 1.2rem;
    border: 1px solid var(--line);
    border-top: 4px solid var(--blue);
    border-radius: 8px;
    background: white;
    box-shadow: var(--shadow);
}
.resource-card h3 { margin: .7rem 0 .45rem; color: var(--navy); font-size: 1.08rem; }
.resource-card p { margin: 0; color: var(--muted); }
.resource-card-head { display: flex; flex-wrap: wrap; gap: .4rem; }
.resource-file-meta {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem .8rem;
    color: var(--muted);
    font-size: .82rem;
}
.resource-coming-soon {
    padding: .75rem;
    border-radius: 6px;
    background: #fff8e6;
    color: #74530d !important;
}
.resource-manager { margin-top: 1.5rem; scroll-margin-top: 1rem; }
.resource-admin-list { display: grid; gap: .75rem; margin-top: 1rem; }
.resource-admin {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fbfdff;
    overflow: hidden;
}
.resource-admin > summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: .9rem 1rem;
    color: var(--navy);
    cursor: pointer;
    font-weight: 800;
    list-style: none;
}
.resource-admin > summary::-webkit-details-marker { display: none; }
.resource-admin > summary::after {
    content: "+";
    display: grid;
    place-items: center;
    width: 1.5rem;
    height: 1.5rem;
    flex: 0 0 1.5rem;
    border-radius: 50%;
    background: #e7eef5;
    color: var(--navy);
    font-size: 1rem;
    line-height: 1;
}
.resource-admin[open] > summary::after { content: "−"; }
.resource-admin[open] > summary { border-bottom: 1px solid var(--line); background: #f2f7fb; }
.resource-admin-form { padding: 1rem; }
.resource-version-list { padding: 0 1rem 1rem; }
.resource-version-list h4 { margin: .25rem 0 .65rem; color: var(--navy); }
.resource-version-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: .7rem 0;
    border-top: 1px solid var(--line);
}
.resource-version-row small { display: block; margin-top: .2rem; }
.empty { color: var(--muted); margin: 0; }
.alert {
    margin-bottom: 1rem;
    padding: .85rem 1rem;
    border-radius: 8px;
    border: 1px solid var(--line);
    background: white;
}
.alert.success { border-color: #b8deb2; background: #f0faee; color: #2e6c25; }
.alert.error { border-color: #f0b4b4; background: #fff0f0; color: #9f2a2a; }

/* Balanced desktop density: reduce oversized spacing and fixed card heights
   while keeping normal body copy readable. */
@media (min-width: 901px) {
    h1 { font-size: clamp(1.5rem, 2vw, 2rem); }

    .shell { grid-template-columns: 240px minmax(0, 1fr); }
    .sidebar {
        position: sticky;
        top: 0;
        height: 100vh;
        overflow-y: auto;
        padding: .9rem;
        gap: .65rem;
    }
    .brand-with-logo { gap: .45rem; }
    .sidebar-logo-card { max-width: 175px; padding: .35rem .45rem; }
    .brand small, .sidebar-user small { font-size: .8rem; }
    .nav { gap: .15rem; margin-top: .45rem; }
    .nav a { padding: .55rem .65rem; border-radius: 6px; font-size: .9rem; line-height: 1.25; }
    .sidebar-user { padding-top: .7rem; }
    .main { padding: 1.25rem; }

    .page-head { margin-bottom: .9rem; }
    .page-intro { max-width: 840px; }
    .panel { padding: 1rem; margin-bottom: 1rem; }
    .panel-head { margin-bottom: .6rem; }

    table { font-size: .875rem; }
    th, td { padding: .55rem .6rem; }
    th { font-size: .75rem; }
    .table-wrap table { min-width: 720px; }
    .compact-table-wrap table { min-width: 0; }
    .dashboard-request-table-wrap table { min-width: 1180px; }
    .policy-table { min-width: 960px !important; }
    .expense-review-table, .checklist-review-table { min-width: 1080px !important; }

    .stats {
        grid-template-columns: repeat(auto-fit, minmax(175px, 1fr));
        gap: .65rem;
        margin-bottom: 1rem;
    }
    .stat { padding: .75rem .8rem; border-top-width: 3px; }
    .stat span { font-size: .75rem; line-height: 1.25; }
    .stat strong { margin-top: .18rem; font-size: 1.4rem; }
    .status-card.selected { outline-width: 2px; }

    .form { gap: .75rem; }
    label { gap: .28rem; font-size: .86rem; }
    input, select, textarea { padding: .5rem .65rem; border-radius: 6px; font-size: .92rem; }
    .filters { gap: .5rem; margin-bottom: .75rem; }
    .request-filters {
        grid-template-columns: minmax(200px, 1.5fr) repeat(5, minmax(120px, 1fr)) auto;
        gap: .5rem;
    }
    .button { min-height: 38px; padding: .48rem .75rem; border-radius: 6px; font-size: .9rem; }
    .button.small { min-height: 32px; padding: .34rem .55rem; font-size: .78rem; }
    .badge { min-height: 24px; padding: .18rem .45rem; font-size: .75rem; }
    .status-cell .badge { min-width: 160px; font-size: .78rem; }

    .request-header-grid { gap: .55rem; margin: .75rem 0; }
    .request-header-grid > div { gap: .15rem; padding: .65rem; border-radius: 6px; }
    .request-header-grid span { font-size: .7rem; }
    .dashboard-inline-control { grid-template-columns: minmax(125px, 1fr) auto; gap: .3rem; }
    .dashboard-inline-control select { padding: .42rem .5rem; font-size: .8rem; }
    .dashboard-inline-control .button { min-height: 32px; }

    .detail-grid { grid-template-columns: minmax(0, 1.55fr) minmax(300px, .85fr); gap: 1rem; }
    .details { gap: .55rem; margin-bottom: .75rem; }
    .details div { padding-bottom: .42rem; }
    .timeline, .file-list, .history-grid, .plain-list { gap: .55rem; }
    .timeline-item, .history-grid div, .file-list a { gap: .2rem; padding: .65rem; border-radius: 6px; }

    .workflow-stage-list { gap: .45rem; }
    .budget-editor, .cert-box, .checkbox-grid { padding: .75rem; border-radius: 6px; }
    .cert-box { gap: .55rem; }
    .checkbox-grid { gap: .35rem .7rem; }
    .prepared-fields { margin-top: .9rem; padding-top: .75rem; }
    .policy-callout { margin-bottom: 1rem; padding: .75rem .9rem; border-radius: 6px; }
    .policy-list, .agreement-checklist { gap: .55rem; }
    .policy-section h3 { margin: 1.1rem 0 .5rem; padding-top: .75rem; }
    .policy-note { margin-top: .7rem; font-size: .85rem; }

    .entity-action-grid { gap: .7rem; margin-bottom: 1rem; }
    .entity-action-card { gap: .7rem; min-height: 225px; padding: .9rem; }
    .entity-action-card h2 { margin-bottom: .4rem; }
    .legal-language { padding: .8rem; border-radius: 6px; }
    .legal-language h3:not(:first-child) { margin-top: .75rem; padding-top: .75rem; }
    .document-upload-grid { gap: .65rem; margin-top: .75rem; }
    .document-upload-card { gap: .6rem; padding: .8rem; border-radius: 6px; }
    .draft-controls, .required-packet-box { padding: .75rem .85rem; border-radius: 6px; }
    .required-packet-box { margin-top: .75rem; }

    .resource-section { margin-bottom: 1rem; }
    .resource-section > .panel-head { margin-bottom: .55rem; }
    .resource-grid { grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: .75rem; }
    .resource-card { gap: .7rem; min-height: 195px; padding: .9rem; }
    .resource-card h3 { margin: .55rem 0 .35rem; font-size: 1rem; }
    .resource-file-meta { gap: .3rem .65rem; font-size: .78rem; }
    .resource-coming-soon { padding: .6rem; }
    .resource-manager { margin-top: 1rem; }
    .resource-admin-list { gap: .6rem; margin-top: .75rem; }
    .resource-admin > summary { padding: .7rem .8rem; }
    .resource-admin-form { padding: .8rem; }
    .resource-version-list { padding: 0 .8rem .8rem; }
    .resource-version-row { gap: .7rem; padding: .5rem 0; }

    .empty-state { padding: .9rem; }
    .notification-panel { margin-bottom: 1rem; padding: .85rem; }
    .notification-head { margin-bottom: .65rem; }
    .notification-list { gap: .55rem; }
    .notification-item { gap: .75rem; padding: .65rem; }
    .readiness-list { gap: .45rem; }
    .readiness-item { gap: .7rem; padding: .65rem 0; }
    .alert { margin-bottom: .8rem; padding: .7rem .85rem; }

    .auth-card { width: min(480px, 100%); padding: 1.5rem; }
    .auth-page > .alert { width: min(480px, 100%); }
    .auth-logo { width: min(270px, 100%); }
    .auth-brand { margin-bottom: .9rem; }
    .auth-card h1 { margin-bottom: .9rem; }
}

.instruction-page-head { margin-bottom: 1rem; }
.instruction-index {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .5rem 1rem;
    padding: 1rem 1.25rem;
}
.instruction-index strong { color: var(--navy); }
.instruction-index a { font-weight: 700; }
.instruction-section { scroll-margin-top: 1rem; }
.instruction-section .panel-head { margin-bottom: .8rem; }
.instruction-steps, .instruction-list {
    display: grid;
    gap: .85rem;
    margin: 0;
    padding-left: 1.4rem;
}
.instruction-steps li, .instruction-list li { padding-left: .3rem; line-height: 1.55; }
.instruction-steps li::marker { color: var(--green); font-weight: 900; }
.instruction-section code {
    padding: .12rem .35rem;
    border: 1px solid var(--line);
    border-radius: 4px;
    background: var(--bg);
    color: var(--navy);
    font-family: inherit;
    font-size: .92em;
    font-weight: 800;
}
.instruction-document-grid,
.instruction-review-grid,
.instruction-admin-grid,
.instruction-checklist {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 1.5rem;
    margin-top: 1.1rem;
    border-top: 1px solid var(--line);
}
.instruction-document-grid > div,
.instruction-admin-grid > div {
    display: grid;
    gap: .2rem;
    padding: .9rem 0;
    border-bottom: 1px solid var(--line);
}
.instruction-document-grid span,
.instruction-admin-grid p,
.instruction-review-grid p { margin: 0; color: var(--muted); }
.instruction-review-grid > div {
    position: relative;
    min-height: 130px;
    padding: 1rem 0 1rem 3rem;
    border-bottom: 1px solid var(--line);
}
.instruction-review-grid > div > span {
    position: absolute;
    top: 1rem;
    left: 0;
    display: grid;
    place-items: center;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background: var(--green);
    color: white;
    font-weight: 900;
}
.instruction-review-grid strong { display: block; margin-bottom: .3rem; color: var(--navy); }
.instruction-table td:first-child { min-width: 210px; }
.instruction-table td { vertical-align: top; }
.instruction-table td:first-child strong,
.status-instruction-table td:first-child strong { display: block; margin-top: .35rem; color: var(--navy); }
.status-instruction-table td:first-child { min-width: 245px; }
.status-guide-list { display: grid; gap: 0; }
.status-guide-list > div {
    display: grid;
    grid-template-columns: auto minmax(210px, .8fr) minmax(0, 2fr);
    align-items: start;
    gap: .75rem 1rem;
    padding: .75rem 0;
    border-bottom: 1px solid var(--line);
}
.status-guide-list > div:last-child { border-bottom: 0; }
.status-guide-list strong { color: var(--navy); }
.status-guide-list p { margin: 0; color: var(--muted); }
.instruction-checklist { padding-top: .35rem; }
.instruction-checklist > div {
    position: relative;
    padding: .7rem 0 .7rem 1.8rem;
    border-bottom: 1px solid var(--line);
    font-weight: 700;
}
.instruction-checklist > div::before {
    content: "\2713";
    position: absolute;
    left: 0;
    color: var(--green);
    font-weight: 900;
}

.context-help-tooltip {
    position: fixed;
    z-index: 1000;
    width: max-content;
    max-width: min(330px, calc(100vw - 16px));
    padding: .65rem .75rem;
    border: 1px solid rgba(255, 255, 255, .22);
    border-radius: 6px;
    background: #102f4f;
    box-shadow: 0 8px 24px rgba(10, 38, 65, .24);
    color: white;
    font-size: .82rem;
    font-weight: 650;
    line-height: 1.4;
    letter-spacing: 0;
    opacity: 0;
    pointer-events: none;
    transform: translateY(3px);
    transition: opacity .12s ease, transform .12s ease;
}
.context-help-tooltip.visible { opacity: 1; transform: translateY(0); }
.context-help-control[aria-description] { position: relative; }

@media (min-width: 901px) and (max-width: 1200px) {
    .request-filters { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
    .shell { grid-template-columns: 1fr; }
    .sidebar {
        position: sticky;
        top: 0;
        z-index: 50;
        padding: .75rem .9rem;
        gap: .55rem;
        box-shadow: 0 4px 16px rgba(10, 38, 65, .18);
    }
    .brand-with-logo { flex-direction: row; align-items: center; }
    .brand-with-logo { padding-right: 5.5rem; }
    .sidebar-logo-card { max-width: 145px; }
    .nav-drawer > summary {
        position: absolute;
        top: .9rem;
        right: .9rem;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: .6rem;
        min-height: 42px;
        padding: .55rem .7rem;
        border: 1px solid rgba(255, 255, 255, .34);
        border-radius: 6px;
        color: white;
        background: rgba(255, 255, 255, .1);
        cursor: pointer;
        font-weight: 800;
        list-style: none;
    }
    .nav-drawer > summary::-webkit-details-marker { display: none; }
    .nav-drawer > summary::after { content: "▾"; font-size: .78rem; transition: transform .16s ease; }
    .nav-drawer[open] > summary { background: rgba(255, 255, 255, .18); }
    .nav-drawer[open] > summary::after { transform: rotate(180deg); }
    .nav-drawer:not([open]) > .nav { display: none; }
    .nav-drawer:not([open]) + .sidebar-user { display: none; }
    .nav { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: .15rem; }
    .nav a { padding: .62rem .7rem; }
    .sidebar-user { margin-top: .2rem; padding-top: .65rem; }
    .main { padding: 1rem; }
    .mfa-setup-layout { min-height: auto; padding: 1rem 0; }
    .panel { padding: 1rem; margin-bottom: 1rem; }
    .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .65rem; margin-bottom: 1rem; }
    .stat { padding: .8rem; border-top-width: 3px; }
    .stat span { font-size: .75rem; line-height: 1.3; }
    .stat strong { font-size: 1.45rem; }
    .dashboard-summary-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .detail-grid, .grid-form, .filters, .allocation-filters, .request-filters, .notification-item, .request-header-grid, .funding-editor-form, .entity-action-grid, .readiness-item, .document-upload-grid, .resource-grid, .expense-row-grid, .budget-version-fields, .allocation-picker-control, .instruction-document-grid, .instruction-review-grid, .instruction-admin-grid, .instruction-checklist, .example-details, .user-allocation-list { grid-template-columns: 1fr; }
    .notification-actions { justify-content: flex-start; }
    .draft-controls { align-items: flex-start; flex-direction: column; }
    .draft-list article { align-items: flex-start; flex-direction: column; }
    .entity-action-card, .resource-card { min-height: 0; }
    .resource-version-row { align-items: flex-start; flex-direction: column; }
    .span-2 { grid-column: span 1; }
    .page-head { align-items: flex-start; flex-direction: column; }
    .workflow-stage-list-wide { grid-template-columns: 1fr; }
    .status-guide-list > div { grid-template-columns: auto minmax(0, 1fr); }
    .status-guide-list p { grid-column: 2; }
}

@media (max-width: 700px) {
    .nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .panel-head, .notification-head { align-items: flex-start; flex-direction: column; }
    .panel-head > .actions, .notification-head > .actions { width: 100%; }
}

@media (max-width: 560px) {
    .auth-card { padding: 1.25rem; }
    .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .dashboard-summary-stats { grid-template-columns: 1fr; }
    .details { grid-template-columns: 1fr; }
    .expense-entry-section, .document-upload-section { padding: .75rem; }
    .expense-row { padding: .75rem; }
    .submit-row .button { width: 100%; }
    .auth-secondary-actions { align-items: flex-start; flex-direction: column; }
    .instruction-index { align-items: flex-start; flex-direction: column; }
    .status-guide-list > div { grid-template-columns: 1fr; }
    .status-guide-list p { grid-column: 1; }
}

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

@media (pointer: coarse) {
    .nav a, .nav-drawer > summary, .signout-form button, .button, .button.small, input:not([type="checkbox"]):not([type="radio"]), select { min-height: 44px; }
    .check-row, .checkbox-label { min-height: 44px; align-items: center; }
    .check-row input, .checkbox-label input { margin-top: 0; }
    input, select, textarea { font-size: 1rem; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}

@media print {
    body { background: white; color: #111; font-size: 10pt; }
    .shell { display: block; }
    .sidebar, .skip-link, .button, .actions, .filters, .notification-panel, .resource-manager, .context-help-tooltip { display: none !important; }
    .main { padding: 0; }
    .panel, .stat, .resource-card { break-inside: avoid; box-shadow: none; }
    .panel, .table-wrap { overflow: visible; }
    .table-wrap table, .policy-table, .expense-review-table, .checklist-review-table { min-width: 0 !important; }
    a { color: inherit; text-decoration: underline; }
}
.form-validation-summary,
.recipient-validation-summary {
    width: 100%;
}

.form-validation-summary strong,
.recipient-validation-summary strong {
    display: block;
    margin-bottom: .35rem;
}

.form-validation-summary ul,
.recipient-validation-summary ul {
    margin: 0;
    padding-left: 1.25rem;
}

.form-draft-status,
.recipient-draft-status {
    color: var(--muted);
    min-height: 1.25rem;
}

.entity-work-groups {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: .75rem;
    margin: 0 0 1.25rem;
}
.entity-work-groups a {
    display: grid;
    gap: .2rem;
    min-width: 0;
    padding: .9rem 1rem;
    border: 1px solid var(--line);
    border-top: 4px solid var(--navy);
    border-radius: 6px;
    background: white;
    box-shadow: var(--shadow);
    color: var(--ink);
}
.entity-work-groups a:first-child { border-top-color: var(--gold); }
.entity-work-groups a:nth-child(3) { border-top-color: var(--green); }
.entity-work-groups a:hover { border-color: var(--blue); text-decoration: none; }
.entity-work-groups strong { color: var(--navy); font-size: 1.45rem; }
.entity-work-groups span { color: var(--muted); font-size: .85rem; font-weight: 800; }
.entity-group-panel { scroll-margin-top: 1rem; }

.reimbursement-wizard { gap: 0; }
.wizard-header {
    position: sticky;
    top: 0;
    z-index: 20;
    display: grid;
    gap: .8rem;
    margin: -1.25rem -1.25rem 1.25rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--line);
    background: rgba(255,255,255,.98);
    box-shadow: 0 8px 18px rgba(18,60,105,.06);
}
.wizard-progress {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin: 0;
    padding: 0;
    list-style: none;
}
.wizard-progress li { min-width: 0; }
.wizard-progress button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .45rem;
    width: 100%;
    min-height: 48px;
    padding: .55rem .65rem;
    border: 1px solid var(--line);
    border-right: 0;
    background: #f7f9fb;
    color: var(--muted);
    font: inherit;
    font-size: .84rem;
    font-weight: 800;
    cursor: pointer;
}
.wizard-progress li:first-child button { border-radius: 6px 0 0 6px; }
.wizard-progress li:last-child button { border-right: 1px solid var(--line); border-radius: 0 6px 6px 0; }
.wizard-progress button span {
    display: grid;
    place-items: center;
    width: 1.65rem;
    height: 1.65rem;
    border: 1px solid #aab6c1;
    border-radius: 50%;
    background: white;
    flex: 0 0 auto;
}
.wizard-progress button[aria-current="step"] { background: #eaf4e6; color: var(--navy); border-color: #9bb993; }
.wizard-progress button[aria-current="step"] span,
.wizard-progress li.complete button span { border-color: var(--green); background: var(--green); color: white; }
.wizard-draft-controls { padding: .75rem .9rem; }
.wizard-step { padding: .25rem 0 1.25rem; }
.wizard-step[hidden] { display: none; }
.wizard-step-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: 1.1rem; }
.wizard-step-heading p:not(.eyebrow) { margin: .35rem 0 0; color: var(--muted); }
.wizard-actions {
    position: sticky;
    bottom: 0;
    z-index: 15;
    display: flex;
    justify-content: space-between;
    gap: .75rem;
    margin: 0 -1.25rem -1.25rem;
    padding: .85rem 1.25rem;
    border-top: 1px solid var(--line);
    background: rgba(255,255,255,.98);
}
.wizard-actions .button:last-child { margin-left: auto; }
.submission-readiness {
    display: grid;
    gap: .8rem;
    padding: 1rem;
    border: 1px solid #e2c67f;
    border-left: 4px solid var(--gold);
    border-radius: 6px;
    background: #fffaf0;
}
.submission-readiness.ready { border-color: #a9c8a0; border-left-color: var(--green); background: #f4faf2; }
.readiness-summary { display: flex; align-items: center; gap: .7rem; flex-wrap: wrap; }
.submission-readiness ol { display: grid; gap: .45rem; margin: 0; padding-left: 1.5rem; }
.submission-readiness li button { padding: 0; border: 0; background: transparent; color: var(--blue); font: inherit; font-weight: 700; text-align: left; cursor: pointer; }
.review-submit-certification { margin-top: 1rem; padding: 1rem; border: 1px solid var(--line); border-radius: 6px; background: #f8fafc; }
.review-submit-certification p { margin: .35rem 0 0; color: var(--muted); }

.request-summary-bar {
    position: sticky;
    top: 0;
    z-index: 25;
    display: grid;
    grid-template-columns: minmax(150px,.8fr) minmax(150px,.8fr) minmax(150px,.8fr) minmax(220px,1.2fr);
    gap: 0;
    margin-bottom: 1rem;
    border: 1px solid var(--line);
    border-top: 4px solid var(--green);
    border-radius: 6px;
    background: white;
    box-shadow: 0 8px 18px rgba(18,60,105,.08);
}
.request-summary-bar > div { display: grid; align-content: center; gap: .2rem; min-width: 0; padding: .75rem 1rem; border-right: 1px solid var(--line); }
.request-summary-bar > div:last-child { border-right: 0; }
.request-summary-bar span { color: var(--muted); font-size: .72rem; font-weight: 800; text-transform: uppercase; }
.request-summary-bar strong { color: var(--navy); overflow-wrap: anywhere; }
.request-summary-action { grid-template-columns: 1fr auto; align-items: center; }
.request-summary-action span { grid-column: 1 / -1; }
.request-summary-action .button { min-height: 36px; padding: .45rem .7rem; }
.request-tabs {
    display: flex;
    gap: 0;
    margin: 0 0 1rem;
    overflow-x: auto;
    border-bottom: 1px solid var(--line);
}
.request-tabs button {
    min-height: 44px;
    padding: .65rem 1rem;
    border: 0;
    border-bottom: 3px solid transparent;
    background: transparent;
    color: var(--muted);
    font: inherit;
    font-weight: 800;
    white-space: nowrap;
    cursor: pointer;
}
.request-tabs button[aria-selected="true"] { border-bottom-color: var(--green); color: var(--navy); }
[data-request-panel][hidden], [data-request-panel-group][hidden] { display: none !important; }

.correction-summary {
    display: grid;
    grid-template-columns: minmax(220px,.7fr) minmax(0,1.3fr);
    gap: 1rem;
    margin-bottom: 1rem;
    padding: 1rem;
    border: 1px solid #e2c67f;
    border-left: 4px solid var(--gold);
    border-radius: 6px;
    background: #fffaf0;
}
.correction-summary h2 { margin-bottom: .35rem; }
.correction-summary p { margin: 0; color: var(--muted); }
.correction-summary ol { display: grid; gap: .55rem; margin: 0; padding-left: 1.4rem; }
.correction-summary li a { display: grid; gap: .15rem; }
.correction-summary li span { color: var(--ink); font-size: .9rem; }
.needs-correction { scroll-margin-top: 8rem; outline: 3px solid rgba(198,146,45,.28); outline-offset: -3px; background: #fffaf0 !important; }
.correction-selector { margin: 0; padding: 1rem; border: 1px solid #e2c67f; border-radius: 6px; background: #fffaf0; }
.correction-selector[hidden] { display: none; }
.correction-selector legend { padding: 0 .35rem; color: var(--navy); font-weight: 800; }
.correction-selector .policy-note { margin: 0 0 .75rem; }
.correction-choice-list { display: grid; gap: .55rem; }
.correction-choice { display: grid; grid-template-columns: minmax(220px,.8fr) minmax(0,1.2fr); gap: .75rem; align-items: start; padding: .7rem; border: 1px solid #ead9aa; border-radius: 6px; background: white; }
.correction-choice textarea[hidden] { display: none; }

@media (max-width: 1100px) {
    .request-summary-bar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .request-summary-bar > div:nth-child(2) { border-right: 0; }
    .request-summary-bar > div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
}

@media (max-width: 900px) {
    .entity-work-groups, .wizard-progress { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .wizard-progress li:first-child button { border-radius: 6px 0 0 0; }
    .wizard-progress li:nth-child(2) button { border-right: 1px solid var(--line); border-radius: 0 6px 0 0; }
    .wizard-progress li:nth-child(3) button { border-radius: 0 0 0 6px; }
    .wizard-progress li:last-child button { border-radius: 0 0 6px 0; }
    .wizard-progress li:nth-child(-n+2) button { border-bottom: 0; }
    .wizard-header { position: static; margin-top: -1rem; }
    .request-summary-bar { position: static; }
    .correction-summary, .correction-choice { grid-template-columns: 1fr; }
    .nav-section { grid-column: 1 / -1; }
    .nav-section > div { grid-template-columns: repeat(2, minmax(0, 1fr)); padding-left: 0; }
}

@media (max-width: 560px) {
    .entity-work-groups { grid-template-columns: 1fr 1fr; gap: .5rem; }
    .entity-work-groups a { padding: .75rem; }
    .wizard-progress button { justify-content: flex-start; font-size: .78rem; }
    .wizard-step-heading { flex-direction: column; }
    .wizard-actions { flex-wrap: wrap; }
    .request-summary-bar { grid-template-columns: 1fr; }
    .request-summary-bar > div { border-right: 0; border-bottom: 1px solid var(--line); }
    .request-summary-bar > div:last-child { border-bottom: 0; }
    .request-summary-action { grid-template-columns: 1fr; }
    .request-summary-action .button { margin-top: .35rem; }
}

[data-recipient-submit][disabled],
[data-user-submit][disabled] {
    cursor: wait;
    opacity: .72;
}
