@font-face {
    font-family: Geist;
    font-style: normal;
    font-weight: 400 800;
    font-display: swap;
    src: url('../fonts/geist-latin.woff2') format('woff2');
}

:root {
    color-scheme: light;
    --ink: #182033;
    --muted: #586277;
    --accent: #5244c6;
    --hover: #4030a9;
    --tint: #efedff;
    --tint-line: #d8d2ff;
    --paper: #f4f5f9;
    --surface-soft: #f8f9fc;
    --line: #dfe3ec;
    --control-line: #c7cedb;
    --white: #fff;
    --sidebar: #17182c;
    --sidebar-end: #22213a;
    --sidebar-muted: #adb0c9;
    --sidebar-line: #ffffff1e;
    --sidebar-active: #343055;
    --sidebar-marker: #b4aaff;
    --hero-edge: #39315e;
    --danger: #9c2f3f;
    --danger-bg: #fff2f3;
    --danger-line: #f2c6cf;
    --warning: #815214;
    --warning-bg: #fff6e6;
    --warning-line: #edd9b4;
    --positive: #214f8b;
    --positive-bg: #edf4ff;
    --radius: .62rem;
    --control-size: 2.25rem;
    --page-gutter: clamp(.9rem, 2vw, 1.65rem);
    --section-gap: .7rem;
    font-family: Geist, ui-sans-serif, system-ui, sans-serif;
    background: var(--paper);
    color: var(--ink);
    line-height: 1.5;
}

:root[data-theme="ocean"] {
    --accent: #086998;
    --hover: #075478;
    --tint: #e8f5fc;
    --tint-line: #b8deef;
    --paper: #f0f5f9;
    --surface-soft: #f6f9fc;
    --sidebar: #0d2536;
    --sidebar-end: #12364b;
    --sidebar-muted: #a7c6da;
    --sidebar-active: #174164;
    --sidebar-marker: #86d6fb;
    --hero-edge: #164962;
}

:root[data-theme="copper"] {
    --accent: #9a4d2e;
    --hover: #793b27;
    --tint: #fbeee6;
    --tint-line: #eccbbb;
    --paper: #f7f3ef;
    --surface-soft: #fbf8f5;
    --sidebar: #30201e;
    --sidebar-end: #442c28;
    --sidebar-muted: #d6b7ad;
    --sidebar-active: #57372d;
    --sidebar-marker: #f4bc99;
    --hero-edge: #613c31;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-padding-top: 1rem; }
html:has(.intake-actions) { scroll-padding-bottom: 5rem; }
body { margin: 0; min-width: 16rem; }
strong { font-weight: 680; }
a { color: var(--accent); text-underline-offset: .19em; }
button, input, select, textarea { font: inherit; }
button, select, summary { cursor: pointer; }
button:disabled { cursor: default; opacity: .65; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.skip-link {
    position: fixed;
    z-index: 100;
    left: .75rem;
    top: .5rem;
    transform: translateY(-160%);
    padding: .6rem .85rem;
    background: var(--white);
    border-radius: .4rem;
}
.skip-link:focus { transform: none; }

.portal-shell { display: grid; grid-template-columns: 12.25rem minmax(0, 1fr); min-height: 100vh; }
.sidebar {
    position: sticky;
    top: 0;
    height: 100dvh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    background: var(--sidebar);
    color: #fff;
    padding: .95rem .65rem .7rem;
}
.brand { display: inline-flex; align-items: center; gap: .7rem; color: inherit; text-decoration: none; }
.sidebar .brand { padding: .15rem .4rem 1rem; }
.brand-mark {
    flex: none;
    display: grid;
    place-items: center;
    min-width: 2.12rem;
    min-height: 2.12rem;
    border-radius: .5rem;
    background: var(--sidebar-marker);
    color: var(--sidebar);
    font-weight: 760;
    font-size: 1rem;
    letter-spacing: -.055em;
}
.brand strong, .brand small, .workspace-account strong, .workspace-account small { display: block; }
.brand strong { font-size: .98rem; line-height: 1.35; }
.brand small { color: var(--sidebar-muted); font-size: .76rem; }
.workspace-nav { flex: 1; display: flex; flex-direction: column; gap: .95rem; }
.nav-group { display: grid; align-content: start; gap: .15rem; }
.nav-group-account { margin-top: auto; padding-top: .6rem; border-top: 1px solid var(--sidebar-line); }
.nav-heading { margin: 0 0 .38rem .65rem; color: var(--sidebar-muted); font-size: .69rem; font-weight: 660; letter-spacing: .09em; text-transform: uppercase; }
.workspace-nav a, .sign-out {
    display: flex;
    position: relative;
    width: 100%;
    align-items: center;
    gap: .58rem;
    padding: .42rem .53rem;
    min-height: 2.16rem;
    border: 0;
    border-radius: .5rem;
    background: transparent;
    color: #d7d9eb;
    text-align: left;
    text-decoration: none;
    font-size: .84rem;
    font-weight: 550;
}
.workspace-nav a:hover, .sign-out:hover { background: #ffffff12; color: #fff; }
.workspace-nav a[aria-current="page"] { color: #fff; background: var(--sidebar-active); font-weight: 680; }
.workspace-nav a[aria-current="page"]::before {
    content: '';
    position: absolute;
    inset: .4rem auto .4rem 0;
    width: .18rem;
    border-radius: .25rem;
    background: var(--sidebar-marker);
}
.sidebar :focus-visible, .access-brand :focus-visible { outline-color: var(--sidebar-marker); }

.nav-icon { width: 1rem; height: 1rem; display: inline-block; position: relative; flex: none; color: currentColor; opacity: .85; }
.nav-icon::before, .nav-icon::after { content: ''; position: absolute; }
.nav-icon--overview::before { inset: 1px; border: 1.35px solid; border-radius: 3px; background: linear-gradient(currentColor, currentColor) center/1px 100% no-repeat, linear-gradient(currentColor, currentColor) center/100% 1px no-repeat; }
.nav-icon--folder::before { inset: 4px 0 1px; border-radius: 3px; border: 1.35px solid; }
.nav-icon--folder::after { width: 7px; height: 4px; top: 1px; left: 0; border: 1.35px solid; border-bottom: 0; border-radius: 3px 3px 0 0; }
.nav-icon--list::before { inset: 1px 2px; border: 1.35px solid; border-radius: 3px; }
.nav-icon--list::after { inset: 5px 5px; border-block: 1px solid; }
.nav-icon--tag::before { inset: 3px 2px; border: 1.35px solid; border-radius: 3px; transform: rotate(-35deg); }
.nav-icon--tag::after { width: 3px; height: 3px; border-radius: 100%; background: currentColor; top: 5px; right: 4px; }
.nav-icon--search::before { width: 10px; height: 10px; border: 1.45px solid; border-radius: 50%; inset: 1px 0 0 1px; }
.nav-icon--search::after { width: 6px; height: 1.4px; background: currentColor; transform: rotate(45deg); right: 0; bottom: 3px; border-radius: 1px; }
.nav-icon--mail::before { inset: 2px 0; border-radius: 3px; border: 1.35px solid; }
.nav-icon--mail::after { inset: 2px 4px auto; width: 8px; height: 8px; transform: rotate(45deg); border-right: 1.2px solid; border-bottom: 1.2px solid; }
.nav-icon--receipt::before { inset: 1px 2px; border: 1.35px solid; border-radius: 2px; }
.nav-icon--receipt::after { inset: 5px 5px; border-block: 1.35px solid; }
.nav-icon--export::before { inset: 7px 1px 1px; border: 1.35px solid; border-top: 0; border-radius: 0 0 3px 3px; }
.nav-icon--export::after { width: 6px; height: 6px; border-right: 1.35px solid; border-bottom: 1.35px solid; transform: rotate(45deg); top: 2px; left: 5px; }
.nav-icon--settings::before { inset: 3px 1px; border-block: 1.35px solid; }
.nav-icon--settings::after { width: 4px; height: 4px; top: 2px; left: 4px; background: currentColor; border-radius: 50%; box-shadow: 5px 9px 0 currentColor; }
.nav-icon--logout::before { inset: 1px 6px 1px 1px; border: 1.35px solid; border-right: 0; border-radius: 3px; }
.nav-icon--logout::after { width: 6px; height: 6px; border-top: 1.35px solid; border-right: 1.35px solid; transform: rotate(45deg); right: 1px; top: 5px; }
.nav-icon--menu::before { inset: 3px 0; border-block: 1.35px solid; background: linear-gradient(currentColor, currentColor) center/100% 1px no-repeat; }

.portal-workspace { min-width: 0; }
.workspace-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    min-height: 3.25rem;
    padding: .4rem var(--page-gutter);
    background: var(--white);
    border-bottom: 1px solid var(--line);
}
.workspace-crumb { min-width: 0; display: flex; gap: .66rem; align-items: center; color: var(--muted); font-size: .86rem; }
.crumb-portal { flex: none; }
.crumb-divider { color: #a5adbc; }
.crumb-current { font-weight: 650; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.workspace-account { display: flex; align-items: center; gap: .58rem; min-width: 0; max-width: 43%; text-decoration: none; color: var(--ink); }
.account-initial { flex: none; width: 2.1rem; height: 2.1rem; display: grid; place-items: center; border-radius: .64rem; background: var(--tint); color: var(--accent); font-size: .87rem; font-weight: 760; }
.account-copy { min-width: 0; }
.account-copy strong { font-size: .83rem; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-copy small { color: var(--muted); font-size: .7rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-toggle, .sidebar-scrim { display: none !important; }

.page { width: 100%; max-width: 90rem; margin: 0 auto; padding: 1.15rem var(--page-gutter) 2rem; outline-offset: -.16rem; }
h1, h2, h3, h4, p { overflow-wrap: anywhere; }
h1 { margin: 0 0 .9rem; font-size: clamp(1.5rem, 2.4vw, 1.9rem); line-height: 1.15; letter-spacing: -.04em; font-weight: 690; }
h2 { margin: 0 0 .65rem; font-size: 1rem; line-height: 1.35; letter-spacing: -.018em; font-weight: 680; }
h3 { line-height: 1.4; }
.page-heading, .actions { display: flex; align-items: center; flex-wrap: wrap; gap: .4rem; }
.page-heading { justify-content: space-between; margin-bottom: .9rem; row-gap: .6rem; }
.page-heading h1 { margin: 0; }
.page-path { margin: 0 0 .5rem; font-size: .8rem; overflow-wrap: anywhere; color: var(--muted); }
.page-path a { font-weight: 600; text-decoration: none; }
.page-path a:hover { text-decoration: underline; }
.panel { min-width: 0; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); }
.panel-padding { padding: .88rem; }
.lede { margin: 0 0 1.2rem; color: var(--muted); }
.empty-state { padding: 1.05rem .9rem; color: var(--muted); }

.button, .primary-button {
    --button-fill: var(--white);
    --button-border: var(--control-line);
    --button-text: var(--ink);
    --button-hover-fill: var(--surface-soft);
    --button-hover-border: var(--muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .42rem;
    min-height: var(--control-size);
    padding: .4rem .7rem;
    border: 1px solid var(--button-border);
    border-radius: .46rem;
    background-color: var(--button-fill);
    color: var(--button-text);
    text-decoration: none;
    font-size: .84rem;
    font-weight: 640;
    line-height: 1.2;
}
.button-primary, .primary-button {
    --button-fill: var(--accent);
    --button-border: var(--accent);
    --button-text: #fff;
    --button-hover-fill: var(--hover);
    --button-hover-border: var(--hover);
}
.button-quiet {
    --button-fill: transparent;
    --button-border: transparent;
    --button-text: var(--muted);
    --button-hover-fill: var(--tint);
    --button-hover-border: transparent;
    --button-hover-text: var(--accent);
}
@media (hover: hover) {
    :is(.button, .primary-button):not(:disabled):hover {
        background-color: var(--button-hover-fill);
        border-color: var(--button-hover-border);
        color: var(--button-hover-text, var(--button-text));
    }
}
.button .nav-icon { opacity: 1; }
.button-upload-icon { position: relative; flex: none; width: 1rem; height: 1rem; }
.button-upload-icon::before, .button-upload-icon::after { content: ''; position: absolute; }
.button-upload-icon::before { inset: .53rem .05rem 0; border: 1.5px solid; border-top: 0; border-radius: 0 0 3px 3px; }
.button-upload-icon::after { inset: .12rem auto auto .34rem; width: .35rem; height: .35rem; border: 1.5px solid; border-right: 0; border-bottom: 0; transform: rotate(45deg); }
.button-plus-icon { flex: none; font-size: 1.17rem; line-height: .9; font-weight: 500; }
.primary-button { width: 100%; min-height: 2.6rem; margin-top: .85rem; }

.field + .field { margin-top: .68rem; }
.field label { display: block; margin-bottom: .34rem; color: var(--ink); font-size: .835rem; font-weight: 640; }
.field input, .field select, .field textarea {
    width: 100%;
    min-width: 0;
    min-height: var(--control-size);
    padding: .38rem .58rem;
    border: 1px solid var(--control-line);
    border-radius: .5rem;
    color: var(--ink);
    background: var(--white);
    font-size: .9rem;
    transition: border-color 100ms ease;
}
.field input:hover, .field select:hover, .field textarea:hover { border-color: var(--muted); }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--accent); }
.field input::placeholder, .field textarea::placeholder { color: #778297; }
.field input[aria-invalid="true"] { border-color: var(--danger); }
.field input[readonly], .field input:disabled, .field select:disabled { background: var(--surface-soft); }
.field textarea { resize: vertical; }
.field input[type="file"] { color: var(--muted); }
.field input::file-selector-button {
    background: var(--tint);
    color: var(--accent);
    font: inherit;
    font-weight: 650;
    border: 0;
    border-radius: .36rem;
    padding: .3rem .53rem;
    margin-inline-end: .6rem;
    cursor: pointer;
}
.field-hint { display: block; margin: .35rem 0; color: var(--muted); font-size: .79rem; }
.field-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 14.5rem), 1fr)); gap: .7rem; }
.field-grid .field, .filter-bar .field { margin: 0; min-width: 0; }
.field-wide { grid-column: 1 / -1; }
.filter-bar { display: flex; flex-wrap: wrap; align-items: end; gap: .5rem; margin-bottom: var(--section-gap); }
.filter-search { flex: 1 1 15rem; }
.form-errors { margin: 0 0 1rem; border: 1px solid var(--danger-line); border-radius: .6rem; padding: .7rem .9rem; background: var(--danger-bg); color: var(--danger); }
.form-errors ul { margin: 0; padding-left: 1.1rem; }
.form-errors p { margin: .25rem 0; }
.status-message, .review-note { margin: 0 0 1rem; }
.status-message { border-color: var(--tint-line); background: var(--tint); }
.status-message h2 { margin-bottom: .35rem; }
.status-message p { margin: .4rem 0 .7rem; }
.status-message p:last-child { margin-bottom: 0; }
.review-note p { margin: 0; }
.review-note ul { margin-bottom: 0; }

.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; }
th, td { padding: .54rem .72rem; border-bottom: 1px solid var(--line); }
th { background: var(--surface-soft); color: var(--muted); font-size: .75rem; font-weight: 670; }
thead th { white-space: nowrap; }
td { font-size: .87rem; }
td:first-child { white-space: nowrap; font-variant-numeric: tabular-nums; }
td:first-child > a { color: var(--ink); font-weight: 660; text-decoration: none; }
td:first-child > a:hover { color: var(--accent); text-decoration: underline; }
tbody tr:hover td { background: var(--surface-soft); }
tbody tr:last-child td, tbody tr:last-child th { border-bottom: 0; }
.pagination { display: flex; flex-wrap: wrap; gap: .5rem; padding-top: .7rem; }
.pagination a { padding: .38rem .75rem; text-decoration: none; background: var(--white); border: 1px solid var(--line); border-radius: .45rem; font-size: .82rem; }
.badge { display: inline-flex; gap: .32rem; align-items: center; width: fit-content; padding: .21rem .5rem; border: 1px solid var(--line); border-radius: 2rem; background: var(--surface-soft); color: var(--muted); font-size: .72rem; line-height: 1.2; font-weight: 650; }
.badge-accent { background: var(--tint); color: var(--accent); border-color: var(--tint-line); }
.badge-positive { background: var(--positive-bg); color: var(--positive); border-color: #cfdef3; }
.badge-warning { background: var(--warning-bg); color: var(--warning); border-color: var(--warning-line); }
.badge-danger { background: var(--danger-bg); color: var(--danger); border-color: var(--danger-line); }
.badges { display: flex; flex-wrap: wrap; gap: .26rem; }
.record-subtitle { margin-top: .27rem; display: flex; gap: .35rem; align-items: center; flex-wrap: wrap; }
.record-subtitle .field-hint { margin: 0; }
.list-tabs { display: flex; gap: .2rem; flex-wrap: wrap; margin: 0 0 .8rem; padding: .23rem; width: fit-content; border: 1px solid var(--line); border-radius: .6rem; background: var(--surface-soft); }
.list-tabs a { padding: .42rem .7rem; border: 1px solid transparent; border-radius: .43rem; color: var(--muted); font-size: .81rem; font-weight: 630; text-decoration: none; }
.list-tabs a:hover { color: var(--accent); }
.list-tabs a[aria-current="page"] { border-color: var(--line); background: var(--white); color: var(--accent); box-shadow: 0 1px 3px #19255312; }

.deal-form, .deal-sections, .lender-form, .lender-sections, .match-groups { display: grid; gap: var(--section-gap); min-width: 0; }
.deal-sections > section, .lender-sections > section { min-width: 0; }
.detail-list, .account-details { display: grid; gap: .6rem; margin: 0; }
.detail-list { grid-template-columns: repeat(auto-fit, minmax(min(100%, 11.5rem), 1fr)); }
.detail-list dt, .account-details dt { margin-bottom: .2rem; color: var(--muted); font-size: .8rem; }
.detail-list dd, .account-details dd, .saved-notes { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.import-panel, .export-panel { max-width: 47rem; }
.import-panel .actions, .criteria-group .actions, .settings-actions { margin-top: .65rem; }
.grade-field, fieldset.criteria-group { min-inline-size: 0; padding: 0; border: 0; margin-inline: 0; }
.grade-field { margin-top: 1rem; }
.grade-field label { display: inline-flex; align-items: center; gap: .37rem; padding: .45rem .64rem; }
.grade-field input, .match-choice input { flex: none; width: 1rem; height: 1rem; }
.account-role-options { margin-bottom: .9rem; }
.role-options { display: grid; gap: .42rem; }
.role-options label { align-items: start; gap: .55rem; padding: .55rem .7rem; border: 1px solid var(--line); border-radius: .48rem; cursor: pointer; }
.role-options label:has(input:checked) { background: var(--tint); border-color: var(--tint-line); }
.role-options input { margin: .23rem 0 0; }
.role-options .field-hint { margin: .08rem 0 0; }
.criteria-group, .criteria-notes { margin-top: .75rem; padding-top: .65rem; border-top: 1px solid var(--line); }
.criteria-group h3, .lender-form legend, .grade-field legend { margin: 0 0 .55rem; padding: 0; font-size: .93rem; font-weight: 700; }
.document-category-form { min-width: 11rem; margin: .65rem 0 0; }
.document-category-form button { margin-top: .5rem; }
.document-choices { display: grid; gap: .35rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr)); }
.document-choices label, .application-choice label { align-items: start; min-width: 0; overflow-wrap: anywhere; background: var(--surface-soft); border: 1px solid var(--line); border-radius: .48rem; }
.document-choices label:has(input:checked), .application-choice label:has(input:checked) { background: var(--tint); border-color: var(--tint-line); }
.document-choices input, .application-choice input { margin-top: .18rem; }
.application-choice .actions { margin-bottom: .8rem; }
.attachment-dialog { width: min(29rem, calc(100% - 1.5rem)); max-height: calc(100% - 1.5rem); padding: clamp(1.05rem, 4vw, 1.55rem); color: var(--ink); }
.attachment-dialog::backdrop { background: #15182b85; }
.attachment-dialog h2 { margin: 0 0 .45rem; font-size: 1.25rem; }
.attachment-dialog p { margin: 0; color: var(--muted); }
.attachment-dialog-list { margin: .85rem 0 1.15rem; background: var(--warning-bg); border: 1px solid var(--warning-line); border-radius: .6rem; padding: .7rem .8rem .7rem 1.85rem; overflow-wrap: anywhere; }
.attachment-dialog .actions { justify-content: end; }
.outcome-save { margin-top: .65rem; }
.submission-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(16rem, 20rem); gap: var(--section-gap); align-items: start; }
.submission-meta { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.submission-meta dd { font-size: .86rem; font-variant-numeric: tabular-nums; }
.inbox-table td:first-child { min-width: 11rem; max-width: 29rem; white-space: normal; overflow-wrap: anywhere; }

.match-count { color: var(--muted); font-weight: 450; }
.match-row { border-top: 1px solid var(--line); padding: .7rem 0; }
.match-row:last-child { padding-bottom: 0; }
.match-heading { display: flex; justify-content: space-between; align-items: start; flex-wrap: wrap; gap: .75rem; }
.match-heading h3 { margin: 0; font-size: 1.02rem; }
.match-choice { display: inline-flex; align-items: center; gap: .4rem; min-height: var(--control-size); padding: 0 .46rem; font-weight: 650; }
.match-reasons { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr)); gap: .6rem; margin-top: .75rem; }
.match-reason { border-radius: .45rem; border-left: 3px solid var(--line); padding: .48rem .62rem; background: var(--surface-soft); }
.match-reason h4 { margin: 0 0 .2rem; font-size: .83rem; }
.match-reason ul { margin: 0; padding-left: 1rem; font-size: .82rem; }
.reason-failed { border-color: var(--danger-line); background: var(--danger-bg); }
.reason-warnings { border-color: var(--warning-line); background: var(--warning-bg); }
.reason-passed { border-color: var(--tint-line); background: var(--tint); }
.criteria-dialog { width: min(43rem, calc(100% - 2rem)); max-height: 85vh; padding: 1.4rem; color: var(--ink); }
.criteria-dialog::backdrop { background: #14172b82; }
.criteria-dialog > form { display: flex; justify-content: flex-end; margin-bottom: .75rem; }
.field .code-input { font-family: ui-monospace, monospace; font-size: .84rem; }
.package-diff td { white-space: pre-wrap; overflow-wrap: anywhere; min-width: 10rem; }

.overview-hero {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: .68rem 1rem;
    margin-bottom: .85rem;
}
.overview-hero h1 { margin-bottom: .5rem; }
.queue-link {
    display: inline-flex;
    align-items: center;
    gap: .6rem;
    background: var(--white);
    border: 1px solid var(--tint-line);
    border-radius: var(--radius);
    padding: .45rem .65rem;
    color: var(--accent);
    text-decoration: none;
}
.queue-link:hover { background: var(--tint); }
.queue-count { padding: .12rem .4rem; border-radius: .35rem; background: var(--tint); font-size: .97rem; font-variant-numeric: tabular-nums; }
.queue-label { color: var(--ink); font-size: .82rem; font-weight: 640; }
.queue-arrow { position: relative; width: .9rem; height: .9rem; transform: scale(.72); }
.queue-arrow::before, .queue-arrow::after { content: ''; position: absolute; }
.queue-arrow::before { inset: 0 0 auto auto; width: .62rem; height: .62rem; border-top: 1.5px solid; border-right: 1.5px solid; }
.queue-arrow::after { top: .45rem; left: -.08rem; width: 1.13rem; border-top: 1.5px solid; transform: rotate(-45deg); }
.overview-counts, .overview-lists { display: grid; gap: var(--section-gap); margin: 0 0 var(--section-gap); }
.overview-counts { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .75rem; }
.overview-counts dt { color: var(--muted); font-size: .8rem; }
.overview-counts dd { margin: .12rem 0 0; font-size: 1.45rem; line-height: 1.2; font-weight: 700; letter-spacing: -.055em; font-variant-numeric: tabular-nums; }
.overview-lists { grid-template-columns: repeat(auto-fit, minmax(min(100%, 21rem), 1fr)); }
.search-results { grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr)); }
.panel-heading { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: .4rem; padding-bottom: .7rem; }
.panel-heading h2 { margin: 0; }
.panel-heading a { font-size: .8rem; font-weight: 650; text-decoration: none; }
.panel-heading a:hover { text-decoration: underline; }
.overview-empty { margin: 0; padding-top: .65rem; border-top: 1px solid var(--line); font-size: .85rem; color: var(--muted); }
.record-list { list-style: none; padding: 0; margin: 0; }
.record-list li { display: flex; align-items: center; justify-content: space-between; gap: .32rem .8rem; flex-wrap: wrap; padding: .48rem 0; border-top: 1px solid var(--line); overflow-wrap: anywhere; }
.record-list li:last-child { padding-bottom: 0; }
.record-main { min-width: 0; }
.record-main a { color: var(--ink); font-weight: 650; text-decoration: none; }
.record-main a:hover { color: var(--accent); text-decoration: underline; }
.record-main small { display: block; color: var(--muted); font-size: .73rem; margin-top: .15rem; }
.record-meta { display: flex; gap: .42rem; align-items: center; flex-wrap: wrap; }
.record-meta time { color: var(--muted); font-size: .73rem; }

.intake-layout { display: grid; grid-template-columns: minmax(0, 1fr) 10.8rem; gap: var(--section-gap); align-items: start; }
.intake-navigation { padding: .7rem; position: sticky; top: 1rem; }
.intake-navigation h2 { font-size: .88rem; margin: 0 0 .55rem; }
.intake-navigation a { display: block; padding: .45rem .42rem; border-radius: .38rem; color: var(--muted); font-size: .8rem; text-decoration: none; font-weight: 590; }
.intake-navigation a:hover { background: var(--tint); color: var(--accent); }
.intake-actions { position: sticky; bottom: .65rem; z-index: 2; padding: .4rem .5rem; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 2px 8px #18244814; }
.upload-panel { max-width: 59rem; }
.application-slots { margin-bottom: .8rem; }
.application-slots .field { padding: .65rem; border: 1px dashed var(--control-line); background: var(--surface-soft); border-radius: .72rem; }
.application-slots .field:hover { border-color: var(--accent); }
.application-slots .field label { margin-bottom: .22rem; }
.application-slots [data-drop-hint] { margin: 0 0 .55rem; }
.application-slots .upload-drop-active { border-color: var(--accent); background: var(--tint); }
.upload-drop {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) minmax(11rem, 18rem);
    align-items: center;
    column-gap: .65rem;
    border: 1px dashed var(--accent);
    background: var(--tint);
    border-radius: var(--radius);
    padding: .75rem;
}
.upload-drop label { grid-column: 2; grid-row: 1; color: var(--accent); font-size: .88rem; margin: 0; }
.upload-drop input[type="file"] { grid-column: 3; grid-row: 1 / span 3; }
.upload-drop .field-hint { grid-column: 2; margin: .12rem 0 0; }
.upload-glyph { grid-row: 1 / span 3; width: 2.25rem; height: 2.25rem; position: relative; display: block; border-radius: .45rem; background: var(--white); color: var(--accent); }
.upload-glyph::before, .upload-glyph::after { content: ''; position: absolute; }
.upload-glyph::before { inset: .99rem .71rem .59rem; border: 1.5px solid; border-top: 0; border-radius: 0 0 .1rem .1rem; }
.upload-glyph::after { inset: .68rem auto auto .94rem; width: .36rem; height: .36rem; border: 1.5px solid; border-right: 0; border-bottom: 0; transform: rotate(45deg); }
.upload-drop-active { background: var(--white); outline: 3px solid var(--tint-line); }
.upload-file-list { list-style: none; padding: 0; margin: .75rem 0; }
.upload-file-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(9rem, 12rem) auto; align-items: center; gap: .5rem; padding: .55rem 0; border-bottom: 1px solid var(--line); }
.upload-file-row span { overflow-wrap: anywhere; font-size: .86rem; }

.settings-layout { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: var(--section-gap); align-items: start; }
.settings-layout > .settings-password { grid-row: span 2; }
.theme-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .6rem; padding: 0; border: 0; margin: 0; }
.theme-options legend { margin: 0 0 .5rem; color: var(--muted); font-size: .79rem; }
.theme-option {
    display: grid;
    align-content: start;
    gap: .48rem;
    padding: .6rem;
    min-width: 0;
    border-radius: .65rem;
    border: 1px solid var(--control-line);
    background: var(--white);
    font-weight: 650;
    font-size: .79rem;
    cursor: pointer;
}
.theme-option:has(input:checked) { border-color: var(--accent); background: var(--tint); }
.theme-label { display: flex; align-items: baseline; gap: .32rem; }
.theme-option input { flex: none; align-self: center; margin: 0; }
.theme-swatches { height: 1.7rem; border-radius: .38rem; border: 1px solid #19255318; }
.theme-swatches[data-swatch="indigo"] { background: linear-gradient(90deg, #17182c 35%, #f4f5f9 35% 76%, #5244c6 76%); }
.theme-swatches[data-swatch="ocean"] { background: linear-gradient(90deg, #0d2536 35%, #f0f5f9 35% 76%, #086998 76%); }
.theme-swatches[data-swatch="copper"] { background: linear-gradient(90deg, #30201e 35%, #f7f3ef 35% 76%, #9a4d2e 76%); }

.access-body { min-height: 100dvh; display: grid; place-items: center; padding: 1rem; background: radial-gradient(ellipse at 30% 25%, #eeeafb, var(--paper) 72%); }
.access-shell { display: grid; grid-template-columns: minmax(18rem, .94fr) minmax(21rem, 1fr); max-width: 66rem; width: 100%; min-height: min(36rem, 86vh); background: var(--white); border: 1px solid #dadcec; border-radius: 1.4rem; overflow: hidden; box-shadow: 0 22px 68px #24234520; }
.access-brand { position: relative; isolation: isolate; display: flex; flex-direction: column; justify-content: space-between; min-height: 26rem; overflow: hidden; padding: clamp(1.7rem, 4.5vw, 3.2rem); background: radial-gradient(ellipse at 95% 0, var(--hero-edge), transparent 78%), linear-gradient(140deg, var(--sidebar), var(--sidebar-end)); color: #fff; }
.access-brand-title { padding-bottom: 3.2rem; }
.access-brand-title strong { display: block; font-size: clamp(2.55rem, 5.1vw, 4.45rem); letter-spacing: -.07em; font-weight: 690; line-height: .99; }
.access-brand-title p { max-width: 17rem; margin: 1rem 0 0; font-size: .9rem; color: #d6d4e8; }
.access-art { position: absolute; z-index: -1; bottom: -9rem; right: -8rem; width: 22rem; height: 22rem; transform: rotate(-25deg); }
.access-art span { position: absolute; inset: 0; border: 1px solid #e0d8ff4c; border-radius: 3rem; }
.access-art span:nth-child(2) { inset: 2.3rem; border-color: #e0d8ff38; }
.access-art span:nth-child(3) { inset: 4.6rem; background: #e0d8ff0a; border-color: #e0d8ff28; }
.sign-in-page { min-width: 0; display: grid; align-items: center; padding: clamp(1.5rem, 4.5vw, 3.4rem); }
.sign-in-panel { max-width: 26rem; width: 100%; margin-inline: auto; border: 0; box-shadow: none; }
.sign-in-panel h1 { margin-bottom: .48rem; }
.sign-in-panel .lede { font-size: .91rem; margin-bottom: 1.4rem; }
.auth-link { margin: 1.05rem 0 0; font-size: .84rem; }

@media (max-width: 73rem) {
    .intake-layout { grid-template-columns: minmax(0, 1fr); }
    .intake-navigation { display: none; }
}

@media (max-width: 56rem) {
    html:has(.portal-shell) { scroll-padding-top: 4.3rem; }
    .portal-shell { display: block; }
    .sidebar { height: auto; position: static; }
    .navigation-enabled .sidebar {
        position: fixed;
        z-index: 30;
        inset: 0 auto 0 0;
        height: 100dvh;
        width: min(16rem, 85vw);
        transform: translateX(-104%);
        visibility: hidden;
    }
    .drawer-open .sidebar { transform: none; visibility: visible; transition: transform 180ms ease; }
    .sidebar-scrim {
        display: block !important;
        position: fixed;
        z-index: 25;
        inset: 0;
        width: 100%;
        border: 0;
        background: #14172b7a;
    }
    .sidebar-scrim[hidden] { display: none !important; }
    .workspace-header { position: sticky; top: 0; z-index: 5; padding-inline: var(--page-gutter); }
    .sidebar-toggle { display: inline-flex !important; padding-inline: .55rem; }
    .sidebar-toggle[hidden] { display: none !important; }
    .crumb-portal, .crumb-divider { display: none; }
    .account-copy { display: none; }
    .sign-in-page { padding: 2rem; }
}

@media (max-width: 44rem) {
    .overview-counts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .settings-layout { grid-template-columns: 1fr; }
    .submission-layout { display: flex; flex-direction: column; }
    .submission-layout > * { width: 100%; }
    .submission-sidebar { order: -1; }
    .upload-drop { grid-template-columns: auto minmax(0, 1fr); gap: .25rem .55rem; }
    .upload-drop .upload-glyph { grid-row: 1 / span 2; }
    .upload-drop input[type="file"] { grid-column: 1 / -1; grid-row: 4; }
    .upload-drop #upload-limits { grid-column: 1 / -1; grid-row: 5; }
    .settings-layout > .settings-password { grid-row: auto; }
    .access-body { align-items: start; padding: .7rem; }
    .access-shell { display: block; min-height: auto; }
    .access-brand { min-height: 12rem; padding: 1.2rem; }
    .access-brand-title { padding: 0; }
    .access-brand-title strong { font-size: clamp(2.05rem, 9vw, 3rem); line-height: 1; }
    .access-brand-title strong br { display: none; }
    .access-brand-title p { font-size: .8rem; margin-top: .48rem; }
    .sign-in-page { padding: 1.55rem 1.1rem 1.8rem; }
}

@media (max-width: 33rem) {
    .page-heading { align-items: start; }
    .theme-options { gap: .35rem; }
    .theme-option { padding: .4rem; }
    .queue-link { max-width: 100%; }
    .upload-file-row { grid-template-columns: minmax(0, 1fr) auto; }
    .upload-file-row span { grid-column: 1 / -1; }
    .filter-bar > .field:not(.filter-search) { flex: 1; }
}

@media (pointer: coarse) {
    :root { --control-size: 2.75rem; }
    .workspace-nav a, .sign-out { min-height: var(--control-size); }
    .field input:not([type="file"]), .field select, .field textarea { font-size: 1rem; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition-duration: 0s !important; }
}
