:root {
    color-scheme: light;
    --page: #f0f4f8;
    --panel: #ffffff;
    --soft: #f8fafc;
    --soft-blue: #eaf4ff;
    --line: #dde3ea;
    --line-strong: #b7c6d8;
    --text: #1e293b;
    --heading: #0f2d52;
    --muted: #475569;
    --primary: #0d47a1;
    --primary-dark: #17182b;
    --primary-soft: #55aee9;
    --accent: #ec6b2e;
    --accent-dark: #d85c24;
    --ok: #047857;
    --ok-bg: #ecfdf5;
    --warn: #92400e;
    --warn-bg: #fffbeb;
    --danger: #b91c1c;
    --danger-bg: #fef2f2;
    --info: #0d47a1;
    --radius: 8px;
    --shadow-sm: 0 1px 3px rgba(15, 45, 82, 0.06);
    --shadow: 0 16px 38px rgba(15, 45, 82, 0.12);
    --shadow-lg: 0 22px 54px rgba(15, 45, 82, 0.16);
    --container: 1180px;
}

* {
    box-sizing: border-box;
}

html {
    min-width: 0;
}

body {
    margin: 0;
    background:
        linear-gradient(180deg, #f8fbff 0%, var(--page) 42%, #f8fafc 100%);
    color: var(--text);
    font-family: "Inter", "IBM Plex Sans", "Source Sans Pro", "Segoe UI", sans-serif;
    font-size: 16px;
    line-height: 24px;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
}

body,
button,
input,
select,
textarea {
    letter-spacing: 0;
}

h1,
h2,
h3,
p {
    margin: 0;
}

h1,
h2,
h3 {
    color: var(--heading);
}

h1 {
    font-size: 24px;
    line-height: 32px;
    font-weight: 700;
}

h2 {
    font-size: 20px;
    line-height: 28px;
    font-weight: 600;
}

h3 {
    font-size: 18px;
    line-height: 26px;
    font-weight: 600;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
select,
textarea {
    font: inherit;
}

button {
    min-height: 42px;
    border: 1px solid transparent;
    border-radius: var(--radius);
    padding: 10px 16px;
    background: var(--theme-control-primary-bg, var(--accent));
    color: var(--theme-control-primary-text, #fff);
    font-weight: 700;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: background-color 0.16s ease, border-color 0.16s ease, color 0.16s ease, transform 0.16s ease, box-shadow 0.16s ease;
}

button:hover {
    background: var(--theme-control-primary-hover, var(--accent-dark));
    box-shadow: var(--shadow-sm);
    transform: translateY(-1px);
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 3px solid rgba(11, 74, 162, 0.22);
    outline-offset: 2px;
}

button.secondary {
    background: #fff;
    border-color: var(--line);
    color: var(--heading);
    box-shadow: var(--shadow-sm);
}

button.secondary:hover {
    background: var(--soft-blue);
    border-color: #c7ddf5;
    color: var(--primary);
    box-shadow: 0 10px 22px rgba(13, 71, 161, 0.1);
}

button:disabled {
    cursor: not-allowed;
    opacity: 0.58;
}

input,
select,
textarea {
    width: 100%;
    min-height: 44px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 10px 12px;
    background: #fff;
    color: var(--text);
    box-shadow: 0 1px 0 rgba(15, 45, 82, 0.02);
    transition: border-color 0.16s ease, box-shadow 0.16s ease, background-color 0.16s ease;
}

textarea {
    min-height: 116px;
    resize: vertical;
}

input:hover,
select:hover,
textarea:hover {
    border-color: #c2d4e8;
}

input.has-error,
select.has-error,
textarea.has-error,
.offer-decline-panel fieldset.has-error {
    border-color: var(--danger);
    background: var(--danger-bg);
    box-shadow: 0 0 0 3px rgba(185, 28, 28, 0.1);
}

input[readonly] {
    background: #f8fafc;
    color: var(--muted);
}

#packet-approval[aria-invalid="true"] {
    outline: 2px solid var(--danger);
    outline-offset: 2px;
}

#packet-approval-error a {
    color: inherit;
    text-decoration: underline;
}

code {
    overflow-wrap: anywhere;
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
    font-size: 12px;
}

[hidden] {
    display: none !important;
}

.borrower-app {
    min-height: 100vh;
}

.borrower-app.is-session-bootstrapping {
    background: var(--theme-page-gradient, linear-gradient(180deg, #f8fbff 0%, #eef4f8 100%));
}

.borrower-app.is-session-bootstrapping .header-actions {
    visibility: hidden;
    pointer-events: none;
}

.borrower-app.is-session-bootstrapping > :not(.app-header):not([data-session-bootstrap]) {
    display: none !important;
}

.session-bootstrap-screen {
    min-height: calc(100vh - 77px);
    display: grid;
    place-items: center;
    padding: 48px 24px 72px;
    background: var(--theme-page-gradient, linear-gradient(180deg, #f8fbff 0%, #eef4f8 100%));
}

.session-bootstrap-card {
    width: min(560px, 100%);
    display: grid;
    justify-items: center;
    gap: 12px;
    padding: 38px 40px;
    border: 1px solid var(--theme-border, var(--line));
    border-radius: 18px;
    background: var(--theme-bg-panel, var(--panel));
    box-shadow: var(--theme-shadow, var(--shadow));
    text-align: center;
}

.session-bootstrap-card h1 {
    max-width: 440px;
}

.session-bootstrap-message,
.session-bootstrap-slow,
.session-bootstrap-noscript {
    max-width: 430px;
    color: var(--theme-text-secondary, var(--muted));
}

.session-bootstrap-spinner {
    width: 42px;
    height: 42px;
    margin-bottom: 4px;
    border: 4px solid var(--theme-brand-soft, var(--soft-blue));
    border-top-color: var(--theme-brand, var(--primary));
    border-radius: 50%;
    animation: session-bootstrap-spin 0.85s linear infinite;
}

.session-bootstrap-slow {
    display: grid;
    justify-items: center;
    gap: 12px;
    margin-top: 4px;
}

.session-bootstrap-slow p,
.session-bootstrap-noscript {
    margin: 0;
}

.session-bootstrap-noscript {
    padding-top: 4px;
}

.session-bootstrap-noscript a {
    color: var(--theme-link, var(--primary));
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.session-bootstrap-screen.has-error .session-bootstrap-spinner {
    display: grid;
    place-items: center;
    animation: none;
    border-color: var(--theme-danger-border, var(--danger));
    color: var(--theme-danger, var(--danger));
}

.session-bootstrap-screen.has-error .session-bootstrap-spinner::after {
    content: "!";
    font-size: 22px;
    font-weight: 700;
    line-height: 1;
}

body.is-submission-busy {
    overflow: hidden;
}

/* Visible feedback for foreground requests, including touch and keyboard users. */
.portal-activity {
    position: fixed;
    inset: auto 16px max(20px, env(safe-area-inset-bottom)) auto;
    z-index: 1100;
    display: flex;
    align-items: center;
    gap: 12px;
    width: max-content;
    max-width: min(420px, calc(100vw - 32px));
    padding: 14px 18px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--panel);
    color: var(--text);
    box-shadow: var(--shadow);
    font-size: 14px;
    line-height: 1.5;
    pointer-events: none;
}

/* The busy control's own spinner is the visible cue; the status stays in the accessibility tree. */
.portal-activity.portal-activity--announce-only {
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    border: 0;
    clip-path: inset(50%);
    white-space: nowrap;
}

.portal-activity[hidden],
body.is-submission-busy .portal-activity,
body:has(.is-session-bootstrapping) .portal-activity {
    display: none;
}

body.has-portal-activity,
body.has-portal-activity button,
body.has-portal-activity a,
body.has-portal-activity select {
    cursor: progress;
}

.portal-activity-spinner,
button.is-portal-action-busy::before,
button[aria-busy="true"]::before,
.classification-results[aria-busy="true"] + .directory-browser-controls [role="status"]::before {
    content: "";
    display: inline-block;
    flex: 0 0 auto;
    width: 16px;
    height: 16px;
    border: 2px solid currentColor;
    border-inline-end-color: transparent;
    border-radius: 50%;
    vertical-align: middle;
    animation: session-bootstrap-spin 0.85s linear infinite;
}

button.is-portal-action-busy::before,
button[aria-busy="true"]::before,
.classification-results[aria-busy="true"] + .directory-browser-controls [role="status"]::before {
    margin-inline-end: 8px;
}

.portal-theme button.is-portal-action-busy:disabled {
    color: var(--theme-text-primary, var(--text));
    background: var(--theme-bg-interactive, var(--soft));
    opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
    .portal-activity-spinner,
    button.is-portal-action-busy::before,
    button[aria-busy="true"]::before,
    .classification-results[aria-busy="true"] + .directory-browser-controls [role="status"]::before {
        animation: none;
    }
}

.submission-progress-screen {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: grid;
    place-items: center;
    overflow-y: auto;
    padding: 24px;
    background: var(--theme-overlay, rgba(15, 23, 42, 0.68));
}

.submission-progress-card {
    width: min(580px, 100%);
    display: grid;
    justify-items: center;
    gap: 12px;
    padding: 40px;
    border: 1px solid var(--theme-border, var(--line));
    border-radius: 18px;
    background: var(--theme-bg-elevated, var(--panel));
    box-shadow: var(--theme-shadow-lg, var(--shadow-lg));
    color: var(--theme-text-primary, var(--text));
    text-align: center;
}

.submission-progress-card h1 {
    max-width: 460px;
}

.submission-success-icon,
.submission-error-icon {
    display: grid;
    place-items: center;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    color: var(--theme-success, #15803d);
    background: var(--theme-success-bg, #dcfce7);
    font-size: 30px;
    line-height: 1;
}

.submission-error-icon {
    color: var(--theme-danger, var(--danger));
    background: var(--theme-danger-bg, var(--danger-bg));
}

.submission-progress-card [data-submission-complete] {
    margin-top: 12px;
}

.submission-progress-message,
.submission-progress-guidance {
    max-width: 470px;
}

.submission-progress-message {
    color: var(--theme-text-secondary, var(--muted));
}

.submission-progress-guidance {
    padding-top: 4px;
    color: var(--theme-text-primary, var(--text));
}

@keyframes session-bootstrap-spin {
    to {
        transform: rotate(360deg);
    }
}

.landing-screen,
.apply-entry-screen {
    background: var(--theme-bg-page, var(--page));
    color: var(--theme-text-primary, var(--text));
}

.special-banner {
    background: linear-gradient(90deg, var(--theme-brand-strong, var(--primary-dark)), var(--theme-control-primary-bg, var(--accent)));
    color: var(--theme-control-primary-text, #fff);
    padding: 10px 18px;
    text-align: center;
    font-size: 14px;
    font-weight: 600;
    box-shadow: inset 0 -1px 0 var(--theme-border-strong, rgba(255, 255, 255, 0.18));
}

.landing-hero {
    position: relative;
    overflow: hidden;
    background:
        linear-gradient(135deg, rgba(23, 24, 43, 0.98), rgba(15, 45, 82, 0.96)),
        var(--primary-dark);
    color: #fff;
    padding: 82px 24px 88px;
    text-align: center;
}

.landing-hero::after {
    content: "";
    position: absolute;
    inset: auto 0 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(85, 174, 233, 0.65), rgba(236, 107, 46, 0.58), transparent);
}

.landing-kicker {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 5px 12px;
    border: 1px solid rgba(85, 174, 233, 0.38);
    border-radius: 999px;
    background: rgba(85, 174, 233, 0.11);
    color: rgba(255, 255, 255, 0.92);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.landing-hero h1 {
    position: relative;
    z-index: 1;
    max-width: 790px;
    margin: 14px auto 16px;
    color: #fff;
    font-size: clamp(34px, 6vw, 54px);
    line-height: 1.08;
}

.landing-hero p:not(.landing-kicker) {
    position: relative;
    z-index: 1;
    max-width: 690px;
    margin: 0 auto 26px;
    color: rgba(255, 255, 255, 0.88);
    font-size: 18px;
}

.btn-hero {
    position: relative;
    z-index: 1;
    min-height: 52px;
    padding: 12px 30px;
    font-size: 17px;
    box-shadow: var(--shadow-sm);
}

.landing-trust {
    position: relative;
    z-index: 1;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    max-width: 790px;
    margin: 28px auto 0;
}

.landing-trust span {
    border: 1px solid rgba(85, 174, 233, 0.24);
    border-radius: 999px;
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.92);
    font-size: 14px;
}

.featured-offer-band {
    padding: 32px 24px;
    background: var(--theme-bg-elevated, var(--panel));
    border-bottom: 1px solid var(--theme-border, var(--line));
}

.featured-offer {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.85fr);
    width: min(1120px, 100%);
    margin: 0 auto;
    overflow: hidden;
    border: 1px solid rgba(85, 174, 233, 0.24);
    border-radius: var(--radius);
    background: linear-gradient(135deg, #17203a, #17182b);
    color: #fff;
    box-shadow: var(--shadow-lg);
}

.featured-offer-main,
.featured-offer-side {
    padding: 24px;
}

.featured-offer-side {
    display: grid;
    align-content: center;
    gap: 12px;
    border-left: 1px solid rgba(255, 255, 255, 0.13);
    background: linear-gradient(135deg, rgba(85, 174, 233, 0.18), rgba(236, 107, 46, 0.2));
}

.featured-badge {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 5px 12px;
    border-radius: 999px;
    background: var(--theme-control-primary-bg, var(--accent));
    color: var(--theme-control-primary-text, #fff);
    font-size: 12px;
    font-weight: 700;
}

.featured-offer h2 {
    margin-top: 12px;
    color: #fff;
    font-size: clamp(26px, 4vw, 38px);
    line-height: 1.12;
}

.featured-offer p {
    max-width: 720px;
    margin-top: 8px;
    color: rgba(255, 255, 255, 0.86);
}

.featured-facts {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    margin: 18px 0;
}

.featured-facts span,
.featured-stat {
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: rgba(255, 255, 255, 0.08);
}

.featured-facts span {
    border-radius: 999px;
    padding: 6px 12px;
    color: rgba(255, 255, 255, 0.92);
    font-size: 13px;
}

button.on-dark {
    color: var(--heading);
}

.featured-stat {
    border-radius: var(--radius);
    padding: 12px;
}

.featured-stat span {
    display: block;
    color: rgba(255, 255, 255, 0.68);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.featured-stat strong {
    display: block;
    margin-top: 3px;
    color: #fff;
}

.landing-section {
    width: min(1120px, 100%);
    margin: 0 auto;
    padding: 44px 24px;
    scroll-margin-top: 112px;
}

.landing-section h2,
.landing-cta-band h2 {
    text-align: center;
}

.section-lead {
    max-width: 660px;
    margin: 8px auto 24px;
    color: var(--theme-text-muted, var(--muted));
    text-align: center;
}

.loan-types-row,
.steps-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 16px;
}

.loan-type-tile {
    position: relative;
    overflow: hidden;
    min-height: 176px;
    display: grid;
    align-content: start;
    gap: 8px;
    padding: 18px;
    border: 1px solid var(--theme-border, var(--line));
    border-radius: var(--radius);
    background: var(--theme-panel-gradient, linear-gradient(145deg, var(--panel), var(--soft)));
    color: var(--theme-text-primary, var(--text));
    text-align: left;
    box-shadow: var(--theme-shadow-sm, var(--shadow-sm));
}

.loan-type-tile::after {
    content: "";
    position: absolute;
    inset: auto 0 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-soft), var(--accent));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.2s ease;
}

.loan-type-tile:hover {
    transform: translateY(-5px);
    border-color: var(--theme-border-strong, var(--line-strong));
    background: var(--theme-bg-hover, var(--soft-blue));
    color: var(--theme-text-primary, var(--text));
    box-shadow: var(--theme-shadow, var(--shadow));
}

.loan-type-tile:hover::after {
    transform: scaleX(1);
}

.loan-type-tile strong {
    color: var(--theme-text-primary, var(--heading));
    font-size: 17px;
    font-weight: 600;
}

.loan-type-tile span:not(.loan-icon):not(.loan-tile-badge) {
    color: var(--theme-text-muted, var(--muted));
    font-size: 14px;
    font-weight: 400;
}

.loan-type-tile em {
    margin-top: 4px;
    color: var(--theme-link, var(--primary));
    font-size: 13px;
    font-style: normal;
    font-weight: 600;
}

.loan-icon {
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    border-radius: var(--radius);
    background: var(--theme-info-bg, var(--soft-blue));
    color: var(--theme-info, var(--primary-dark));
    font-size: 12px;
    font-weight: 700;
}

.loan-icon svg {
    width: 26px;
    height: 26px;
    display: block;
}

.loan-icon path,
.loan-icon circle {
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.loan-personal .loan-icon,
.loan-med .loan-icon {
    background: var(--theme-warning-bg, var(--warn-bg));
    color: var(--theme-warning, var(--warn));
}

.loan-home .loan-icon,
.loan-mortgage .loan-icon,
.loan-land .loan-icon,
.loan-edu .loan-icon {
    background: var(--theme-bg-interactive, var(--soft));
    color: var(--theme-text-secondary, var(--text));
}

.loan-tile-badge {
    justify-self: start;
    border: 1px solid var(--theme-warning-border, var(--line));
    border-radius: 999px;
    padding: 3px 8px;
    background: var(--theme-warning-bg, var(--warn-bg));
    color: var(--theme-warning, var(--warn));
    font-size: 11px;
    font-weight: 700;
}

.how-it-works {
    width: 100%;
    max-width: none;
    background: var(--theme-bg-inset, var(--soft));
}

.how-it-works .steps-row {
    width: min(1120px, 100%);
    margin: 0 auto;
}

.step-tile {
    padding: 18px;
    border: 1px solid var(--theme-border, var(--line));
    border-radius: var(--radius);
    background: var(--theme-panel-gradient, var(--panel));
    color: var(--theme-text-primary, var(--text));
    box-shadow: var(--theme-shadow-sm, var(--shadow-sm));
}

.step-tile::before {
    content: attr(data-step);
    display: inline-grid;
    place-items: center;
    width: 34px;
    height: 34px;
    margin-bottom: 12px;
    border-radius: var(--radius);
    background: var(--theme-info-bg, var(--soft-blue));
    color: var(--theme-info, var(--primary-dark));
    font-size: 12px;
    font-weight: 700;
}

.step-tile strong {
    display: block;
    color: var(--theme-text-primary, var(--heading));
}

.step-tile span {
    color: var(--theme-text-muted, var(--muted));
    font-size: 14px;
}

.landing-cta-band {
    padding: 34px 24px;
    border-top: 1px solid var(--theme-row-selected-border, var(--line-strong));
    border-bottom: 1px solid var(--theme-row-selected-border, var(--line-strong));
    background: var(--theme-brand-soft, var(--soft-blue));
    color: var(--theme-text-primary, var(--text));
    text-align: center;
}

.landing-cta-band p {
    margin: 8px 0 16px;
    color: var(--theme-text-muted, var(--muted));
}

.public-site .marketing-footer {
    padding: 0 max(24px, calc((100vw - 1120px) / 2 + 24px));
    background: #101827;
    color: #d8e3ef;
}

.public-site .marketing-footer__content {
    display: grid;
    grid-template-columns: minmax(240px, 1.25fr) repeat(2, minmax(190px, 0.75fr));
    gap: 52px;
    padding: 44px 0 36px;
}

.public-site .marketing-footer__brand {
    align-self: start;
}

.public-site .marketing-footer h2 {
    margin: 0 0 12px;
    color: #fff;
    font-size: 16px;
    line-height: 22px;
    font-weight: 600;
}

.public-site .marketing-footer__brand h2 {
    margin-bottom: 4px;
    font-size: 18px;
    line-height: 24px;
}

.public-site .marketing-footer p,
.public-site .marketing-footer dl,
.public-site .marketing-footer dd,
.public-site .marketing-footer address {
    margin: 0;
}

.public-site .marketing-footer__brand p,
.public-site .marketing-footer__address,
.public-site .marketing-footer__list {
    color: #b8c7d8;
    font-size: 14px;
    line-height: 21px;
}

.public-site .marketing-footer__list {
    display: grid;
    gap: 10px;
}

.public-site .marketing-footer__list div {
    display: grid;
    grid-template-columns: 74px minmax(0, 1fr);
    gap: 10px;
}

.public-site .marketing-footer__list dt {
    color: #8fa3b8;
    font-weight: 600;
}

.public-site .marketing-footer__list dd,
.public-site .marketing-footer__list a {
    min-width: 0;
    overflow-wrap: anywhere;
}

.public-site .marketing-footer__address {
    display: grid;
    gap: 2px;
    font-style: normal;
}

.public-site .marketing-footer a {
    color: #fff;
    text-decoration: underline;
    text-decoration-color: rgba(255, 255, 255, 0.32);
    text-underline-offset: 3px;
    transition: color 0.16s ease, text-decoration-color 0.16s ease;
}

.public-site .marketing-footer a:hover {
    color: #a8dcff;
    text-decoration-color: currentColor;
}

.public-site .marketing-footer a:focus-visible {
    border-radius: 3px;
    outline: 3px solid #8ec5ff;
    outline-offset: 3px;
}

.public-site .marketing-footer__corporate-link {
    display: inline-flex;
    margin-top: 14px;
    font-size: 14px;
    font-weight: 600;
}

.public-site .marketing-footer__bottom {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    align-items: flex-start;
    padding: 20px 0 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.14);
    color: #9fb0c3;
    font-size: 12px;
    line-height: 18px;
}

.public-site .marketing-footer__bottom p {
    max-width: 760px;
}

.public-site .marketing-footer__legal {
    display: flex;
    flex: 0 0 auto;
    flex-wrap: wrap;
    gap: 18px;
}

@media (max-width: 820px) {
    .public-site .marketing-footer__content {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 32px;
    }

    .public-site .marketing-footer__brand {
        grid-column: 1 / -1;
    }
}

@media (max-width: 560px) {
    .public-site .marketing-footer {
        padding-right: 18px;
        padding-left: 18px;
    }

    .public-site .marketing-footer__content {
        grid-template-columns: 1fr;
        gap: 28px;
        padding: 34px 0 28px;
    }

    .public-site .marketing-footer__brand {
        grid-column: auto;
    }

    .public-site .marketing-footer__bottom {
        display: grid;
        gap: 14px;
    }
}

.apply-entry-wrap {
    width: min(980px, 100%);
    margin: 0 auto;
    padding: 28px 24px;
}

.link-button {
    width: auto;
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    margin-bottom: 14px;
    padding: 8px 10px;
    border: 0;
    background: transparent;
    box-shadow: none;
    color: var(--primary);
    font-size: 14px;
    font-weight: 600;
}

.link-button:hover {
    background: var(--soft);
    box-shadow: none;
    color: var(--accent);
    transform: none;
}

.apply-entry-shell {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(280px, 0.95fr);
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    box-shadow: var(--shadow-lg);
}

.apply-entry-main,
.apply-entry-side {
    padding: 28px;
}

.apply-entry-main {
    display: grid;
    gap: 14px;
}

.apply-entry-side {
    display: grid;
    align-content: center;
    gap: 12px;
    background: linear-gradient(135deg, #17182b, #253455);
    color: #fff;
}

.apply-entry-side h2 {
    color: #fff;
}

.apply-entry-side p {
    max-width: 65ch;
}

.apply-entry-side p,
.portal-checklist {
    color: rgba(255, 255, 255, 0.84);
}

.portal-checklist {
    display: grid;
    gap: 9px;
    padding-left: 18px;
    font-size: 14px;
}

.apply-entry-card {
    display: grid;
    gap: 12px;
}

.choice-btn {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr);
    gap: 14px;
    align-items: center;
    width: 100%;
    min-height: 92px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    box-shadow: none;
    color: var(--text);
    text-align: left;
}

.choice-btn:hover {
    border-color: var(--primary-soft);
    background: #f8fbff;
    color: var(--text);
    box-shadow: 0 12px 26px rgba(13, 71, 161, 0.1);
}

.choice-btn.recommended {
    border-color: #b8dcf5;
    background: linear-gradient(135deg, #ffffff, #f2f8fd);
}

.choice-icon {
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    border-radius: var(--radius);
    background: var(--theme-info-bg, #e8f4fd);
    color: var(--theme-info, var(--primary-dark));
    font-size: 12px;
    font-weight: 700;
}

.choice-btn.recommended .choice-icon {
    background: var(--theme-control-primary-bg, var(--accent));
    color: var(--theme-control-primary-text, #fff);
}

.choice-btn strong,
.choice-btn small {
    display: block;
}

.choice-btn strong {
    color: var(--heading);
    font-size: 16px;
    font-weight: 600;
}

.choice-btn small {
    margin-top: 3px;
    color: var(--muted);
    font-size: 14px;
    font-weight: 400;
}

.apply-trust-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.apply-trust-row span {
    border: 1px solid var(--theme-border, var(--line));
    border-radius: 999px;
    padding: 5px 10px;
    background: var(--theme-bg-interactive, #f8fafc);
    color: var(--theme-text-secondary, var(--muted));
    font-size: 12px;
    font-weight: 600;
}

.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 12px max(20px, calc((100vw - var(--container)) / 2 + 16px));
    background: var(--theme-chrome-bg, rgba(255, 255, 255, 0.92));
    border-bottom: 1px solid var(--theme-border, var(--line));
    position: sticky;
    top: 0;
    z-index: 10;
    backdrop-filter: blur(14px);
    box-shadow: var(--theme-shadow-sm, var(--shadow-sm));
    transition: padding 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}

.brand-lockup,
.header-actions,
.button-row,
.trust-strip {
    display: flex;
    align-items: center;
}

.brand-lockup {
    gap: 12px;
    min-width: 0;
}

.brand-mark {
    width: 68px;
    height: 52px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    transition: width 0.18s ease, height 0.18s ease;
}

.brand-mark img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

:root[data-theme="light"] .brand-mark img[src$="/brand-assets/tuffops_logo_lockup_financial_services.png"] {
    content: url("/brand-assets/tuffops_logo_lockup_financial_services_on_dark.png");
}

.brand-copy {
    display: grid;
    gap: 2px;
    min-width: 0;
    transition: opacity 0.18s ease;
}

.brand-copy strong {
    color: var(--theme-text-primary, var(--heading));
    font-size: 16px;
    line-height: 1.1;
}

.brand-copy span,
.muted,
.meta {
    color: var(--muted);
}

.brand-copy span {
    font-size: 12px;
}

.header-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.public-app-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
}

.public-session-row {
    display: flex;
    grid-column: 1 / -1;
    justify-content: flex-end;
}

.public-session-indicator {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 8px 12px;
    min-height: 36px;
    padding: 5px 7px 5px 12px;
    border: 1px solid var(--theme-border);
    border-radius: 999px;
    background: var(--theme-bg-inset);
    color: var(--theme-text-secondary);
    box-shadow: var(--theme-shadow-sm);
    font-size: 12px;
}

.public-session-copy {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin: 0;
}

.public-session-copy strong {
    color: var(--theme-text-primary);
}

.public-session-dot {
    width: 8px;
    height: 8px;
    flex: 0 0 auto;
    border: 2px solid var(--theme-bg-elevated);
    border-radius: 50%;
    background: var(--theme-success);
    box-shadow: 0 0 0 1px var(--theme-success-border);
}

.public-session-return,
.public-session-signout {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 28px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    line-height: 16px;
}

.public-session-return {
    padding: 5px 10px;
    background: var(--theme-brand-soft);
    color: var(--theme-link);
    text-decoration: none;
}

.public-session-return:hover {
    background: var(--theme-bg-hover);
    color: var(--theme-link-hover);
}

.portal-theme button.public-session-signout {
    min-width: 0;
    padding: 5px 9px;
    border: 0;
    background: transparent;
    color: var(--theme-text-muted);
    box-shadow: none;
}

.portal-theme button.public-session-signout:hover {
    background: var(--theme-control-quiet-hover);
    color: var(--theme-text-primary);
    box-shadow: none;
    transform: none;
}

.portal-theme button.public-session-signout:disabled {
    cursor: wait;
    opacity: 0.62;
}

.public-session-message {
    flex-basis: 100%;
    color: var(--theme-danger);
    text-align: right;
}

.public-customer-action {
    white-space: nowrap;
}

.account-menu {
    display: grid;
    position: relative;
    grid-template-columns: auto auto;
    align-items: center;
    gap: 9px;
    min-height: 42px;
    padding: 4px 4px 4px 6px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #fff;
    box-shadow: var(--shadow-sm);
    transition: padding 0.18s ease, gap 0.18s ease, box-shadow 0.18s ease;
}

.account-trigger {
    display: grid;
    grid-template-columns: 34px minmax(96px, auto) 8px;
    align-items: center;
    gap: 9px;
    min-height: 34px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: inherit;
    box-shadow: none;
}

.account-trigger:hover {
    background: transparent;
    box-shadow: none;
    transform: none;
}

.account-avatar {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--primary), var(--primary-soft));
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    transition: width 0.18s ease, height 0.18s ease;
}

.account-chevron {
    display: block;
    width: 8px;
    height: 8px;
    border-right: 2px solid var(--muted);
    border-bottom: 2px solid var(--muted);
    transform: rotate(45deg) translateY(-2px);
    transition: transform 0.16s ease;
}

.account-menu.is-open .account-chevron {
    transform: rotate(225deg) translate(-1px, -1px);
}

.account-copy {
    display: grid;
    min-width: 0;
    line-height: 1.1;
}

.account-copy span,
.account-copy strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.account-copy span {
    max-width: 180px;
    color: var(--heading);
    font-size: 13px;
    font-weight: 600;
}

.account-copy strong {
    color: var(--muted);
    font-size: 11px;
    font-weight: 500;
}

.account-action {
    min-height: 34px;
    padding: 7px 12px;
    border-radius: 999px;
    font-size: 13px;
    white-space: nowrap;
}

.account-popover {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 30;
    max-height: calc(100dvh - 96px);
    overflow-y: auto;
    display: grid;
    gap: 8px;
    width: min(320px, calc(100vw - 24px));
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    box-shadow: var(--shadow);
}

.account-popover[hidden] {
    display: none;
}

.account-popover-copy {
    display: grid;
    gap: 2px;
    padding: 0 2px 4px;
    line-height: 1.15;
}

.account-popover-copy span,
.account-popover-copy strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.account-popover-copy span {
    color: var(--heading);
    font-size: 14px;
    font-weight: 600;
}

.account-popover-copy strong {
    color: var(--muted);
    font-size: 12px;
    font-weight: 500;
}

.account-popover-appearance {
    display: grid;
    gap: 6px;
    padding: 10px 2px;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.account-popover-appearance .theme-control {
    width: 100%;
    grid-template-columns: 1fr;
    gap: 4px;
}

.account-popover-appearance .theme-control select {
    width: 100%;
    min-width: 0;
}

.account-popover-appearance p {
    margin: 0;
    color: var(--muted);
    font-size: 12px;
    line-height: 17px;
}

.account-popover-action {
    width: 100%;
    min-height: 38px;
    justify-content: center;
    border-radius: var(--radius);
}

.account-experiences {
    display: grid;
    gap: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--line);
}

.account-experiences[hidden] {
    display: none;
}

.account-experience-title {
    padding: 0 2px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.account-experience-list {
    display: grid;
    gap: 4px;
}

.account-experience-link {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 8px;
    align-items: center;
    min-height: 52px;
    padding: 8px;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    color: var(--heading);
}

.account-experience-link:hover {
    border-color: #c9dcec;
    background: #f6f9fc;
}

.account-experience-link.current {
    background: #f3f8fd;
    border-color: #cfe1f2;
}

.experience-marker {
    display: grid;
    place-items: center;
    min-width: 34px;
    min-height: 30px;
    border-radius: var(--radius-sm);
    background: #eef4f9;
    color: var(--primary);
    font-size: 11px;
    font-weight: 700;
}

.account-experience-link span:last-child,
.account-staff-verification {
    display: grid;
    min-width: 0;
}

.account-experience-link strong,
.account-experience-link small,
.account-staff-verification strong,
.account-staff-verification span {
    overflow: hidden;
    text-overflow: ellipsis;
}

.account-experience-link strong {
    font-size: 13px;
    line-height: 18px;
}

.account-experience-link small {
    color: var(--muted);
    font-size: 12px;
    line-height: 16px;
}

.account-staff-verification {
    gap: 6px;
    padding: 10px;
    border: 1px solid #d8e3ee;
    border-radius: var(--radius-sm);
    background: #fbfcfe;
}

.account-staff-verification strong {
    color: var(--heading);
    font-size: 13px;
    line-height: 18px;
}

.account-staff-verification span {
    color: var(--muted);
    font-size: 12px;
    line-height: 17px;
}

.account-verify-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 7px 10px;
    border-radius: var(--radius-sm);
    background: var(--primary);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
}

.header-link,
.button-link {
    display: inline-flex;
    align-items: center;
    min-height: 42px;
    border-radius: var(--radius);
    color: var(--theme-text-primary, var(--heading));
    font-size: 14px;
    font-weight: 600;
}

.header-link {
    padding: 8px 10px;
}

.header-link:hover {
    background: var(--theme-control-quiet-hover, var(--soft-blue));
    color: var(--theme-link-hover, var(--primary));
}

.button-link {
    justify-content: center;
    padding: 9px 15px;
    border: 1px solid var(--theme-border, var(--line));
    background: var(--theme-control-secondary-bg, var(--panel));
    color: var(--theme-control-secondary-text, var(--heading));
    text-decoration: none;
}

.button-link:hover {
    background: var(--theme-control-secondary-hover, var(--soft-blue));
    border-color: var(--theme-border-strong, var(--line-strong));
    color: var(--theme-link-hover, var(--primary));
}

.header-link:active,
.button-link:active {
    background: var(--theme-bg-pressed, var(--soft-blue));
}

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

.portal-hero {
    width: min(var(--container), calc(100% - 32px));
    margin: 24px auto 18px;
    padding: 28px;
    border-radius: var(--radius);
    background:
        linear-gradient(135deg, rgba(15, 45, 82, 0.96), rgba(23, 24, 43, 0.98)),
        var(--primary-dark);
    color: #fff;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.portal-hero h1,
.portal-hero .eyebrow {
    color: #fff;
}

.portal-hero-content {
    display: grid;
    align-content: center;
    gap: 12px;
}

.hero-copy {
    max-width: 660px;
    color: rgba(255, 255, 255, 0.86);
    font-size: 16px;
}

.trust-strip {
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.trust-strip span {
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.92);
    border-radius: 999px;
    padding: 6px 10px;
    font-size: 13px;
    font-weight: 600;
}

.portal-shell {
    width: min(var(--container), calc(100% - 32px));
    margin: 0 auto 40px;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
    align-items: start;
}

.portal-shell.auth-only {
    width: min(980px, calc(100% - 32px));
    grid-template-columns: minmax(0, 1fr);
}

.portal-shell.auth-only .journey {
    width: 100%;
}

.borrower-app.auth-focused {
    min-height: 100vh;
    background: var(--theme-page-gradient, linear-gradient(180deg, #f8fbff 0%, #eef4f8 100%));
}

.borrower-app.auth-focused .account-menu {
    display: none;
}

.borrower-app.auth-focused .portal-shell.auth-only {
    width: min(760px, calc(100% - 32px));
    margin: 30px auto 48px;
}

.borrower-app.auth-focused .journey {
    gap: 0;
}

.borrower-app.auth-focused .workspace-status,
.borrower-app.auth-focused .application-progress-strip {
    display: none;
}

.borrower-app.auth-focused .auth-panel {
    border: 0;
    background: transparent;
    box-shadow: none;
}

.borrower-app.auth-focused .auth-layout {
    gap: 12px;
    padding: 0 0 24px;
    background: transparent;
}

.progress-panel,
.panel,
.card,
.form-section,
.state,
.item {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.progress-panel {
    position: sticky;
    top: 92px;
    padding: 16px;
    display: grid;
    gap: 14px;
    box-shadow: var(--shadow-sm);
}

.portal-nav-panel {
    align-content: start;
}

.application-progress-strip {
    display: block;
    margin-bottom: 12px;
    padding: 8px 2px 14px;
}

.application-progress-strip p {
    display: none;
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    font-weight: 600;
}

.application-progress-strip ol {
    position: relative;
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(0, 1fr);
    gap: 0;
    margin: 0;
    padding: 0;
    list-style: none;
}

.application-progress-strip li {
    position: relative;
    display: grid;
    justify-items: center;
    gap: 7px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 600;
    text-align: center;
}
.application-progress-strip li[hidden] { display:none; }

.application-progress-strip li::before,
.application-progress-strip li::after {
    content: "";
    position: absolute;
    top: 15px;
    height: 2px;
    background: #d8e2ee;
    z-index: 0;
}

.application-progress-strip li::before {
    left: 0;
    right: 50%;
}

.application-progress-strip li::after {
    left: 50%;
    right: 0;
}

.application-progress-strip li:first-child::before,
.application-progress-strip li:last-child::after {
    display: none;
}

.application-progress-strip li.complete::before,
.application-progress-strip li.complete::after,
.application-progress-strip li.active::before {
    background: #2e7d56;
}

.application-progress-strip .progress-marker {
    position: relative;
    z-index: 1;
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border: 2px solid #ccd8e6;
    border-radius: 50%;
    background: #fff;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.application-progress-strip li.active {
    color: var(--heading);
}

.application-progress-strip li.active .progress-marker {
    border-color: var(--accent);
    background: var(--accent);
    color: #fff;
}

.application-progress-strip li.complete {
    color: #2e7d56;
}

.application-progress-strip li.complete .progress-marker {
    border-color: #2e7d56;
    background: #2e7d56;
    color: #fff;
}

.progress-heading {
    display: grid;
    gap: 6px;
    padding-bottom: 14px;
    border-bottom: 1px solid #eef2f7;
}

.progress-heading p:not(.eyebrow) {
    color: var(--muted);
    font-size: 14px;
}

.steps {
    display: grid;
    gap: 8px;
}

.portal-nav {
    gap: 6px;
}

.step {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    width: 100%;
    min-height: 58px;
    border-color: var(--line);
    background: #fff;
    box-shadow: none;
    color: var(--text);
    text-align: left;
    padding: 9px 10px;
}

.step:hover {
    background: var(--soft);
    border-color: #c8d7e8;
    color: var(--heading);
}

.step:disabled {
    cursor: not-allowed;
    opacity: .58;
}

.step:disabled:hover {
    background: #fff;
    border-color: var(--line);
    color: var(--text);
}

.step.active {
    border-color: #b8dcf5;
    background: linear-gradient(135deg, #ffffff, #f2f8fd);
    color: var(--heading);
    box-shadow: inset 3px 0 0 var(--primary-soft);
}

.step.done {
    border-color: #c8ead8;
}

.step-index {
    display: grid;
    place-items: center;
    width: 38px;
    height: 34px;
    border-radius: var(--radius);
    background: #e8f4fd;
    color: var(--primary);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0;
}

.step.done .step-index {
    background: var(--ok-bg);
    color: var(--ok);
}

.step strong {
    display: block;
    color: inherit;
    font-size: 14px;
    line-height: 1.15;
}

.step small {
    display: block;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.2;
    margin-top: 2px;
}

.signout-button {
    width: 100%;
}

.journey,
.stack,
.grid {
    display: grid;
    gap: 14px;
}

.panel {
    padding: 24px;
    box-shadow: var(--shadow-sm);
}

.panel-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 22px;
    padding-bottom: 16px;
    border-bottom: 1px solid #eef2f7;
}

.panel-header > div {
    display: grid;
    gap: 6px;
}

.documents-product {
    margin: 0;
    color: var(--theme-text-primary, var(--heading));
    font-size: 1.05rem;
    font-weight: 600;
    line-height: 1.35;
}

.documents-product-label {
    margin-right: 0.35em;
    color: var(--theme-text-muted, var(--muted));
    font-size: 0.92rem;
    font-weight: 600;
}

.eyebrow {
    color: var(--primary);
    font-size: 12px;
    line-height: 16px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.auth-panel {
    padding: 0;
    overflow: hidden;
    border-color: var(--line);
    background: #fff;
}

.auth-panel .panel-header {
    margin: 0;
    padding: 22px 24px;
    border-bottom: 1px solid var(--line);
    background: linear-gradient(135deg, #ffffff, #f7fbff);
}

.auth-panel .panel-header h2 {
    color: var(--heading);
}

.auth-panel .panel-header .muted {
    color: var(--muted);
}

.auth-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    place-items: start center;
    min-height: 0;
    padding: 30px 20px 34px;
    background: linear-gradient(180deg, #ffffff, #f8fafc);
}

.auth-focused-nav {
    width: 100%;
    max-width: 680px;
}

.auth-back-link {
    margin: 0;
}

.auth-card-shell {
    width: 100%;
    max-width: 680px;
    min-width: 0;
    display: grid;
    gap: 0;
    overflow: hidden;
    border: 1px solid #d7e7f6;
    border-radius: 16px;
    background: #fff;
    box-shadow: var(--shadow-lg);
    color: var(--text);
}

.auth-transition-state {
    min-height: 360px;
    padding: 64px 44px;
    display: grid;
    place-content: center;
    justify-items: center;
    gap: 10px;
    color: var(--muted);
    text-align: center;
}

.auth-transition-state[hidden] {
    display: none;
}

.auth-transition-state .eyebrow,
.auth-transition-state h2,
.auth-transition-state p {
    margin: 0;
}

.auth-transition-state h2 {
    color: var(--heading);
    font-size: 26px;
}

.auth-transition-state p:last-child {
    max-width: 420px;
    line-height: 1.5;
}

.auth-layout.auth-transitioning .auth-focused-nav {
    visibility: hidden;
}

.auth-layout.auth-transitioning .auth-card-shell > :not(.auth-transition-state) {
    display: none;
}

.secure-emblem {
    width: 18px;
    height: 18px;
    display: grid;
    place-items: center;
    position: relative;
    flex: 0 0 auto;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: var(--muted);
    box-shadow: none;
}

.secure-emblem::before {
    content: "";
    width: 11px;
    height: 9px;
    margin-top: 6px;
    border-radius: 2px;
    background: currentColor;
}

.secure-emblem::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 50%;
    width: 10px;
    height: 9px;
    border: 2px solid currentColor;
    border-bottom: 0;
    border-radius: 999px 999px 0 0;
    transform: translateX(-50%);
}

.auth-flow-heading {
    display: grid;
    gap: 8px;
    padding: 34px 44px 24px;
    text-align: left;
}

.auth-flow-heading .eyebrow {
    color: var(--primary);
}

.auth-flow-heading h1,
.auth-flow-heading h3 {
    color: var(--heading);
    font-size: 22px;
    line-height: 1.2;
    font-weight: 700;
}

.auth-flow-heading h1 {
    font-size: 28px;
}

.auth-flow-heading .muted {
    max-width: 560px;
    font-size: 15px;
    line-height: 1.5;
}

.auth-inline-status {
    margin: 0 44px 18px;
    padding: 10px 12px;
    border: 1px solid var(--theme-info-border, #b8d8f6);
    border-radius: var(--radius);
    background: var(--info-soft, #eef7ff);
    color: var(--info);
    font-size: 13px;
    font-weight: 600;
    line-height: 1.35;
}

.auth-inline-status.error {
    border-color: var(--theme-danger-border, #f7c4bf);
    background: var(--danger-bg);
    color: var(--danger);
}

.auth-inline-status.ok {
    border-color: var(--theme-success-border, #b9e8cb);
    background: var(--ok-bg);
    color: var(--ok);
}

.auth-inline-status.warn {
    border-color: var(--theme-warning-border, #f3d59a);
    background: var(--warn-bg);
    color: var(--warn);
}

.auth-inline-status[hidden] {
    display: none;
}

.customer-identity-entry {
    display: grid;
    gap: 10px;
    margin: 0 44px 24px;
}

.customer-identity-entry h2 {
    font-size: 18px;
    line-height: 1.4;
}

.customer-identity-entry p {
    color: var(--muted);
    font-size: 14px;
    line-height: 1.5;
}

.customer-identity-pending {
    display: grid;
    gap: .85rem;
    margin-bottom: 1rem;
    padding: 1rem;
    border: 1px solid var(--line);
    border-radius: 1rem;
    background: var(--surface-soft);
}

.customer-identity-entry h2,
.customer-identity-pending h2,
.customer-identity-pending h3,
.customer-identity-entry p,
.customer-identity-pending p {
    margin: 0;
}

.customer-identity-button {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    min-height: 2.9rem;
    padding: .75rem 1rem;
    border: 1px solid transparent;
    border-radius: .7rem;
    background: var(--primary);
    color: var(--theme-text-inverse, #fff);
    font-weight: 700;
    text-align: center;
    text-decoration: none;
}

.customer-identity-button:hover,
.customer-identity-button:active {
    background: var(--primary-dark);
    color: var(--theme-text-inverse, #fff);
}

.auth-code-heading {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 44px 20px;
    color: var(--muted);
    font-size: 14px;
    font-weight: 500;
    line-height: 1.5;
    text-align: center;
}

.auth-code-heading::before,
.auth-code-heading::after {
    content: "";
    flex: 1;
    border-top: 1px solid var(--line);
}

.customer-identity-pending[hidden],
.customer-identity-entry[hidden] {
    display: none;
}

.customer-accounts {
    display: grid;
    gap: 1rem;
    margin-top: 1.25rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--line);
}

.customer-accounts-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.customer-account-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
    gap: 1rem;
}

.customer-account-card,
.customer-account-history,
.customer-account-transaction {
    display: grid;
    gap: .55rem;
    padding: 1rem;
    border: 1px solid var(--line);
    border-radius: .85rem;
}

.customer-account-card {
    container-type: inline-size;
}

.customer-account-card > .customer-account-balance {
    font-size: .875rem;
    font-size: clamp(.875rem, 7.5cqi, 1rem);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    overflow-wrap: normal;
    word-break: normal;
}

.customer-account-card h4,
.customer-account-card p,
.customer-account-history h4 {
    margin: 0;
}

.customer-account-transaction {
    grid-template-columns: minmax(0, 1fr) auto auto;
    margin-top: .5rem;
}

@media (max-width: 40rem) {
    .customer-accounts-heading,
    .customer-account-transaction {
        grid-template-columns: 1fr;
        flex-direction: column;
    }
}

.auth-mode-switch {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    margin: 0 44px 28px;
    padding: 5px;
    border: 1px solid var(--theme-border, #cbd8e6);
    border-radius: 999px;
    background: var(--theme-bg-interactive, #f1f5f9);
    box-shadow: inset 0 1px 2px rgba(15, 45, 82, 0.06);
}

.auth-mode-option {
    position: relative;
    min-height: 48px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    box-shadow: none;
    color: var(--theme-text-secondary, var(--muted));
    font-size: 15px;
    font-weight: 600;
    transition: background-color 180ms ease, box-shadow 180ms ease, color 180ms ease, transform 180ms ease;
}

.auth-mode-option:hover {
    background: var(--theme-bg-hover, transparent);
    box-shadow: none;
    color: var(--theme-text-primary, var(--heading));
    transform: none;
}

.auth-mode-option.active {
    background: var(--theme-row-selected-bg, #fff);
    box-shadow: 0 8px 20px rgba(15, 45, 82, 0.12);
    color: var(--theme-text-primary, var(--heading));
    transform: none;
}

.auth-mode-option.active::after {
    content: "\2713";
    position: absolute;
    right: 16px;
    top: 50%;
    width: 22px;
    height: 22px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    background: var(--ok);
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    transform: translateY(-50%);
}

.auth-flow-panel {
    display: grid;
    gap: 0;
    min-width: 0;
}

.auth-card,
.verification-card {
    min-width: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.auth-card {
    padding: 0 28px 8px;
}

.auth-card-head {
    display: block;
}

.auth-card-head h3 {
    margin-top: 0;
    margin-bottom: 6px;
    color: var(--heading);
}

.auth-card .muted,
.verification-card .muted {
    color: var(--muted);
}

.auth-card label,
.verification-card label {
    color: var(--theme-text-muted, #5b6b7f);
    font-size: 14px;
    font-weight: 500;
}

.auth-card input,
.auth-card select,
.verification-card input,
.verification-card select {
    min-height: 48px;
    border-color: var(--line);
    border-radius: 12px;
    background: #fff;
    color: var(--text);
    font-size: 16px;
    padding: 11px 14px;
}

.auth-card input:focus-visible,
.auth-card select:focus-visible,
.verification-card input:focus-visible,
.verification-card select:focus-visible {
    outline: 2px solid rgba(85, 174, 233, 0.42);
    border-color: var(--primary-soft);
}

.auth-phone-grid {
    display: grid;
    grid-template-columns: minmax(160px, 0.85fr) minmax(0, 1.15fr);
    gap: 12px;
}

.auth-phone-grid select {
    color: var(--heading);
    font-size: 15px;
}

.auth-card button,
.verification-card button {
    width: 100%;
    min-height: 52px;
    margin-top: 16px;
    border-radius: 10px;
    background: var(--theme-control-primary-bg, var(--accent));
    box-shadow: var(--shadow-sm);
    color: var(--theme-control-primary-text, #fff);
    font-size: 17px;
    font-weight: 700;
}

.auth-card button:hover,
.verification-card button:hover {
    background: var(--theme-control-primary-hover, var(--accent-dark));
    box-shadow: var(--shadow-sm);
}

.verification-card {
    padding: 0 28px 8px;
}

.verification-actions {
    display: grid;
    gap: 8px;
}

.verification-card .verification-actions button.secondary {
    margin-top: 10px;
    border-color: var(--line);
    background: #fff;
    box-shadow: var(--shadow-sm);
    color: var(--heading);
    font-size: 15px;
}

.verification-card .verification-actions button.secondary:hover {
    border-color: #c7ddf5;
    background: var(--soft-blue);
    box-shadow: 0 10px 22px rgba(13, 71, 161, 0.1);
    color: var(--primary);
}

.auth-layout:not(.verification-ready) .verification-card,
.auth-layout.verification-ready .auth-flow-panel,
.auth-layout.verification-ready .auth-mode-switch,
.auth-layout.verification-ready .customer-identity-entry,
.auth-layout.verification-ready .auth-code-heading,
.auth-layout.verification-ready .auth-alternate-action {
    display: none;
}

.auth-privacy-note {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin: 12px 44px 28px;
    color: var(--muted);
    font-size: 14px;
    font-weight: 500;
    line-height: 1.45;
    text-align: left;
}

.card,
.form-section {
    padding: 16px;
}

.card.auth-card,
.card.verification-card {
    padding: 0 44px 10px;
}

.form-section {
    display: grid;
    gap: 14px;
}

.customer-prefill-notice {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 12px;
    align-items: center;
    padding: 14px 16px;
    border: 1px solid var(--theme-info-border, #9bc9e8);
    border-radius: var(--radius);
    background: var(--theme-info-bg, #eaf6ff);
    color: var(--theme-text-primary, var(--text));
}

.customer-prefill-time {
    display: inline;
    margin-inline-start: 0.35em;
}

.intake-phone-row {
    margin-block: 12px;
}

#details-form .form-section > .field {
    margin-bottom: 12px;
}

#details-form .split + .split {
    margin-top: 12px;
}

.customer-prefill-correction {
    display: block;
}

.customer-prefill-notice[hidden] {
    display: none;
}

.customer-prefill-icon {
    display: grid;
    width: 30px;
    height: 30px;
    place-items: center;
    border-radius: 50%;
    background: var(--theme-bg-panel, #fff);
    color: var(--theme-brand-strong, var(--primary));
    font-weight: 600;
}

.customer-prefill-notice strong,
.customer-prefill-notice p {
    display: block;
    margin: 0;
}

.customer-prefill-notice p {
    margin-top: 2px;
    color: var(--theme-text-secondary, var(--muted));
    font-size: 14px;
    line-height: 20px;
}

.form-section.compact {
    max-width: 460px;
}

/* Details step: roomier sections, icon-led titles, two calm columns. */
#details-form { gap: 20px; }
#details-form > .form-section { gap: 18px; padding: 24px; border-radius: 14px; border-color: var(--theme-border, var(--line)); }
.form-section__head { display: flex; align-items: flex-start; gap: 14px; }
.form-section__head h3 { margin: 0; font-size: 1.0625rem; font-weight: 600; line-height: 1.4; }
.form-section__head p { margin: 4px 0 0; max-width: 68ch; font-size: .9rem; line-height: 1.5; }
.form-section__icon {
    display: grid;
    place-items: center;
    flex: none;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--theme-brand-soft, var(--soft-blue));
    color: var(--theme-brand-strong, var(--primary));
}
.form-section__icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
#details-form > .form-section .split { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 20px; }
#details-form > .form-section .field > label,
#details-form > .form-section .field-label-row > label {
    color: var(--theme-text-secondary, var(--text));
    font-size: .875rem;
    font-weight: 500;
}
#details-form .field-hint,
#details-form [data-contact-status] { margin: 0; font-size: .85rem; line-height: 1.45; }
#details-form [data-contact-status].is-verified {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    justify-self: start;
    padding: 2px 10px 2px 8px;
    border-radius: 999px;
    background: var(--theme-success-bg, var(--ok-bg));
    color: var(--theme-success, var(--ok));
    font-weight: 500;
}
#details-form [data-contact-status].is-verified::before {
    content: "";
    width: .45em;
    height: .8em;
    margin: -2px 2px 0 2px;
    border-inline-end: 2px solid currentColor;
    border-block-end: 2px solid currentColor;
    transform: rotate(45deg);
}

.input-affix {
    display: flex;
    align-items: center;
    border: 1px solid var(--theme-border-strong, var(--line));
    border-radius: 8px;
    background: var(--theme-bg-panel, var(--panel));
}
.input-affix:focus-within { border-color: var(--theme-brand, var(--primary)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--theme-brand, var(--primary)) 18%, transparent); }
.input-affix:has(.has-error) { border-color: var(--theme-danger, #b42318); }
.input-affix__text { padding-inline: 12px 2px; color: var(--theme-text-muted, var(--muted)); font-size: .9rem; font-weight: 500; }
.portal-theme .input-affix input,
.portal-theme .input-affix input:focus { flex: 1; min-width: 0; border: 0; background: transparent; box-shadow: none; outline: none; }


@media (max-width: 640px) {
    #details-form > .form-section { padding: 18px; }
    #details-form > .form-section .split { grid-template-columns: minmax(0, 1fr); }
}

/* Independent question sections sit on the page, not inside another card. */
.panel[data-step-panel="details"].has-question-sections {
    background: transparent;
    border: 0;
    box-shadow: none;
    padding: 0;
}

#custom-fields-content {
    display: grid;
    gap: 24px;
    min-width: 0;
    container: question-form / inline-size;
}

#custom-fields-content[hidden] { display: none; }

#custom-fields-content > h3,
.customer-question-section > h4,
.customer-question-section > p {
    margin: 0;
    overflow-wrap: anywhere;
}

.customer-question-section > h4 { font-size: 1rem; }
.customer-question-section,
.customer-question-section .field { min-width: 0; }
.customer-question-section {
    padding: 24px;
    gap: 24px;
}
.customer-question-section .split {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
    align-items: start;
}
.customer-question-section .field { gap: 8px; }
.customer-question-section .field > label,
.customer-question-section fieldset.field > legend {
    color: var(--theme-text-secondary, var(--text));
    font-size: .875rem;
    font-weight: 600;
    line-height: 1.5;
}
.customer-question-section textarea { min-height: 112px; }
.customer-question-section .split > :is(.classification-picker, [data-phone-component], [data-multi]) {
    grid-column: 1 / -1;
}
.customer-question-section .classification-picker > p {
    margin: 0;
    max-width: 72ch;
    font-size: .875rem;
    line-height: 1.6;
}
.customer-question-section .classification-picker > [data-classification-selected] {
    color: var(--theme-text-primary, var(--text));
    font-weight: 600;
    overflow-wrap: anywhere;
}
.customer-question-section .classification-picker > .button-row { margin-top: 4px; }
.customer-question-section [data-repeat-group] > [data-add-entry] { justify-self: start; }

@container question-form (max-width: 640px) {
    .customer-question-section { padding: 16px; gap: 20px; }
    .customer-question-section .split { grid-template-columns: minmax(0, 1fr); gap: 20px; }
    .customer-question-section .question-phone-controls { grid-template-columns: minmax(0, 1fr); }
}

.customer-question-section [data-repeat-group] { display: grid; gap: 16px; min-width: 0; }
.customer-question-section [data-multi] { min-width: 0; margin: 0; padding: 12px; border: 1px solid var(--theme-border, var(--line)); border-radius: 8px; }
.customer-question-section [data-multi] > label { display: flex; align-items: center; gap: 10px; overflow-wrap: anywhere; }
.customer-question-section [data-multi] input[type="checkbox"] { width: 20px; height: 20px; min-height: 20px; flex: 0 0 20px; margin: 0; padding: 0; }

.split {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
}

.field {
    display: grid;
    align-content: start;
    gap: 6px;
}

.field-label-row {
    display: flex;
    align-items: center;
    gap: 6px;
    min-height: 24px;
}

.field-help-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    min-width: 22px;
    height: 22px;
    min-height: 22px;
    border: 1px solid #b9d5f0;
    border-radius: 50%;
    padding: 0;
    background: var(--soft-blue);
    color: var(--primary);
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    box-shadow: none;
}

.field-help-button:hover {
    background: #dbeeff;
    box-shadow: none;
    transform: none;
}

.field-help-button[aria-expanded="true"],
.field-help-button.is-open {
    border-color: var(--primary);
    background: #dbeeff;
}

.field-help-dialog {
    width: min(360px, calc(100vw - 32px));
    max-height: calc(100vh - 32px);
    max-height: calc(100dvh - 32px);
    margin: auto;
    border: 0;
    border-radius: var(--radius);
    padding: 0;
    overflow: visible;
    background: transparent;
    color: var(--text);
}

.field-help-dialog::backdrop {
    background: rgba(15, 45, 82, 0.32);
}

.field-help-dialog-panel {
    display: grid;
    gap: 10px;
    min-width: 0;
    max-width: 100%;
    max-height: calc(100vh - 32px);
    max-height: calc(100dvh - 32px);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 16px;
    overflow-x: hidden;
    overflow-y: auto;
    background: #fff;
    box-shadow: var(--shadow-lg);
}

.field-help-dialog-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.field-help-dialog-header h3 {
    min-width: 0;
    overflow-wrap: anywhere;
}

.field-help-dialog-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    min-width: 30px;
    height: 30px;
    min-height: 30px;
    border: 1px solid var(--line);
    border-radius: 50%;
    padding: 0;
    background: #fff;
    color: var(--heading);
    font-size: 20px;
    font-weight: 600;
    line-height: 1;
    box-shadow: none;
}

.field-help-dialog-close:hover {
    background: var(--soft-blue);
    border-color: #c7ddf5;
    color: var(--primary);
    box-shadow: none;
    transform: none;
}

.field-help-copy {
    display: grid;
    gap: 10px;
    min-width: 0;
}

.field-help-dialog p {
    min-width: 0;
    overflow-wrap: anywhere;
    color: var(--muted);
    font-size: 14px;
}

.document-camera-dialog {
    width: min(720px, calc(100vw - 24px));
    max-height: calc(100vh - 24px);
    max-height: calc(100dvh - 24px);
    padding: 0;
    border: 0;
    border-radius: var(--radius);
    background: transparent;
    color: var(--text);
}

.document-camera-dialog::backdrop {
    background: rgba(15, 23, 42, 0.62);
}

.saved-document-preview-dialog {
    width: min(980px, calc(100vw - 24px));
    max-height: calc(100dvh - 24px);
    padding: 0;
    overflow: hidden;
    border: 0;
    border-radius: 18px;
    background: transparent;
    color: var(--text);
}

.saved-document-preview-dialog::backdrop {
    background: rgba(7, 19, 31, 0.78);
    backdrop-filter: blur(3px);
}

.saved-document-preview-panel {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    max-height: calc(100dvh - 24px);
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: var(--panel);
    box-shadow: 0 28px 80px rgba(2, 15, 27, 0.38);
}

.saved-document-preview-stage {
    display: grid;
    min-height: 280px;
    max-height: calc(100dvh - 190px);
    place-items: center;
    overflow: auto;
    border-radius: 12px;
    background:
        linear-gradient(45deg, #e8eef3 25%, transparent 25%),
        linear-gradient(-45deg, #e8eef3 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #e8eef3 75%),
        linear-gradient(-45deg, transparent 75%, #e8eef3 75%),
        #f4f7f9;
    background-position: 0 0, 0 8px, 8px -8px, -8px 0;
    background-size: 16px 16px;
}

.saved-document-preview-stage img {
    display: block;
    max-width: 100%;
    max-height: calc(100dvh - 190px);
    object-fit: contain;
}

.saved-document-preview-stage:has(.document-preview-unavailable:not([hidden])) {
    background: var(--theme-bg-inset, var(--soft));
}

.document-preview-unavailable {
    max-width: 420px;
    padding: 24px;
    text-align: center;
    color: var(--theme-text-primary, var(--text));
}

.document-preview-unavailable p {
    color: var(--theme-text-secondary, var(--muted));
    line-height: 1.5;
}

.saved-document-preview-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    min-width: 0;
    padding-top: 14px;
}

.saved-document-preview-actions span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.identity-document-dialog {
    width: min(860px, calc(100vw - 24px));
    max-height: calc(100dvh - 24px);
    padding: 0;
    border: 0;
    border-radius: var(--radius);
    background: transparent;
    color: var(--text);
}

.identity-document-dialog::backdrop {
    background: rgba(15, 23, 42, 0.62);
}

.identity-document-dialog[aria-busy="true"] [data-identity-capture-status] {
    border: 1px solid var(--line);
}

.identity-document-dialog[aria-busy="true"] .identity-document-panel {
    min-height: 280px;
}

.identity-processing-actions {
    align-items: center;
}

.state.document-read-progress,
.identity-capture-card.document-read-progress {
    position: relative;
    padding-left: 52px;
}

.document-read-progress::before {
    content: "";
    position: absolute;
    left: 18px;
    top: 20px;
    width: 18px;
    height: 18px;
    border: 2px solid var(--line-strong);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: session-bootstrap-spin 0.9s linear infinite;
}

.document-uploaded-check {
    color: var(--ok);
    font-size: 24px;
    font-weight: 700;
}

@media (prefers-reduced-motion: reduce) {
    .document-read-progress::before {
        animation: none;
    }
}

.identity-document-panel {
    display: grid;
    gap: 16px;
    max-height: calc(100dvh - 24px);
    overflow: auto;
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    box-shadow: var(--shadow-lg);
}

.identity-document-fields {
    align-items: start;
}

.identity-does-not-expire {
    grid-column: 1 / -1;
}

.document-camera-panel {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    gap: 14px;
    max-height: calc(100vh - 24px);
    max-height: calc(100dvh - 24px);
    overflow: hidden;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: #fff;
    box-shadow: var(--shadow-lg);
}

.document-camera-body {
    display: grid;
    gap: 14px;
    min-height: 0;
    overflow: auto;
    overscroll-behavior: contain;
}

.document-camera-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
}

.document-camera-header h2 {
    margin-top: 2px;
}

.document-camera-close {
    width: 42px;
    min-width: 42px;
    padding: 0;
    font-size: 24px;
    line-height: 1;
}

.document-camera-stage {
    position: relative;
    display: grid;
    place-items: center;
    width: 100%;
    aspect-ratio: 4 / 3;
    min-height: 260px;
    overflow: hidden;
    border: 1px solid #263449;
    border-radius: 18px;
    background: #07111f;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05);
}

.document-camera-stage video,
.document-camera-stage img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.document-camera-stage[data-camera-captured="true"] img {
    object-fit: contain;
    background: #eef2f6;
}

.document-camera-stage canvas {
    display: none;
}

.document-camera-frame {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border: 1px solid rgba(255, 255, 255, 0.74);
    border-radius: 12px;
    box-shadow: 0 0 0 999px rgba(4, 12, 24, 0.52);
    pointer-events: none;
    transition: border-color 160ms ease, box-shadow 160ms ease;
}

.document-camera-stage[data-camera-profile="page"] .document-camera-frame {
    width: auto;
    height: 84%;
    max-width: 86%;
    aspect-ratio: 1 / 1.4142;
}

.document-camera-stage[data-camera-profile="card"] .document-camera-frame {
    width: 86%;
    height: auto;
    max-height: 78%;
    aspect-ratio: 1.586 / 1;
    border-radius: 18px;
}

.document-camera-frame[data-tone="ready"] {
    border-color: rgba(89, 220, 152, 0.95);
    box-shadow: 0 0 0 999px rgba(4, 12, 24, 0.52), 0 0 0 3px rgba(31, 168, 108, 0.2);
}

.document-camera-stage[data-camera-captured="true"] .document-camera-frame,
.document-camera-stage[data-camera-captured="true"] .document-camera-guidance {
    display: none;
}

.document-camera-corner {
    position: absolute;
    width: 28px;
    height: 28px;
    border-color: #fff;
    border-style: solid;
    border-width: 0;
}

.document-camera-corner.top-left {
    top: -3px;
    left: -3px;
    border-top-width: 4px;
    border-left-width: 4px;
    border-top-left-radius: 12px;
}

.document-camera-corner.top-right {
    top: -3px;
    right: -3px;
    border-top-width: 4px;
    border-right-width: 4px;
    border-top-right-radius: 12px;
}

.document-camera-corner.bottom-left {
    bottom: -3px;
    left: -3px;
    border-bottom-width: 4px;
    border-left-width: 4px;
    border-bottom-left-radius: 12px;
}

.document-camera-corner.bottom-right {
    right: -3px;
    bottom: -3px;
    border-right-width: 4px;
    border-bottom-width: 4px;
    border-bottom-right-radius: 12px;
}

.document-camera-guidance {
    position: absolute;
    z-index: 2;
    top: 14px;
    left: 50%;
    display: flex;
    align-items: center;
    gap: 8px;
    width: max-content;
    max-width: calc(100% - 28px);
    padding: 9px 12px;
    transform: translateX(-50%);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 999px;
    background: rgba(7, 17, 31, 0.84);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    line-height: 18px;
    text-align: center;
    backdrop-filter: blur(8px);
}

.document-camera-guidance[hidden] {
    display: none;
}

.document-camera-guidance-dot {
    width: 8px;
    height: 8px;
    flex: 0 0 auto;
    border-radius: 50%;
    background: #f7c948;
    box-shadow: 0 0 0 4px rgba(247, 201, 72, 0.16);
}

.document-camera-guidance[data-tone="ready"] .document-camera-guidance-dot {
    background: #59dc98;
    box-shadow: 0 0 0 4px rgba(89, 220, 152, 0.16);
}

.document-camera-empty {
    position: absolute;
    inset: 0;
    display: grid;
    align-content: center;
    justify-items: center;
    gap: 6px;
    padding: 24px;
    text-align: center;
    background: linear-gradient(135deg, #172033, #0f2d52);
    color: #fff;
}

.document-camera-empty[hidden] {
    display: none;
}

.document-camera-empty strong {
    color: #fff;
    font-size: 18px;
    line-height: 26px;
    font-weight: 600;
}

.document-camera-empty span,
.document-camera-help {
    color: var(--muted);
    font-size: 14px;
    line-height: 20px;
}

.document-camera-empty span {
    max-width: 360px;
    color: rgba(255, 255, 255, 0.82);
}

.document-camera-quality {
    display: grid;
    gap: 12px;
    padding: 14px;
    border: 1px solid #d8e2ec;
    border-radius: 14px;
    background: #f7f9fc;
}

.document-camera-quality[hidden] {
    display: none;
}

.document-camera-quality[data-tone="passed"] {
    border-color: #b9e5cf;
    background: #f0faf5;
}

.document-camera-quality h3 {
    margin-top: 2px;
    font-size: 17px;
    line-height: 24px;
}

.document-camera-quality ul {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    padding: 0;
    margin: 0;
    list-style: none;
}

.document-camera-quality li {
    display: grid;
    grid-template-columns: 24px minmax(0, 1fr);
    gap: 8px;
    align-items: start;
    min-width: 0;
    padding: 9px;
    border: 1px solid #e0e7ef;
    border-radius: 10px;
    background: #fff;
}

.document-camera-quality li > span:first-child {
    display: grid;
    place-items: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #fff1ce;
    color: #825d00;
    font-weight: 700;
}

.document-camera-quality li[data-tone="passed"] > span:first-child {
    background: #dff5e9;
    color: #157347;
}

.document-camera-quality li > span:last-child {
    display: grid;
    gap: 1px;
    min-width: 0;
}

.document-camera-quality small {
    color: var(--muted);
    font-size: 12px;
    line-height: 16px;
}

.document-camera-privacy {
    color: var(--muted);
    font-size: 13px;
    line-height: 18px;
}

.document-camera-actions,
.upload-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.document-camera-actions {
    z-index: 4;
    justify-content: flex-end;
    align-items: center;
    padding: 12px 0 2px;
    border-top: 1px solid var(--line);
    background: var(--panel, #fff);
}

.document-camera-primary-action {
    min-width: 154px;
}

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

.upload-actions button {
    min-height: 40px;
    padding: 8px 12px;
    white-space: nowrap;
}

.portal-theme--borrower #documents-content .document-card.document-invalid {
    border-color: var(--theme-danger-border, var(--danger));
    box-shadow: inset 3px 0 0 var(--theme-danger, var(--danger));
}

#documents-content [data-document-validation-error] {
    grid-column: 1 / -1;
    margin: 8px 0 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--theme-danger, var(--danger));
}

#document-continue-error strong,
#document-continue-error a {
    color: inherit;
}

#document-continue-error ul {
    margin: 8px 0 0;
    padding-left: 20px;
}

#document-continue-error li + li {
    margin-top: 8px;
}

#document-continue-error a {
    text-decoration: underline;
    text-underline-offset: 3px;
}

.field-error {
    color: var(--danger);
    font-size: 13px;
    font-weight: 600;
}

[data-details-errors]:not([hidden]) {
    display: grid;
    justify-items: start;
    justify-self: end;
    max-width: min(100%, 64ch);
    padding-inline-start: 12px;
    border-inline-start: 3px solid var(--danger);
}

[data-details-errors] .link-button {
    max-width: 100%;
    margin: 0;
    padding: 4px 2px;
    line-height: 1.5;
    text-align: start;
    text-decoration: underline;
    text-underline-offset: 3px;
    overflow-wrap: anywhere;
}

.verification-card .field-error {
    padding: 10px 12px;
    border: 1px solid #f7c4bf;
    border-radius: var(--radius);
    background: var(--danger-bg);
    line-height: 1.35;
}

.auth-card .auth-channel-field {
    display: none;
}

.auth-alternate-action {
    margin: 0 44px 36px;
    color: var(--text);
    font-size: 15px;
    line-height: 1.45;
}

.auth-alternate-action .link-button {
    display: inline;
    width: auto;
    min-height: 0;
    margin: 0;
    padding: 0;
    font-size: inherit;
    line-height: inherit;
    vertical-align: baseline;
}

label {
    color: var(--theme-text-muted, #5b6b7f);
    font-size: 13px;
    font-weight: 500;
}

.button-row {
    flex-wrap: wrap;
    gap: 8px;
}

/* Workflow footers follow reading/tab order: secondary actions, then forward. */
.portal-theme--borrower .workflow-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: center;
    gap: 12px;
    margin-top: 16px;
}

.portal-theme--borrower .workflow-actions > button {
    flex: 0 1 auto;
    width: auto;
    max-width: 100%;
}

.portal-theme--borrower .workflow-actions > [data-documents-progress-guidance] {
    flex: 1 1 240px;
}

.portal-theme--borrower .workflow-actions button.workflow-quiet {
    margin-inline-end: 8px;
    background: transparent;
    border-color: transparent;
    box-shadow: none;
    color: var(--theme-text-secondary);
}

.portal-theme--borrower .workflow-actions button.workflow-quiet:hover {
    background: var(--theme-bg-hover);
    color: var(--theme-text-primary);
    box-shadow: none;
}

.portal-theme--borrower .workflow-forward,
.panel[data-step-panel="reminders"] .reminder-save-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

/* Decorative arrow survives dynamic button labels without changing their names. */
.portal-theme--borrower .workflow-forward::after,
.panel[data-step-panel="reminders"] .reminder-save-action::after {
    content: "";
    flex: 0 0 auto;
    width: 0.5em;
    height: 0.5em;
    border-block-start: 2px solid currentColor;
    border-inline-end: 2px solid currentColor;
    transform: rotate(45deg);
    margin-inline-end: 3px;
}

.portal-theme--borrower .workflow-standalone {
    justify-self: end;
    margin-top: 16px;
    max-width: 100%;
}

.reminder-intake-label,
.panel[data-step-panel="reminders"] .reminder-dashboard-label {
    display: none;
}

.panel[data-step-panel="reminders"] .reminder-intake-label {
    display: inline;
}

@media (max-width: 680px) {
    .portal-theme--borrower .workflow-actions > .workflow-forward,
    .portal-theme--borrower .workflow-standalone,
    .panel[data-step-panel="reminders"] .reminder-save-action {
        flex-basis: 100%;
        width: 100%;
        justify-self: stretch;
    }
}

.utility-action {
    width: auto;
    flex: 0 0 auto;
    justify-self: start;
    white-space: nowrap;
}

.page-action-bar,
.terms-box,
.final-identity-panel {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
}

.online-identity-panel {
    display: grid;
    gap: 1rem;
}

.online-identity-panel[hidden] {
    display: none;
}

.page-action-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 18px;
    background: linear-gradient(135deg, #ffffff, #f8fbff);
    box-shadow: var(--shadow-sm);
}

.page-action-bar span {
    color: var(--muted);
    font-size: 14px;
    line-height: 20px;
}

.dashboard-empty-state {
    display: grid;
    justify-items: center;
    gap: 14px;
    padding: 34px 22px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    text-align: center;
    box-shadow: var(--shadow-sm);
}

.dashboard-empty-icon {
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    background: var(--soft-blue);
    color: var(--primary);
    font-size: 24px;
    font-weight: 700;
    line-height: 1;
}

.dashboard-empty-state h3 {
    margin: 0;
    color: var(--heading);
    font-size: 20px;
    line-height: 28px;
    font-weight: 600;
}

.dashboard-empty-state p {
    max-width: 340px;
    margin: 0;
    color: var(--muted);
    font-size: 14px;
    line-height: 20px;
}

.dashboard-empty-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 2px;
}

.terms-box {
    display: grid;
    gap: 10px;
    margin-top: 14px;
    padding: 18px;
    background: linear-gradient(135deg, #ffffff, #f8fbff);
    box-shadow: var(--shadow-sm);
}

.terms-box strong {
    color: var(--heading);
    font-size: 16px;
    line-height: 24px;
    font-weight: 600;
}

.terms-box p {
    color: var(--muted);
    font-size: 14px;
    line-height: 20px;
}

.field-context {
    margin: 0 0 8px;
    color: var(--muted);
    font-size: 14px;
    line-height: 20px;
}

.field-context a {
    color: var(--primary);
    font-weight: 600;
}

.check-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 14px 0;
}

.check-row input {
    width: 18px;
    min-height: 18px;
    margin-top: 2px;
    flex: 0 0 auto;
}

.check-row span {
    color: var(--text);
    font-size: 14px;
    line-height: 20px;
}

.final-identity-panel {
    display: grid;
    gap: 16px;
    margin-top: 18px;
    padding: 20px;
    background: linear-gradient(135deg, #ffffff, #f4f9fe);
    border-color: #cfe1f2;
    box-shadow: var(--shadow-sm);
}

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

.identity-frame {
    min-height: 132px;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 8px;
    border: 2px dashed var(--line-strong);
    border-radius: var(--radius);
    background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
    box-shadow: none;
    color: var(--text);
    text-align: center;
}

button.identity-frame:hover {
    border-color: var(--primary);
    background: #f8fbff;
    box-shadow: none;
    color: var(--text);
}

.identity-frame.done {
    border-style: solid;
    border-color: #b9e8cb;
    background: linear-gradient(135deg, #ffffff, var(--ok-bg));
}

.identity-frame strong {
    color: var(--heading);
    font-size: 15px;
    line-height: 22px;
    font-weight: 600;
}

.identity-frame span {
    color: var(--muted);
    font-size: 14px;
    line-height: 20px;
}

.state {
    padding: 14px;
    color: var(--muted);
    font-size: 14px;
    line-height: 20px;
}

.state strong {
    color: var(--heading);
}

.workspace-status {
    position: sticky;
    top: 92px;
    z-index: 9;
    font-size: 14px;
    box-shadow: var(--shadow-sm);
}

.state.error {
    border-color: #f7c4bf;
    background: var(--danger-bg);
    color: var(--danger);
}

.state.ok {
    border-color: #b9e8cb;
    background: var(--ok-bg);
    color: var(--ok);
}

.state.warn {
    border-color: #f3d59a;
    background: var(--warn-bg);
    color: var(--warn);
}

.state.busy {
    border-color: var(--line);
    color: var(--muted);
}

.badge {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 4px 9px;
    border: 1px solid #b8d8f6;
    border-radius: 999px;
    background: #dbeeff;
    color: var(--info);
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.badge.info {
    border-color: #b8d8f6;
    background: #dbeeff;
    color: #0a3d8f;
}

.badge.ok {
    border-color: #9adbb9;
    background: var(--ok-bg);
    color: var(--ok);
}

.badge.warn {
    border-color: #f0c36f;
    background: var(--warn-bg);
    color: var(--warn);
}

.badge.error {
    border-color: #f2aaa4;
    background: var(--danger-bg);
    color: var(--danger);
}

.developer-badge {
    opacity: 0.84;
}

.dev-tools {
    margin-top: 14px;
    padding: 12px 14px;
    border: 1px dashed var(--line-strong);
    border-radius: var(--radius);
    background: #fff;
}

.dev-tools summary {
    color: var(--muted);
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
}

.dev-tools:not([open]) > :not(summary) {
    display: none;
}

.dev-tools p {
    margin: 8px 0;
}

.developer-only {
    border-style: dashed;
}

.item-list {
    display: grid;
    gap: 10px;
}

.underwriting-borrower-documents {
    margin-bottom: 18px;
}

.underwriting-borrower-document {
    display: grid;
    gap: 14px;
}

.underwriting-borrower-document.is-upload-request {
    border-color: var(--warn);
    background: linear-gradient(135deg, var(--warn-bg), var(--theme-bg-elevated, #fff));
    box-shadow: inset 0 0 0 1px var(--warn), var(--shadow-sm);
}

.underwriting-borrower-document__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.underwriting-borrower-document__actions > a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 8px 12px;
    border: 1px solid var(--theme-control-primary-bg, var(--accent));
    border-radius: 10px;
    background: var(--theme-control-primary-bg, var(--accent));
    color: var(--theme-control-primary-text, #fff);
    font-weight: 700;
    text-decoration: none;
}

.underwriting-borrower-document__actions > a:hover {
    border-color: var(--theme-control-primary-hover, var(--accent-dark));
    background: var(--theme-control-primary-hover, var(--accent-dark));
}

.underwriting-borrower-document__actions > a.secondary {
    border-color: var(--theme-border, var(--line));
    background: var(--theme-control-secondary-bg, var(--panel));
    color: var(--theme-control-secondary-text, var(--text));
}

.underwriting-borrower-document__actions > a.secondary:hover {
    border-color: var(--theme-border-strong, var(--line-strong));
    background: var(--theme-control-secondary-hover, var(--soft));
}

.underwriting-borrower-document__upload {
    display: flex;
    flex: 1 1 320px;
    flex-wrap: wrap;
    gap: 10px;
    align-items: end;
}

.underwriting-borrower-document__upload .field {
    flex: 1 1 220px;
}

.item-list.has-error {
    padding: 10px;
    border: 1px solid var(--danger);
    border-radius: var(--radius);
    background: var(--danger-bg);
    box-shadow: 0 0 0 3px rgba(185, 28, 28, 0.08);
}

.product-grid:not(:empty) {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 14px;
}

#start-application-form {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    border: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
}

.item {
    display: grid;
    gap: 10px;
    padding: 14px;
    background: #fff;
}

.item.selected {
    border-color: var(--primary);
    box-shadow: inset 0 0 0 1px var(--primary);
}

.metric-strip {
    display: grid;
    grid-template-columns: minmax(220px, 1.45fr) repeat(3, minmax(120px, 0.65fr));
    gap: 12px;
}

.metric-card,
.data-card,
.application-card,
.product-card,
.choice-card,
.document-card,
.attachment-review-panel,
.attachment-card,
.review-card,
.offer-summary {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

.metric-card {
    display: grid;
    align-content: start;
    gap: 6px;
    padding: 16px;
    min-width: 0;
    background: linear-gradient(180deg, #ffffff 0%, #f9fbfd 100%);
    container-type: inline-size;
}

.dashboard-action-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 18px;
    align-items: center;
    padding: 18px;
    background: linear-gradient(135deg, #ffffff, #f4f9fe);
    border: 1px solid #c9dcec;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

.dashboard-action-card h3,
.dashboard-action-card p {
    margin: 0;
}

.dashboard-action-card p {
    margin-top: 3px;
    color: var(--muted);
    font-size: 14px;
    line-height: 20px;
}

.dashboard-messages {
    display: grid;
    gap: 12px;
}

.dashboard-messages .section-heading h3,
.dashboard-message-card p {
    margin: 0;
}

.dashboard-message-list {
    display: grid;
    gap: 10px;
}

.dashboard-message-card {
    display: grid;
    gap: 10px;
    padding: 16px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    scroll-margin: 24px;
}

.dashboard-message-card.selected {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(13, 71, 161, 0.18);
    outline: none;
}

.dashboard-message-heading {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 12px;
}

.dashboard-message-card small {
    color: var(--muted);
    font-size: 12px;
}

.dashboard-message-card p {
    color: var(--primary-dark);
    line-height: 1.55;
    white-space: pre-wrap;
}

.dashboard-submission-confirmation {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 14px;
    align-items: start;
    padding: 18px;
    border: 1px solid #9adbb9;
    border-radius: var(--radius);
    background: linear-gradient(135deg, #eaf8f0, #ffffff);
    box-shadow: var(--shadow-sm);
}

.dashboard-submission-icon {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    background: var(--ok);
    color: #fff;
    font-size: 24px;
    line-height: 1;
    font-weight: 700;
}

.dashboard-submission-confirmation h3,
.dashboard-submission-confirmation p {
    margin: 0;
}

.dashboard-submission-confirmation h3 {
    color: var(--heading);
    font-size: 22px;
    line-height: 30px;
}

.dashboard-submission-confirmation p:not(.eyebrow) {
    margin-top: 4px;
    color: var(--muted);
    font-size: 15px;
    line-height: 22px;
}

.dashboard-submission-confirmation span {
    display: inline-flex;
    margin-top: 10px;
    color: var(--ok);
    font-size: 13px;
    line-height: 18px;
    font-weight: 600;
}

.metric-card span,
.data-row span,
.document-overview span {
    color: var(--muted);
    font-size: 12px;
    line-height: 16px;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.metric-card strong {
    color: var(--heading);
    font-size: 20px;
    font-size: clamp(20px, 12cqi, 24px);
    line-height: 1.3;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    overflow-wrap: normal;
    word-break: normal;
}

.metric-card.primary {
    background: linear-gradient(135deg, #ffffff, #f3f8fd);
    border-color: #cfe1f2;
}

.metric-card.primary strong {
    font-size: 18px;
    font-size: clamp(18px, 10cqi, 20px);
    line-height: 1.4;
}

.metric-strip--customer .metric-card strong {
    font-size: 28px;
    font-size: clamp(26px, 12cqi, 32px);
    line-height: 1.2;
}

.metric-card small {
    color: var(--muted);
    font-size: 14px;
    line-height: 20px;
}

.data-card {
    display: grid;
    gap: 14px;
    padding: 18px;
}

.dashboard-saved-documents {
    margin-top: 20px;
}

.saved-documents-card {
    overflow: hidden;
    padding: 0;
    border-color: var(--line);
    background: var(--panel);
}

.saved-documents-heading {
    padding: 18px 22px;
    cursor: pointer;
}

.saved-documents-card[open] > .saved-documents-heading {
    border-bottom: 1px solid var(--line);
}

.saved-documents-heading h3 {
    display: inline;
    margin: 0;
    color: var(--heading);
    font-size: 20px;
    line-height: 28px;
}

.saved-documents-count {
    margin-left: 6px;
    color: inherit;
    font-size: 1em;
    font-weight: inherit;
}

.saved-documents-grid {
    display: grid;
}

.saved-document-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 16px;
    min-width: 0;
    padding: 18px 22px;
}

.saved-document-row + .saved-document-row {
    border-top: 1px solid var(--line);
}

.saved-document-main {
    display: grid;
    gap: 5px;
    min-width: 0;
}

.saved-document-title-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.saved-document-title-row h4 {
    margin: 0;
    color: var(--heading);
    font-size: 16px;
    line-height: 22px;
    font-weight: 600;
    overflow-wrap: anywhere;
}

.saved-document-file-details {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 0 6px;
    min-width: 0;
}

.portal-theme--borrower .saved-document-filename {
    width: auto;
    min-height: 0;
    max-width: 100%;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    color: var(--theme-link);
    font-size: 13px;
    font-weight: 600;
    text-align: left;
    text-decoration: underline;
    text-underline-offset: 3px;
    overflow-wrap: anywhere;
}

.portal-theme--borrower .saved-document-filename:hover {
    background: transparent;
    box-shadow: none;
    color: var(--theme-link-hover);
    transform: none;
}

.portal-theme--borrower .saved-document-filename.is-unavailable {
    color: var(--theme-text-secondary);
    cursor: default;
    opacity: 1;
    text-decoration: none;
}

.saved-document-file-details > span,
.saved-document-submitted,
.saved-document-expiration,
.saved-document-preview-status {
    color: var(--muted);
    font-size: 12px;
    line-height: 17px;
}

.saved-document-file-details > span::before {
    content: '·';
    margin-right: 6px;
}

.saved-document-submitted,
.saved-document-expiration,
.saved-document-preview-status {
    margin: 0;
}

.saved-document-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.portal-theme--borrower button.saved-document-download {
    display: grid;
    width: 40px;
    height: 40px;
    min-height: 40px;
    padding: 0;
    place-items: center;
    border: 1px solid var(--theme-border);
    border-radius: 50%;
    background: transparent;
    color: var(--theme-text-secondary);
    box-shadow: none;
}

.portal-theme--borrower button.saved-document-download:hover {
    border-color: var(--theme-border-strong);
    background: var(--theme-control-quiet-hover);
    color: var(--theme-text-primary);
    box-shadow: none;
    transform: none;
}

button.saved-document-download[hidden] {
    display: none;
}

.saved-document-download svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.saved-documents-empty {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 18px;
    padding: 18px;
    border: 1px dashed var(--line-strong);
    border-radius: 14px;
    background: var(--soft);
}

.saved-documents-empty > span {
    display: grid;
    flex: 0 0 54px;
    width: 54px;
    height: 62px;
    place-items: center;
    border: 1px solid var(--line-strong);
    border-radius: 7px 7px 13px 7px;
    color: var(--heading);
    font-size: 12px;
    font-weight: 700;
}

.saved-documents-empty strong {
    color: var(--heading);
}

.saved-documents-empty p {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 14px;
}

.dashboard-empty-state .saved-documents-card {
    width: min(100%, 720px);
    text-align: left;
}

.data-list {
    display: grid;
    gap: 8px;
}

.data-list.compact {
    gap: 6px;
}

.data-row {
    display: grid;
    grid-template-columns: minmax(120px, 170px) minmax(0, 1fr);
    gap: 10px;
    align-items: start;
    padding: 10px 0;
    border-bottom: 1px solid var(--theme-divider, #eef2f7);
}

.data-row:last-child {
    border-bottom: 0;
}

.data-row strong {
    color: var(--text);
    font-size: 14px;
    line-height: 20px;
    font-weight: 500;
}

.application-card,
.choice-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(150px, 0.55fr) auto;
    gap: 16px;
    align-items: center;
    padding: 18px;
    background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
    transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.application-card:hover,
.choice-card:hover,
.product-card:hover,
.document-card:hover {
    border-color: #c4d7eb;
    box-shadow: 0 12px 28px rgba(15, 45, 82, 0.09);
}

.application-card h3,
.choice-card h3,
.product-card h3,
.document-card h3 {
    margin-top: 8px;
    font-weight: 600;
}

.application-meta,
.choice-meta {
    display: grid;
    gap: 5px;
    color: var(--muted);
    font-size: 14px;
    line-height: 20px;
}

.dashboard-panel {
    padding: 22px;
}

.dashboard-panel-header {
    align-items: center;
    margin-bottom: 18px;
    padding-bottom: 14px;
}

.dashboard-panel-header h2 {
    font-size: clamp(22px, 3vw, 30px);
    line-height: 1.2;
}

.dashboard-layout {
    display: grid;
    gap: 18px;
}

.dashboard-panel--customer > #dashboard-content ~ section {
    margin-top: 18px;
}

.dashboard-live {
    padding: 11px 14px;
    border: 1px solid #a7d8c0;
    border-radius: var(--radius);
    background: var(--ok-bg);
    color: var(--ok);
    font-size: 14px;
    font-weight: 600;
}

.dashboard-live:empty {
    display: none;
}

.dashboard-live.error {
    border-color: #fecaca;
    background: var(--danger-bg);
    color: var(--danger);
}

.dashboard-attention-banner {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 14px;
    align-items: center;
    padding: 18px;
    border: 1px solid #f5c875;
    border-left: 5px solid var(--warn);
    border-radius: var(--radius);
    background: linear-gradient(135deg, var(--warn-bg), #fff);
    box-shadow: var(--shadow-sm);
}

.dashboard-attention-banner.urgency-overdue {
    border-color: #fecaca;
    border-left-color: var(--danger);
    background: linear-gradient(135deg, var(--danger-bg), #fff);
}

.dashboard-attention-icon {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    background: var(--warn);
    color: #fff;
    font-size: 22px;
    font-weight: 700;
}

.urgency-overdue .dashboard-attention-icon {
    background: var(--danger);
}

.dashboard-attention-banner h3,
.dashboard-attention-banner p {
    margin: 0;
}

.dashboard-attention-banner p:not(.eyebrow) {
    margin-top: 3px;
    color: var(--muted);
    font-size: 14px;
    overflow-wrap: anywhere;
}

.dashboard-layout .metric-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.dashboard-metric {
    width: 100%;
    min-height: 138px;
    position: relative;
    justify-items: start;
    color: inherit;
    text-align: left;
    cursor: pointer;
    transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.metric-strip--customer .dashboard-metric {
    min-height: 112px;
}

.dashboard-metric:hover {
    border-color: #9bbbd8;
    box-shadow: 0 12px 26px rgba(15, 45, 82, 0.1);
    transform: translateY(-2px);
}

.dashboard-metric:focus-visible {
    border-color: var(--primary);
    outline: 3px solid rgba(13, 71, 161, 0.24);
    outline-offset: 2px;
}

.dashboard-metric:active {
    box-shadow: var(--shadow-sm);
    transform: translateY(1px);
}

.dashboard-metric[aria-pressed="true"] {
    border-color: var(--primary);
    background: linear-gradient(135deg, #fff, var(--soft-blue));
    box-shadow: inset 0 0 0 1px var(--primary), var(--shadow-sm);
}

.dashboard-metric .dashboard-metric-action {
    display: inline-flex;
    gap: 5px;
    align-items: center;
    margin-top: auto;
    color: var(--primary);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0;
    text-transform: none;
}

.dashboard-metric .dashboard-metric-action > span {
    color: inherit;
    font: inherit;
    letter-spacing: inherit;
    text-transform: inherit;
}

.metric-strip--customer .dashboard-metric-action--arrow {
    position: absolute;
    right: 16px;
    bottom: 16px;
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    margin: 0;
    border: 1px solid var(--line);
    border-radius: 50%;
    background: var(--theme-bg-interactive);
    color: var(--heading);
    font-size: 1.5rem;
    line-height: 1;
}

.metric-strip--customer .dashboard-metric:hover .dashboard-metric-action--arrow {
    background: var(--theme-bg-hover);
}

.dashboard-applications,
.dashboard-messages {
    display: grid;
    gap: 14px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    box-shadow: var(--shadow-sm);
}

.dashboard-section-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
}

.dashboard-section-heading h3 {
    font-size: 21px;
    line-height: 28px;
}

.dashboard-filter-bar,
.message-badges,
.application-card-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.dashboard-filter-button {
    min-height: 38px;
    padding: 7px 11px;
    border-color: var(--line);
    background: #fff;
    color: var(--muted);
    font-size: 13px;
    box-shadow: none;
}

.dashboard-filter-button:hover,
.dashboard-filter-button[aria-pressed="true"] {
    border-color: var(--primary);
    background: var(--soft-blue);
    color: var(--primary);
    transform: none;
}

.dashboard-application-tools {
    min-width: 0;
    display: grid;
    justify-items: end;
    gap: 10px;
}

.dashboard-application-tools .dashboard-filter-bar {
    justify-content: flex-end;
}

.dashboard-application-sort {
    min-width: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 8px 12px;
}

.dashboard-sort-description {
    margin: 0;
    color: var(--muted);
    font-size: 12px;
    font-weight: 500;
    line-height: 18px;
}

.dashboard-application-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.borrower-application-card {
    min-width: 0;
    display: grid;
    align-content: start;
    gap: 16px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: linear-gradient(180deg, #fff, #fbfdff);
    box-shadow: var(--shadow-sm);
    scroll-margin: 24px;
    transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.borrower-application-card:focus {
    outline: none;
}

.borrower-application-card:focus-within:not(:focus) {
    border-color: var(--primary);
    outline: 3px solid rgba(13, 71, 161, 0.2);
    outline-offset: 2px;
}

.application-card-heading {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(170px, 0.65fr);
    gap: 16px;
    align-items: start;
}

.application-card-primary {
    min-width: 0;
    min-height: 44px;
    display: grid;
    justify-items: start;
    gap: 5px;
    padding: 11px;
    border: 1px solid transparent;
    border-radius: var(--radius);
    background: transparent;
    color: inherit;
    text-align: left;
    cursor: pointer;
    box-shadow: none;
    transition: border-color 0.16s ease, background 0.16s ease, transform 0.16s ease;
}

.application-card-primary:hover {
    border-color: #c9dcec;
    background: var(--soft-blue);
    box-shadow: none;
    transform: none;
}

.application-card-primary:focus-visible {
    border-color: var(--primary);
    outline: 3px solid rgba(13, 71, 161, 0.2);
    outline-offset: 2px;
}

.application-card-primary:active {
    background: #e5f0fa;
    transform: translateY(1px);
}

.application-card-title {
    color: var(--heading);
    font-size: 19px;
    font-weight: 600;
    line-height: 25px;
    overflow-wrap: anywhere;
}

.application-reference {
    color: var(--muted);
    font-size: 13px;
    overflow-wrap: anywhere;
}

.application-card-primary-cue {
    display: inline-flex;
    gap: 5px;
    align-items: center;
    margin-top: 3px;
    color: var(--primary);
    font-size: 12px;
    font-weight: 600;
}

.application-identity-status {
    margin: 0;
    color: var(--theme-text-secondary, var(--muted));
    font-size: 14px;
}

.application-next-step {
    display: grid;
    gap: 3px;
    margin: 0;
    padding: 11px;
    border-radius: var(--radius);
    background: var(--soft-blue);
    color: var(--muted);
    font-size: 13px;
    line-height: 18px;
}

.application-next-step strong {
    color: var(--primary);
}

.application-facts {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1px;
    margin: 0;
    overflow: hidden;
    border: 1px solid #e9eef4;
    border-radius: var(--radius);
    background: #e9eef4;
}

.application-facts div {
    min-width: 0;
    display: grid;
    gap: 2px;
    padding: 10px 12px;
    background: #fff;
}

.application-facts > div:last-child:nth-child(odd) {
    grid-column: 1 / -1;
}

.application-facts dt {
    color: var(--muted);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.application-facts dd {
    margin: 0;
    color: var(--heading);
    font-size: 14px;
    font-weight: 600;
    overflow-wrap: anywhere;
}

.application-timestamp {
    width: max-content;
    max-width: 100%;
    display: grid;
    gap: 1px;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.application-timestamp-date {
    color: var(--heading);
}

.application-facts dd small {
    display: block;
}

.application-timestamp-time,
.application-timestamp-missing,
.application-facts dd small {
    color: var(--muted);
    font-size: 12px;
    font-weight: 500;
    line-height: 17px;
}

.application-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: auto;
    padding-top: 2px;
    color: var(--muted);
    font-size: 13px;
}

.application-card-actions {
    justify-content: flex-end;
}

.borrower-application-card--customer .application-card-actions .packet-downloads {
    order: 0;
}

.borrower-application-card--customer .application-card-actions {
    margin-left: auto;
}

.application-card-actions .application-meta {
    display: flex;
    align-items: center;
}

.application-card-actions .application-meta > span {
    display: none;
}

.application-card-actions .packet-downloads {
    display: grid;
    flex: 1 0 100%;
    order: 2;
    align-items: start;
}

.application-card-footer:has(.packet-downloads) {
    display: block;
}

.application-card-footer:has(.packet-downloads) > span {
    display: block;
    margin-bottom: 8px;
}

.application-card-actions .packet-downloads > span {
    display: block;
}

.packet-downloads form {
    display: grid;
    gap: 12px;
    margin-top: 12px;
}

.packet-downloads .packet-correction-confirmation {
    display: flex;
    align-items: center;
    gap: 8px;
}

.packet-downloads input[type="checkbox"] {
    width: 18px;
    height: 18px;
    min-height: 18px;
    flex: 0 0 18px;
}

.dashboard-sort-control {
    display: grid;
    grid-template-columns: auto minmax(120px, auto);
    gap: 8px;
    align-items: center;
    color: var(--muted);
    font-size: 13px;
    font-weight: 600;
}

.dashboard-sort-control select {
    min-height: 42px;
    padding: 8px 34px 8px 10px;
}

.dashboard-message-tools {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px 14px;
}

.dashboard-message-list {
    gap: 9px;
}

.dashboard-message-card {
    min-height: 44px;
    gap: 0;
    padding: 0;
    border-left: 4px solid #94a3b8;
    overflow: hidden;
}

.dashboard-message-card.unread {
    background: linear-gradient(90deg, #f3f8fd, #fff 42%);
}

.dashboard-message-card.urgency-overdue {
    border-left-color: var(--danger);
}

.dashboard-message-card.urgency-due_soon,
.dashboard-message-card.urgency-action_required {
    border-left-color: var(--warn);
}

.dashboard-message-card:focus-within {
    outline: 3px solid rgba(13, 71, 161, 0.24);
    outline-offset: 2px;
}

.dashboard-message-toggle {
    position: relative;
    width: 100%;
    min-height: 44px;
    display: grid;
    gap: 8px;
    padding: 15px 76px 15px 16px;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: inherit;
    text-align: left;
    cursor: pointer;
    box-shadow: none;
    transition: background 0.16s ease;
}

.dashboard-message-toggle:hover {
    background: rgba(226, 239, 250, 0.58);
    box-shadow: none;
    transform: none;
}

.dashboard-message-toggle:focus-visible {
    outline: 3px solid rgba(13, 71, 161, 0.24);
    outline-offset: -3px;
}

.dashboard-message-toggle:active {
    background: rgba(205, 225, 243, 0.72);
    transform: none;
}

.dashboard-message-heading {
    align-items: center;
}

.dashboard-message-heading time {
    color: var(--muted);
    font-size: 12px;
    text-align: right;
}

.dashboard-message-subject {
    color: var(--heading);
    font-size: 16px;
    font-weight: 600;
    line-height: 22px;
    overflow-wrap: anywhere;
}

.message-urgency-badge {
    gap: 5px;
}

.dashboard-message-toggle[aria-expanded="true"] .dashboard-message-preview {
    display: none;
}

.dashboard-message-preview {
    display: -webkit-box;
    overflow: hidden;
    color: var(--muted) !important;
    font-size: 14px;
    line-height: 21px !important;
    white-space: normal !important;
    overflow-wrap: anywhere;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.dashboard-message-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 5px 18px;
    color: var(--muted);
    font-size: 12px;
    line-height: 18px;
}

.dashboard-message-meta span {
    overflow-wrap: anywhere;
}

.dashboard-message-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 2px;
}

.dashboard-message-arrow {
    position: absolute;
    right: 16px;
    bottom: 16px;
    display: grid;
    width: 44px;
    height: 44px;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 50%;
    background: var(--theme-bg-interactive);
    color: var(--heading);
    font-size: 1.5rem;
    line-height: 1;
}

.dashboard-message-toggle:hover .dashboard-message-arrow {
    border-color: var(--line-strong);
    background: var(--theme-bg-hover);
}

.dashboard-message-expanded {
    display: grid;
    gap: 12px;
    padding: 15px 16px 17px;
    border-top: 1px solid var(--line);
    background: #fff;
}

.dashboard-message-expanded[hidden] {
    display: none;
}

.dashboard-message-expanded p {
    color: var(--primary-dark);
    font-size: 14px;
    line-height: 1.6;
    overflow-wrap: anywhere;
    white-space: pre-wrap;
}

.dashboard-message-actions button {
    min-height: 40px;
}

.message-action-required {
    color: var(--warn);
}

.dashboard-section-empty {
    grid-column: 1 / -1;
    display: grid;
    gap: 3px;
    padding: 24px;
    border: 1px dashed var(--line-strong);
    border-radius: var(--radius);
    background: var(--soft);
    color: var(--muted);
    text-align: center;
}

.dashboard-section-empty strong {
    color: var(--heading);
}

.dashboard-secondary-action {
    box-shadow: none;
}

.dashboard-destination-highlight {
    outline: 3px solid var(--accent) !important;
    outline-offset: 4px;
    box-shadow: 0 0 0 8px rgba(236, 107, 46, 0.15), 0 12px 28px rgba(15, 45, 82, 0.12) !important;
}

.product-card {
    display: grid;
    gap: 15px;
    padding: 18px;
    position: relative;
    overflow: hidden;
    background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
    transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.product-card::after {
    content: "";
    position: absolute;
    inset: auto 0 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-soft), var(--accent));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.16s ease;
}

.product-card:hover {
    transform: translateY(-2px);
}

.product-card:hover::after,
.product-card.selected::after {
    transform: scaleX(1);
}

.product-card.selected,
.choice-card.selected,
.document-card.selected {
    border-color: var(--primary);
    background: linear-gradient(135deg, #ffffff, #f4f9fe);
    box-shadow: inset 0 0 0 1px var(--primary), 0 14px 32px rgba(13, 71, 161, 0.1);
}

.product-card.selected {
    grid-column: 1 / -1;
}

/* Services are independent destinations; only loan choices expand for terms. */
.service-catalog-active .workspace-status {
    position: static;
}

/* Customer landing pages share open sections and independently framed cards. */
.panel.service-catalog,
.panel.dashboard-panel--customer,
.dashboard-panel--customer .dashboard-applications {
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
}

.service-catalog > .panel-header,
.dashboard-panel--customer > .panel-header {
    padding-bottom: 0;
    border: 0;
}

.service-catalog .product-grid:not(:empty),
.dashboard-panel--customer .dashboard-application-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}

.dashboard-panel--customer .dashboard-layout {
    gap: 24px;
}

.panel.dashboard-panel--customer {
    margin-top: 20px;
}

.dashboard-panel--customer .metric-strip,
.dashboard-panel--customer .dashboard-application-list {
    gap: 20px;
}

.dashboard-panel--customer .dashboard-applications > .dashboard-section-heading {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
}

.dashboard-panel--customer .dashboard-application-tools {
    display: flex;
    flex-wrap: wrap;
    align-items: start;
    justify-content: space-between;
    gap: 12px 20px;
}

.dashboard-panel--customer .dashboard-application-tools .dashboard-filter-bar {
    justify-content: flex-start;
}

.borrower-application-card--customer {
    display: flex;
    flex-direction: column;
    padding: 24px;
}

.borrower-application-card--customer .application-card-heading {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
}

.borrower-application-card--customer .application-card-primary {
    padding: 0;
    border: 0;
}

.borrower-application-card--customer .application-next-step {
    padding: 0;
    background: transparent;
}

.product-card.service-card {
    display: flex;
    flex-direction: column;
    gap: 24px;
    min-width: 0;
    padding: 24px;
    transform: none;
}

.product-card.service-card::after {
    content: none;
}

.service-card h3,
.service-card p {
    overflow-wrap: anywhere;
}

.service-card p.service-card-status {
    margin-top: 12px;
    color: var(--theme-text-secondary, var(--muted));
}

.service-card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: auto;
}

.service-card-actions > button,
.borrower-application-card--customer .customer-card-action {
    min-width: 120px;
    max-width: 100%;
    box-shadow: none;
}

.service-card-feedback {
    flex-basis: 100%;
    min-width: 0;
    overflow-wrap: anywhere;
}

@media (max-width: 700px) {
    .service-catalog .product-grid:not(:empty),
    .dashboard-panel--customer .dashboard-application-list,
    .dashboard-panel--customer .metric-strip {
        grid-template-columns: minmax(0, 1fr);
    }

    .service-card-actions > button,
    .borrower-application-card--customer .customer-card-action {
        width: 100%;
    }

    .dashboard-panel--customer .dashboard-application-tools,
    .dashboard-panel--customer .dashboard-filter-bar,
    .dashboard-panel--customer .dashboard-application-sort,
    .borrower-application-card--customer .application-card-actions {
        width: 100%;
    }

    .borrower-application-card--customer .application-card-footer {
        flex-direction: column;
        align-items: stretch;
    }
}

#branches-content,
#loan-officers-content {
    gap: 12px;
}

#branch-form.customer-selection-actions,
#preferred-loan-officer-form.customer-selection-actions {
    margin-top: 16px;
}

.customer-step-panel > #documents-content ~ :not([hidden]),
.customer-step-panel > [data-final-review] > #review-content ~ :not([hidden]) {
    margin-top: 16px;
}

/* Documents use independent cards instead of a panel around nested panels. */
.portal-theme--borrower .panel[data-step-panel="documents"] {
    background: transparent;
    border: 0;
    box-shadow: none;
    padding: 0;
}

.panel[data-step-panel="documents"] > .panel-header {
    border-bottom: 0;
    padding-bottom: 0;
    margin-bottom: 24px;
}

#documents-content { gap: 24px; }
#documents-content .document-group { gap: 16px; min-width: 0; }
#documents-content .document-group > h3 { margin: 0; }
#documents-content .document-group > .item-list { gap: 16px; }
#documents-content .document-card { padding: 24px; gap: 16px; min-width: 0; }

.portal-theme--borrower #documents-content .document-card:hover:not(.document-invalid) {
    border-color: var(--theme-border-strong, var(--line));
    box-shadow: none;
}

.portal-theme--borrower #documents-content .document-card-body > .item-list > .upload-slot:not(.selected) {
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    padding: 0;
}

.portal-theme--borrower #documents-content .document-card-body > .item-list > .upload-slot + .upload-slot:not(.selected) {
    border-top: 1px solid var(--theme-border, var(--line));
    padding-top: 16px;
}

#documents-content [data-customer-reuse] { display: grid; gap: 8px; }
#documents-content [data-customer-reuse][hidden] { display: none; }
#documents-content [data-customer-reuse] > p { margin: 0; }
#documents-content [data-customer-reuse] > button { justify-self: start; }

@media (max-width: 680px) {
    #documents-content .document-card { padding: 16px; }
    #documents-content { gap: 20px; }
}

.choice-card > div:first-of-type {
    position: relative;
    padding-right: 44px;
}

.customer-choice-check {
    display: none;
    position: absolute;
    top: 0;
    right: 0;
    width: 30px;
    height: 30px;
    place-items: center;
    border: 1px solid var(--theme-success);
    border-radius: 50%;
    color: var(--theme-success);
}

.choice-card.selected .customer-choice-check {
    display: grid;
}

.customer-choice-check svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

#new-payment {
    appearance: textfield;
    -moz-appearance: textfield;
}

#new-payment::-webkit-inner-spin-button,
#new-payment::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

#branch-form,
#preferred-loan-officer-form {
    padding: 16px 18px;
    background: linear-gradient(135deg, #ffffff, #f8fbff);
}

.choice-card.selected button,
.product-card.selected [data-start-selected-loan] {
    box-shadow: var(--shadow-sm);
}

.product-icon {
    width: 52px;
    height: 52px;
    display: grid;
    place-items: center;
    border-radius: var(--radius);
    background: #f1f7fe;
    color: var(--primary);
}

.product-icon svg {
    width: 28px;
    height: 28px;
    display: block;
}

.product-icon path,
.product-icon circle {
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.product-icon--auto {
    background: #e8f4fd;
    color: #0d47a1;
}

.product-icon--personal {
    background: #fff0e8;
    color: #a83f16;
}

.product-icon--loan {
    background: #eef4f9;
    color: #334155;
}

.product-card p,
.choice-card p,
.review-head p,
.offer-summary p {
    color: #3f4f63;
    font-size: 14px;
    line-height: 20px;
}

.product-facts,
.offer-facts,
.slot-meta {
    display: grid;
    gap: 9px;
}

.inline-loan-selection {
    display: grid;
    gap: 16px;
    margin-top: 4px;
    padding: 16px;
    background: linear-gradient(135deg, #ffffff, #f4f9fe);
    border: 1px solid #cfe0f2;
    border-radius: var(--radius);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

.inline-loan-selection__header {
    display: grid;
    gap: 4px;
}

.inline-loan-selection__header strong {
    color: var(--heading);
    font-size: 16px;
    line-height: 24px;
    font-weight: 600;
}

.inline-loan-selection__header span {
    color: var(--muted);
    font-size: 14px;
    line-height: 20px;
}

.inline-loan-fields {
    display: grid;
    grid-template-columns: repeat(3, minmax(170px, 1fr));
    gap: 14px;
}

.product-facts span,
.offer-facts span,
.slot-meta span {
    display: inline-flex;
    gap: 6px;
    align-items: baseline;
    color: #3f4f63;
    font-size: 14px;
    line-height: 20px;
}

.product-facts strong,
.offer-facts strong {
    color: var(--heading);
    font-weight: 600;
}

.document-overview {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 18px 20px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--theme-bg-elevated, var(--panel));
    box-shadow: var(--shadow-sm);
}

.document-overview strong {
    display: block;
    color: var(--heading);
    font-size: 24px;
    line-height: 32px;
    font-weight: 700;
}

.document-overview p {
    color: var(--muted);
    font-size: 14px;
    line-height: 20px;
}

.document-group {
    background: transparent;
    border: 0;
}

.document-group > h3 {
    color: var(--heading);
    font-size: 18px;
    line-height: 26px;
    font-weight: 600;
}

.document-card {
    display: grid;
    gap: 14px;
    padding: 16px;
    background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
}

.document-card.compact {
    padding: 16px;
}

.document-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    padding-bottom: 2px;
}

.document-card-head > div {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.document-mode {
    color: var(--muted);
    font-size: 12px;
    line-height: 16px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.document-requirement-description {
    margin: -4px 0 0;
    color: var(--theme-text-secondary, var(--muted));
    font-size: 14px;
    line-height: 21px;
}

.upload-slot {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 14px;
    align-items: center;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    box-shadow: 0 1px 0 rgba(15, 45, 82, 0.03);
}

.upload-slot.has-thumbnail {
    grid-template-columns: 112px minmax(0, 1fr) auto;
}

.uploaded-document-thumbnail {
    position: relative;
    display: grid;
    width: 112px;
    height: 76px;
    min-height: 76px;
    padding: 0;
    place-items: center;
    overflow: hidden;
    border: 1px solid var(--line-strong);
    border-radius: 10px;
    background:
        linear-gradient(135deg, rgba(27, 95, 145, 0.08), rgba(52, 133, 132, 0.1)),
        var(--soft);
    color: var(--heading);
    box-shadow: none;
    cursor: zoom-in;
}

.uploaded-document-thumbnail:hover,
.uploaded-document-thumbnail:focus-visible {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(27, 95, 145, 0.18);
    transform: none;
}

.uploaded-document-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.uploaded-document-thumbnail-placeholder {
    display: grid;
    gap: 2px;
    place-items: center;
}

.upload-slot .uploaded-document-thumbnail-placeholder strong {
    font-size: 12px;
    letter-spacing: 0.08em;
}

.uploaded-document-thumbnail-placeholder small {
    color: var(--muted);
    font-size: 10px;
    font-weight: 600;
}

.uploaded-document-thumbnail-action {
    position: absolute;
    right: 6px;
    bottom: 6px;
    padding: 4px 7px;
    border-radius: 999px;
    background: rgba(10, 35, 57, 0.88);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    opacity: 0;
    transform: translateY(3px);
    transition: opacity 0.16s ease, transform 0.16s ease;
}

.uploaded-document-thumbnail.has-preview .uploaded-document-thumbnail-action,
.uploaded-document-thumbnail:focus-visible .uploaded-document-thumbnail-action {
    opacity: 1;
    transform: translateY(0);
}

.upload-slot.complete,
.upload-slot.needed {
    border-color: var(--line);
    background: var(--theme-bg-elevated, var(--panel));
}

.identity-capture-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 14px;
    align-items: center;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--theme-bg-elevated, var(--panel));
}

.identity-capture-card strong,
.identity-capture-card p {
    display: block;
}

.identity-capture-card strong {
    margin-top: 6px;
    color: var(--heading);
}

.identity-capture-card p {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 14px;
    line-height: 20px;
}

.upload-slot.selected {
    border-color: var(--primary);
    box-shadow: inset 0 0 0 1px var(--primary);
}

.upload-slot strong,
.upload-slot span,
.upload-slot p {
    display: block;
}

.upload-slot strong {
    color: var(--heading);
    font-size: 15px;
    line-height: 22px;
    font-weight: 600;
}

.upload-slot > div:first-child span,
.upload-slot-main > span,
.upload-slot p {
    color: var(--muted);
    font-size: 14px;
    line-height: 20px;
    overflow-wrap: anywhere;
}

.portal-theme--borrower .document-card-head .badge.document-status-neutral,
.portal-theme--borrower .document-card-head .badge:not(.ok, .warn, .error) {
    color: var(--theme-text-secondary, var(--muted));
    background: var(--theme-bg-inset, var(--soft));
    border-color: var(--theme-border, var(--line));
}

.portal-theme--borrower .slot-action-status.document-status-neutral {
    color: var(--theme-text-secondary, var(--muted));
}

.document-confirmation {
    grid-column: 1 / -1;
    display: grid;
    gap: 16px;
    min-width: 0;
    padding-top: 20px;
    border-top: 1px solid var(--theme-border, var(--line));
}

.document-file-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 12px;
}

@media (max-width: 680px) {
    .upload-slot > .document-file-actions {
        grid-column: 1 / -1;
        align-items: flex-start;
    }
}

.document-confirmation > p:not(.field-error) {
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--theme-text-secondary, var(--muted));
    line-height: 1.5;
}

.document-confirmation > label:not(.check-row) {
    display: grid;
    gap: 8px;
    width: min(100%, 320px);
}

.document-confirmation > .check-row {
    align-items: start;
    margin: 0;
}

.document-confirmation > .check-row span {
    color: var(--theme-text-primary, var(--text));
    line-height: 1.5;
}

.document-confirmation > button {
    justify-self: start;
}

.document-confirmation-complete {
    padding-top: 16px;
}

.document-confirmation-complete strong {
    display: inline;
    margin-right: 6px;
}

.portal-theme--borrower :is(.document-card, .attachment-card) > .identity-capture-card.complete {
    background: transparent;
    border: 0;
    border-top: 1px solid var(--theme-border, var(--line));
    border-radius: 0;
    box-shadow: none;
    padding: 16px 0 0;
}

.document-confirmation > .field-error {
    margin: 0;
    color: var(--theme-danger, var(--danger));
}

.document-processing-state {
    position: relative;
    margin-top: 5px;
    padding-left: 14px;
    color: var(--theme-text-secondary, var(--muted));
    font-size: 12px;
    line-height: 18px;
}

.document-processing-state::before {
    position: absolute;
    top: 6px;
    left: 1px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    content: '';
}

.document-processing-state.ok {
    color: var(--theme-success, var(--ok));
}

.document-processing-state.info {
    color: var(--theme-info, var(--primary));
}

.document-processing-state.warn {
    color: var(--theme-warning, var(--warn));
}

.upload-slot p {
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--theme-bg-inset, var(--soft));
}

.inline-upload-file {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.slot-action-status {
    color: var(--ok);
    font-size: 14px;
    line-height: 20px;
    font-weight: 600;
    text-align: right;
}

.review-card {
    display: grid;
    gap: 16px;
    padding: 20px;
}

.packet-review {
    display: grid;
    gap: 16px;
}

.packet-summary {
    padding: 20px 24px;
}

.review-card.ok,
.review-card.warn {
    border-color: var(--line);
    background: var(--theme-bg-elevated, var(--panel));
}

.review-card.error {
    border-color: #f2aaa4;
    background: linear-gradient(135deg, #ffffff, var(--danger-bg));
}

.review-head,
.offer-summary {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    align-items: flex-start;
}

.review-head > strong {
    color: var(--heading);
    font-size: 24px;
    line-height: 32px;
    font-weight: 700;
    white-space: nowrap;
}

.review-head h3 {
    margin-top: 8px;
    font-size: 20px;
    line-height: 28px;
    font-weight: 600;
}

.review-head p {
    margin-top: 4px;
    line-height: 20px;
}

.packet-summary-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 2px 30px;
}

.attachment-review-panel {
    display: grid;
    gap: 14px;
    padding: 20px;
    background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
}

.attachment-review-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    padding-bottom: 4px;
}

.attachment-review-head h3 {
    font-size: 20px;
    line-height: 28px;
    font-weight: 600;
}

.attachment-review-head p {
    margin-top: 3px;
    color: var(--muted);
    font-size: 14px;
    line-height: 20px;
}

.attachment-list {
    display: grid;
    gap: 12px;
}

.attachment-card {
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr) auto;
    gap: 14px;
    align-items: center;
    padding: 14px;
    box-shadow: 0 1px 0 rgba(15, 45, 82, 0.03);
}

.attachment-card.has-thumbnail {
    grid-template-columns: 112px minmax(0, 1fr) auto;
}

.attachment-card.has-thumbnail .uploaded-document-thumbnail {
    align-self: stretch;
    height: 84px;
    min-height: 84px;
}

.attachment-card.complete,
.attachment-card.needed {
    border-color: var(--line);
    background: var(--theme-bg-elevated, var(--panel));
}

.attachment-card.selected {
    border-color: var(--primary);
    box-shadow: inset 0 0 0 1px var(--primary);
}

.attachment-status-icon {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    background: var(--theme-bg-inset, var(--soft));
    color: var(--theme-text-muted, var(--muted));
    font-size: 11px;
    line-height: 14px;
    font-weight: 700;
}

.attachment-main {
    display: grid;
    gap: 6px;
    min-width: 0;
}

.attachment-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.attachment-title-row h4 {
    margin: 0;
    color: var(--heading);
    font-size: 16px;
    line-height: 24px;
    font-weight: 600;
    overflow-wrap: anywhere;
}

.attachment-main p {
    margin: 0;
    color: var(--text);
    font-size: 14px;
    line-height: 20px;
    font-weight: 500;
    overflow-wrap: anywhere;
}

.attachment-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 12px;
    color: var(--muted);
    font-size: 13px;
    line-height: 18px;
}

.attachment-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.attachment-actions button {
    min-height: 38px;
    padding: 8px 13px;
    font-size: 13px;
    line-height: 18px;
}

.packet-approval-panel {
    margin-top: 0;
    border-color: #cfe1f2;
}

.packet-approval-panel .check-row {
    margin: 10px 0 0;
    padding-top: 14px;
    border-top: 1px solid var(--line);
}

.portal-theme--borrower .panel[data-step-panel="submit"] {
    background: transparent;
    border: 0;
    box-shadow: none;
    padding: 0;
}

.panel[data-step-panel="submit"] > [data-final-review] > .panel-header {
    border-bottom: 0;
    padding-bottom: 0;
    margin-bottom: 24px;
}

#review-content.packet-review { gap: 28px; }
#review-content .packet-summary { padding: 24px; gap: 24px; }
#review-content .packet-summary-grid { gap: 24px 32px; }

#review-content .review-head {
    padding-bottom: 24px;
    border-bottom: 1px solid var(--theme-border, var(--line));
}

#review-content .review-head h3 {
    font-size: 24px;
    line-height: 1.3;
    letter-spacing: -0.025em;
    overflow-wrap: anywhere;
}

#review-content .review-head p {
    margin-top: 8px;
    line-height: 1.6;
    color: var(--theme-text-secondary, var(--muted));
}

#review-content .packet-review-layout {
    display: grid;
    gap: 28px;
    align-items: start;
}

#review-content .packet-review-layout:has(.packet-question-section) {
    grid-template-columns: minmax(0, 1fr) minmax(220px, 0.45fr);
}

#review-content .packet-review-overview {
    order: 2;
    min-width: 0;
    container: review-overview / inline-size;
    padding: 20px;
    border: 1px solid var(--theme-border, var(--line));
    border-radius: 10px;
    background: var(--theme-bg-panel, var(--panel));
}

#review-content .packet-review-overview .packet-summary-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px 24px;
}

#review-content .packet-review-overview .data-row:last-child {
    grid-column: 1 / -1;
    padding-top: 12px;
    border-top: 1px solid var(--theme-border, var(--line));
}

@container review-overview (min-width: 26rem) {
    #review-content .packet-review-overview .packet-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@container review-overview (min-width: 42rem) {
    #review-content .packet-review-overview .packet-summary-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

#review-content .packet-review-sections {
    display: grid;
    gap: 28px;
    min-width: 0;
}

#review-content .packet-review-sections:empty { display: none; }

#review-content .packet-question-section { min-width: 0; }

#review-content .packet-question-section + .packet-question-section {
    padding-top: 24px;
    border-top: 1px solid var(--theme-border, var(--line));
}

#review-content :is(.packet-review-overview, .packet-question-section) > h4 {
    margin: 0 0 20px;
    color: var(--heading);
    font-size: 18px;
    line-height: 1.4;
    font-weight: 600;
    letter-spacing: -0.015em;
    overflow-wrap: anywhere;
}

#review-content .packet-review-wide { grid-column: 1 / -1; min-width: 0; }

#review-content .packet-summary-grid > .data-row,
#review-content .packet-review-wide > .data-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 6px;
    padding: 0;
    border: 0;
    align-content: start;
    min-width: 0;
}

@container review-overview (width < 26rem) {
    #review-content .packet-review-overview .data-row {
        grid-template-columns: minmax(0, 0.75fr) minmax(0, 1.25fr);
        column-gap: 12px;
    }
}

#review-content .data-row > span {
    font-size: 13px;
    line-height: 1.5;
    text-transform: none;
    letter-spacing: normal;
    font-weight: 400;
    overflow-wrap: anywhere;
    color: var(--theme-text-secondary, var(--muted));
}

#review-content .data-row > strong {
    font-size: 16px;
    line-height: 1.6;
    font-weight: 400;
    overflow-wrap: anywhere;
}

.portal-theme--borrower #review-content .attachment-review-panel {
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
    gap: 16px;
}

#review-content .attachment-list { gap: 16px; }
#review-content .attachment-card { padding: 24px; gap: 20px; align-items: start; }
#review-content .attachment-main { gap: 10px; }
#review-content .attachment-title-row { flex-wrap: wrap; }
#review-content .attachment-actions { align-self: start; }
#review-content .attachment-title-row h4 { font-size: 16px; line-height: 1.5; font-weight: 600; }
#review-content .attachment-review-head p { line-height: 1.6; }

.panel[data-step-panel="submit"] > [data-final-review] > .packet-approval-panel {
    margin-top: 28px;
    padding: 24px;
    border-color: var(--theme-border, var(--line));
    background: var(--theme-panel-gradient, var(--panel));
}

.panel[data-step-panel="submit"] .packet-approval-panel .check-row {
    border-top: 0;
    margin-top: 16px;
    padding-top: 0;
}

@media (max-width: 960px) {
    #review-content .packet-review-layout:has(.packet-question-section) { grid-template-columns: minmax(0, 1fr); }
    #review-content .packet-review-overview { order: 0; }
}

@media (max-width: 680px) {
    #review-content .packet-summary,
    #review-content .attachment-card,
    .panel[data-step-panel="submit"] > [data-final-review] > .packet-approval-panel { padding: 20px; }
    #review-content .packet-summary-grid { grid-template-columns: minmax(0, 1fr); gap: 20px; }
    #review-content .packet-review-overview { padding: 16px; }
}

.offer-summary {
    flex-wrap: wrap;
    padding: 20px 22px;
    background: linear-gradient(135deg, #ffffff, #f4f9fe);
    border-color: #cfe1f2;
    box-shadow: var(--shadow-sm);
    container-type: inline-size;
}

.offer-summary.signed {
    background: linear-gradient(135deg, #ffffff, var(--ok-bg));
    border-color: #b9e8cb;
}

.offer-summary h3 {
    margin-top: 8px;
    font-size: 16px;
    font-size: clamp(16px, 6cqi, 28px);
    line-height: 1.3;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    overflow-wrap: normal;
    word-break: normal;
}

.offer-summary p {
    margin-top: 4px;
    line-height: 20px;
}

.offer-summary .offer-facts {
    min-width: min(260px, 100%);
    padding: 12px 14px;
    border: 1px solid #d8e7f5;
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.72);
}

.offer-summary .offer-facts span {
    font-size: 14px;
    line-height: 20px;
}

.offer-timing {
    display: grid;
    flex: 1 0 100%;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 10px;
    padding-top: 16px;
    border-top: 1px solid var(--theme-divider, var(--line));
}

.offer-timing-card {
    display: grid;
    gap: 3px;
    padding: 12px 14px;
    border: 1px solid var(--theme-info-border, #9bc9e8);
    border-radius: var(--radius);
    background: var(--theme-info-bg, #eaf6ff);
}

.offer-timing-card.attention,
.offer-timing-card.warn {
    border-color: var(--theme-warning-border, #e6c66f);
    background: var(--theme-warning-bg, #fff8e8);
}

.offer-timing-card.ok {
    border-color: var(--theme-success-border, #9adbb9);
    background: var(--theme-success-bg, var(--ok-bg));
}

.offer-timing-card > span,
.offer-timing-card > small {
    color: var(--theme-text-secondary, var(--muted));
    font-size: 12px;
    line-height: 17px;
}

.offer-timing-card > span {
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.offer-timing-card > strong {
    color: var(--theme-text-primary, var(--heading));
    font-size: 16px;
    line-height: 23px;
}

.offer-document-summary {
    display: grid;
    gap: 3px;
}

.offer-document-summary span {
    color: var(--theme-text-secondary, var(--muted));
    font-size: 14px;
    line-height: 20px;
    overflow-wrap: anywhere;
}

.offer-verification-details {
    border-top: 1px solid var(--theme-divider, var(--line));
    color: var(--theme-text-secondary, var(--muted));
}

.offer-verification-details > summary {
    padding: 11px 0 3px;
    color: var(--theme-link, var(--primary));
    font-size: 13px;
    line-height: 20px;
    font-weight: 600;
    cursor: pointer;
}

.offer-verification-details[open] > summary {
    margin-bottom: 4px;
}

.offer-verification-card {
    padding: 16px 18px;
}

.offer-verification-card > summary {
    padding: 0;
}

/* The signing card is one of the offer cards, so it follows the same theme surface in light and dark. */
#signature-form {
    padding: 18px;
    border-color: var(--theme-border, var(--line));
    background: var(--theme-panel-gradient, linear-gradient(180deg, #ffffff 0%, #fbfdff 100%));
    color: var(--theme-text-primary, var(--text));
}

#signature-form h3 {
    font-size: 18px;
    line-height: 26px;
    font-weight: 600;
}

.condition-item {
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: linear-gradient(180deg, #ffffff 0%, var(--soft) 100%);
    color: var(--text);
    font-size: 14px;
    line-height: 20px;
}

.kv {
    display: grid;
    grid-template-columns: minmax(120px, 170px) minmax(0, 1fr);
    gap: 9px 14px;
    font-size: 14px;
    line-height: 20px;
}

.kv .muted {
    font-weight: 600;
}

.borrower-servicing {
    display: grid;
    gap: 18px;
    margin-top: 24px;
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: var(--surface);
}

.borrower-servicing-heading,
.borrower-servicing-detail-heading,
.borrower-servicing-card-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
}

.borrower-servicing-heading h3,
.borrower-servicing-detail-heading h4,
.borrower-servicing-result-section h5,
.borrower-servicing-card h4 {
    margin: 0;
    color: var(--text);
}

.borrower-servicing-heading .muted {
    max-width: 760px;
    margin: 4px 0 0;
}

.borrower-servicing-state {
    margin: 0;
}

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

.borrower-servicing-card {
    display: grid;
    min-width: 0;
    gap: 16px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--soft);
}

.borrower-servicing-product {
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.borrower-servicing-badge {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    max-width: 100%;
    min-height: 28px;
    padding: 4px 9px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface);
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
    line-height: 18px;
}

.borrower-servicing-badge.is-success {
    border-color: rgba(14, 123, 90, 0.45);
    color: var(--ok);
}

.borrower-servicing-badge.is-warning {
    border-color: rgba(176, 111, 0, 0.45);
    color: var(--warn);
}

.borrower-servicing-badge.is-error {
    border-color: rgba(181, 48, 48, 0.45);
    color: var(--danger);
}

.borrower-servicing-facts,
.borrower-servicing-result-facts {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin: 0;
}

.borrower-servicing-fact {
    min-width: 0;
}

.borrower-servicing-fact dt {
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
    line-height: 18px;
}

.borrower-servicing-fact dd {
    margin: 2px 0 0;
    color: var(--text);
    font-size: 14px;
    font-weight: 600;
    line-height: 20px;
}

.borrower-servicing-reference {
    overflow-wrap: anywhere;
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    font-size: 12px !important;
}

.borrower-servicing-open,
.borrower-servicing-load-more,
.borrower-servicing-actions button,
.borrower-servicing-statement-form button,
.borrower-servicing-result-section > button {
    min-height: 44px;
}

.borrower-servicing-load-more {
    width: 100%;
    margin-top: 14px;
}

.borrower-servicing-detail {
    display: grid;
    min-width: 0;
    gap: 18px;
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--soft);
}

.borrower-servicing-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.borrower-servicing-statement-form fieldset,
.borrower-servicing-statement-notices,
.offer-decline-panel fieldset {
    display: grid;
    gap: 12px;
    min-width: 0;
    margin: 0;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.borrower-servicing-statement-form legend,
.borrower-servicing-statement-notices legend,
.offer-decline-panel legend {
    padding: 0 6px;
    color: var(--text);
    font-weight: 600;
}

.borrower-servicing-statement-form .muted,
.borrower-servicing-statement-notices .muted {
    margin: 0;
}

.borrower-servicing-statement-list {
    display: grid;
    gap: 8px;
    margin: 0 0 16px;
    padding: 0;
    list-style: none;
}

.borrower-servicing-statement-item {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid var(--line);
}

.borrower-servicing-notice {
    display: flex;
    align-items: center;
    gap: 10px;
}

.borrower-servicing-date-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.borrower-servicing-date-fields label {
    display: grid;
    gap: 6px;
    color: var(--text);
    font-size: 13px;
    font-weight: 600;
}

.borrower-servicing-result,
.borrower-servicing-result-section {
    display: grid;
    min-width: 0;
    gap: 14px;
}

.borrower-servicing-result-section > .muted {
    overflow-wrap: anywhere;
}

.borrower-servicing-result-section:focus {
    outline: 3px solid var(--focus);
    outline-offset: 4px;
}

.borrower-servicing-authority-note {
    margin: 0;
    padding: 12px 14px;
    border-left: 4px solid var(--accent);
    border-radius: 8px;
    background: var(--surface);
    color: var(--muted);
    font-size: 13px;
    line-height: 20px;
}

.borrower-servicing-table-wrap {
    max-width: 100%;
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
}

.borrower-servicing-table-wrap:focus {
    outline: 3px solid var(--focus);
    outline-offset: 2px;
}

.borrower-servicing-table {
    width: 100%;
    min-width: 700px;
    border-collapse: collapse;
    color: var(--text);
    font-size: 13px;
}

.borrower-servicing-table th,
.borrower-servicing-table td {
    padding: 11px 12px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
    overflow-wrap: anywhere;
}

.borrower-servicing-table th {
    background: var(--soft);
    color: var(--muted);
    font-size: 12px;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.borrower-servicing-table tbody tr:last-child td {
    border-bottom: 0;
}

/* The offer's payment schedule has four columns, so it does not need the servicing tables' wide minimum. */
.offer-payment-schedule-title {
    margin: 0;
    color: var(--heading);
    font-size: 16px;
    line-height: 24px;
    font-weight: 600;
}

.borrower-servicing-table.offer-payment-schedule {
    min-width: 440px;
    font-variant-numeric: tabular-nums;
}

.offer-payment-schedule :is(th, td) {
    white-space: nowrap;
    overflow-wrap: normal;
}

.offer-payment-schedule :is(th, td):not(:first-child) {
    text-align: right;
}

.offer-payment-schedule td small {
    display: block;
    color: var(--muted);
    font-size: 12px;
    line-height: 16px;
    white-space: normal;
}

@media (max-width: 980px) {
    .featured-offer,
    .apply-entry-shell {
        grid-template-columns: 1fr;
    }

    .featured-offer-side {
        border-left: 0;
        border-top: 1px solid rgba(255, 255, 255, 0.13);
    }

    .portal-shell {
        grid-template-columns: 1fr;
    }

    .metric-strip {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .dashboard-layout .metric-strip,
    .dashboard-application-list {
        grid-template-columns: 1fr;
    }

    .borrower-servicing-card-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-section-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .dashboard-application-tools,
    .dashboard-application-tools .dashboard-filter-bar {
        width: 100%;
        justify-items: stretch;
        justify-content: flex-start;
    }

    .dashboard-application-sort {
        justify-content: flex-start;
    }

    .dashboard-attention-banner {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .dashboard-attention-banner > button {
        grid-column: 1 / -1;
        width: 100%;
    }

    .application-card,
    .dashboard-action-card,
    .dashboard-submission-confirmation,
    .choice-card,
    .attachment-card,
    .upload-slot,
    .identity-capture-card {
        grid-template-columns: 1fr;
    }

    .attachment-status-icon {
        display: none;
    }

    .attachment-actions {
        justify-content: flex-start;
    }

    .upload-actions {
        justify-content: flex-start;
    }

    .upload-slot.has-thumbnail {
        grid-template-columns: 96px minmax(0, 1fr);
    }

    .attachment-card.has-thumbnail {
        grid-template-columns: 96px minmax(0, 1fr);
    }

    .uploaded-document-thumbnail {
        width: 96px;
        height: 72px;
        min-height: 72px;
    }

    .upload-slot.has-thumbnail > .upload-actions,
    .upload-slot.has-thumbnail > .slot-action-status,
    .upload-slot.has-thumbnail > .document-file-actions {
        grid-column: 2;
    }

    .attachment-card.has-thumbnail > .attachment-actions {
        grid-column: 2;
    }

    .slot-action-status {
        text-align: left;
    }

    .progress-panel {
        position: static;
    }

    .steps {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .auth-layout {
        min-height: 0;
    }
}

@media (max-width: 680px) {
    .workspace-status {
        top: 78px;
    }

    .borrower-servicing {
        margin-top: 18px;
        padding: 14px;
    }

    .borrower-servicing-heading,
    .borrower-servicing-detail-heading,
    .borrower-servicing-card-heading {
        align-items: stretch;
        flex-direction: column;
    }

    .borrower-servicing-heading > button,
    .borrower-servicing-detail-heading > button,
    .borrower-servicing-actions,
    .borrower-servicing-actions button,
    .borrower-servicing-statement-form button,
    .borrower-servicing-result-section > button {
        width: 100%;
    }

    .borrower-servicing-facts,
    .borrower-servicing-result-facts,
    .borrower-servicing-date-fields {
        grid-template-columns: 1fr;
    }

    .borrower-servicing-detail,
    .borrower-servicing-card {
        padding: 14px;
    }

    .landing-hero {
        padding: 52px 18px 58px;
    }

    .landing-hero h1 {
        font-size: 34px;
    }

    .landing-hero p:not(.landing-kicker) {
        font-size: 16px;
    }

    .featured-offer-band,
    .landing-section,
    .landing-cta-band,
    .apply-entry-wrap {
        padding-left: 14px;
        padding-right: 14px;
    }

    .featured-offer-main,
    .featured-offer-side,
    .apply-entry-main,
    .apply-entry-side {
        padding: 18px;
    }

    .loan-types-row,
    .steps-row {
        grid-template-columns: 1fr;
    }

    .app-header {
        align-items: center;
        gap: 10px;
        padding: 10px 16px;
    }

    .header-actions {
        flex: 1 1 auto;
        gap: 6px;
        align-items: center;
        justify-content: flex-end;
    }

    .public-app-header {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .public-session-row {
        justify-content: stretch;
    }

    .public-session-indicator {
        width: 100%;
        justify-content: flex-start;
        border-radius: var(--radius);
    }

    .public-session-copy {
        flex: 1 1 100%;
    }

    .public-session-message {
        text-align: left;
    }

    .header-actions .badge {
        min-height: 24px;
        padding: 3px 8px;
        font-size: 11px;
    }

    .header-actions .badge:not(.developer-badge) {
        order: 2;
    }

    .developer-badge {
        order: 3;
    }

    .account-menu {
        order: 1;
        grid-template-columns: auto;
        padding: 4px;
        box-shadow: 0 8px 18px rgba(15, 45, 82, 0.08);
    }

    .account-trigger {
        grid-template-columns: 32px 8px;
        min-height: 32px;
        gap: 8px;
    }

    .account-avatar {
        width: 32px;
        height: 32px;
    }

    .account-copy {
        display: none;
    }

    .account-action {
        display: none;
    }

    .account-chevron {
        display: block;
    }

    .app-header.is-compact {
        gap: 8px;
        padding: 6px 10px;
        background: rgba(255, 255, 255, 0.96);
        box-shadow: 0 8px 22px rgba(15, 45, 82, 0.12);
    }

    .app-header.is-compact .brand-mark {
        width: 42px;
        height: 32px;
    }

    .app-header.is-compact .brand-copy {
        opacity: 0;
        width: 0;
        overflow: hidden;
    }

    .app-header.is-compact .header-actions .badge {
        display: none;
    }

    .app-header.is-compact .account-menu {
        gap: 6px;
        padding: 3px;
        box-shadow: none;
    }

    .app-header.is-compact .account-trigger {
        grid-template-columns: 30px 8px;
        min-height: 30px;
        gap: 7px;
    }

    .app-header.is-compact .account-avatar {
        width: 30px;
        height: 30px;
    }

    .brand-mark {
        width: 54px;
        height: 42px;
    }

    .brand-copy span {
        display: none;
    }

    .portal-hero,
    .portal-shell {
        width: min(100% - 20px, 1180px);
    }

    .application-progress-strip {
        padding: 0 0 10px;
    }

    .application-progress-strip p {
        display: block;
    }

    .application-progress-strip ol {
        display: none;
    }

    .portal-hero {
        padding: 16px;
        margin-top: 14px;
        gap: 14px;
    }

    .document-camera-dialog,
    .identity-document-dialog,
    .saved-document-preview-dialog {
        width: 100vw;
        max-width: 100vw;
        max-height: 100vh;
        max-height: 100dvh;
        margin: 0;
    }

    .document-camera-panel,
    .identity-document-panel {
        min-height: 100vh;
        min-height: 100dvh;
        border-radius: 0;
        padding: 14px;
        align-content: start;
    }

    .saved-document-preview-panel {
        min-height: 100dvh;
        max-height: 100dvh;
        border-radius: 0;
        padding: 12px;
    }

    .saved-document-preview-stage,
    .saved-document-preview-stage img {
        max-height: calc(100dvh - 190px);
    }

    .document-camera-stage {
        min-height: 220px;
        aspect-ratio: 3 / 4;
    }

    .document-camera-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: 100%;
    }

    .document-camera-primary-action {
        grid-column: 1 / -1;
    }

    .document-camera-quality ul,
    .upload-actions {
        display: grid;
        grid-template-columns: 1fr;
        width: 100%;
    }

    .document-camera-actions button,
    .upload-actions button {
        width: 100%;
    }

    .upload-slot.has-thumbnail {
        grid-template-columns: 1fr;
    }

    .attachment-card.has-thumbnail {
        grid-template-columns: 1fr;
    }

    .uploaded-document-thumbnail {
        width: 100%;
        height: 156px;
    }

    .attachment-card.has-thumbnail .uploaded-document-thumbnail {
        height: 180px;
    }

    .upload-slot.has-thumbnail > .upload-actions,
    .upload-slot.has-thumbnail > .slot-action-status,
    .upload-slot.has-thumbnail > .document-file-actions {
        grid-column: 1;
    }

    .attachment-card.has-thumbnail > .attachment-actions {
        grid-column: 1;
    }

    h1 {
        font-size: 24px;
    }

    .hero-copy {
        font-size: 14px;
    }

    .trust-strip {
        display: none;
    }

    .progress-heading {
        display: none;
    }

    .split,
    .inline-loan-fields,
    .kv,
    .identity-grid {
        grid-template-columns: 1fr;
    }

    .metric-strip,
    .data-row,
    .document-overview,
    .review-head,
    .packet-summary-grid,
    .attachment-review-head,
    .offer-summary {
        grid-template-columns: 1fr;
        display: grid;
    }

    .dashboard-panel {
        padding: 14px;
    }

    .dashboard-panel-header {
        align-items: stretch;
    }

    .dashboard-panel-header > button {
        width: 100%;
        min-height: 44px;
    }

    .dashboard-layout .metric-strip {
        grid-template-columns: 1fr;
    }

    .dashboard-applications,
    .dashboard-messages {
        padding: 14px;
    }

    .dashboard-filter-bar {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: 100%;
    }

    .dashboard-filter-button {
        min-height: 44px;
        padding: 8px;
        white-space: normal;
    }

    .dashboard-message-tools {
        width: 100%;
        justify-content: stretch;
    }

    .dashboard-application-sort {
        display: grid;
        grid-template-columns: 1fr;
        width: 100%;
    }

    .dashboard-message-tools .dashboard-filter-bar {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .application-card-heading,
    .application-facts {
        grid-template-columns: 1fr;
    }

    .application-card-primary {
        width: 100%;
    }

    .application-card-footer,
    .application-card-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .application-card-actions,
    .application-card-actions button,
    .application-card-actions .application-meta,
    .application-card-actions .application-meta button {
        width: 100%;
        min-height: 44px;
    }

    .dashboard-sort-control {
        grid-template-columns: 1fr;
        width: 100%;
    }

    .dashboard-sort-control select {
        width: 100%;
        min-height: 44px;
    }

    .dashboard-message-heading,
    .dashboard-message-meta {
        align-items: flex-start;
        flex-direction: column;
    }

    .dashboard-message-heading time {
        text-align: left;
    }

    .dashboard-message-card {
        min-height: 44px;
        overflow-wrap: anywhere;
    }

    .dashboard-message-toggle {
        min-height: 44px;
    }

    .dashboard-message-actions,
    .dashboard-message-actions button {
        width: 100%;
    }

    .dashboard-secondary-action {
        grid-template-columns: 1fr;
    }

    .dashboard-secondary-action button {
        width: 100%;
        min-height: 44px;
    }

    .saved-documents-heading,
    .saved-document-row {
        padding: 16px;
    }

    .saved-document-preview-actions {
        align-items: flex-start;
        flex-direction: column;
    }

    .saved-document-preview-actions button {
        width: 100%;
    }

    .packet-summary {
        padding: 16px;
    }

    .attachment-review-panel {
        padding: 16px;
    }

    .attachment-title-row {
        align-items: flex-start;
        flex-direction: column;
        gap: 6px;
    }

    .steps {
        display: flex;
        overflow-x: auto;
        padding-bottom: 4px;
        scroll-snap-type: x proximity;
    }

    .step {
        flex: 0 0 174px;
        scroll-snap-align: start;
    }

    .panel {
        padding: 16px;
    }

    .auth-panel {
        padding: 0;
    }

    .auth-panel .panel-header,
    .auth-flow-heading,
    .auth-card,
    .verification-card {
        padding: 18px;
    }

    .card.auth-card,
    .card.verification-card {
        padding: 0 18px 8px;
    }

    .auth-flow-heading h1,
    .auth-flow-heading h3 {
        font-size: 21px;
    }

    .borrower-app.auth-focused .portal-shell.auth-only {
        width: min(100% - 20px, 760px);
        margin-top: 16px;
    }

    .borrower-app.auth-focused .auth-layout {
        padding-bottom: 20px;
    }

    .auth-layout {
        padding: 18px 12px 24px;
    }

    .auth-mode-switch {
        margin-right: 18px;
        margin-left: 18px;
    }

    .auth-inline-status,
    .customer-identity-entry,
    .auth-code-heading {
        margin-right: 18px;
        margin-left: 18px;
    }

    .auth-phone-grid {
        grid-template-columns: 1fr;
    }

    .auth-privacy-note,
    .auth-alternate-action {
        margin-right: 18px;
        margin-left: 18px;
    }

    .panel-header {
        display: grid;
    }
}

.document-reminder-preferences {
    display: grid;
    gap: 16px;
    margin-top: 24px;
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: var(--panel);
    color: var(--text);
}

.document-reminder-preferences-heading,
.document-reminder-contact-heading,
.offer-decline-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.document-reminder-preferences-heading h3,
.document-reminder-contact-heading h2,
.offer-decline-heading h2 {
    margin: 0;
}

.document-reminder-preferences-form,
.document-reminder-contact-panel,
.offer-decline-panel {
    display: grid;
    gap: 16px;
}

.document-reminder-channel-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.document-reminder-channel {
    display: grid;
    align-content: start;
    gap: 12px;
    min-width: 0;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 14px;
}

.document-reminder-channel p {
    margin: 5px 0 8px;
    overflow-wrap: anywhere;
}

.document-reminder-privacy-note {
    margin: 0;
    color: var(--muted, #5f6f7f);
}

.portal-theme--borrower .panel[data-step-panel="reminders"] {
    background: transparent;
    border: 0;
    box-shadow: none;
    padding: 0;
}

.panel[data-step-panel="reminders"] > .panel-header {
    border-bottom: 0;
    padding-bottom: 0;
    margin-bottom: 24px;
}

.panel[data-step-panel="reminders"] .document-reminder-preferences {
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    gap: 24px;
}

.panel[data-step-panel="reminders"] .document-reminder-preferences-heading {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

.panel[data-step-panel="reminders"] .document-reminder-preferences-heading .eyebrow {
    display: none;
}

.panel[data-step-panel="reminders"] .document-reminder-preferences-heading > button {
    width: auto;
}

.panel[data-step-panel="reminders"] .document-reminder-preferences-form,
.panel[data-step-panel="reminders"] .document-reminder-channel-grid {
    gap: 24px;
}

.panel[data-step-panel="reminders"] .document-reminder-channel {
    padding: 24px;
    gap: 16px;
    border-radius: 12px;
    background: var(--theme-panel-gradient, var(--panel));
}

.panel[data-step-panel="reminders"] .document-reminder-channel > button {
    justify-self: start;
}

.panel[data-step-panel="reminders"] .document-reminder-privacy-note {
    max-width: 72ch;
    line-height: 1.6;
}

.panel[data-step-panel="reminders"] > .page-action-bar {
    margin-top: 16px;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
}

@media (max-width: 680px) {
    .panel[data-step-panel="reminders"] .document-reminder-channel {
        padding: 20px;
    }

    .panel[data-step-panel="reminders"] .document-reminder-channel-grid {
        gap: 16px;
    }

}

.document-reminder-contact-dialog,
.offer-decline-dialog {
    width: min(620px, calc(100vw - 32px));
    border: 0;
    border-radius: 18px;
    padding: 0;
    background: var(--panel);
    color: var(--text);
    box-shadow: var(--shadow-lg);
}

.document-reminder-contact-dialog::backdrop,
.offer-decline-dialog::backdrop {
    background: var(--theme-overlay);
}

.document-reminder-contact-panel,
.offer-decline-panel {
    padding: 24px;
}

/* Reasons are easy to tap on a phone. */
.offer-decline-panel .check-row {
    align-items: center;
    min-height: 44px;
    margin: 0;
}

@media (max-width: 680px) {
    .session-bootstrap-screen {
        min-height: calc(100vh - 70px);
        padding: 32px 16px 48px;
    }

    .session-bootstrap-card {
        padding: 30px 22px;
    }

    .submission-progress-screen {
        padding: 16px;
    }

    .submission-progress-card {
        padding: 30px 22px;
    }

    .document-reminder-channel-grid {
        grid-template-columns: 1fr;
    }

    .document-reminder-preferences-heading,
    .document-reminder-contact-heading {
        display: grid;
    }

    .document-reminder-preferences-heading > button {
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .session-bootstrap-spinner {
        animation: none;
    }

    button,
    .loan-type-tile,
    .loan-type-tile::after,
    .product-card,
    .product-card::after {
        transition: none;
    }

    .borrower-application-card,
    .application-card-primary,
    .dashboard-message-card,
    .dashboard-message-toggle,
    .dashboard-metric {
        scroll-behavior: auto;
        transition: none;
    }

    button:hover,
    .loan-type-tile:hover,
    .product-card:hover {
        transform: none;
    }
}
.borrower-servicing-document-list,
.borrower-servicing-document-versions {
    display: grid;
    gap: 12px;
}

.borrower-servicing-document-card,
.borrower-servicing-document-version {
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--panel, #fff);
}

.borrower-servicing-document-version {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.borrower-servicing-document-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.borrower-servicing-document-card > .servicing-capture,
.borrower-servicing-document-card > .borrower-servicing-upload { margin-top: 14px; }
.borrower-servicing-upload { margin-bottom: 16px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--theme-bg-panel, var(--panel, #fff)); }
.borrower-servicing-upload summary { min-height: 44px; padding: 10px 0; font-weight: 700; cursor: pointer; }
.borrower-servicing-upload-form { display: grid; gap: 14px; }
.borrower-servicing-upload-form label { display: grid; gap: 6px; font-weight: 700; }
.borrower-servicing-upload-form :is(input, select) { width: 100%; min-width: 0; min-height: 44px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--theme-bg-panel, var(--panel, #fff)); color: var(--theme-text-primary, var(--text)); font: inherit; }

.borrower-servicing-document-actions a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 8px 12px;
    border: 1px solid var(--theme-control-primary-bg, var(--accent));
    border-radius: 10px;
    background: var(--theme-control-primary-bg, var(--accent));
    color: var(--theme-control-primary-text, #fff);
    font-weight: 700;
    text-decoration: none;
}

.borrower-servicing-document-actions a:hover {
    border-color: var(--theme-control-primary-hover, var(--accent-dark));
    background: var(--theme-control-primary-hover, var(--accent-dark));
}

.borrower-servicing-document-actions a.secondary {
    border-color: var(--theme-border, var(--line));
    background: var(--theme-control-secondary-bg, var(--panel));
    color: var(--theme-control-secondary-text, var(--text));
}

.borrower-servicing-document-actions a.secondary:hover {
    border-color: var(--theme-border-strong, var(--line));
    background: var(--theme-control-secondary-hover, var(--soft));
}

@media (max-width: 680px) {
    .borrower-servicing-document-version {
        align-items: stretch;
        flex-direction: column;
    }
}

/* The identity handoff is one focused step, before final signature and submission. */
[data-final-review][hidden], .final-identity-panel[hidden] { display: none !important; }
.online-identity-panel { max-width: 48rem; margin-inline: auto; gap: 1.5rem; }
.online-identity-panel h2:focus, #workflow-review-heading:focus { outline: none; }
.identity-result { padding: 1rem 1.25rem; border-radius: .75rem; background: var(--theme-bg-elevated); line-height: 1.6; }
.identity-result--verified::before { content: '✓'; margin-right: .65rem; color: var(--theme-success, #39a87b); }
.identity-result--loading::before { content: ''; display: inline-block; width: .85rem; height: .85rem; margin-right: .65rem; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: session-bootstrap-spin 1s linear infinite; }
.identity-consent { padding-block: .25rem; }
.identity-choices { border: 0; padding: 0; margin: 0; min-width: 0; }
.identity-choices[hidden], .identity-consent[hidden] { display: none !important; }
.identity-choices legend { margin-bottom: .75rem; font-weight: 600; }
.identity-choice { display: flex; align-items: flex-start; gap: .75rem; padding: 1rem; margin: .25rem 0; border-radius: .75rem; cursor: pointer; color: var(--theme-text-primary); font-size: .95rem; font-weight: 400; line-height: 1.5; }
.identity-choice:hover, .identity-choice:has(input:checked) { background: var(--theme-bg-elevated); }
.identity-choice:focus-within { outline: 2px solid var(--theme-focus-ring, #80baff); outline-offset: 2px; }
.identity-choice input[type="radio"] { flex: 0 0 auto; width: 1rem; height: 1rem; min-height: 1rem; padding: 0; margin: .2rem 0 0; border: 0; background: transparent; box-shadow: none; }
.identity-choice span { display: block; }
.identity-choice .muted { margin-top: .3rem; font-size: .9rem; line-height: 1.5; }
.identity-choices .identity-consent { margin: .5rem 1rem 1.25rem 2.75rem; font-size: .9rem; line-height: 1.6; }
.identity-next-step { font-size: .9rem; line-height: 1.6; }
@media (prefers-reduced-motion: reduce) { .identity-result--loading::before { animation: none; } }

/* Loan marketplace: market choice before the Loan step. */
.market-selector {
    margin: 0;
    padding: 0;
    border: 0;
}

.market-selector legend {
    margin-bottom: 12px;
    color: var(--heading);
    font-size: 1.15rem;
    font-weight: 700;
}

.market-selector__choices {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
}

.portal-theme .market-choice {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 56px;
    padding: 12px 16px;
    border: 1px solid var(--theme-border-strong, var(--line-strong));
    border-radius: var(--radius);
    background: var(--theme-control-secondary-bg, var(--panel));
    color: var(--theme-control-secondary-text, var(--text));
    font-weight: 600;
    text-align: left;
}

.portal-theme .market-choice:hover,
.portal-theme .market-choice:focus-visible {
    border-color: color-mix(in srgb, var(--theme-brand-strong, var(--primary)) 40%, transparent);
    background: var(--theme-brand-soft, var(--soft-blue));
    color: var(--theme-brand-strong, var(--primary));
}

.market-flag {
    flex: none;
    width: 36px;
    height: 24px;
    object-fit: cover;
    border: 1px solid var(--line);
    border-radius: 3px;
}

.market-selected {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 12px;
}

/* Marketplace Loan step: one frame (the page panel), quiet controls, brand-blue primary action. */
.market-loan {
    grid-column: 1 / -1;
    display: grid;
    gap: 24px;
}

.market-loan__head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px 20px;
}

.market-loan__title { display: flex; align-items: center; gap: 14px; min-width: 0; }
.market-loan__title h3 { margin: 0; font-size: 1.125rem; font-weight: 600; line-height: 1.3; }
.market-loan__title p { margin: 2px 0 0; color: var(--theme-text-muted, var(--muted)); font-size: .9rem; }

.market-loan__icon {
    display: grid;
    place-items: center;
    flex: none;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: var(--theme-brand-soft, var(--soft-blue));
    color: var(--theme-brand-strong, var(--primary));
}

.market-loan__icon svg { width: 24px; height: 24px; display: block; }
.market-loan__icon :is(path, circle) { fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

.market-loan__place {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 4px 4px 4px 10px;
    border: 1px solid var(--theme-border, var(--line));
    border-radius: 999px;
    color: var(--theme-text-secondary, var(--muted));
    font-size: .9rem;
}

.market-loan__place .market-flag { width: 24px; height: 16px; border-radius: 2px; }
.market-loan__place strong { color: var(--theme-text-primary, var(--heading)); font-weight: 600; }

.portal-theme .market-loan .market-loan__change {
    min-height: 0;
    padding: 4px 12px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--theme-link, var(--primary));
    font-size: .875rem;
    font-weight: 500;
    box-shadow: none;
    transform: none;
}

.portal-theme .market-loan .market-loan__change:hover { background: var(--theme-brand-soft, var(--soft-blue)); }

.market-loan__form { display: grid; gap: 22px; }
.market-loan__field { display: grid; gap: 8px; margin: 0; min-width: 0; }
.portal-theme .market-loan__field > label,
.portal-theme .market-loan__terms legend { padding: 0; font-size: 1rem; line-height: 1.4; font-weight: 500; color: var(--theme-text-primary, var(--heading)); }
.market-loan__terms { border: 0; padding: 0; }
.market-loan__terms legend { margin-bottom: 8px; }

.market-loan__money {
    display: flex;
    align-items: center;
    max-width: 360px;
    border: 1px solid var(--theme-border-strong, var(--theme-border, var(--line)));
    border-radius: 10px;
    background: var(--theme-bg-input, var(--panel));
    transition: border-color .15s ease, box-shadow .15s ease;
}

.market-loan__money:focus-within {
    border-color: var(--theme-brand, var(--primary));
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--theme-brand, var(--primary)) 18%, transparent);
}

.market-loan__money.has-error { border-color: var(--theme-danger, #b42318); }
.market-loan__currency { padding: 0 4px 0 14px; color: var(--theme-text-muted, var(--muted)); font-weight: 500; }
.market-loan__money input,
.market-loan__money input:focus {
    flex: 1;
    min-width: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
    outline: none;
    font-size: 1.125rem;
    font-weight: 500;
}

.market-loan__hint { margin: 0; color: var(--theme-text-muted, var(--muted)); font-size: .875rem; }

.market-loan__chips { display: flex; flex-wrap: wrap; gap: 8px; }
.market-loan__chip { position: relative; }
.market-loan__chip input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.market-loan__chip span,
.portal-theme .market-loan select.market-loan__other {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 0 16px;
    border: 1px solid var(--theme-border, var(--line));
    border-radius: 999px;
    background: var(--theme-bg-panel, var(--panel));
    color: var(--theme-text-primary, var(--heading));
    font-size: .95rem;
    font-weight: 500;
    transition: border-color .15s ease, background-color .15s ease;
}

.portal-theme .market-loan select.market-loan__other { width: auto; padding-right: 36px; }
.market-loan__chip:hover span { border-color: var(--theme-border-strong, var(--theme-brand, var(--primary))); }
.market-loan__chip input:checked + span,
.portal-theme .market-loan select.market-loan__other.is-chosen {
    border-color: var(--theme-brand, var(--primary));
    background: var(--theme-brand-soft, var(--soft-blue));
    color: var(--theme-brand-strong, var(--primary));
}

.market-loan__chip input:focus-visible + span { outline: 2px solid var(--theme-brand, var(--primary)); outline-offset: 2px; }
.market-loan__terms.has-error .market-loan__chip span,
.market-loan__terms.has-error select.market-loan__other { border-color: var(--theme-danger, #b42318); }

.market-loan__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 12px 16px;
    padding-top: 20px;
    border-top: 1px solid var(--theme-border, var(--line));
}

.market-loan__summary { margin: 0 auto 0 0; color: var(--theme-danger, #b42318); font-size: .9rem; font-weight: 500; }

/* Brand blue for each step's forward action; other buttons keep the calm slate default. */
.portal-theme--borrower button.workflow-forward,
.portal-theme--borrower .market-loan button[data-select-offering] {
    --theme-control-primary-bg: var(--theme-brand, #0d47a1);
    --theme-control-primary-hover: var(--theme-brand-strong, #0b326f);
    --theme-control-primary-pressed: var(--theme-brand-strong, #0b326f);
    min-width: 160px;
    font-weight: 600;
}

:root[data-theme="dark"] .portal-theme--borrower button.workflow-forward,
:root[data-theme="dark"] .portal-theme--borrower .market-loan button[data-select-offering] {
    --theme-control-primary-bg: #2f5f9e;
    --theme-control-primary-hover: #3a6fb3;
    --theme-control-primary-pressed: #284f84;
    --theme-control-primary-text: #f8fafc;
}

@media (max-width: 640px) {
    .market-loan { gap: 20px; }
    .market-loan__money { max-width: none; }
    .market-loan__actions > button { width: 100%; }
    .market-loan__summary { flex-basis: 100%; }
}

.market-how {
    display: grid;
    gap: 12px;
    margin-top: 18px;
    padding: 16px 18px;
    border: 1px solid var(--theme-border, var(--line));
    border-radius: 14px;
    background: var(--theme-bg-inset, var(--soft));
}

.market-how__heading { display: flex; align-items: center; gap: 8px; }
.market-how__heading h3 { margin: 0; font-size: 1rem; font-weight: 600; }
.market-how__steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr));
    gap: 12px;
    margin: 0;
    padding: 0;
    list-style: none;
    counter-reset: market-step;
}

.market-how__steps li { display: grid; gap: 2px; padding-left: 36px; position: relative; counter-increment: market-step; }
.market-how__steps li::before {
    content: counter(market-step);
    position: absolute;
    left: 0;
    top: 0;
    display: grid;
    place-items: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--theme-brand-soft, var(--soft-blue));
    color: var(--theme-brand-strong, var(--primary));
    font-size: .85rem;
    font-weight: 600;
}

.market-how__steps strong { font-weight: 600; }
.market-how__steps span { color: var(--theme-text-muted, var(--muted)); font-size: .92rem; }

/* Loan marketplace: offer preferences and received offers. Quiet cards, medium weights, muted labels. */
.marketplace-panel {
    display: grid;
    gap: 14px;
    margin: 16px 0;
    padding: 20px;
    border: 1px solid var(--theme-border, var(--line));
    border-radius: 14px;
    background: var(--theme-bg-panel, var(--panel));
}

.marketplace-panel h3 { margin: 0; font-size: 1.05rem; font-weight: 600; }
.marketplace-panel p { margin: 0; }
.marketplace-preferences { display: grid; gap: 18px; }
.marketplace-choices { display: grid; gap: 8px; margin: 0; padding: 0; border: 0; min-width: 0; }
.marketplace-choices legend { margin-bottom: 6px; font-weight: 600; color: var(--theme-text-primary, var(--heading)); }
.marketplace-choices > p { margin: -2px 0 4px; }
.marketplace-titled { display: flex; align-items: center; gap: 8px; }
.marketplace-intro { display: flex; align-items: center; gap: 8px; color: var(--theme-text-muted, var(--muted)); }
.portal-theme .marketplace-panel .marketplace-option {
    margin: 0;
    padding: 10px 12px;
    border: 1px solid var(--theme-border, var(--line));
    border-radius: 10px;
    background: var(--theme-bg-inset, var(--soft));
    font-weight: 400;
}
.marketplace-option:has(input:checked) {
    border-color: color-mix(in srgb, var(--theme-brand-strong, var(--primary)) 40%, transparent);
    background: var(--theme-brand-soft, var(--soft-blue));
}

.marketplace-offers {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
    gap: 14px;
}

.marketplace-offer {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 18px;
    border: 1px solid var(--theme-border, var(--line));
    border-radius: 14px;
    background: var(--theme-bg-elevated, var(--panel));
    min-width: 0;
    overflow-wrap: anywhere;
}

.marketplace-offer h4 { margin: 0; font-size: 1rem; font-weight: 600; }
.marketplace-offer-title { display: flex; align-items: center; gap: 10px; }
.marketplace-icon { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.marketplace-icon-badge { display: inline-grid; place-items: center; width: 32px; height: 32px; flex: none; border-radius: 9px; color: var(--theme-brand-strong, var(--primary)); background: var(--theme-brand-soft, var(--soft-blue)); }
.marketplace-panel .has-icon { display: inline-flex; align-items: center; gap: 8px; }
.marketplace-panel p.has-icon, .marketplace-panel strong.has-icon { display: flex; }
.marketplace-status strong .marketplace-icon { color: var(--theme-brand-strong, var(--primary)); }
.marketplace-empty { display: grid; justify-items: center; gap: 8px; padding: 22px 12px; border: 1px dashed var(--theme-border, var(--line)); border-radius: 12px; text-align: center; }
.marketplace-empty-icon { width: 30px; height: 30px; fill: none; stroke: var(--theme-text-muted, var(--muted)); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; opacity: .7; }
.marketplace-instalment { margin: 0; padding: 12px 14px; border-radius: 10px; background: var(--theme-brand-soft, var(--soft-blue)); color: var(--theme-brand-strong, var(--primary)); }
.marketplace-instalment strong { font-size: 1.4rem; font-weight: 600; letter-spacing: -.01em; }
.marketplace-terms { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 14px; margin: 0; }
.marketplace-terms dt { font-size: .78rem; color: var(--theme-text-muted, var(--muted)); }
.marketplace-terms dd { margin: 2px 0 0; font-weight: 400; }
.marketplace-note { padding-top: 10px; border-top: 1px solid var(--theme-divider, var(--line)); }
.marketplace-note strong { display: block; font-size: .78rem; font-weight: 500; color: var(--theme-text-muted, var(--muted)); }
.marketplace-note p { margin: 2px 0 0; white-space: pre-line; }
.marketplace-respond { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; }
.marketplace-respond button { flex: 1 1 auto; }
.marketplace-confirm-dialog { width: min(460px, calc(100vw - 32px)); }
.marketplace-confirm-dialog h3 { margin: 0; }
.marketplace-confirm-dialog p { margin: 0; }
.marketplace-shared-list { display: grid; gap: 4px; margin: 0; padding-left: 20px; font-size: 14px; }
.marketplace-confirm-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-top: 4px; }
@media (max-width: 640px) {
    .marketplace-confirm-dialog { margin: auto auto 0; width: 100vw; max-width: 100vw; }
    .marketplace-confirm-dialog .field-help-dialog-panel { border-radius: 16px 16px 0 0; }
    .marketplace-confirm-actions button { flex: 1 1 auto; }
}
.marketplace-status { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 14px 16px; border: 1px solid var(--theme-border, var(--line)); border-radius: 12px; background: var(--theme-bg-inset, var(--soft)); }

/* Customer offers: the home card, the offers page and its comparison table. Light, 1px, no heavy outlines. */
.dashboard-offers { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 16px 18px; border: 1px solid var(--theme-border, var(--line)); border-radius: 12px; background: var(--theme-brand-soft, var(--soft-blue)); }
.dashboard-offers h3 { margin: 0 0 4px; font-size: 1.1rem; font-weight: 600; }
.dashboard-offers p { margin: 6px 0 0; color: var(--theme-text-muted, var(--muted)); }
.dashboard-offers-wide { flex: 1 1 100%; }
.dashboard-offers-request { display: inline-flex; flex-wrap: wrap; gap: 2px 8px; font-size: .88rem; }
.dashboard-offers-request strong { font-weight: 500; }
.dashboard-offers-request span { color: var(--theme-text-muted, var(--muted)); }
.dashboard-offers-list { display: grid; gap: 10px; margin: 10px 0 0; padding: 0; list-style: none; }
.dashboard-offers-list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding-top: 10px; border-top: 1px solid var(--theme-divider, var(--line)); }
.dashboard-offers-list li > span { display: grid; gap: 2px; }
.marketplace-offers-page { display: grid; gap: 12px; }
.marketplace-offers-page h2 { margin: 0; }
.marketplace-offers-back { justify-self: start; }
.marketplace-request-label { margin: 0; color: var(--theme-text-muted, var(--muted)); }
.marketplace-request-switch { display: flex; flex-wrap: wrap; gap: 8px; }
.marketplace-offers-page .marketplace-request-option { padding: 6px 12px; border: 1px solid var(--theme-border, var(--line)); border-radius: 999px; background: var(--theme-bg-elevated, var(--panel)); color: inherit; font: inherit; font-size: .88rem; cursor: pointer; }
.marketplace-offers-page .marketplace-request-option[aria-pressed="true"] { border-color: var(--theme-brand-strong, var(--primary)); background: var(--theme-brand-soft, var(--soft-blue)); color: var(--theme-brand-strong, var(--primary)); font-weight: 600; }
.marketplace-offer-count { margin: 0; font-size: 1.15rem; font-weight: 600; }
.marketplace-offers-link { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 14px 16px; border: 1px solid var(--theme-border, var(--line)); border-radius: 12px; background: var(--theme-bg-inset, var(--soft)); }
.marketplace-offers-link p { margin: 4px 0 0; }
.marketplace-compare { overflow-x: auto; }
.marketplace-compare-table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.marketplace-compare-table caption { text-align: left; font-weight: 600; padding-bottom: 6px; }
.marketplace-compare-table th, .marketplace-compare-table td { padding: 8px 10px; text-align: left; border-bottom: 1px solid var(--theme-divider, var(--line)); white-space: nowrap; }
.marketplace-compare-table th[scope="row"] { font-weight: 400; color: var(--theme-text-muted, var(--muted)); }
.marketplace-compare-table th[scope="col"] { font-weight: 600; }
.marketplace-lowest { font-size: .75rem; font-weight: 600; color: var(--theme-success, #2f7d4f); }
@media (max-width: 640px) {
    .marketplace-compare { display: none; }
    .dashboard-offers > button, .dashboard-offers-list button { width: 100%; }
}
.marketplace-status div { display: grid; gap: 4px; min-width: 0; flex: 1 1 280px; }
.marketplace-status strong { font-weight: 600; }
.marketplace-panel .marketplace-hint { font-size: .9rem; color: var(--theme-text-muted, var(--muted)); }
/* Optional credit-check consent and bureau reference. */
.marketplace-panel .marketplace-credit .check-row > span { display: grid; gap: 4px; }
.marketplace-panel .marketplace-credit small.marketplace-hint { display: block; font-size: .85rem; line-height: 1.45; }
.marketplace-panel .marketplace-optional { margin-left: 6px; color: var(--theme-text-muted, var(--muted)); font-size: .8rem; font-weight: 500; }
.marketplace-panel .marketplace-reference { margin-top: 8px; }
.marketplace-panel .marketplace-reference[hidden] { display: none; }

/* Calm marketplace controls in both themes: neutral by default, a soft brand tint for the section's main action. */
.portal-theme .marketplace-panel button:not(.field-help-button) {
    min-height: 42px;
    padding: 9px 14px;
    border: 1px solid var(--theme-border-strong, var(--line-strong));
    border-radius: var(--radius);
    color: var(--theme-control-secondary-text, var(--text));
    background: var(--theme-control-secondary-bg, var(--panel));
    box-shadow: none;
    font-weight: 500;
}

.portal-theme .marketplace-panel button:not(.field-help-button):hover { background: var(--theme-control-secondary-hover, var(--soft)); }

.portal-theme .marketplace-panel button.marketplace-primary {
    color: var(--theme-brand-strong, var(--primary));
    background: var(--theme-brand-soft, var(--soft-blue));
    border-color: color-mix(in srgb, var(--theme-brand-strong, var(--primary)) 40%, transparent);
}

.portal-theme .marketplace-panel button.marketplace-primary:hover {
    background: color-mix(in srgb, var(--theme-brand-soft, var(--soft-blue)) 80%, var(--theme-brand-strong, var(--primary)) 20%);
}


/* Quiet "more info" buttons in the marketplace: outlined, not filled. */
.portal-theme :is(.marketplace-panel, .market-how) .field-help-button {
    border: 1px solid var(--theme-border-strong, var(--line-strong));
    background: var(--theme-control-secondary-bg, var(--panel));
    color: var(--theme-text-muted, var(--muted));
    font-weight: 600;
}

.portal-theme :is(.marketplace-panel, .market-how) .field-help-button:hover,
.portal-theme :is(.marketplace-panel, .market-how) .field-help-button[aria-expanded="true"] {
    border-color: color-mix(in srgb, var(--theme-brand-strong, var(--primary)) 45%, transparent);
    background: var(--theme-brand-soft, var(--soft-blue));
    color: var(--theme-brand-strong, var(--primary));
}

/* Documents step: one calm card per requirement, a progress bar, soft scan action. */
.portal-theme--borrower .documents-product-label { font-weight: 400; }
.portal-theme--borrower .documents-product strong { font-weight: 600; }

#documents-content .document-overview { padding: 20px 24px; border-radius: 14px; border-color: var(--theme-border, var(--line)); box-shadow: none; }
#documents-content .document-overview > div { display: grid; gap: 6px; flex: 1 1 220px; max-width: 360px; }
#documents-content .document-overview span { font-size: .8rem; font-weight: 500; letter-spacing: .02em; text-transform: none; }
#documents-content .document-overview strong { font-size: 1.5rem; line-height: 1.2; font-weight: 600; }
.document-progress {
    width: 100%;
    height: 6px;
    border: 0;
    border-radius: 999px;
    overflow: hidden;
    appearance: none;
    background: var(--theme-border, var(--line));
}
.document-progress::-webkit-progress-bar { background: var(--theme-border, var(--line)); border-radius: 999px; }
.document-progress::-webkit-progress-value { background: var(--theme-brand, var(--primary)); border-radius: 999px; }
.document-progress::-moz-progress-bar { background: var(--theme-brand, var(--primary)); border-radius: 999px; }
.document-overview.complete .document-progress::-webkit-progress-value { background: var(--theme-success, var(--ok)); }
.document-overview.complete .document-progress::-moz-progress-bar { background: var(--theme-success, var(--ok)); }

#documents-content .document-group > h3 { font-size: 1.0625rem; font-weight: 600; }
#documents-content .document-card {
    gap: 14px;
    padding: 22px 24px;
    border-color: var(--theme-border, var(--line));
    border-radius: 14px;
    background: var(--theme-bg-panel, var(--panel));
    box-shadow: none;
}
#documents-content .document-card:hover { border-color: var(--theme-border-strong, var(--line)); box-shadow: none; }
/* The document type leads each card; requirement, instructions and status support it. */
#documents-content .document-card-head { align-items: flex-start; gap: 12px; padding: 0; }
#documents-content .document-card-title { display: grid; gap: 2px; min-width: 0; }
#documents-content .document-card h3 { margin: 0; color: var(--theme-text-primary, var(--heading)); font-size: 1.125rem; line-height: 1.35; font-weight: 600; overflow-wrap: anywhere; }
#documents-content .document-card-badges { flex: none; justify-content: flex-end; }
#documents-content .document-card-head .badge { min-height: 24px; padding: 2px 10px; font-size: .8125rem; font-weight: 500; }
#documents-content .document-mode { color: var(--theme-text-muted, var(--muted)); font-size: .8125rem; line-height: 1.4; font-weight: 400; letter-spacing: 0; text-transform: none; }
#documents-content .document-requirement-description { margin: -6px 0 0; color: var(--theme-text-muted, var(--muted)); font-size: .875rem; line-height: 1.45; }
#documents-content .upload-slot {
    padding: 14px 16px;
    border-color: var(--theme-border, var(--line));
    border-radius: 12px;
    box-shadow: none;
}
#documents-content .upload-slot.needed { background: var(--theme-bg-inset, var(--soft)); }
#documents-content .upload-slot-main .upload-slot-filename { color: var(--theme-text-primary, var(--heading)); font-size: .9375rem; line-height: 1.4; }
#documents-content .upload-slot-main strong { color: var(--theme-text-secondary, var(--muted)); font-size: .8125rem; line-height: 1.4; font-weight: 500; }
#documents-content .document-processing-state { font-size: .8125rem; }
#documents-content .document-processing-state.ok { color: var(--theme-text-muted, var(--muted)); }
#documents-content .document-processing-state.ok::before { background: var(--theme-success, var(--ok)); }
#documents-content .document-file-actions { flex-direction: row; align-items: center; gap: 10px; }
#documents-content .document-uploaded-check { color: var(--theme-success, var(--ok)); font-size: 18px; line-height: 1; }

/* Settled cards fold to one row: the heading becomes the toggle, the file name its summary. */
#documents-content .document-card-title { flex: 1; }
#documents-content .document-card-body { display: grid; gap: 14px; min-width: 0; }
#documents-content .document-card-body[hidden] { display: none; }
.portal-theme--borrower #documents-content button.document-card-toggle {
    display: grid;
    grid-template-columns: 16px minmax(0, 1fr);
    column-gap: 10px;
    align-items: center;
    width: 100%;
    min-height: 44px;
    margin: -6px 0;
    padding: 6px 0;
    border: 0;
    border-radius: 8px;
    background: transparent;
    box-shadow: none;
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
}
.portal-theme--borrower #documents-content button.document-card-toggle:hover .document-card-name { text-decoration: underline; text-underline-offset: 3px; }
.portal-theme--borrower #documents-content button.document-card-toggle:focus-visible { outline: 2px solid var(--theme-focus, var(--theme-brand, var(--primary))); outline-offset: 4px; }
#documents-content .document-card-chevron {
    width: 8px;
    height: 8px;
    margin-left: 3px;
    border-right: 2px solid var(--theme-text-muted, var(--muted));
    border-bottom: 2px solid var(--theme-text-muted, var(--muted));
    transform: translateY(-2px) rotate(45deg);
    transition: transform .15s ease;
}
#documents-content .document-card.is-collapsed .document-card-chevron { transform: rotate(-45deg); }
#documents-content .document-card-name { min-width: 0; overflow-wrap: anywhere; }
#documents-content .document-card-brief { grid-column: 2; overflow: hidden; color: var(--theme-text-muted, var(--muted)); font-size: .875rem; font-weight: 400; line-height: 1.4; text-overflow: ellipsis; white-space: nowrap; }
#documents-content .document-card-brief > span { color: var(--theme-success, var(--ok)); }
#documents-content .document-card:not(.is-collapsed) .document-card-brief,
#documents-content .document-card.is-collapsed .document-mode { display: none; }
#documents-content .document-card.is-collapsed { padding-block: 16px; }
#documents-content .document-card.is-collapsed .document-card-head { align-items: center; }
#documents-content h3:has(.document-card-toggle) + .document-mode { margin-top: 4px; }
@media (prefers-reduced-motion: reduce) { #documents-content .document-card-chevron { transition: none; } }
#documents-content .document-card-controls { display: flex; justify-content: flex-end; gap: 8px; margin: 0; }
.portal-theme--borrower #documents-content .document-card-controls button { width: auto; min-height: 36px; padding: 4px 14px; font-size: .875rem; font-weight: 500; }
.portal-theme--borrower #documents-content .document-card-controls button:disabled { opacity: .55; cursor: default; }
@media (max-width: 640px) {
    #documents-content .document-card-controls { display: grid; grid-template-columns: 1fr 1fr; }
    .portal-theme--borrower #documents-content .document-card-controls button { width: 100%; min-height: 40px; }
}

/* Scan is a soft brand action next to an outlined Upload, so neither shouts. */
.portal-theme--borrower #documents-content .upload-actions button:not(.secondary) {
    border: 1px solid transparent;
    background: var(--theme-brand-soft, var(--soft-blue));
    color: var(--theme-brand-strong, var(--primary));
    font-weight: 500;
}
.portal-theme--borrower #documents-content .upload-actions button:not(.secondary):hover {
    border-color: var(--theme-brand, var(--primary));
    background: var(--theme-brand-soft, var(--soft-blue));
}
.portal-theme--borrower #documents-content .upload-actions button.secondary { font-weight: 500; }

/* Saved-document reuse: a quiet secondary row, not a second primary area. */
#documents-content [data-customer-reuse] {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 12px;
    padding-top: 12px;
    border-top: 1px solid var(--theme-border, var(--line));
}
#documents-content [data-customer-reuse] > p { color: var(--theme-text-muted, var(--muted)); font-size: .85rem; }
.portal-theme--borrower #documents-content [data-customer-reuse] > button {
    min-height: 32px;
    padding: 4px 12px;
    font-size: .875rem;
    font-weight: 500;
}
#documents-content [data-customer-reuse] > div:not([hidden]) { flex-basis: 100%; }

@media (max-width: 640px) {
    #documents-content .document-card { padding: 18px; }
    #documents-content .document-overview { flex-direction: column; align-items: stretch; }
}

/* Review step: quiet withdraw action, drawn attachment status, offers inside the review flow. */
.portal-theme--borrower #review-content [data-withdraw-application] {
    justify-self: end;
    width: auto;
    min-height: 32px;
    padding: 4px 12px;
    border-color: transparent;
    background: transparent;
    color: var(--theme-text-secondary, var(--muted));
    font-size: .875rem;
    font-weight: 500;
    box-shadow: none;
}
.portal-theme--borrower #review-content [data-withdraw-application]:hover {
    background: var(--theme-danger-bg, var(--danger-bg));
    color: var(--theme-danger, var(--danger));
}
#review-content .packet-summary { border-radius: 14px; box-shadow: none; }
#review-content .attachment-review-panel { border-radius: 14px; box-shadow: none; }
.attachment-status-icon svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.attachment-status-icon.is-complete { background: var(--theme-success-bg, var(--ok-bg)); color: var(--theme-success, var(--ok)); }
.attachment-status-icon.is-needed { background: var(--theme-warning-bg, var(--warn-bg)); color: var(--theme-warning, var(--warn)); }
#review-content > .marketplace-panel { margin: 0; }

.marketplace-panel .marketplace-intro { margin-top: 6px; }

/* Dashboard: calm metric tiles, flat application cards, one action per card. */
.portal-theme--borrower #start-new-application { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; }
.start-new-icon { position: relative; width: 14px; height: 14px; flex: none; }
.start-new-icon::before,
.start-new-icon::after { content: ""; position: absolute; inset: 6px 0; border-radius: 2px; background: currentColor; }
.start-new-icon::after { inset: 0 6px; }

.portal-theme--borrower [data-step-panel="dashboard"] .dashboard-metric {
    min-height: 0;
    gap: 4px;
    padding: 18px 20px;
    border-color: var(--theme-border, var(--line));
    border-radius: 14px;
    background: var(--theme-bg-panel, var(--panel));
    box-shadow: none;
}
.portal-theme--borrower [data-step-panel="dashboard"] .dashboard-metric:hover { border-color: var(--theme-border-strong, var(--line)); box-shadow: none; transform: none; }
.portal-theme--borrower [data-step-panel="dashboard"] .dashboard-metric[aria-pressed="true"] {
    border-color: var(--theme-brand, var(--primary));
    background: var(--theme-brand-soft, var(--soft-blue));
    box-shadow: none;
}
.portal-theme--borrower [data-step-panel="dashboard"] .dashboard-metric > span:first-child {
    color: var(--theme-text-secondary, var(--muted));
    font-size: .85rem;
    font-weight: 500;
    letter-spacing: 0;
    text-transform: none;
}
.portal-theme--borrower [data-step-panel="dashboard"] .dashboard-metric strong { font-size: 1.75rem; line-height: 1.2; font-weight: 600; }
.portal-theme--borrower [data-step-panel="dashboard"] .dashboard-metric small { color: var(--theme-text-muted, var(--muted)); font-size: .85rem; font-weight: 400; }
.portal-theme--borrower [data-step-panel="dashboard"] .dashboard-metric .dashboard-metric-action { margin-top: 8px; color: var(--theme-link, var(--primary)); font-size: .85rem; font-weight: 500; }

.portal-theme--borrower [data-step-panel="dashboard"] .dashboard-filter-button {
    min-height: 34px;
    padding: 4px 14px;
    border-color: var(--theme-border, var(--line));
    border-radius: 999px;
    background: transparent;
    color: var(--theme-text-secondary, var(--muted));
    font-size: .85rem;
    font-weight: 500;
}
.portal-theme--borrower [data-step-panel="dashboard"] .dashboard-filter-button:hover { border-color: var(--theme-border-strong, var(--line)); background: transparent; color: var(--theme-text-primary, var(--heading)); }
.portal-theme--borrower [data-step-panel="dashboard"] .dashboard-filter-button[aria-pressed="true"] {
    border-color: var(--theme-brand, var(--primary));
    background: var(--theme-brand-soft, var(--soft-blue));
    color: var(--theme-brand-strong, var(--primary));
}

/* The live sort announcement stays for screen readers; the dropdown already shows it. */
.dashboard-sort-description {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.portal-theme--borrower .borrower-application-card:not(.borrower-application-card--customer) {
    gap: 18px;
    padding: 22px;
    border-color: var(--theme-border, var(--line));
    border-radius: 14px;
    background: var(--theme-bg-panel, var(--panel));
    box-shadow: none;
}
.portal-theme--borrower .borrower-application-card:not(.borrower-application-card--customer):hover { border-color: var(--theme-border-strong, var(--line)); box-shadow: none; transform: none; }
.portal-theme--borrower .borrower-application-card:not(.borrower-application-card--customer) .application-card-title { font-size: 1.125rem; line-height: 1.35; }
.portal-theme--borrower .borrower-application-card:not(.borrower-application-card--customer) .application-next-step {
    gap: 2px;
    padding: 10px 12px;
    border-radius: 10px;
    background: var(--theme-bg-inset, var(--soft));
    color: var(--theme-text-secondary, var(--muted));
    font-size: .85rem;
}
.portal-theme--borrower .borrower-application-card:not(.borrower-application-card--customer) .application-next-step strong { color: var(--theme-text-primary, var(--heading)); font-weight: 600; }
.portal-theme--borrower .borrower-application-card:not(.borrower-application-card--customer) .application-facts {
    gap: 0;
    border-color: var(--theme-border, var(--line));
    border-radius: 12px;
    background: transparent;
}
.portal-theme--borrower .borrower-application-card:not(.borrower-application-card--customer) .application-facts div { padding: 12px 14px; background: transparent; }
.portal-theme--borrower .borrower-application-card:not(.borrower-application-card--customer) .application-facts > div:nth-child(even) { border-left: 1px solid var(--theme-border, var(--line)); }
.portal-theme--borrower .borrower-application-card:not(.borrower-application-card--customer) .application-facts > div:nth-child(n+3) { border-top: 1px solid var(--theme-border, var(--line)); }
.portal-theme--borrower .borrower-application-card:not(.borrower-application-card--customer) .application-facts > div:last-child:nth-child(odd) { border-left: 0; }
.portal-theme--borrower .borrower-application-card:not(.borrower-application-card--customer) .application-facts dt {
    color: var(--theme-text-muted, var(--muted));
    font-size: .8rem;
    font-weight: 500;
    letter-spacing: 0;
    text-transform: none;
}
.portal-theme--borrower .borrower-application-card:not(.borrower-application-card--customer) .application-facts dd { font-size: .95rem; font-weight: 500; }
.portal-theme--borrower .borrower-application-card:not(.borrower-application-card--customer) .application-card-footer > span { color: var(--theme-text-muted, var(--muted)); font-size: .85rem; }


/* Direct-loan catalog: hairline product cards and one frame for the selected loan's fields. */
.portal-theme--borrower #offerings-content .product-card:not(.service-card) {
    gap: 16px;
    padding: 22px;
    border-color: var(--theme-border, var(--line));
    border-radius: 14px;
    background: var(--theme-bg-panel, var(--panel));
    box-shadow: none;
    transform: none;
}
.portal-theme--borrower #offerings-content .product-card:not(.service-card)::after { display: none; }
.portal-theme--borrower #offerings-content .product-card:not(.service-card):hover { border-color: var(--theme-border-strong, var(--line)); box-shadow: none; transform: none; }
.portal-theme--borrower #offerings-content .product-card.selected {
    border-color: var(--theme-brand, var(--primary));
    background: var(--theme-bg-panel, var(--panel));
    box-shadow: none;
}
.portal-theme--borrower #offerings-content .product-card h3 { margin: 4px 0 0; font-size: 1.125rem; }
.portal-theme--borrower #offerings-content .product-icon { width: 44px; height: 44px; border-radius: 12px; background: var(--theme-brand-soft, var(--soft-blue)); color: var(--theme-brand-strong, var(--primary)); }
.portal-theme--borrower #offerings-content .product-icon svg { width: 24px; height: 24px; }
.portal-theme--borrower #offerings-content .product-facts {
    gap: 0;
    border: 1px solid var(--theme-border, var(--line));
    border-radius: 12px;
    overflow: hidden;
}
.portal-theme--borrower #offerings-content .product-facts span {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 14px;
    font-size: .9rem;
    color: var(--theme-text-primary, var(--heading));
}
.portal-theme--borrower #offerings-content .product-facts span + span { border-top: 1px solid var(--theme-border, var(--line)); }
.portal-theme--borrower #offerings-content .product-facts strong { color: var(--theme-text-muted, var(--muted)); font-weight: 500; }
.portal-theme--borrower #offerings-content .inline-loan-selection {
    gap: 16px;
    margin-top: 0;
    padding: 18px 0 0;
    border: 0;
    border-top: 1px solid var(--theme-border, var(--line));
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}
.portal-theme--borrower #offerings-content .inline-loan-selection__header strong { font-size: 1rem; }
.portal-theme--borrower #offerings-content .inline-loan-fields label { color: var(--theme-text-secondary, var(--text)); font-size: .875rem; font-weight: 500; }
.portal-theme--borrower #offerings-content .product-card:not(.selected) > button[data-select-offering] { justify-self: start; }
.portal-theme--borrower #offerings-content .product-card:not(.service-card) {
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    column-gap: 14px;
}
.portal-theme--borrower #offerings-content .product-card:not(.service-card) > .product-icon { grid-column: 1; }
.portal-theme--borrower #offerings-content .product-card:not(.service-card) > div:nth-child(2) { grid-column: 2; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; column-gap: 12px; }
.portal-theme--borrower #offerings-content .product-card:not(.service-card) > div:nth-child(2) > .button-row { grid-column: 2; grid-row: 1 / span 2; margin: 0; }
.portal-theme--borrower #offerings-content .product-card:not(.service-card) > div:nth-child(2) > h3 { grid-column: 1; grid-row: 1; margin: 0; }
.portal-theme--borrower #offerings-content .product-card:not(.service-card) > div:nth-child(2) > p { grid-column: 1; grid-row: 2; margin: 2px 0 0; color: var(--theme-text-muted, var(--muted)); }
.portal-theme--borrower #offerings-content .product-card:not(.service-card) > :nth-child(n+3) { grid-column: 1 / -1; }
.portal-theme--borrower #offerings-content .product-card:not(.service-card) .badge { min-height: 24px; padding: 2px 10px; font-weight: 500; }
.portal-theme--borrower #offerings-content .product-card button[data-select-offering] {
    --theme-control-primary-bg: var(--theme-brand, #0d47a1);
    --theme-control-primary-hover: var(--theme-brand-strong, #0b326f);
    --theme-control-primary-pressed: var(--theme-brand-strong, #0b326f);
    font-weight: 600;
}
:root[data-theme="dark"] .portal-theme--borrower #offerings-content .product-card button[data-select-offering] {
    --theme-control-primary-bg: #2f5f9e;
    --theme-control-primary-hover: #3a6fb3;
    --theme-control-primary-pressed: #284f84;
    --theme-control-primary-text: #f8fafc;
}

/* Direct loans reuse the marketplace field set inside their product card. */
.portal-theme--borrower #offerings-content .product-card .market-loan__form { padding-top: 18px; border-top: 1px solid var(--theme-border, var(--line)); }
.portal-theme .market-loan__select { max-width: 360px; }
.market-loan__select.has-error { border-color: var(--theme-danger, #b42318); }

.portal-theme--borrower #offerings-content .market-loan__chips select.market-loan__other { flex: 0 0 auto; width: auto; max-width: 100%; }
.portal-theme--borrower #offerings-content .market-loan__summary { color: var(--theme-danger, #b42318); }
.portal-theme--borrower #offerings-content .market-loan__hint { color: var(--theme-text-muted, var(--muted)); }

/* Help "i" buttons keep their small look but get a 42px tap area. */
.field-help-button { position: relative; }
.field-help-button::after { content: ""; position: absolute; inset: -10px; }

/* Phones (most customers): no zoom-on-focus, comfortable taps, one frame per step. */
@media (max-width: 767px) {
    .portal-theme--borrower :is(input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="range"]), select, textarea) { font-size: 16px; }
}

@media (max-width: 640px) {
    /* Dashboard: three compact counts in one row; the full wording stays in each tile's accessible name. */
    .portal-theme--borrower .metric-strip:not(.metric-strip--customer) { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
    .portal-theme--borrower .metric-strip:not(.metric-strip--customer) .dashboard-metric { padding: 12px; gap: 2px; }
    .portal-theme--borrower .metric-strip:not(.metric-strip--customer) .dashboard-metric > span:first-child { font-size: .78rem; line-height: 1.3; }
    .portal-theme--borrower .metric-strip:not(.metric-strip--customer) .dashboard-metric strong { font-size: 1.5rem; }
    .portal-theme--borrower .metric-strip:not(.metric-strip--customer) .dashboard-metric :is(small, .dashboard-metric-action) { display: none; }
    .portal-theme--borrower [data-step-panel="dashboard"] .dashboard-filter-button { min-height: 40px; }
    .portal-theme--borrower .borrower-application-card:not(.borrower-application-card--customer) { gap: 14px; padding: 16px; }
    .portal-theme--borrower .dashboard-panel:not(.dashboard-panel--customer) .dashboard-applications { padding: 0; border: 0; background: transparent; box-shadow: none; }
    .portal-theme--borrower .borrower-application-card:not(.borrower-application-card--customer) .application-card-primary { padding: 0; }
    .portal-theme--borrower .borrower-application-card:not(.borrower-application-card--customer) .application-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .portal-theme--borrower .borrower-application-card:not(.borrower-application-card--customer) .application-facts div { padding: 10px 12px; }

    /* Loan step */
    .portal-theme .market-loan .market-loan__change { min-height: 40px; }
    .market-loan__chips { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .market-loan__chip span { justify-content: center; width: 100%; }
    .portal-theme--borrower .market-loan__chips select.market-loan__other,
    .portal-theme--borrower #offerings-content .market-loan__chips select.market-loan__other { width: 100%; }
    .portal-theme .market-loan__select { max-width: none; }

    /* The pinned status notice stays pinned (deliberate) but takes less of a phone screen. */
    .portal-theme--borrower .workspace-status { padding: 8px 12px; font-size: 13px; line-height: 18px; }

    /* Direct-loan card: badge under the name so the name keeps one line; long values align right. */
    .portal-theme--borrower #offerings-content .product-card:not(.service-card) { padding: 16px; }
    .portal-theme--borrower #offerings-content .product-card:not(.service-card) > div:nth-child(2) { grid-template-columns: minmax(0, 1fr); }
    .portal-theme--borrower #offerings-content .product-card:not(.service-card) > div:nth-child(2) > .button-row { grid-column: 1; grid-row: 3; margin-top: 6px; }
    .portal-theme--borrower #offerings-content .product-facts span { text-align: right; }
    .portal-theme--borrower #offerings-content .product-facts strong { flex: none; text-align: left; }

    /* Details: sections become dividers so fields use the full width. */
    #details-form > .form-section { padding: 20px 0 0; border: 0; border-top: 1px solid var(--theme-border, var(--line)); border-radius: 0; background: transparent; }

    /* Documents: Scan and Upload side by side. */
    #documents-content .upload-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    #documents-content .document-card { padding: 16px; }
    #documents-content .upload-slot { padding: 12px; }

    /* Review and offers */
    .portal-theme--borrower #review-content [data-withdraw-application] { min-height: 40px; }
    .portal-theme--borrower #review-content .attachment-review-panel button { min-height: 40px; }
    .marketplace-panel { padding: 16px; }
    .marketplace-offer { padding: 14px; }
    .marketplace-terms { grid-template-columns: 1fr; gap: 0; }
    .marketplace-terms > div { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-top: 1px solid var(--theme-border, var(--line)); }
    .marketplace-terms > div:first-child { border-top: 0; }
    .marketplace-terms dd { margin: 0; text-align: right; }
}

/* Branch and loan-officer choices (direct loans): same hairline cards, no tinted wrapper around Continue. */
.portal-theme--borrower .panel--loan-choice .choice-card {
    border-color: var(--theme-border, var(--line));
    border-radius: 14px;
    background: var(--theme-bg-panel, var(--panel));
    box-shadow: none;
    transform: none;
}
.portal-theme--borrower .panel--loan-choice .choice-card:hover { border-color: var(--theme-border-strong, var(--line)); box-shadow: none; transform: none; }
.portal-theme--borrower .panel--loan-choice .choice-card.selected { border-color: var(--theme-brand, var(--primary)); background: var(--theme-bg-panel, var(--panel)); box-shadow: inset 0 0 0 1px var(--theme-brand, var(--primary)); }
.portal-theme--borrower .panel--loan-choice .choice-card .badge { min-height: 24px; padding: 2px 10px; font-weight: 500; }
.portal-theme--borrower .panel--loan-choice :is(#branch-form, #preferred-loan-officer-form) {
    padding: 16px 0 0;
    border: 0;
    border-top: 1px solid var(--theme-border, var(--line));
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

/* Phones: dashboard filters are one swipeable row of chips instead of a multi-row block. */
@media (max-width: 640px) {
    .portal-theme--borrower [data-step-panel="dashboard"] .dashboard-filter-bar {
        display: flex;
        flex-wrap: nowrap;
        gap: 8px;
        overflow-x: auto;
        overscroll-behavior-x: contain;
        scroll-snap-type: x proximity;
        scrollbar-width: none;
        margin-inline: 0;
        padding: 2px 0 4px;
    }
    .portal-theme--borrower [data-step-panel="dashboard"] .dashboard-filter-bar::-webkit-scrollbar { display: none; }
    .portal-theme--borrower [data-step-panel="dashboard"] .dashboard-filter-bar > .dashboard-filter-button {
        flex: 0 0 auto;
        width: auto;
        padding-inline: 16px;
        white-space: nowrap;
        scroll-snap-align: start;
    }
}

/* Account menu: theme-aware "Switch experience" rows and a normal-size "Hide balances" checkbox row. */
.account-experience-link:hover {
    border-color: var(--theme-border-strong, #c9dcec);
    background: var(--theme-bg-hover, #f6f9fc);
}
.account-experience-link.current {
    border-color: var(--theme-brand, #cfe1f2);
    background: var(--theme-brand-soft, #f3f8fd);
}
.account-experience-link.current strong { color: var(--theme-brand-strong, var(--heading)); }
.experience-marker {
    background: var(--theme-bg-inset, #eef4f9);
    color: var(--theme-link, var(--primary));
    font-weight: 600;
}
.account-experience-link.current .experience-marker {
    background: var(--theme-bg-panel, #fff);
    color: var(--theme-brand-strong, var(--primary));
}
.account-popover [data-ob-balance-preference] {
    display: grid;
    gap: 4px;
    padding: 8px 2px;
    border-bottom: 1px solid var(--theme-border, var(--line));
}
.account-popover [data-ob-balance-preference][hidden] { display: none; }
.account-popover [data-ob-balance-preference] > label {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 40px;
    color: var(--theme-text-primary, var(--heading));
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
}
.portal-theme .account-popover [data-ob-balance-preference] input[type="checkbox"] {
    flex: none;
    width: 20px;
    height: 20px;
    min-width: 0;
    min-height: 0;
    margin: 0;
    padding: 0;
    accent-color: var(--theme-brand, var(--primary));
}
.account-popover [data-ob-balance-preference] p:empty { display: none; }
.account-popover [data-ob-balance-preference] label:has(> input[type="checkbox"]) {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 36px;
    color: var(--theme-text-primary, var(--heading));
    font-size: 14px;
    font-weight: 400;
    cursor: pointer;
}
.account-popover [data-ob-balance-preference] details > summary {
    display: list-item;
    padding: 10px 0;
    color: var(--theme-text-primary, var(--heading));
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
}
.account-popover [data-ob-balance-preference] details > :not(summary) { margin-left: 18px; }
.account-popover [data-ob-balance-preference] form,
.account-popover [data-ob-balance-preference] section:not([hidden]) {
    display: grid;
    gap: 8px;
    padding: 4px 0 10px;
}
.account-popover [data-ob-balance-preference] fieldset { display: grid; gap: 2px; margin: 0; padding: 0; border: 0; min-width: 0; }
.account-popover [data-ob-balance-preference] legend,
.account-popover [data-ob-balance-preference] h3 {
    margin: 0 0 4px;
    padding: 0;
    color: var(--theme-text-secondary, var(--muted));
    font-size: 13px;
    font-weight: 500;
}
.account-popover [data-ob-balance-preference] label:not(:has(> input[type="checkbox"])) {
    display: grid;
    gap: 4px;
    color: var(--theme-text-secondary, var(--muted));
    font-size: 13px;
    font-weight: 500;
}
.account-popover [data-ob-balance-preference] p { margin: 0; color: var(--theme-text-muted, var(--muted)); font-size: 12.5px; line-height: 1.45; }
.portal-theme .account-popover [data-ob-balance-preference] button {
    width: 100%;
    min-height: 36px;
    padding: 6px 12px;
    font-size: 14px;
    font-weight: 500;
}
