:root {
    --ink: #1c1c1e;
    --ink-soft: #6d6a64;
    --ink-faint: #9a968c;
    --forest-950: #4f0d19;
    --forest-900: #64111f;
    --forest-800: #7a1626;
    --forest-700: #a41e34;
    --forest-100: #f0d7dc;
    --forest-50: #faf0f2;
    --gold: #c9435a;
    --gold-dark: #a41e34;
    --gold-soft: rgba(164, 30, 52, .12);
    --canvas: #f1efea;
    --surface: rgba(255, 255, 255, .72);
    --surface-solid: #ffffff;
    --surface-muted: rgba(247, 250, 248, .68);
    --surface-hover: rgba(255, 255, 255, .88);
    --glass-border: rgba(255, 255, 255, .74);
    --line: rgba(92, 80, 78, .18);
    --line-soft: rgba(92, 80, 78, .1);
    --input: rgba(255, 255, 255, .78);
    --topbar: rgba(241, 239, 234, .74);
    --mobile-nav: rgba(250, 252, 251, .82);
    --scrollbar-thumb: rgba(100, 17, 31, .32);
    --scrollbar-thumb-hover: rgba(100, 17, 31, .52);
    --success: #177d58;
    --success-soft: #e5f5ee;
    --warning: #a96812;
    --warning-soft: #fff3dc;
    --danger: #b43c3c;
    --danger-soft: #fdeaea;
    --info: #2f6e91;
    --info-soft: #e8f3f8;
    --shadow-sm: 0 8px 28px rgba(84, 27, 37, .07), inset 0 1px rgba(255, 255, 255, .5);
    --shadow-lg: 0 28px 70px rgba(62, 17, 25, .16), inset 0 1px rgba(255, 255, 255, .5);
    --radius-sm: 12px;
    --radius: 19px;
    --radius-lg: 28px;
    --sidebar: 252px;
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--ink);
    background: var(--canvas);
    font-synthesis: none;
}

* {
    box-sizing: border-box;
    scrollbar-width: thin;
    scrollbar-color: var(--scrollbar-thumb) transparent;
}
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
    min-height: 40px;
    border: 3px solid transparent;
    border-radius: 999px;
    background: var(--scrollbar-thumb);
    background-clip: padding-box;
}
*::-webkit-scrollbar-thumb:hover { background-color: var(--scrollbar-thumb-hover); }
*::-webkit-scrollbar-corner { background: transparent; }
.sr-only { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0,0,0,0) !important; white-space: nowrap !important; border: 0 !important; }
html { min-height: 100%; background: var(--canvas); }
body { margin: 0; min-height: 100vh; font-size: 16px; line-height: 1.5; }
button, input, select, textarea { font: inherit; }
button, summary, select { cursor: pointer; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }
h1, h2, h3, h4, p { margin-top: 0; }
h1, h2, h3, h4 { line-height: 1.15; letter-spacing: -.025em; }
h1 { font-size: clamp(1.6rem, 3vw, 2.15rem); margin-bottom: .5rem; }
h2 { font-size: 1.2rem; margin-bottom: .4rem; }
h3 { font-size: 1rem; margin-bottom: .25rem; }

.app-body { background: var(--canvas); }
.app-shell { min-height: 100vh; }
.app-main { margin-left: var(--sidebar); min-height: 100vh; }
.content { width: min(1500px, 100%); margin: 0 auto; padding: 24px 30px 48px; }

.sidebar {
    position: fixed; inset: 0 auto 0 0; width: var(--sidebar); z-index: 30;
    display: flex; flex-direction: column; padding: 24px 16px 16px;
    color: #efece5; background: #1c0c10;
}
.sidebar__brand { display: flex; align-items: center; gap: 12px; padding: 0 8px 28px; color: #fff; }
.sidebar__brand strong, .sidebar__brand small { display: block; line-height: 1.05; }
.sidebar__brand strong { font-size: .98rem; }
.sidebar__brand small { margin-top: 3px; color: #9a968c; font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; }
.brand-mark {
    width: 42px; height: 42px; flex: 0 0 42px; display: grid; place-items: center;
    border: 1px solid rgba(255,255,255,.18); border-radius: 13px;
    color: #fff; background: #a41e34;
    box-shadow: inset 0 1px rgba(255,255,255,.25), 0 8px 18px rgba(0,0,0,.15);
    font-size: .72rem; font-weight: 800; letter-spacing: .06em;
}
.brand-mark--large { width: 60px; height: 60px; border-radius: 18px; font-size: .9rem; }
.brand-mark img { width: 100%; height: 100%; display: block; border-radius: inherit; object-fit: cover; }
.sidebar__nav {
    --scrollbar-thumb: rgba(255, 255, 255, .2);
    --scrollbar-thumb-hover: rgba(255, 255, 255, .38);
    flex: 1;
    overflow-y: auto;
}
.nav-label { margin: 0 12px 8px; color: #6d6a64; font-size: .7rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.nav-label--spaced { margin-top: 27px; }
.nav-link { display: flex; align-items: center; gap: 12px; min-height: 46px; margin: 3px 0; padding: 9px 12px; border-radius: 12px; color: #9a968c; font-size: .92rem; font-weight: 600; transition: .15s ease; }
.nav-count { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; min-width: 22px; height: 22px; margin-left: auto; padding: 0 6px; border-radius: 999px; background: #a41e34; color: #fff; font-size: .72rem; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.mobile-account-nav .quick-add__menu .mobile-updates-link { display: flex; align-items: center; gap: 12px; }
.nav-link:hover { color: #fff; background: rgba(255,255,255,.07); }
.nav-link.is-active { color: #fff; background: rgba(255,255,255,.12); box-shadow: inset 3px 0 var(--gold); }
.ui-icon { width: 1em; height: 1em; display: block; flex: 0 0 auto; }
.nav-icon { width: 24px; display: inline-grid; place-items: center; color: #8e8880; }
.nav-icon .ui-icon { width: 20px; height: 20px; }
.nav-link.is-active .nav-icon { color: #c9435a; }
.sidebar__footer { padding-top: 12px; border-top: 1px solid rgba(255,255,255,.09); }
.user-chip { display: flex; align-items: center; gap: 11px; padding: 8px; border-radius: 12px; }
.user-chip:hover { background: rgba(255,255,255,.07); }
.avatar { width: 38px; height: 38px; flex: 0 0 38px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: #8c1a2d; font-size: .75rem; font-weight: 800; }
.user-chip__copy { min-width: 0; }
.user-chip__copy strong, .user-chip__copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-chip__copy strong { color: #fff; font-size: .85rem; }
.user-chip__copy small { color: #6d6a64; font-size: .72rem; }

.topbar {
    position: sticky; top: 0; z-index: 20; min-height: 88px; display: flex; align-items: center; justify-content: space-between;
    padding: 18px 30px; border-bottom: 1px solid rgba(221, 227, 223, .85); background: rgba(244,246,243,.92); backdrop-filter: blur(14px);
}
.topbar__title p { margin: 0 0 1px; color: var(--ink-faint); font-size: .75rem; font-weight: 650; text-transform: uppercase; letter-spacing: .06em; }
.topbar__title h1 { margin: 0; font-size: 1.45rem; }
.mobile-brand { display: none; }
.quick-add { position: relative; }
.quick-add summary { list-style: none; }
.quick-add summary::-webkit-details-marker { display: none; }
.quick-add[open] summary::before { content: ""; position: fixed; inset: 0; z-index: -1; }
.quick-add__menu { position: absolute; top: calc(100% + 10px); right: 0; width: 270px; padding: 10px; border: 1px solid var(--line); border-radius: 15px; background: #fff; box-shadow: var(--shadow-lg); }
.quick-add__menu > p { margin: 4px 8px 7px; color: var(--ink-faint); font-size: .72rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.quick-add__menu a { display: block; padding: 10px 11px; border-radius: 10px; }
.quick-add__menu a:hover { background: var(--forest-50); }
.quick-add__menu strong, .quick-add__menu small { display: block; }
.quick-add__menu strong { font-size: .9rem; }
.quick-add__menu small { color: var(--ink-soft); font-size: .78rem; }

.button { min-height: 42px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 9px 15px; border: 1px solid transparent; border-radius: 11px; font-weight: 750; font-size: .88rem; line-height: 1; transition: .15s ease; }
.button:hover { transform: translateY(-1px); }
.button--primary { color: #fff; background: var(--forest-800); box-shadow: 0 6px 16px rgba(122, 22, 38, .17); }
.button--primary:hover { background: var(--forest-700); }
.button--secondary { color: var(--forest-800); border-color: var(--line); background: #fff; }
.button--secondary:hover { border-color: rgba(164, 30, 52, .3); background: var(--forest-50); }
.button--danger { color: var(--danger); border-color: #f2caca; background: #fff; }
.button--compact { min-height: 39px; padding: 8px 13px; }
.button--large { min-height: 50px; padding: 13px 20px; }
.button--full { width: 100%; }
.text-button { padding: 5px; border: 0; color: var(--forest-700); background: transparent; font-size: .78rem; font-weight: 800; }
.link { color: var(--forest-700); font-weight: 750; }
.link:hover { text-decoration: underline; }

[data-toast] { display: none !important; }
#toast-container { position: fixed; z-index: 10000; display: flex; width: min(380px, calc(100vw - 32px)); flex-direction: column; gap: 10px; pointer-events: none; }
#toast-container.toast-bottom-right { right: max(16px, env(safe-area-inset-right)); bottom: max(16px, env(safe-area-inset-bottom)); }
.tmc-toast { --toast-accent: #55a9d0; position: relative; display: grid; grid-template-columns: 30px minmax(0, 1fr) 24px; gap: 10px; align-items: start; padding: 14px; overflow: hidden; color: #f8fafc; border: 1px solid rgba(255,255,255,.13); border-radius: 13px; background: #202126; box-shadow: 0 16px 38px rgba(0,0,0,.24); pointer-events: auto; animation: toast-in .2s ease-out; }
.tmc-toast::before { position: absolute; inset: 0 auto 0 0; width: 4px; content: ""; background: var(--toast-accent); }
.toast--success { --toast-accent: #38b77a; }
.toast--error { --toast-accent: #e66363; }
.toast--warning { --toast-accent: #e7ad43; }
.toast--info { --toast-accent: #55a9d0; }
.toast__icon { display: grid; width: 26px; height: 26px; place-items: center; color: #151619; border-radius: 50%; background: var(--toast-accent); font-size: .82rem; font-weight: 900; }
.toast__copy { min-width: 0; }
.toast__title, .toast__message { display: block; }
.toast__title { margin: 1px 0 3px; color: #fff; font-size: .88rem; }
.toast__message { color: #e4e5e8; font-size: .84rem; font-weight: 600; line-height: 1.45; overflow-wrap: anywhere; }
.toast__close { width: 24px; height: 24px; padding: 0; color: #bdc0c7; border: 0; background: transparent; font-size: 1.3rem; line-height: 1; }
.toast__close:hover { color: #fff; }
.toast__actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }
.toast__action { min-height: 32px; padding: 6px 11px; color: #f3f4f6; border: 1px solid #555861; border-radius: 8px; background: transparent; font-size: .76rem; font-weight: 800; }
.toast__action--primary { color: #fff; border-color: var(--forest-600); background: var(--forest-700); }
.tmc-confirm-dialog { position: fixed; inset: 0; width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; padding: 16px; border: 0; background: transparent; }
.tmc-confirm-dialog[open] { display: grid; place-items: center; }
.tmc-confirm-dialog::backdrop { background: rgba(0, 0, 0, .65); }
.tmc-toast[data-toast-confirm] { width: min(380px, 100%); max-height: 100%; overflow-y: auto; animation: toast-confirm-in .2s ease-out; }
.toast--leaving { animation: toast-out .18s ease-in forwards; }
.tmc-toast[data-toast-confirm].toast--leaving { animation: toast-confirm-out .18s ease-in forwards; }
@keyframes toast-in { from { opacity: 0; transform: translate3d(18px, 0, 0); } }
@keyframes toast-out { to { opacity: 0; transform: translate3d(18px, 0, 0); } }
@keyframes toast-confirm-in { from { opacity: 0; transform: translateY(12px); } }
@keyframes toast-confirm-out { to { opacity: 0; transform: translateY(12px); } }

.page-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 20px; }
.page-heading h1 { margin-bottom: 4px; }
.page-heading p { margin-bottom: 0; color: var(--ink-soft); }
.page-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.vehicle-actions-toggle { display: none; }
.vehicle-view-tabs { display: inline-flex; gap: 4px; margin-bottom: 16px; padding: 4px; border: 1px solid var(--line-soft); border-radius: 12px; background: var(--surface-muted); }
.vehicle-view-tab { padding: 8px 13px; border-radius: 9px; color: var(--ink-soft); font-size: .78rem; font-weight: 800; line-height: 1.2; }
.vehicle-view-tab:hover { color: var(--ink); background: var(--surface-hover); }
.vehicle-view-tab[aria-current="page"] { color: var(--forest-800); background: var(--surface-solid); box-shadow: 0 2px 8px rgba(84, 27, 37, .08); }
.vehicle-view-tab:focus-visible { outline: 2px solid var(--forest-700); outline-offset: 2px; }
.eyebrow { margin-bottom: 7px; color: var(--gold-dark); font-size: .72rem; font-weight: 850; letter-spacing: .11em; text-transform: uppercase; }
.muted { color: var(--ink-soft); }
.small { font-size: .82rem; }
.tiny { font-size: .72rem; }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }
.nowrap { white-space: nowrap; }
.stack-sm > * + * { margin-top: 8px; }
.stack > * + * { margin-top: 14px; }
.stack-lg > * + * { margin-top: 20px; }

.dashboard-welcome { position: relative; overflow: hidden; display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 20px; padding: 23px 26px; border-radius: var(--radius-lg); color: #fff; background: #7a1626; box-shadow: var(--shadow-sm); }
.dashboard-welcome::after { content: ""; position: absolute; width: 240px; height: 240px; right: -60px; top: -130px; border: 45px solid rgba(211,168,75,.12); border-radius: 50%; }
.dashboard-welcome__copy { position: relative; z-index: 1; }
.dashboard-welcome h1 { margin-bottom: 6px; font-size: clamp(1.35rem, 3vw, 1.85rem); }
.dashboard-welcome p { margin-bottom: 0; color: #c7c2b8; }
.dashboard-welcome .button { position: relative; z-index: 2; flex: 0 0 auto; color: var(--forest-800); background: #f6f4ef; box-shadow: none; }

.metric-grid { display: grid; grid-template-columns: repeat(6, minmax(135px, 1fr)); gap: 12px; margin-bottom: 20px; }
.metric-card { min-width: 0; padding: 17px 18px; border: 1px solid var(--line-soft); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); }
.metric-card__top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 13px; }
.metric-card__label { color: var(--ink-soft); font-size: .76rem; font-weight: 750; }
.metric-card__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--forest-100); box-shadow: 0 0 0 4px var(--forest-50); }
.metric-card__dot--gold { background: var(--gold); box-shadow: 0 0 0 4px var(--gold-soft); }
.metric-card__value { display: block; overflow: hidden; text-overflow: ellipsis; font-size: 1.45rem; line-height: 1; letter-spacing: -.04em; }
.metric-card__note { display: block; margin-top: 8px; color: var(--ink-faint); font-size: .7rem; }

.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(300px, .75fr); gap: 18px; }
.card { border: 1px solid var(--line-soft); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); }
.card + .card { margin-top: 16px; }
.card__header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 17px 19px; border-bottom: 1px solid var(--line-soft); }
/* Keep header backgrounds inside the rounded border without clipping card controls. */
.card > .card__header:first-child { border-radius: calc(var(--radius) - 1px) calc(var(--radius) - 1px) 0 0; }
.card__header h2 { margin: 0; }
.card__header p { margin: 3px 0 0; color: var(--ink-soft); font-size: .8rem; }
.card__body { padding: 18px 19px; }
.card__body--flush { padding: 0; }
.deals-pending { margin-bottom: 20px; }
.deals-pending + .metric-grid { margin-top: 20px; }

.attention-list { display: grid; gap: 9px; }
.attention-item { display: flex; align-items: center; gap: 13px; padding: 12px; border: 1px solid var(--line-soft); border-radius: 12px; transition: .15s; }
.attention-item:hover { border-color: #d0c8c0; background: var(--forest-50); }
.attention-item__icon { width: 36px; height: 36px; flex: 0 0 36px; display: grid; place-items: center; border-radius: 10px; color: var(--warning); background: var(--warning-soft); font-weight: 800; }
.attention-item__copy { min-width: 0; flex: 1; }
.attention-item__copy strong, .attention-item__copy small { display: block; }
.attention-item__copy strong { overflow: hidden; text-overflow: ellipsis; font-size: .88rem; white-space: nowrap; }
.attention-item__copy small { margin-top: 2px; color: var(--ink-soft); font-size: .73rem; }
.attention-item__count { color: var(--forest-700); font-weight: 850; }

.list-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 14px; padding: 14px 18px; border-bottom: 1px solid var(--line-soft); }
.list-row:last-child { border-bottom: 0; }
.list-row:hover { background: #fbfcfb; }
.list-row__main { min-width: 0; display: flex; align-items: center; gap: 12px; }
.list-row__copy { min-width: 0; }
.list-row__copy strong, .list-row__copy small { display: block; }
.list-row__copy strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .9rem; }
.list-row__copy small { margin-top: 3px; color: var(--ink-soft); font-size: .75rem; }
.list-row__meta { text-align: right; }
.list-row__meta strong, .list-row__meta small { display: block; }
.list-row__meta strong { font-size: .88rem; }
.list-row__meta small { color: var(--ink-faint); font-size: .72rem; }
.vehicle-thumb { width: 46px; height: 40px; flex: 0 0 46px; display: grid; place-items: center; border-radius: 10px; color: var(--forest-700); background: var(--forest-50); font-size: .67rem; font-weight: 850; letter-spacing: .04em; }
.vehicle-thumb__image { width: 100%; height: 100%; display: block; border-radius: inherit; object-fit: cover; }
.inventory-vehicle { display: flex; align-items: center; gap: 10px; min-width: 0; text-align: left; }
.vehicle-summary__copy { min-width: 0; }
.inventory-vehicle .cell-main { display: block; color: var(--ink); font-size: .85rem; font-weight: 750; overflow-wrap: anywhere; }
.inventory-vehicle .cell-sub { display: block; margin-top: 2px; color: var(--ink-soft); font-size: .72rem; font-weight: 400; overflow-wrap: anywhere; }
.inventory-vehicle .vehicle-summary__context { display: block; margin-top: 4px; color: var(--ink-soft); font-size: .73rem; font-weight: 400; line-height: 1.45; overflow-wrap: anywhere; }
a.inventory-vehicle:hover .cell-main { color: var(--forest-700); text-decoration: underline; }

.document-upload .field + .field { margin-top: 12px; }
.document-upload__help { margin: 8px 0 13px; color: var(--ink-faint); font-size: .7rem; }
.document-upload input[type="file"] { min-height: 48px; padding: 6px; color: var(--ink-soft); font-size: .76rem; }
.document-upload input[type="file"]::file-selector-button {
    min-height: 34px; margin-right: 8px; padding: 7px 10px; border: 1px solid var(--line);
    border-radius: 8px; color: var(--forest-700); background: var(--surface-solid); font-weight: 750;
}
.document-list { margin-top: 18px; padding-top: 7px; border-top: 1px solid var(--line-soft); }
.document-item { display: flex; align-items: center; gap: 5px; border-bottom: 1px solid var(--line-soft); }
.document-item:last-child { border-bottom: 0; }
.document-item__link { min-width: 0; flex: 1; display: flex; align-items: center; gap: 10px; padding: 11px 4px; border-radius: 10px; }
.document-item__link:hover { background: var(--surface-muted); }
.document-item__icon {
    width: 38px; height: 38px; flex: 0 0 38px; display: grid; place-items: center;
    border-radius: 10px; color: var(--forest-700); background: var(--forest-50);
}
.document-item__icon .ui-icon { width: 18px; height: 18px; }
.document-item__copy { min-width: 0; flex: 1; }
.document-item__copy strong, .document-item__copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.document-item__copy strong { font-size: .8rem; }
.document-item__copy small { margin-top: 2px; color: var(--ink-soft); font-size: .65rem; }
.document-item__download { color: var(--ink-faint); }
.document-item__remove {
    width: 34px; height: 34px; display: grid; place-items: center; padding: 0;
    border: 0; border-radius: 9px; color: var(--ink-faint); background: transparent;
}
.document-item__remove:hover { color: var(--danger); background: var(--danger-soft); }
.document-item__remove .ui-icon, .document-item__download .ui-icon { width: 16px; height: 16px; }
.document-item--agreement { margin-top: 4px; border: 1px solid rgba(164, 30, 52, .14); border-radius: 12px; background: rgba(164, 30, 52, .045); }
.document-item--agreement .document-item__link { padding: 11px 9px; }
.document-item--agreement .document-item__icon { color: #fff; background: var(--forest-700); }
.document-item__badges { display: flex !important; align-items: center; gap: 5px; margin-bottom: 5px; overflow: visible !important; white-space: normal !important; }
.document-item__badges .status { display: inline-flex; margin: 0; padding: 3px 6px; font-size: .58rem; line-height: 1; }
.signed-agreement-upload { margin: -1px 0 7px; padding: 0 7px 7px; border: 1px solid rgba(164, 30, 52, .14); border-top: 0; border-radius: 0 0 12px 12px; background: rgba(164, 30, 52, .045); }
.signed-agreement-upload__field { position: relative; display: block; cursor: pointer; }
.signed-agreement-upload__field > span { display: inline-flex; align-items: center; gap: 6px; color: var(--forest-700); font-size: .68rem; font-weight: 800; }
.signed-agreement-upload__field .ui-icon { width: 14px; height: 14px; }
.signed-agreement-upload__field input { position: absolute; width: 1px; height: 1px; min-height: 0; opacity: 0; pointer-events: none; }

.photo-grid {
    margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line-soft);
    display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px;
}
.photo-tile { position: relative; aspect-ratio: 1 / 1; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-muted); }
.photo-grid[data-photo-sort] .photo-tile { transition: opacity .15s ease, transform .15s ease, box-shadow .15s ease; }
.photo-tile.is-dragging { z-index: 2; opacity: .55; transform: scale(.96); box-shadow: 0 10px 26px rgba(0, 0, 0, .24); pointer-events: none; }
.photo-tile__link { display: block; width: 100%; height: 100%; }
.photo-tile img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .2s ease; }
.photo-tile:hover img { transform: scale(1.05); }
.photo-tile__delete { position: absolute; top: 5px; right: 5px; margin: 0; opacity: 0; transition: opacity .15s ease; }
.photo-tile:hover .photo-tile__delete, .photo-tile:focus-within .photo-tile__delete { opacity: 1; }
.photo-tile__delete button {
    width: 28px; height: 28px; display: grid; place-items: center; padding: 0;
    border: 0; border-radius: 8px; color: #fff; background: rgba(20, 20, 22, .62);
    -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); cursor: pointer;
}
.photo-tile__delete button:hover { background: var(--danger); }
.photo-tile__delete .ui-icon { width: 15px; height: 15px; }
.photo-tile__drag {
    position: absolute; right: 5px; bottom: 5px; width: 30px; height: 28px; padding: 0;
    border: 0; border-radius: 8px; color: #fff; background: rgba(20, 20, 22, .62);
    font-size: 1rem; line-height: 1; touch-action: none; cursor: grab;
    -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
}
.photo-tile__drag:active { cursor: grabbing; }
.photo-tile__drag:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.photo-tile__cover {
    position: absolute; top: 6px; left: 6px; display: none; padding: 4px 7px;
    border-radius: 999px; color: #fff; background: rgba(164, 30, 52, .88);
    font-size: .58rem; font-weight: 850; letter-spacing: .04em; text-transform: uppercase;
}
.photo-tile:first-child .photo-tile__cover { display: block; }
@media (hover: none) { .photo-tile__delete { opacity: 1; } }

.status { display: inline-flex; align-items: center; gap: 5px; min-height: 25px; padding: 4px 8px; border-radius: 999px; font-size: .68rem; font-weight: 800; white-space: nowrap; }
.status::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.status--success { color: var(--success); background: var(--success-soft); }
.status--warning { color: var(--warning); background: var(--warning-soft); }
.status--danger { color: var(--danger); background: var(--danger-soft); }
.status--neutral { color: #6d6a64; background: #eeeae4; }

.toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.search-field { position: relative; flex: 1; }
.search-field input { padding-left: 40px; }
.search-field::before { content: "⌕"; position: absolute; left: 14px; top: 50%; transform: translateY(-51%); color: var(--ink-faint); font-size: 1.15rem; }
.filter-select { width: auto; min-width: 160px; }

.data-table { width: 100%; border-collapse: collapse; }
.data-table th { padding: 11px 15px; border-bottom: 1px solid var(--line); color: var(--ink-faint); background: #fafbfa; font-size: .68rem; font-weight: 850; letter-spacing: .06em; text-align: left; text-transform: uppercase; white-space: nowrap; }
.data-table td { padding: 14px 15px; border-bottom: 1px solid var(--line-soft); font-size: .85rem; vertical-align: middle; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover { background: #fbfcfb; }
.table-actions { display: flex; align-items: center; gap: 7px; }
.table-actions form { margin: 0; }
.data-table .cell-main { display: block; font-weight: 750; }
.data-table .cell-sub { display: block; margin-top: 2px; color: var(--ink-soft); font-size: .72rem; }
.mobile-records { display: none; }
.record-card { display: block; padding: 15px; border: 1px solid var(--line-soft); border-radius: 14px; background: #fff; box-shadow: var(--shadow-sm); }
.record-card__top, .record-card__bottom { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.record-card__top h3 { margin-bottom: 3px; font-size: .97rem; }
.record-card__top p { margin: 0; color: var(--ink-soft); font-size: .75rem; }
.record-card__bottom { align-items: flex-end; margin-top: 15px; padding-top: 12px; border-top: 1px solid var(--line-soft); }
.record-card__bottom small, .record-card__bottom strong { display: block; }
.record-card__bottom small { color: var(--ink-faint); font-size: .67rem; }
.record-card__bottom strong { margin-top: 2px; font-size: .85rem; }

.vehicle-hero { position: relative; overflow: hidden; margin-bottom: 17px; padding: 24px; border-radius: var(--radius-lg); color: #fff; background: #7a1626; }
.vehicle-hero::after { content: attr(data-initials); position: absolute; right: 22px; bottom: -24px; color: rgba(255,255,255,.045); font-size: 8rem; font-weight: 900; letter-spacing: -.08em; }
.vehicle-hero__top, .vehicle-hero__bottom { position: relative; z-index: 1; display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.vehicle-hero h1 { margin: 8px 0 5px; }
.vehicle-hero p { margin: 0; color: #c7c2b8; }
.vehicle-hero__pricing { text-align: right; }
.vehicle-hero .vehicle-hero__depreciation { margin-top: 5px; color: #fff; font-size: .78rem; font-weight: 750; }
.vehicle-hero__bottom { align-items: flex-end; margin-top: 25px; }
.vehicle-key { display: flex; flex-wrap: wrap; gap: 22px; }
.vehicle-key span { display: block; color: #9a968c; font-size: .66rem; font-weight: 750; letter-spacing: .06em; text-transform: uppercase; }
.vehicle-key strong { display: block; margin-top: 2px; font-size: .9rem; }
.vehicle-hero .field select { color: #fff; border-color: rgba(255,255,255,.18); background-color: rgba(255,255,255,.09); }

.detail-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(280px, .65fr); gap: 17px; }
.info-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px 16px; }
.info-item > span { display: block; margin-bottom: 4px; color: var(--ink-faint); font-size: .7rem; font-weight: 750; text-transform: uppercase; letter-spacing: .04em; }
.info-item strong { font-size: .9rem; }
.info-item__value { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; }
.info-item__value .status { display: inline-flex; margin-bottom: 0; color: var(--warning); font-size: .68rem; letter-spacing: 0; text-transform: none; }
.completed-sale-heading { margin: 22px 0 10px; padding-top: 18px; border-top: 1px solid var(--line-soft); }
.earning-list { display: grid; gap: 8px; }
.earning-row { display: flex; align-items: center; gap: 12px; padding: 12px 10px 12px 14px; border: 1px solid var(--line-soft); border-radius: 12px; }
.earning-row__copy { min-width: 0; flex: 1; }
.earning-row__copy strong { display: block; font-size: .85rem; overflow-wrap: anywhere; }
.earning-row__copy small { display: block; margin-top: 4px; color: var(--ink-soft); font-size: .72rem; }
.earning-row__amount { flex-shrink: 0; font-size: .85rem; font-variant-numeric: tabular-nums; }
.earning-row form { flex-shrink: 0; margin: 0; }
.earning-row__delete { display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 9px; color: var(--ink-faint); background: transparent; cursor: pointer; }
.earning-row__delete:hover { color: var(--danger); background: var(--danger-soft); }
.earning-row__delete:focus-visible { outline: 2px solid var(--danger); outline-offset: 2px; }
.earning-row__delete .ui-icon { width: 18px; height: 18px; }
.earning-add { margin-top: 16px; }
.earning-add > summary { width: fit-content; list-style: none; cursor: pointer; }
.earning-add > summary::-webkit-details-marker { display: none; }
.earning-add__actions { display: flex; justify-content: flex-end; margin-top: 16px; }
.earning-add__form { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line-soft); }
@media (max-width: 480px) {
    .earning-add__actions .button { width: 100%; }
    .earning-row { gap: 8px; padding: 10px 6px 10px 12px; flex-wrap: wrap; }
    .earning-row__copy { flex-basis: calc(100% - 64px); }
    .earning-row__amount { order: 1; width: 100%; }
}

.financial-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.financial-cell { padding: 13px; border-radius: 12px; background: var(--forest-50); }
.financial-cell span, .financial-cell strong { display: block; }
.financial-cell span { color: var(--ink-soft); font-size: .68rem; }
.financial-cell strong { margin-top: 5px; font-size: .95rem; }
.financial-cell .financial-profit { font-size: 1.1rem; font-weight: 900; }
.negotiation-calculator { display: grid; grid-template-columns: minmax(0, 1.5fr) repeat(2, minmax(180px, 1fr)); gap: 10px; align-items: end; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line-soft); }
.negotiation-calculator__field { margin: 0; }
.completed-sale-heading,
.field.negotiation-calculator__field > span:first-child { font-size: 1rem; }
.negotiation-money-input { position: relative; display: block; }
.negotiation-money-input__prefix { position: absolute; top: 50%; left: 12px; z-index: 1; color: var(--ink-soft); font-size: .82rem; font-weight: 750; line-height: 1; transform: translateY(-50%); pointer-events: none; }
.negotiation-money-input input { padding-left: 38px; }
.negotiation-calculator__result { min-height: 44px; padding: 8px 13px; border-radius: 12px; background: var(--surface-muted); }
.negotiation-calculator__result span, .negotiation-calculator__result strong { display: block; }
.negotiation-calculator__result span { color: var(--ink-soft); font-size: .68rem; }
.negotiation-calculator__result strong { margin-top: 3px; font-size: 1.05rem; }
.calculation-note { margin: 9px 0 0; color: var(--ink-faint); font-size: .72rem; }
.notes-box { color: var(--ink-soft); font-size: .88rem; white-space: pre-wrap; }

.expense-page-heading { align-items: center; }
.expense-actions { align-items: center; }
.expense-actions form { margin: 0; }
.expense-hero {
    position: relative; overflow: hidden; display: flex; align-items: flex-end; justify-content: space-between; gap: 28px;
    margin-bottom: 17px; padding: 25px 27px; border: 1px solid rgba(255,255,255,.13); border-radius: var(--radius-lg);
    color: #fff; background: #7a1626;
    box-shadow: 0 18px 45px rgba(82, 18, 29, .18), inset 0 1px rgba(255,255,255,.13);
}
.expense-hero::after {
    content: "$"; position: absolute; right: 25%; bottom: -68px; color: rgba(255,255,255,.04);
    font-size: 12rem; font-weight: 900; line-height: 1;
}
.expense-hero__copy, .expense-hero__amount { position: relative; z-index: 1; }
.expense-hero__labels { display: flex; align-items: center; gap: 10px; margin-bottom: 17px; }
.expense-hero__labels > span:not(.status) { color: #c7c2b8; font-size: .74rem; font-weight: 750; }
.expense-hero .eyebrow { margin-bottom: 7px; color: #eaa2ae; }
.expense-hero h1 { max-width: 780px; margin-bottom: 7px; font-size: clamp(1.65rem, 3vw, 2.35rem); }
.expense-hero__copy > p:last-child { margin: 0; color: #c7c2b8; font-size: .9rem; }
.expense-hero__amount { min-width: 180px; text-align: right; }
.expense-hero__amount span, .expense-hero__amount strong, .expense-hero__amount small { display: block; }
.expense-hero__amount span { color: #aaa49b; font-size: .68rem; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }
.expense-hero__amount strong { margin: 3px 0; font-size: clamp(1.8rem, 4vw, 2.65rem); letter-spacing: -.055em; }
.expense-hero__amount small { color: #c7c2b8; font-size: .75rem; }
.expense-detail-grid .card + .card { margin-top: 16px; }
.calculation-note { margin: 14px 0 0; color: var(--ink-faint); font-size: .73rem; }
.expense-vehicle { display: flex; align-items: center; gap: 12px; }
.expense-vehicle > span:last-child { min-width: 0; }
.expense-vehicle strong, .expense-vehicle small { display: block; }
.expense-vehicle strong { font-size: .95rem; }
.expense-vehicle small { overflow: hidden; margin-top: 3px; color: var(--ink-soft); font-size: .73rem; text-overflow: ellipsis; white-space: nowrap; }
.info-grid--compact { grid-template-columns: repeat(2, 1fr); gap: 16px 12px; padding: 15px 0; border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); }

.form-card { max-width: 980px; margin: 0 auto; }
.form-card .card__body { padding: 24px; }
.logcard-import {
    margin: -4px -4px 30px; padding: 20px; border: 1px solid rgba(164, 30, 52, .18); border-radius: 17px;
    background: linear-gradient(135deg, rgba(250, 240, 242, .9), rgba(255, 255, 255, .74));
}
.logcard-import + fieldset { margin-top: 0; padding-top: 0; border-top: 0; }
.logcard-import__heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.logcard-import__heading legend { margin-bottom: 6px; font-size: 1.08rem; font-weight: 800; letter-spacing: -.015em; }
.logcard-import__heading .eyebrow { display: block; margin-bottom: 5px; }
.logcard-import__heading .field-help { max-width: 690px; margin-bottom: 15px; }
.logcard-import__privacy { flex: 0 0 auto; margin-top: 2px; padding: 5px 9px; color: var(--success); border-radius: 999px; background: var(--success-soft); font-size: .69rem; font-weight: 800; }
.logcard-dropzone {
    display: flex; min-height: 86px; align-items: center; gap: 14px; padding: 15px; border: 1.5px dashed rgba(122, 22, 38, .32); border-radius: 14px;
    background: rgba(255, 255, 255, .7); cursor: pointer; transition: border-color .15s ease, background .15s ease, transform .15s ease;
}
.logcard-dropzone:hover, .logcard-dropzone.is-dragging { border-color: var(--forest-700); background: var(--surface-solid); transform: translateY(-1px); }
.logcard-dropzone__icon { width: 44px; height: 44px; flex: 0 0 44px; display: grid; place-items: center; color: var(--forest-700); border-radius: 13px; background: var(--forest-50); }
.logcard-dropzone__icon .ui-icon { width: 21px; height: 21px; }
.logcard-dropzone__copy { min-width: 0; flex: 1; }
.logcard-dropzone__copy strong, .logcard-dropzone__copy small { display: block; overflow: hidden; text-overflow: ellipsis; }
.logcard-dropzone__copy strong { color: var(--ink); font-size: .88rem; }
.logcard-dropzone__copy small { margin-top: 3px; color: var(--ink-soft); font-size: .75rem; }
.logcard-dropzone__button { pointer-events: none; }
.logcard-import__result { display: flex; align-items: center; gap: 10px; margin-top: 11px; padding: 10px 12px; color: var(--success); border-radius: 11px; background: var(--success-soft); }
.logcard-import__result[hidden] { display: none; }
.logcard-import__result-icon { width: 23px; height: 23px; flex: 0 0 23px; display: grid; place-items: center; color: #fff; border-radius: 50%; background: var(--success); font-size: .75rem; font-weight: 900; }
.logcard-import__result p { margin: 0; font-size: .76rem; line-height: 1.4; }
.logcard-import__result strong, .logcard-import__result span { display: block; }
.logcard-import.is-loading .logcard-dropzone__icon { animation: logcard-pulse 1s ease-in-out infinite alternate; }
.logcard-import.has-error .logcard-dropzone { border-color: rgba(180, 60, 60, .45); background: var(--danger-soft); }
.field input.is-imported { border-color: rgba(23, 125, 88, .45); background: var(--success-soft); box-shadow: 0 0 0 3px rgba(23, 125, 88, .08); }
@keyframes logcard-pulse { to { opacity: .5; transform: translateY(-2px); } }
.agreement-deal-picker { max-width: 720px; margin: 0 0 16px; }
.agreement-deal-picker .card__body { padding: 14px 17px; }
.agreement-workspace { display: grid; grid-template-columns: minmax(0, 920px) minmax(250px, 310px); align-items: start; gap: 18px; }
.agreement-workspace .form-card { width: 100%; max-width: none; margin: 0; }
.agreement-preview-card { position: sticky; top: 112px; overflow: hidden; border: 1px solid var(--glass-border); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); }
.agreement-preview-card__header { display: flex; align-items: center; gap: 11px; padding: 17px; color: #fff; background: #1c0c10; }
.agreement-preview-card__header .brand-mark { width: 38px; height: 38px; flex-basis: 38px; border-radius: 11px; }
.agreement-preview-card__header strong, .agreement-preview-card__header small { display: block; }
.agreement-preview-card__header strong { font-size: .84rem; text-transform: uppercase; letter-spacing: .025em; }
.agreement-preview-card__header small { margin-top: 2px; color: #9a968c; font-size: .68rem; }
.agreement-preview-card__body { display: grid; gap: 8px; padding: 17px; }
.agreement-preview-card__body span { padding: 9px 10px; border-left: 3px solid var(--forest-700); color: var(--ink-soft); background: var(--surface-muted); font-size: .75rem; font-weight: 750; }
.agreement-preview-card__footer { padding: 15px 17px; border-top: 1px solid var(--line-soft); }
.agreement-preview-card__footer strong, .agreement-preview-card__footer small { display: block; }
.agreement-preview-card__footer strong { color: var(--forest-700); font-size: .75rem; }
.agreement-preview-card__footer small { margin-top: 4px; color: var(--ink-soft); font-size: .68rem; line-height: 1.45; }
.agreement-vehicle-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 9px; margin-bottom: 16px; }
.agreement-vehicle-summary span { min-width: 0; padding: 11px; border-radius: 11px; background: var(--surface-muted); }
.agreement-vehicle-summary small, .agreement-vehicle-summary strong { display: block; }
.agreement-vehicle-summary small { color: var(--ink-faint); font-size: .64rem; font-weight: 750; text-transform: uppercase; }
.agreement-vehicle-summary strong { overflow: hidden; margin-top: 4px; font-size: .78rem; text-overflow: ellipsis; white-space: nowrap; }
.agreement-confirmation { margin-top: 27px; padding: 14px; border: 1px solid rgba(164, 30, 52, .17); border-radius: 12px; background: var(--forest-50); }
.agreement-confirmation label { display: flex; align-items: flex-start; gap: 10px; color: var(--ink-soft); font-size: .8rem; font-weight: 650; cursor: pointer; }
.agreement-confirmation input { width: 18px; height: 18px; min-height: 0; flex: 0 0 18px; margin: 1px 0 0; accent-color: var(--forest-700); }

.floor-stock-toggle {
    display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px;
    border: 1px solid var(--line); border-radius: 12px; background: var(--surface-muted); cursor: pointer;
}
.floor-stock-toggle input { width: 19px; height: 19px; min-height: 0; flex: 0 0 19px; margin: 1px 0 0; }
.floor-stock-toggle span { display: grid; gap: 3px; }
.floor-stock-toggle strong { color: var(--ink); font-size: .9rem; }
.floor-stock-toggle small { color: var(--ink-soft); font-size: .78rem; font-weight: 500; }
.floor-stock-fields { display: grid; gap: 16px; margin-top: 18px; }
.floor-stock-fields[hidden] { display: none !important; }
fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
fieldset + fieldset { margin-top: 30px; padding-top: 26px; border-top: 1px solid var(--line-soft); }
legend { width: 100%; margin-bottom: 4px; padding: 0; font-size: 1rem; font-weight: 850; letter-spacing: -.01em; }
.field-help { margin: 0 0 17px; color: var(--ink-soft); font-size: .8rem; }
.field-hint { display: block; margin-top: 6px; color: var(--ink-soft); font-size: .72rem; line-height: 1.4; }
.member-picker { position: relative; }
.member-picker__control {
    display: flex; min-height: 46px; align-items: center; gap: 7px; padding: 6px;
    border: 1px solid var(--line); border-radius: 12px; background: var(--input);
    box-shadow: inset 0 1px 2px rgba(25, 56, 50, .025); transition: .15s;
}
.member-picker:focus-within .member-picker__control { border-color: rgba(164, 30, 52, .52); box-shadow: 0 0 0 4px rgba(164, 30, 52, .1); }
.member-picker__chips { display: none; flex: 1 1 auto; flex-wrap: wrap; gap: 6px; min-width: 0; }
.member-picker.is-enhanced .member-picker__chips { display: flex; }
.member-picker__placeholder { align-self: center; padding-left: 5px; color: var(--ink-soft); font-size: .8rem; }
.member-tag {
    display: inline-flex; max-width: 100%; min-height: 32px; align-items: center; gap: 7px;
    padding: 3px 5px 3px 4px; border: 1px solid rgba(164, 30, 52, .18); border-radius: 999px;
    color: var(--ink); background: rgba(164, 30, 52, .09); font-size: .78rem; font-weight: 750;
}
.member-tag__avatar, .member-picker__avatar {
    display: inline-grid; flex: 0 0 auto; width: 24px; height: 24px; place-items: center;
    border-radius: 50%; color: #fff; background: var(--forest-700); font-size: .67rem; font-weight: 850;
}
.member-tag__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.member-tag__remove {
    display: grid; flex: 0 0 auto; width: 22px; height: 22px; min-height: 0; place-items: center; padding: 0;
    border: 0; border-radius: 50%; color: var(--ink-soft); background: transparent; font-size: 1rem; line-height: 1;
}
.member-tag__remove:hover { color: #fff; background: var(--forest-700); }
.member-picker__trigger {
    display: none; flex: 0 0 auto; min-height: 32px; align-items: center; gap: 4px; padding: 6px 9px;
    border: 0; border-radius: 8px; color: var(--forest-700); background: transparent; font-size: .75rem; font-weight: 850;
}
.member-picker.is-enhanced .member-picker__trigger { display: inline-flex; }
.member-picker__trigger:hover { background: rgba(164, 30, 52, .08); }
.member-picker__menu {
    margin-top: 7px; padding: 8px; border: 1px solid var(--glass-border); border-radius: 13px;
    background: var(--surface-solid, #fff); box-shadow: var(--shadow-lg);
}
.member-picker.is-enhanced .member-picker__menu {
    position: absolute; z-index: 30; top: 100%; right: 0; left: 0; display: none;
}
.member-picker.is-enhanced .member-picker__menu.is-open { display: block; }
.member-picker__search { display: block; margin-bottom: 7px; }
.member-picker__search input { min-height: 39px; padding: 8px 10px; font-size: .8rem; }
.member-picker__options { max-height: 220px; overflow-y: auto; }
.member-picker__option {
    position: relative; display: grid; grid-template-columns: 28px minmax(0, 1fr) 20px; align-items: center; gap: 9px;
    padding: 8px; border-radius: 9px; cursor: pointer;
}
.member-picker__option:hover, .member-picker__option.is-selected { background: var(--surface-muted); }
.member-picker__option input { position: absolute; width: 1px; height: 1px; min-height: 0; opacity: 0; pointer-events: none; }
.member-picker__name { overflow: hidden; color: var(--ink); font-size: .8rem; font-weight: 750; text-overflow: ellipsis; white-space: nowrap; }
.member-picker__check { color: var(--forest-700); font-weight: 900; opacity: 0; }
.member-picker__option.is-selected .member-picker__check { opacity: 1; }
.member-picker__empty { margin: 0; padding: 13px 8px; color: var(--ink-soft); font-size: .78rem; text-align: center; }
.form-grid { display: grid; gap: 15px; }
.form-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.field { display: block; }
.field > span:first-child { display: block; margin-bottom: 6px; color: #48443f; font-size: .76rem; font-weight: 800; }
.field + .field, .form-grid + .field, .field + .form-grid, .form-grid + .form-grid { margin-top: 15px; }
.form-grid > .field { min-width: 0; }
.form-grid > .field + .field { margin-top: 0; }
.depreciation-preview { grid-column: 1 / -1; padding: 14px 16px; border: 1px solid rgba(164, 30, 52, .18); border-radius: 12px; background: var(--forest-50); }
.depreciation-preview span, .depreciation-preview strong, .depreciation-preview small { display: block; }
.depreciation-preview span { color: var(--ink-faint); font-size: .68rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.depreciation-preview strong { margin-top: 4px; color: var(--ink); font-size: 1.05rem; }
.depreciation-preview small { margin-top: 3px; color: var(--ink-soft); font-size: .72rem; }

.calculator-layout { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 20px; align-items: start; }
.calculator-card fieldset:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.calculator-mode { display: inline-flex; gap: 4px; margin-bottom: 18px; padding: 4px; border-radius: 12px; background: var(--surface-muted); }
.calculator-mode label { cursor: pointer; }
.calculator-mode input { position: absolute; opacity: 0; pointer-events: none; }
.calculator-mode span { display: block; padding: 9px 13px; border-radius: 9px; color: var(--ink-soft); font-size: .78rem; font-weight: 800; }
.calculator-mode input:checked + span { color: var(--ink); background: var(--surface-solid); box-shadow: var(--shadow-sm); }
.calculator-values .is-calculated input { color: var(--forest-700); background: var(--forest-50); font-weight: 800; }
.term-inputs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.term-inputs label { position: relative; }
.term-inputs input { padding-right: 58px; }
.term-inputs small { position: absolute; right: 11px; bottom: 12px; color: var(--ink-faint); font-size: .68rem; font-weight: 750; pointer-events: none; }
.calculator-result { position: sticky; top: 88px; overflow: hidden; border-top: 4px solid var(--brand); }
.calculator-result__label { margin: 22px 0 4px; color: var(--ink-soft); font-size: .76rem; font-weight: 750; }
.calculator-result__value { display: block; color: var(--brand); font-size: clamp(1.65rem, 4vw, 2.15rem); line-height: 1.1; letter-spacing: -.04em; }
.calculator-result__period { margin: 7px 0 22px; color: var(--ink-soft); font-size: .75rem; }
.calculator-breakdown { margin: 0; border-top: 1px solid var(--line); }
.calculator-breakdown div { display: flex; justify-content: space-between; gap: 15px; padding: 11px 0; border-bottom: 1px solid var(--line); font-size: .76rem; }
.calculator-breakdown dt { color: var(--ink-soft); }
.calculator-breakdown dd { margin: 0; color: var(--ink); font-weight: 800; text-align: right; }
.calculator-note { margin-top: 18px; padding: 13px; border-radius: 11px; background: var(--forest-50); }
.calculator-note strong { font-size: .75rem; }
.calculator-note p { margin: 4px 0 0; color: var(--ink-soft); font-size: .7rem; line-height: 1.55; }
input, select, textarea { width: 100%; min-height: 46px; padding: 10px 12px; border: 1px solid #d8d3cc; border-radius: 10px; outline: 0; color: var(--ink); background: #fff; transition: .15s; }
textarea { min-height: 104px; resize: vertical; }
input::placeholder, textarea::placeholder { color: #aaa49b; }
input:focus, select:focus, textarea:focus { border-color: var(--forest-700); box-shadow: 0 0 0 3px rgba(164, 30, 52, .1); }
input[readonly] { color: var(--ink-soft); background: #f2f4f2; }
.agreement-guide { margin-bottom: 18px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--forest-50); }
.agreement-guide strong { font-size: .82rem; }
.agreement-guide p { margin: 4px 0 0; color: var(--ink-soft); font-size: .76rem; line-height: 1.55; }

/* Safari gives native date controls a large intrinsic width; constrain them to
   their grid cell so iPad forms remain aligned with text and select fields. */
input[type="date"], input[type="datetime-local"], input[type="time"], input[type="month"], input[type="week"] {
    display: block;
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 46px;
    min-height: 46px;
    min-width: 0;
    max-width: 100%;
    padding: 10px 12px;
    font: inherit;
    line-height: 24px;
}
input[type="date"]::-webkit-date-and-time-value,
input[type="datetime-local"]::-webkit-date-and-time-value { min-height: 24px; padding: 0; text-align: left; }
input[type="date"]::-webkit-calendar-picker-indicator,
input[type="datetime-local"]::-webkit-calendar-picker-indicator { margin: 0; padding: 0; }

.signing-body { display: grid; min-height: 100vh; place-items: center; padding: 24px; background: var(--canvas); }
.signing-shell { width: min(720px, 100%); }
.signing-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.signing-brand strong, .signing-brand small { display: block; }
.signing-brand small { color: var(--ink-soft); }
.signature-pad { overflow: hidden; margin-top: 8px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.signature-pad canvas { display: block; width: 100%; height: 190px; touch-action: none; cursor: crosshair; }
.signature-pad__actions { display: flex; justify-content: flex-end; padding: 7px; border-top: 1px solid var(--line-soft); }
.signing-summary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 18px 0; }
.signing-summary span { padding: 12px; border-radius: 10px; background: var(--surface-muted); }
.signing-summary small, .signing-summary strong { display: block; }
.signing-summary small { color: var(--ink-soft); font-size: .72rem; }
.share-link { display: flex; gap: 8px; margin-top: 12px; }
.share-link input { flex: 1; }
.password-field { position: relative; display: block; }
.password-field input { padding-right: 60px; }
.password-field .text-button { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); }
.form-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 26px; padding-top: 20px; border-top: 1px solid var(--line-soft); }
.money-input { position: relative; }
.money-input::before { content: "S$"; position: absolute; left: 12px; top: 44px; transform: translateY(-50%); color: var(--ink-soft); font-size: .82rem; font-weight: 750; }
.money-input input { padding-left: 38px; }

.pipeline { display: flex; gap: 6px; overflow-x: auto; margin-bottom: 20px; padding-bottom: 4px; scrollbar-width: thin; }
.pipeline a { flex: 0 0 auto; min-width: 115px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 11px; background: #fff; }
.pipeline a.is-active { color: #fff; border-color: var(--forest-800); background: var(--forest-800); }
.pipeline span, .pipeline strong { display: block; }
.pipeline span { font-size: .7rem; font-weight: 750; }
.pipeline strong { margin-top: 3px; font-size: 1rem; }

.task-list { display: grid; gap: 10px; }
.task-item { display: grid; grid-template-columns: auto minmax(0, 1fr) minmax(130px, 180px) auto; align-items: center; gap: 13px; padding: 14px 15px; border: 1px solid var(--line-soft); border-radius: 13px; background: #fff; box-shadow: var(--shadow-sm); }
.task-check { width: 34px; height: 34px; display: grid; place-items: center; padding: 0; border: 1px solid #d5d0c8; border-radius: 10px; color: var(--forest-700); background: #fff; font-size: 1rem; }
.task-check:hover { border-color: var(--success); color: #fff; background: var(--success); }
.task-item__copy { min-width: 0; }
.task-item__copy strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .9rem; }
.task-item__copy small { display: block; margin-top: 3px; color: var(--ink-soft); font-size: .73rem; }
.task-item__vehicle { margin-top: 6px; }
.task-assignee { min-width: 0; }
.task-assignee__label { display: block; margin-bottom: 5px; color: var(--ink-soft); font-size: .68rem; font-weight: 600; }
.task-assignee__person { display: flex; align-items: center; gap: 7px; }
.task-assignee__avatar { display: grid; place-items: center; flex: 0 0 28px; width: 28px; height: 28px; border-radius: 50%; background: var(--forest-50); color: var(--forest-700); font-size: .65rem; font-weight: 800; }
.task-assignee__name { min-width: 0; color: var(--ink); font-size: .8rem; font-weight: 650; overflow-wrap: anywhere; }
.task-item__meta { display: flex; align-items: center; justify-content: flex-end; gap: 10px; text-align: right; }
.task-item.is-completed { opacity: .6; }
.task-item.is-completed .task-item__copy strong { text-decoration: line-through; }

.empty-state { padding: 38px 20px; text-align: center; }
.empty-state--large { min-height: 60vh; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.empty-state__icon { width: 48px; height: 48px; display: grid; place-items: center; margin: 0 auto 13px; border-radius: 15px; color: var(--forest-700); background: var(--forest-50); font-weight: 900; }
.empty-state h1, .empty-state h2 { margin-bottom: 6px; }
.empty-state p { max-width: 430px; margin: 0 auto 17px; color: var(--ink-soft); font-size: .87rem; }

.more-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 13px; }
.more-item { display: flex; align-items: center; gap: 14px; min-height: 92px; padding: 16px; border: 1px solid var(--line-soft); border-radius: 14px; background: #fff; box-shadow: var(--shadow-sm); transition: .15s; }
.more-item:hover { transform: translateY(-2px); border-color: rgba(164, 30, 52, .24); }
.more-item__icon { width: 42px; height: 42px; flex: 0 0 42px; display: grid; place-items: center; border-radius: 12px; color: var(--forest-700); background: var(--forest-50); font-weight: 900; }
.more-item strong, .more-item small { display: block; }
.more-item small { margin-top: 3px; color: var(--ink-soft); font-size: .73rem; }

.bar-list { display: grid; gap: 14px; }
.bar-row__top { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 6px; font-size: .78rem; }
.bar-row__top span { color: var(--ink-soft); }
.bar-track { height: 8px; overflow: hidden; border-radius: 999px; background: #edf1ef; }
.bar-fill { height: 100%; min-width: 3px; border-radius: inherit; background: var(--forest-700); }
.bar-row > small { display: block; margin-top: 5px; font-size: .7rem; font-weight: 750; }

.report-heading { align-items: center; }
.report-export { position: relative; flex: 0 0 auto; }
.report-export summary { list-style: none; }
.report-export summary::-webkit-details-marker { display: none; }
.report-export[open] summary::before { content: ""; position: fixed; inset: 0; z-index: -1; }
.report-export__menu {
    position: absolute; top: calc(100% + 9px); right: 0; z-index: 12; width: 220px; padding: 8px;
    border: 1px solid var(--glass-border); border-radius: 14px; background: var(--surface-solid); box-shadow: var(--shadow-lg);
}
.report-export__menu a { display: block; padding: 10px 11px; border-radius: 9px; font-size: .82rem; font-weight: 750; }
.report-export__menu a:hover { background: var(--forest-50); }
.report-filters { margin-bottom: 14px; }
.expense-filters { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 10px; padding: 12px 16px; margin-bottom: 14px; }
.expense-filters .field { width: 180px; margin: 0; gap: 4px; }
.expense-filters .field input { min-height: 38px; padding: 7px 10px; }
.expense-filters .button { min-height: 38px; }
.expense-filters__error { flex-basis: 100%; margin: 0; }
@media (max-width: 480px) { .expense-filters .field { width: calc(50% - 5px); min-width: 0; } }
.report-filters__intro { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 16px; }
.report-filters__intro strong, .report-filters__intro small { display: block; }
.report-filters__intro strong { font-size: .92rem; }
.report-filters__intro small { margin-top: 3px; color: var(--ink-soft); font-size: .74rem; }
.report-filter-grid { display: grid; grid-template-columns: repeat(6, minmax(130px, 1fr)); gap: 12px; }
.report-filter-grid .field + .field { margin-top: 0; }
.report-filter-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 15px; padding-top: 15px; border-top: 1px solid var(--line-soft); }
.report-nav {
    position: sticky; top: 88px; z-index: 9; display: flex; gap: 5px; overflow-x: auto; margin-bottom: 26px;
    padding: 7px; border: 1px solid var(--glass-border); border-radius: 15px; background: var(--topbar);
    box-shadow: var(--shadow-sm); backdrop-filter: blur(18px); scrollbar-width: thin;
}
.report-nav a { flex: 0 0 auto; padding: 8px 11px; border-radius: 9px; color: var(--ink-soft); font-size: .75rem; font-weight: 800; white-space: nowrap; }
.report-nav a:hover { color: var(--forest-700); background: var(--forest-50); }
.report-section { margin-bottom: 34px; scroll-margin-top: 155px; }
.report-section__heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 14px; }
.report-section__heading .eyebrow { margin-bottom: 4px; }
.report-section__heading h2 { margin-bottom: 4px; font-size: 1.35rem; }
.report-section__heading p:last-child { margin: 0; color: var(--ink-soft); font-size: .82rem; }
.report-card-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.report-card-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.report-card-grid .card + .card { margin-top: 0; }
.report-detail-card { margin-top: 16px; }
.report-stat-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin-bottom: 16px; }
.report-stat-grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.report-list-row .list-row__copy small { white-space: normal; }
.report-definitions { margin-top: 10px; }

.profile-card { max-width: 620px; }
.profile-head { display: flex; align-items: center; gap: 15px; }
.profile-head .avatar { width: 58px; height: 58px; flex-basis: 58px; font-size: 1rem; }
.profile-head h2 { margin: 0 0 3px; }
.profile-head p { margin: 0; color: var(--ink-soft); }

.auth-body { min-height: 100vh; background: #f1efea; }
.auth-shell { width: min(1040px, calc(100% - 40px)); min-height: 650px; display: grid; grid-template-columns: 1.05fr .95fr; margin: 5vh auto; overflow: hidden; border-radius: 28px; background: #fff; box-shadow: var(--shadow-lg); }
.auth-brand-panel { position: relative; overflow: hidden; padding: 60px; color: #fff; background: #7a1626; }
.auth-brand-panel::before { content: ""; position: absolute; width: 420px; height: 420px; left: -210px; bottom: -260px; border: 80px solid rgba(211,168,75,.12); border-radius: 50%; }
.auth-brand-panel .brand-mark { margin-bottom: 90px; }
.auth-brand-panel .eyebrow { color: #c9435a; }
.auth-brand-panel h1 { font-size: clamp(2.2rem, 4vw, 3.35rem); letter-spacing: -.055em; }
.auth-brand-panel > p:not(.eyebrow) { max-width: 390px; color: #9a968c; }
.auth-brand-accent { position: absolute; right: 44px; bottom: 42px; width: 84px; height: 5px; border-radius: 99px; background: var(--gold); }
.auth-card { align-self: center; padding: 54px; }
.auth-card h2 { margin-bottom: 7px; font-size: 1.7rem; }
.auth-card > .muted { margin-bottom: 28px; }
.auth-help { margin: 26px 0 0; color: var(--ink-faint); font-size: .75rem; text-align: center; }
.auth-mobile-brand { display: none; }

.setup-shell { width: min(1180px, calc(100% - 40px)); display: grid; grid-template-columns: .75fr 1.25fr; gap: 50px; align-items: start; margin: 5vh auto; }
.setup-intro { position: sticky; top: 5vh; padding: 40px 12px; }
.setup-intro .brand-mark { margin-bottom: 35px; }
.setup-intro h1 { max-width: 440px; font-size: clamp(2.2rem, 5vw, 3.4rem); letter-spacing: -.055em; }
.setup-intro > p:not(.eyebrow) { max-width: 450px; color: var(--ink-soft); }
.setup-points { display: grid; gap: 12px; margin-top: 30px; }
.setup-points span { display: flex; align-items: center; gap: 10px; color: var(--ink-soft); font-size: .85rem; font-weight: 700; }
.setup-points b { width: 27px; height: 27px; display: grid; place-items: center; border-radius: 50%; color: var(--forest-700); background: var(--forest-100); font-size: .72rem; }
.setup-card { align-self: start; padding: 36px; border-radius: 22px; box-shadow: var(--shadow-lg); }
.simple-state { width: min(540px, calc(100% - 36px)); margin: 10vh auto; padding: 40px; border-radius: 20px; background: #fff; box-shadow: var(--shadow-lg); text-align: center; }
.simple-state .brand-mark { margin: 0 auto 28px; }
.simple-state p:not(.eyebrow) { color: var(--ink-soft); }
.bottom-nav { display: none; }
.install-prompt {
    position: fixed; right: max(18px, env(safe-area-inset-right)); bottom: max(18px, env(safe-area-inset-bottom)); z-index: 80;
    width: min(430px, calc(100vw - 36px)); display: grid; grid-template-columns: 48px minmax(0, 1fr) auto 28px; gap: 12px;
    align-items: center; padding: 14px; color: #fff; border: 1px solid rgba(255,255,255,.14); border-radius: 18px;
    background: #211014; box-shadow: 0 18px 45px rgba(20, 7, 10, .3);
}
.install-prompt[hidden] { display: none; }
.install-prompt__logo { width: 48px; height: 48px; border-radius: 13px; }
.install-prompt__copy { min-width: 0; }
.install-prompt__copy strong, .install-prompt__copy span { display: block; }
.install-prompt__copy strong { margin-bottom: 3px; font-size: .92rem; }
.install-prompt__copy span { color: #d7d0d2; font-size: .76rem; line-height: 1.35; }
.install-prompt__action { min-height: 38px; padding: 8px 13px; color: #fff; border: 0; border-radius: 10px; background: var(--forest-600); font-weight: 800; }
.install-prompt__close { width: 28px; height: 28px; padding: 0; color: #cfc7c9; border: 0; background: transparent; font-size: 1.4rem; line-height: 1; }

@media (max-width: 1180px) {
    .metric-grid { grid-template-columns: repeat(3, 1fr); }
    .report-filter-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .report-stat-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .report-card-grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 980px), (max-width: 1024px) and (orientation: portrait) {
    :root { --sidebar: 220px; }
    .content, .topbar { padding-left: 22px; padding-right: 22px; }
    .dashboard-grid, .detail-grid, .agreement-workspace { grid-template-columns: 1fr; }
    .agreement-preview-card { position: static; display: none; }
    .more-grid { grid-template-columns: repeat(2, 1fr); }
    .financial-strip { grid-template-columns: repeat(2, 1fr); }
}

/* Use the compact, card-based layout on portrait tablets as well as phones.
   A portrait iPad is wider than the former 820px cutoff, but the persistent
   sidebar left too little room for the desktop data tables. */
@media (max-width: 820px), (max-width: 1024px) and (orientation: portrait) {
    body { font-size: 16px; }
    .sidebar { display: none; }
    .app-main { margin-left: 0; }
    .topbar { min-height: 72px; padding: calc(10px + env(safe-area-inset-top)) 16px 10px; }
    .topbar__title { flex: 1; min-width: 0; margin-left: 11px; }
    .topbar__title p { display: none; }
    .topbar__title h1 { overflow: hidden; text-overflow: ellipsis; font-size: 1.05rem; white-space: nowrap; }
    .mobile-brand { display: block; }
    .mobile-brand .brand-mark { width: 39px; height: 39px; flex-basis: 39px; border-radius: 12px; font-size: .66rem; }
    .quick-add .button b { display: none; }
    .quick-add .button { width: 39px; min-height: 39px; padding: 0; border-radius: 12px; font-size: 1.2rem; }
    .quick-add__menu { position: fixed; top: calc(68px + env(safe-area-inset-top)); right: 12px; width: min(290px, calc(100vw - 24px)); }
    .content { padding: 18px 15px calc(94px + env(safe-area-inset-bottom)); }
    .bottom-nav { position: fixed; inset: auto 0 0; z-index: 25; display: grid; grid-template-columns: repeat(5, 1fr); padding: 7px 7px calc(7px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: rgba(255,255,255,.96); box-shadow: 0 -7px 24px rgba(122, 22, 38, .07); backdrop-filter: blur(16px); }
    .bottom-nav a { min-width: 0; display: grid; justify-items: center; gap: 1px; padding: 4px 2px; border-radius: 9px; color: #7c7770; }
    .bottom-nav a span { height: 22px; }
    .bottom-nav__icon { display: grid; place-items: center; }
    .bottom-nav__icon .ui-icon { width: 20px; height: 20px; }
    .bottom-nav a small { font-size: .63rem; font-weight: 750; }
    .bottom-nav a.is-active { color: var(--forest-700); background: var(--forest-50); }
    .install-prompt { right: 12px; bottom: calc(78px + env(safe-area-inset-bottom)); width: calc(100vw - 24px); grid-template-columns: 44px minmax(0, 1fr) auto 24px; gap: 10px; padding: 12px; }
    .install-prompt__logo { width: 44px; height: 44px; border-radius: 12px; }
    .report-heading { align-items: flex-start; }
    .report-export__menu { position: fixed; top: calc(70px + env(safe-area-inset-top)); right: 12px; width: min(250px, calc(100vw - 24px)); }
    .report-filters__intro { align-items: flex-start; flex-direction: column; gap: 10px; }
    .report-filter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
    .report-filter-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .report-filter-actions .button--primary { grid-column: 1 / -1; grid-row: 1; }
    .report-nav { top: calc(72px + env(safe-area-inset-top)); margin: 0 -15px 24px; border-right: 0; border-left: 0; border-radius: 0; }
    .report-section { margin-bottom: 29px; scroll-margin-top: 138px; }
    .report-section__heading { align-items: flex-start; }
    .report-section__heading h2 { font-size: 1.2rem; }
    .report-section__heading p:last-child { font-size: .76rem; }
    .report-card-grid { grid-template-columns: 1fr; gap: 13px; }
    .report-card-grid--3 { grid-template-columns: 1fr; }
    .report-stat-grid, .report-stat-grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .report-list-row { padding: 13px 14px; }
    .page-heading { align-items: center; margin-bottom: 16px; }
    .page-heading h1 { font-size: 1.38rem; }
    .page-heading p { font-size: .8rem; }
    .dashboard-welcome { align-items: flex-start; padding: 20px; }
    .dashboard-welcome p { max-width: 250px; font-size: .82rem; }
    .dashboard-welcome .button { min-width: 42px; padding: 10px; }
    .dashboard-welcome .button span.button-label { display: none; }
    .metric-grid { grid-template-columns: repeat(2, 1fr); gap: 9px; }
    .metric-card { padding: 14px; }
    .metric-card__top { margin-bottom: 10px; }
    .metric-card__value { font-size: 1.2rem; }
    .dashboard-grid { gap: 14px; }
    .card + .card { margin-top: 13px; }
    .card__header { padding: 15px; }
    .card__body { padding: 15px; }
    .card__body--flush { padding: 0; }
    .document-item { min-width: 0; max-width: 100%; overflow: hidden; }
    .document-item__link { max-width: 100%; overflow: hidden; }
    .document-item__copy { width: 0; flex: 1 1 0; }
    .document-item__copy strong, .document-item__copy small { max-width: 100%; }
    .document-item__download, .document-item > form { flex: 0 0 auto; }
    .toolbar { flex-wrap: wrap; }
    .vehicle-view-tabs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; }
    .vehicle-view-tab { text-align: center; }
    .search-field { flex-basis: 100%; }
    .filter-select { flex: 1; min-width: 0; }
    .desktop-table { display: none; }
    .mobile-records { display: grid; gap: 10px; }
    .vehicle-hero { padding: 19px; }
    .vehicle-hero__top { flex-direction: column; gap: 8px; }
    .vehicle-hero__pricing { text-align: left; }
    .vehicle-hero__bottom { display: block; margin-top: 20px; }
    .vehicle-key { display: grid; grid-template-columns: repeat(3, 1fr); gap: 15px 10px; }
    .vehicle-hero__bottom form { margin-top: 18px; }
    .vehicle-hero__bottom select { min-height: 42px; }
    .vehicle-hero::after { display: none; }
    .info-grid { grid-template-columns: repeat(2, 1fr); }
    .expense-page-heading { align-items: stretch; flex-direction: column; gap: 13px; }
    .expense-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; }
    .expense-actions form { grid-column: 1 / -1; }
    .expense-actions form .button { width: 100%; }
    .expense-hero { align-items: flex-start; flex-direction: column; gap: 24px; padding: 21px; }
    .expense-hero::after { right: -8px; bottom: -45px; font-size: 9rem; }
    .expense-hero__amount { min-width: 0; text-align: left; }
    .expense-hero__amount strong { font-size: 2rem; }
    .more-grid { grid-template-columns: 1fr; gap: 9px; }
    .more-item { min-height: 77px; }
    .calculator-layout { grid-template-columns: 1fr; }
    .calculator-result { position: static; }
    .calculator-mode { display: grid; grid-template-columns: 1fr; width: 100%; }
    .form-card .card__body { padding: 18px 15px; }
    .logcard-import { margin: -3px -1px 26px; padding: 15px; }
    .logcard-import__heading { display: block; }
    .logcard-import__privacy { display: inline-block; margin: 0 0 13px; }
    .logcard-dropzone { align-items: flex-start; flex-wrap: wrap; }
    .logcard-dropzone__copy { padding-top: 2px; }
    .logcard-dropzone__button { width: 100%; }
    .form-grid--2, .form-grid--3, .form-grid--4 { grid-template-columns: 1fr; gap: 15px; }
    .negotiation-calculator { grid-template-columns: 1fr; }
    .agreement-vehicle-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .form-grid .field + .field { margin-top: 0; }
    .form-actions { position: sticky; bottom: calc(66px + env(safe-area-inset-bottom)); z-index: 10; margin: 24px -15px -18px; padding: 12px 15px; background: rgba(255,255,255,.96); box-shadow: 0 -8px 20px rgba(122, 22, 38, .06); backdrop-filter: blur(10px); }
    .form-actions .button { flex: 1; }
    .task-item { grid-template-columns: auto minmax(0, 1fr); }
    .task-assignee { grid-column: 2; }
    .task-item__meta { grid-column: 2; justify-content: flex-start; text-align: left; }
    .auth-shell { width: 100%; min-height: 100vh; display: block; margin: 0; border-radius: 0; }
    .auth-brand-panel { display: none; }
    .auth-card { min-height: 100vh; display: flex; flex-direction: column; justify-content: center; padding: 32px 22px; }
    .auth-mobile-brand { display: flex; align-items: center; gap: 11px; margin-bottom: 60px; }
    .setup-shell { width: 100%; display: block; margin: 0; }
    .setup-intro { position: static; padding: 34px 20px 12px; }
    .setup-intro .brand-mark { margin-bottom: 28px; }
    .setup-intro h1 { font-size: 2.1rem; }
    .setup-points { display: none; }
    .setup-card { padding: 26px 20px 40px; border-radius: 24px 24px 0 0; box-shadow: none; }
}

@media (max-width: 420px) {
    .metric-card__note { display: none; }
    .metric-card { min-height: 100px; }
    .financial-strip { grid-template-columns: 1fr 1fr; }
    .negotiation-calculator { grid-template-columns: 1fr; }
    .page-actions .button--secondary:not(.button--mobile-visible) { display: none; }
    .expense-actions .button--secondary { display: inline-flex; }
    .report-heading { flex-direction: column; }
    .report-heading__actions, .report-heading .report-export, .report-heading .report-export summary { width: 100%; }
    .report-heading__actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .report-heading__actions .button--secondary { display: inline-flex; }
    .report-filter-grid { grid-template-columns: 1fr; }
    .report-section__heading .link, .report-section__heading > .status { display: none; }
    .report-stat-grid, .report-stat-grid--4 { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 820px), (max-width: 1024px) and (orientation: portrait) {
    .vehicle-heading { position: relative; display: grid; grid-template-columns: auto auto; gap: 12px; }
    .vehicle-heading > div:first-child { white-space: nowrap; }
    .vehicle-heading.is-collapsible .vehicle-actions-toggle { display: inline-flex; min-height: 44px; gap: 8px; }
    .vehicle-heading .page-actions { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1fr); padding: 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-muted); }
    .vehicle-heading.is-collapsible .page-actions { position: absolute; top: calc(100% + 8px); right: 0; z-index: 25; width: min(340px, 100%); max-height: 60vh; max-height: 60dvh; overflow-y: auto; overscroll-behavior: contain; background: var(--surface-solid); box-shadow: var(--shadow-lg); }
    .vehicle-heading.is-collapsible:not(.is-expanded) .page-actions { display: none; }
    .vehicle-heading .page-actions .button { display: flex; justify-content: flex-start; min-height: 44px; white-space: normal; }
}

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

@media print {
    html, html[data-theme="dark"] {
        color-scheme: light;
        --ink: #1c1c1e !important;
        --ink-soft: #6d6a64 !important;
        --ink-faint: #9a968c !important;
        --surface: #fff !important;
        --surface-muted: #f6f4ef !important;
        --line: #d8d3cc !important;
        --line-soft: #e8e3dc !important;
    }
    .sidebar, .topbar, .bottom-nav, .report-filters, .report-nav, .report-heading__actions { display: none !important; }
    .app-main { margin-left: 0; }
    .content { width: 100%; padding: 0; }
    .report-section { break-inside: avoid; margin-bottom: 24px; }
    .card, .metric-card, .financial-cell { box-shadow: none !important; backdrop-filter: none !important; }
    .report-heading { margin-bottom: 18px; }
    body { background: #fff !important; }
}

/* Soft glass appearance */
html {
    color-scheme: light;
    transition: background-color .2s ease, color .2s ease;
}

.app-body,
.auth-body {
    background: var(--canvas);
    background-attachment: fixed;
}

.sidebar {
    border-right: 1px solid rgba(255, 255, 255, .1);
    background: #1c0c10;
    box-shadow: 12px 0 40px rgba(39, 8, 14, .14);
    -webkit-backdrop-filter: blur(24px) saturate(130%);
    backdrop-filter: blur(24px) saturate(130%);
}

.topbar {
    border-color: var(--line-soft);
    background: var(--topbar);
    box-shadow: 0 8px 30px rgba(70, 21, 30, .04);
    -webkit-backdrop-filter: blur(22px) saturate(145%);
    backdrop-filter: blur(22px) saturate(145%);
}

.topbar__actions {
    display: flex;
    align-items: center;
    gap: 9px;
}

.theme-toggle {
    min-height: 39px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 7px 11px;
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    color: var(--ink-soft);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    -webkit-backdrop-filter: blur(16px) saturate(140%);
    backdrop-filter: blur(16px) saturate(140%);
    transition: transform .15s ease, background-color .2s ease, color .2s ease;
}

.theme-toggle:hover {
    color: var(--forest-700);
    background: var(--surface-hover);
    transform: translateY(-1px);
}

.theme-toggle__icon {
    width: 20px;
    display: inline-grid;
    place-items: center;
    font-size: 1rem;
    line-height: 1;
}

.theme-toggle__label {
    font-size: .73rem;
    font-weight: 800;
}

.theme-toggle--floating {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 50;
}

.card,
.metric-card,
.record-card,
.task-item,
.more-item,
.auth-shell,
.setup-card,
.simple-state {
    border-color: var(--glass-border);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    -webkit-backdrop-filter: blur(20px) saturate(140%);
    backdrop-filter: blur(20px) saturate(140%);
}

.metric-card,
.record-card,
.task-item,
.more-item {
    transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease, background-color .2s ease;
}

.metric-card:hover,
.record-card:hover,
.task-item:hover {
    border-color: rgba(164, 30, 52, .24);
    background: var(--surface-hover);
    box-shadow: 0 14px 38px rgba(87, 23, 35, .1);
}

.metric-card {
    border-radius: 17px;
}

.card__header {
    border-color: var(--line-soft);
    background: var(--surface-muted);
}

.quick-add__menu {
    border-color: var(--glass-border);
    border-radius: 17px;
    background: var(--surface-solid);
    box-shadow: var(--shadow-lg);
}

.button,
input,
select,
textarea,
.pipeline a,
.task-check {
    border-radius: 12px;
}

.button--secondary,
.button--danger,
.task-check,
.pipeline a {
    border-color: var(--glass-border);
    background: var(--surface);
    box-shadow: inset 0 1px rgba(255, 255, 255, .42);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
}

.button--primary {
    background: var(--forest-700);
    box-shadow: 0 9px 22px rgba(122, 22, 38, .2), inset 0 1px rgba(255, 255, 255, .14);
}

input,
select,
textarea {
    border-color: var(--line);
    color: var(--ink);
    background: var(--input);
    box-shadow: inset 0 1px 2px rgba(25, 56, 50, .025);
}

/* Native <select> popups render options over an opaque OS canvas, so the
   translucent select background above leaves option text unreadable (white on
   white in dark mode). Give options solid, theme-aware colours. */
select option,
select optgroup {
    color: var(--ink);
    background-color: var(--surface-solid);
}

input[readonly] {
    background: var(--surface-muted);
}

input:focus,
select:focus,
textarea:focus {
    border-color: rgba(164, 30, 52, .52);
    background: var(--surface-hover);
    box-shadow: 0 0 0 4px rgba(164, 30, 52, .1);
}

input[type="checkbox"],
input[type="radio"] {
    accent-color: var(--forest-700);
}

.attention-item,
.financial-cell {
    border-color: var(--line-soft);
    background: rgba(255, 255, 255, .32);
}

.attention-item:hover,
.list-row:hover,
.data-table tbody tr:hover {
    border-color: rgba(164, 30, 52, .2);
    background: var(--surface-muted);
}

.data-table th {
    border-color: var(--line-soft);
    background: var(--surface-muted);
}

.data-table td,
.list-row,
.card__header,
.form-actions {
    border-color: var(--line-soft);
}

.status {
    border: 1px solid currentColor;
    border-color: color-mix(in srgb, currentColor 16%, transparent);
}

.status--neutral,
.bar-track {
    background: rgba(97, 118, 112, .1);
}

.vehicle-thumb,
.more-item__icon,
.empty-state__icon,
.attention-item__icon,
.financial-cell {
    box-shadow: inset 0 1px rgba(255, 255, 255, .48);
}

.dashboard-welcome,
.vehicle-hero {
    border: 1px solid rgba(255, 255, 255, .13);
    background: #7a1626;
    box-shadow: 0 18px 45px rgba(82, 18, 29, .18), inset 0 1px rgba(255, 255, 255, .13);
}

.auth-shell {
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-lg);
}

.auth-card {
    background: rgba(255, 255, 255, .12);
}

.auth-brand-panel {
    background: #7a1626;
}

.bottom-nav {
    border-color: var(--glass-border) !important;
    background: var(--mobile-nav) !important;
    box-shadow: 0 -10px 35px rgba(78, 20, 31, .09) !important;
    -webkit-backdrop-filter: blur(22px) saturate(150%) !important;
    backdrop-filter: blur(22px) saturate(150%) !important;
}

@media (max-width: 820px), (max-width: 1024px) and (orientation: portrait) {
    .theme-toggle {
        width: 39px;
        min-height: 39px;
        padding: 0;
    }

    .topbar .theme-toggle__label {
        display: none;
    }

    .theme-toggle--floating {
        width: auto;
        padding: 7px 11px;
        top: calc(14px + env(safe-area-inset-top));
        right: 14px;
    }

    .form-actions {
        background: var(--mobile-nav);
        -webkit-backdrop-filter: blur(22px) saturate(150%);
        backdrop-filter: blur(22px) saturate(150%);
    }
}

/* Dark appearance */
html[data-theme="dark"] {
    color-scheme: dark;
    --ink: #f6f4ef;
    --ink-soft: #9a968c;
    --ink-faint: #6d6a64;
    --forest-950: #4f0d19;
    --forest-900: #7a1626;
    --forest-800: #a41e34;
    --forest-700: #c9435a;
    --forest-100: rgba(201, 67, 90, .2);
    --forest-50: rgba(164, 30, 52, .12);
    --gold: #c9435a;
    --gold-dark: #d85b70;
    --gold-soft: rgba(164, 30, 52, .16);
    --canvas: #0b0b0d;
    --surface: rgba(28, 28, 30, .76);
    --surface-solid: #1c1c1e;
    --surface-muted: rgba(35, 33, 34, .66);
    --surface-hover: rgba(43, 38, 40, .88);
    --glass-border: rgba(246, 244, 239, .1);
    --line: rgba(239, 236, 229, .13);
    --line-soft: rgba(239, 236, 229, .075);
    --input: rgba(17, 16, 18, .78);
    --topbar: rgba(11, 11, 13, .78);
    --mobile-nav: rgba(16, 16, 19, .9);
    --scrollbar-thumb: rgba(239, 236, 229, .24);
    --scrollbar-thumb-hover: rgba(239, 236, 229, .42);
    --success: #67c99f;
    --success-soft: rgba(45, 147, 104, .14);
    --warning: #e2ad5f;
    --warning-soft: rgba(192, 124, 35, .15);
    --danger: #ee8b8b;
    --danger-soft: rgba(195, 66, 66, .14);
    --info: #82bfdc;
    --info-soft: rgba(58, 137, 174, .14);
    --shadow-sm: 0 12px 34px rgba(0, 0, 0, .2), inset 0 1px rgba(255, 255, 255, .035);
    --shadow-lg: 0 32px 80px rgba(0, 0, 0, .38), inset 0 1px rgba(255, 255, 255, .045);
}

html[data-theme="dark"] .app-body,
html[data-theme="dark"] .auth-body {
    background: var(--canvas);
}

html[data-theme="dark"] .sidebar {
    border-color: rgba(255, 255, 255, .06);
    background: #10090b;
    box-shadow: 12px 0 42px rgba(0, 0, 0, .23);
}

html[data-theme="dark"] .card__header {
    background: var(--surface-muted);
}

html[data-theme="dark"] .logcard-import { background: linear-gradient(135deg, rgba(100, 17, 31, .24), rgba(255, 255, 255, .025)); }
html[data-theme="dark"] .logcard-dropzone { background: rgba(255, 255, 255, .025); }
html[data-theme="dark"] .logcard-dropzone:hover,
html[data-theme="dark"] .logcard-dropzone.is-dragging { background: rgba(255, 255, 255, .05); }
html[data-theme="dark"] .field input.is-imported { background: rgba(23, 125, 88, .13); }

html[data-theme="dark"] .attention-item,
html[data-theme="dark"] .financial-cell {
    background: rgba(255, 255, 255, .025);
}

html[data-theme="dark"] .button--secondary,
html[data-theme="dark"] .button--danger,
html[data-theme="dark"] .task-check,
html[data-theme="dark"] .pipeline a {
    color: var(--ink);
    box-shadow: inset 0 1px rgba(255, 255, 255, .04);
}

html[data-theme="dark"] .button--danger {
    color: var(--danger);
}

html[data-theme="dark"] .pipeline a.is-active {
    color: #fff;
}

html[data-theme="dark"] .status--neutral {
    color: var(--ink-soft);
}

html[data-theme="dark"] .button--primary {
    color: #fff;
    background: #a41e34;
}

html[data-theme="dark"] .dashboard-welcome,
html[data-theme="dark"] .vehicle-hero,
html[data-theme="dark"] .expense-hero {
    background: #64111f;
    box-shadow: 0 22px 52px rgba(0, 0, 0, .24), inset 0 1px rgba(255, 255, 255, .07);
}

html[data-theme="dark"] .auth-card {
    background: rgba(9, 20, 18, .18);
}

html[data-theme="dark"] input::placeholder,
html[data-theme="dark"] textarea::placeholder {
    color: #6d6a64;
}

html[data-theme="dark"] .vehicle-thumb,
html[data-theme="dark"] .more-item__icon,
html[data-theme="dark"] .empty-state__icon,
html[data-theme="dark"] .attention-item__icon,
html[data-theme="dark"] .financial-cell {
    box-shadow: inset 0 1px rgba(255, 255, 255, .045);
}

/* Field labels use a fixed dark brown for light mode; lift them to the
   theme ink colour so they stay legible on dark surfaces. */
html[data-theme="dark"] .field > span:first-child {
    color: var(--ink);
}

/* color-scheme is inherited from the root, but set it explicitly on
   date/time controls so the native calendar-picker indicator and popup
   render with light glyphs (visible) in dark mode across browsers. */
html[data-theme="dark"] input[type="date"],
html[data-theme="dark"] input[type="datetime-local"],
html[data-theme="dark"] input[type="time"],
html[data-theme="dark"] input[type="month"],
html[data-theme="dark"] input[type="week"] {
    color-scheme: dark;
}

/* Loan comparison */
.loan-vehicle-context {
    display: flex;
    align-items: center;
    gap: 13px;
    margin: -4px 0 20px;
    padding: 13px 16px;
    border: 1px solid rgba(164, 30, 52, .18);
    border-radius: 14px;
    background: linear-gradient(135deg, var(--forest-50), var(--surface));
    box-shadow: inset 0 1px rgba(255, 255, 255, .72);
}
.loan-vehicle-context__icon {
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    display: grid;
    place-items: center;
    color: var(--forest-700);
    border-radius: 11px;
    background: var(--gold-soft);
}
.loan-vehicle-context__icon .ui-icon { width: 22px; height: 22px; }
.loan-vehicle-context__copy { min-width: 0; display: flex; align-items: baseline; gap: 7px; flex-wrap: wrap; }
.loan-vehicle-context__copy strong { color: var(--gold-dark); font-size: .92rem; letter-spacing: -.01em; }
.loan-vehicle-context__copy > span { color: var(--ink-soft); font-size: .84rem; }

.loan-layout{display:grid;grid-template-columns:minmax(280px,.8fr) minmax(400px,1.2fr);gap:18px}.loan-summary{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;margin-top:22px}.loan-summary div,.loan-result{border:1px solid var(--line);border-radius:14px;padding:14px}.loan-summary span,.loan-result dt{display:block;color:var(--ink-soft);font-size:.76rem}.loan-summary strong{display:block;margin-top:5px}.loan-rate-source{margin:0 0 14px}.loan-result-controls,.loan-sort{display:flex;align-items:center;gap:8px;flex-wrap:wrap}.loan-result-controls{justify-content:space-between;margin-bottom:14px}.loan-sort>span{margin-right:2px;color:var(--ink-soft)}.loan-results{display:grid;gap:10px}.loan-results-footer{display:flex;align-items:center;justify-content:space-between;gap:14px;margin-top:14px}.loan-results-footer p{margin:0}.loan-results-footer .button{flex:0 0 auto}.loan-result{display:grid;grid-template-columns:minmax(140px,.7fr) 1.3fr;gap:16px}.loan-result.is-best{border-color:#287a5a;background:rgba(40,122,90,.05)}.loan-result h3{margin:8px 0 2px}.loan-result dl{display:grid;grid-template-columns:repeat(2,1fr);gap:10px;margin:0}.loan-result dd{font-weight:700;margin:3px 0 0}.source-list{display:grid;gap:8px;margin-top:20px}.source-list__item{display:flex;align-items:center;gap:8px}.source-list__item>a{display:flex;flex:1;min-width:0;flex-direction:column;padding:11px;border:1px solid var(--line);border-radius:10px;color:inherit;text-decoration:none}.source-list__item form{flex:0 0 auto}.source-list small{color:var(--ink-soft);margin-top:3px}@media(max-width:850px){.loan-layout{grid-template-columns:1fr}.loan-result{grid-template-columns:1fr}.loan-summary{grid-template-columns:1fr}.loan-results-footer{align-items:stretch;flex-direction:column}.loan-results-footer .button{text-align:center}}

.downpayment-presets:not([hidden]) {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.downpayment-presets .button {
    min-height: 40px;
    padding: 6px 12px;
    flex: 1;
    font-size: .8rem;
}

/* Keep calculator and finance-management panels aligned at every width. */
.loan-layout,
.finance-admin-layout {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    align-items: stretch;
}

.loan-layout > .card,
.finance-admin-layout > .card {
    min-width: 0;
    /* Grid gap supplies spacing; the shared sibling-card margin offsets columns. */
    margin-top: 0;
}

.finance-admin-layout {
    margin-top: 18px;
}

.loan-result,
.loan-result dl,
.loan-result dl > div {
    min-width: 0;
}

.loan-result dd {
    overflow-wrap: anywhere;
}

@media (max-width: 850px) {
    .loan-layout,
    .finance-admin-layout {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 480px) {
    .loan-result dl {
        grid-template-columns: minmax(0, 1fr);
    }

    .loan-summary {
        gap: 8px;
    }
}

/* Finance rate library */
.finance-sample-download{margin-bottom:20px}
.loan-remarks-button{display:inline-flex;align-items:center;gap:6px;margin-top:10px;padding:6px 9px;border:1px solid rgba(40,122,90,.24);border-radius:9px;background:var(--surface);color:var(--forest-700);font:inherit;font-size:.78rem;font-weight:700;cursor:pointer;transition:border-color .15s ease,box-shadow .15s ease,transform .15s ease}.loan-remarks-button:hover{border-color:var(--forest-700);box-shadow:0 4px 12px rgba(28,62,49,.1);transform:translateY(-1px)}.loan-remarks-button .ui-icon{width:16px;height:16px}.loan-remarks-dialog{width:min(480px,calc(100vw - 32px));padding:0;border:0;border-radius:18px;background:var(--surface);color:var(--ink);box-shadow:0 24px 70px rgba(17,35,29,.28)}.loan-remarks-dialog::backdrop{background:rgba(12,27,22,.52);backdrop-filter:blur(3px)}.loan-remarks-dialog__header{display:flex;align-items:flex-start;justify-content:space-between;gap:18px;padding:20px 22px 16px;border-bottom:1px solid var(--line);background:linear-gradient(135deg,var(--forest-50),var(--surface))}.loan-remarks-dialog__header .small{color:var(--forest-700);font-weight:700;text-transform:uppercase;letter-spacing:.06em}.loan-remarks-dialog__header h3{margin:4px 0 0}.loan-remarks-dialog__header p{margin:3px 0 0;color:var(--ink-soft);font-size:.85rem}.loan-remarks-dialog__close{display:grid;place-items:center;width:34px;height:34px;flex:0 0 34px;padding:0;border:1px solid var(--line);border-radius:50%;background:var(--surface);color:var(--ink);font-size:1.5rem;line-height:1;cursor:pointer}.loan-remarks-dialog__body{display:grid;gap:10px;padding:20px 22px}.loan-remarks-dialog__body p{margin:0;padding:12px 14px;border-left:3px solid var(--gold);border-radius:0 10px 10px 0;background:var(--canvas);line-height:1.55;overflow-wrap:anywhere}
.finance-rate-library{margin-top:18px}.finance-rate-table-wrap{overflow-x:auto}.finance-rate-table{min-width:1500px}.finance-rate-table td{vertical-align:top}.finance-rate-table input,.finance-rate-table select{width:100%;min-width:105px;margin-bottom:5px;padding:7px 8px;font:inherit;color:var(--ink);border:1px solid var(--line);border-radius:7px;background:var(--surface)}.finance-rate-table td:first-child input,.finance-rate-table td:nth-child(2) input{min-width:150px}.finance-rate-range{display:flex;align-items:center;gap:4px}.finance-rate-range input{min-width:55px}.finance-rate-table .table-actions{align-items:flex-start;flex-direction:column}

/* Header shortcuts keep tools focused and administration reachable on mobile. */
.mobile-account-nav { display: none; }
.topbar__actions .button b, .header-theme .theme-toggle__label { font-size: .88rem; font-weight: 750; }
html[data-theme="dark"] .topbar__actions .header-listings > summary,
html[data-theme="dark"] .topbar__actions > .header-theme,
html[data-theme="dark"] .topbar__actions .button--primary { color: #fff; }
.topbar__actions > .header-theme:hover { background: var(--forest-50); border-color: rgba(164, 30, 52, .3); }
.header-listings > summary { gap: 7px; }
.header-listings > summary .ui-icon { width: 16px; height: 16px; }
.header-listings > summary, .mobile-account-nav > summary { list-style: none; cursor: pointer; }
.header-listings > summary::-webkit-details-marker, .mobile-account-nav > summary::-webkit-details-marker { display: none; }
.mobile-account-nav .quick-add__menu { max-height: calc(100dvh - 160px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); overflow-y: auto; overscroll-behavior: contain; }
.mobile-account-nav .quick-add__menu > p:not(:first-child) { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.mobile-account-nav a[aria-current="page"] { background: var(--forest-50); color: var(--forest-700); }
@media (max-width: 820px), (max-width: 1024px) and (orientation: portrait) {
    .header-listings { display: none; }
    .header-theme { width: 42px; min-height: 42px; flex-shrink: 0; }
    .mobile-account-nav { display: block; order: 2; }
    .mobile-account-nav > .mobile-menu-toggle { width: auto; min-height: 42px; padding: 8px 11px; gap: 7px; font-size: .8rem; font-weight: 700; box-shadow: none; }
    .mobile-menu-toggle .ui-icon { width: 17px; height: 17px; }
    .topbar__actions { gap: 8px; flex-shrink: 0; margin-left: 12px; }
    .topbar .quick-add > .button { width: 42px; min-height: 42px; }
    .mobile-account-nav .quick-add__menu { width: min(340px, calc(100vw - 24px)); padding: 14px; }
    .mobile-account-nav .quick-add__menu a { min-height: 44px; }
}

/* Database update rows need their own spacing; document links supply it elsewhere. */
.migration-section + .migration-section { margin-top: 28px; }
.migration-section > h3 { margin: 0 0 12px; }
.migration-section > .field-help { margin: 0 0 16px; line-height: 1.6; }
.migration-status .migration-row { display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; gap: 14px; padding: 14px 0; }
.migration-status .migration-row .document-item__copy { width: auto; }
.migration-status .migration-row .document-item__copy strong { white-space: normal; overflow-wrap: anywhere; line-height: 1.5; }
.migration-status .migration-row .document-item__copy small { margin-top: 4px; }
.migration-row__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.migration-row__actions form { margin: 0; }
@media (max-width: 600px) {
    .migration-status .migration-row { grid-template-columns: 38px minmax(0, 1fr); gap: 10px 12px; }
    .migration-row__actions { grid-column: 2; }
}
#conversation-history { scroll-margin-top: 100px; }
#conversation-history .form-actions { position: static; margin: 8px 0 0; padding: 16px 0 0; background: none; box-shadow: none; backdrop-filter: none; }
.conversation-history { border-top: 1px solid var(--line); }
.conversation-list { list-style: none; padding: 0; margin: 0; }
.conversation-entry { padding: 0 0 20px 16px; margin-left: 4px; border-left: 2px solid var(--line); }
.conversation-entry:last-child { padding-bottom: 0; }
.conversation-entry__heading { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; }
.conversation-entry__heading strong { color: var(--forest-700); font-size: .88rem; }
.conversation-entry__heading time, .conversation-entry__author { color: var(--ink-soft); font-size: .75rem; }
.conversation-entry__body { white-space: pre-wrap; overflow-wrap: anywhere; margin: 8px 0; line-height: 1.6; }
.conversation-entry__author { margin: 0; }
.conversation-history nav { margin-top: 20px; }

/* Bidding desk */
.bidding-heading-actions,.bidding-candidate-heading-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 10px; }
.bidding-candidate-heading-actions form { margin: 0; }
.bidding-ai-connection { display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: 16px; margin-bottom: 18px; padding: 18px; border: 1px solid rgba(191,137,39,.32); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); }
.bidding-ai-connection.is-connected { border-color: rgba(40,122,90,.34); }
.bidding-ai-connection h2,.bidding-ai-connection p { margin: 0; }
.bidding-ai-connection h2 { margin: 2px 0 5px; font-size: 1.05rem; }
.bidding-ai-connection > div > p:last-child { color: var(--ink-soft); font-size: .84rem; line-height: 1.5; }
.bidding-ai-connection__icon,.bidding-ai-runner__icon { display: grid; place-items: center; flex: 0 0 auto; width: 44px; height: 44px; border-radius: 13px; color: #8a5914; background: rgba(191,137,39,.14); font-size: .78rem; font-weight: 900; }
.bidding-ai-connection.is-connected .bidding-ai-connection__icon { color: #146344; background: rgba(40,122,90,.13); }
.bidding-ai-connection__aside { display: flex; align-items: center; gap: 16px; }
.bidding-ai-connection__status { display: flex; align-items: center; gap: 9px; }
.bidding-ai-wallet { display: flex; align-items: center; gap: 12px; min-width: 190px; padding-right: 16px; border-right: 1px solid var(--line); }
.bidding-ai-wallet > div { display: grid; gap: 1px; min-width: 0; }
.bidding-ai-wallet span,.bidding-ai-wallet small { color: var(--ink-soft); font-size: .68rem; }
.bidding-ai-wallet strong { font-size: 1rem; white-space: nowrap; }
.bidding-ai-wallet .text-button { flex: 0 0 auto; font-size: .72rem; }
.bidding-ai-wallet.is-loading strong { color: var(--ink-soft); }
.bidding-ai-wallet.is-empty strong,.bidding-ai-wallet.is-empty small { color: var(--danger); }
.bidding-ai-wallet.is-unavailable strong { font-size: .84rem; }
.bidding-ai-update-notice { margin-bottom: 18px; }
.bidding-ai-settings-dialog { width: min(560px,calc(100vw - 28px)); max-height: min(760px,calc(100vh - 28px)); margin: auto; padding: 0; overflow: auto; color: var(--ink); border: 1px solid var(--line); border-radius: 18px; background: var(--surface-solid); box-shadow: var(--shadow-lg); }
.bidding-ai-settings-dialog::backdrop { background: rgba(9,12,11,.7); backdrop-filter: blur(3px); }
.bidding-ai-settings-dialog__header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding: 20px 22px 17px; border-bottom: 1px solid var(--line); }
.bidding-ai-settings-dialog__header h2,.bidding-ai-settings-dialog__header p { margin: 0; }
.bidding-ai-settings-dialog__close { width: 34px; height: 34px; padding: 0; border: 1px solid var(--line); border-radius: 10px; color: var(--ink-soft); background: transparent; font-size: 1.35rem; line-height: 1; cursor: pointer; }
.bidding-ai-settings-dialog__body { padding: 22px; }
.bidding-ai-security-note { margin-bottom: 18px; padding: 14px 15px; border: 1px solid rgba(40,122,90,.24); border-radius: 12px; background: rgba(40,122,90,.08); }
.bidding-ai-security-note strong { color: #146344; }
.bidding-ai-security-note p { margin: 5px 0 0; color: var(--ink-soft); font-size: .82rem; line-height: 1.55; }
.bidding-ai-settings-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 0 0 20px; }
.bidding-ai-settings-facts div { padding: 11px 12px; border-radius: 10px; background: var(--canvas); }
.bidding-ai-settings-facts dt { color: var(--ink-soft); font-size: .7rem; }
.bidding-ai-settings-facts dd { margin: 3px 0 0; font-size: .84rem; font-weight: 800; }
.bidding-ai-disconnect-form { margin-top: 18px; padding-top: 17px; text-align: center; border-top: 1px solid var(--line); }
.bidding-ai-runner { display: grid; grid-template-columns: minmax(0,1fr) minmax(210px,320px) auto; align-items: center; gap: 18px; margin-bottom: 18px; padding: 18px; border: 1px solid rgba(40,122,90,.3); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); }
.bidding-ai-runner__main { display: flex; align-items: center; gap: 14px; min-width: 0; }
.bidding-ai-runner__main h2,.bidding-ai-runner__main p { margin: 0; }
.bidding-ai-runner__main h2 { margin: 2px 0 4px; font-size: 1rem; }
.bidding-ai-runner__main p:last-child { color: var(--ink-soft); font-size: .8rem; line-height: 1.45; }
.bidding-ai-runner__icon { color: #146344; background: rgba(40,122,90,.13); }
.bidding-ai-runner.is-running .bidding-ai-runner__icon { animation: bidding-ai-pulse 1.4s ease-in-out infinite; }
@keyframes bidding-ai-pulse { 50% { transform: scale(.94); opacity: .65; } }
.bidding-ai-runner__progress > span { display: block; height: 8px; overflow: hidden; border-radius: 999px; background: var(--canvas); }
.bidding-ai-runner__progress i { display: block; height: 100%; border-radius: inherit; background: #287a5a; transition: width .25s ease; }
.bidding-ai-runner__progress small { display: block; margin-top: 7px; color: var(--ink-soft); font-size: .7rem; }

/* Deal readiness and global search */
.global-header-search { position: relative; width: clamp(180px, 20vw, 300px); }
.global-header-search label { display: block; }
.global-header-search input { width: 100%; min-height: 40px; padding: 8px 48px 8px 36px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink); }
.global-header-search::before { content: "⌕"; position: absolute; left: 13px; top: 50%; z-index: 1; transform: translateY(-52%); color: var(--ink-faint); }
.global-header-search kbd { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); padding: 2px 6px; border: 1px solid var(--line); border-radius: 6px; color: var(--ink-faint); background: var(--canvas); font: 700 .68rem/1.4 inherit; pointer-events: none; }
.global-search-mobile { display: none; text-decoration: none; font-size: 1.3rem; }
.global-search-page-form { display: flex; gap: 10px; margin-bottom: 20px; padding: 14px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); box-shadow: var(--shadow-sm); }
.global-search-page-form input { min-height: 46px; }
.search-result-count { margin: 4px 0 16px; color: var(--ink-soft); }
.search-results-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; align-items: start; }
.search-result-group .card__header h2 { display: flex; gap: 8px; align-items: center; }
.search-result-item { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 12px; align-items: center; min-height: 70px; padding: 12px 16px; border-bottom: 1px solid var(--line); color: inherit; text-decoration: none; }
.search-result-item:last-child { border-bottom: 0; }
.search-result-item:hover { background: var(--forest-50); }
.search-result-item__copy { min-width: 0; }
.search-result-item__copy strong,.search-result-item__copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-result-item__copy small { margin-top: 3px; color: var(--ink-soft); }
.deal-readiness-hero { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 18px 28px; align-items: center; margin-bottom: 20px; padding: 24px; border: 1px solid rgba(185, 126, 35, .3); border-radius: 20px; background: linear-gradient(135deg, rgba(185, 126, 35, .1), var(--surface)); }
.deal-readiness-hero.is-ready { border-color: rgba(40, 122, 90, .3); background: linear-gradient(135deg, rgba(40, 122, 90, .11), var(--surface)); }
.deal-readiness-hero h2,.deal-readiness-hero p { margin: 0; }
.deal-readiness-hero .eyebrow { margin-bottom: 4px; }
.deal-readiness-hero h2 + p { margin-top: 5px; color: var(--ink-soft); }
.deal-readiness-score { text-align: right; }
.deal-readiness-score strong,.deal-readiness-score span { display: block; }
.deal-readiness-score strong { font-size: 1.8rem; }
.deal-readiness-score span { color: var(--ink-soft); font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; }
.deal-readiness-progress { grid-column: 1 / -1; height: 9px; overflow: hidden; border-radius: 999px; background: var(--canvas); }
.deal-readiness-progress span { display: block; height: 100%; border-radius: inherit; background: #b97e23; transition: width .2s ease; }
.is-ready .deal-readiness-progress span,.vehicle-checklist-card .status--success ~ .deal-readiness-progress span { background: #287a5a; }
.deal-detail-grid { align-items: start; }
.checklist-card { overflow: hidden; }
.checklist-item { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 10px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.checklist-item:last-child { border-bottom: 0; }
.checklist-item__status { display: grid; place-items: center; width: 28px; height: 28px; border: 2px solid var(--line); border-radius: 50%; color: var(--ink-faint); font-weight: 900; }
.checklist-item.is-resolved .checklist-item__status { border-color: #287a5a; background: #287a5a; color: #fff; }
.checklist-item__heading { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.checklist-item__heading strong,.checklist-item__heading small { display: block; }
.checklist-item__heading small,.checklist-item__meta { margin: 4px 0 0; color: var(--ink-soft); font-size: .78rem; }
.checklist-item__form { display: grid; grid-template-columns: minmax(145px, .7fr) minmax(200px, 1.3fr) auto; gap: 10px; align-items: end; margin-top: 12px; }
.checklist-item__form .field { margin: 0; }
.handover-action-card.is-ready { border-color: rgba(40, 122, 90, .4); }
.checklist-progress-link { display: flex; gap: 8px; align-items: center; min-width: 100px; color: inherit; text-decoration: none; }
.checklist-progress-link > span { width: 72px; height: 7px; overflow: hidden; border-radius: 999px; background: var(--canvas); }
.checklist-progress-link i { display: block; height: 100%; border-radius: inherit; background: #287a5a; }
.checklist-progress-link small { color: var(--ink-soft); white-space: nowrap; }

@media (max-width: 1050px) {
    .global-header-search { display: none; }
    .global-search-mobile { display: grid; }
}

@media (max-width: 760px) {
    .search-results-grid { grid-template-columns: 1fr; }
    .global-search-page-form { padding: 10px; }
    .global-search-page-form .button { padding-inline: 14px; }
    .deal-readiness-hero { padding: 18px; }
    .checklist-item { padding: 14px; }
    .checklist-item__form { grid-template-columns: 1fr; }
    .checklist-item__form .button { width: 100%; }
}
.bidding-ai-runner__actions { display: flex; flex-direction: column; gap: 7px; }
.bidding-ai-runner__actions [hidden] { display: none !important; }
.bidding-ai-job-status { display: inline-flex; align-items: center; justify-content: center; min-height: 40px; padding: 8px 13px; border: 1px solid var(--line); border-radius: 999px; color: var(--ink-soft); background: var(--canvas); font-size: .76rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.bidding-ai-job-status::before { content: ''; width: 7px; height: 7px; margin-right: 8px; border-radius: 50%; background: currentColor; }
.bidding-ai-job-status--queued { color: #8a5914; border-color: rgba(191,137,39,.3); background: rgba(191,137,39,.12); }
.bidding-ai-job-status--researching { color: #146344; border-color: rgba(40,122,90,.3); background: rgba(40,122,90,.12); }
.bidding-ai-job-status--researching::before { animation: bidding-ai-pulse 1.2s ease-in-out infinite; }
.bidding-ai-job-status--complete { color: #146344; border-color: rgba(40,122,90,.25); background: rgba(40,122,90,.08); }
.bidding-ai-runner__footnote { grid-column: 1 / -1; margin: -3px 0 0; padding-top: 13px; color: var(--ink-soft); border-top: 1px solid var(--line); font-size: .72rem; line-height: 1.45; }
.bidding-new-session { position: relative; }
.bidding-new-session > summary { list-style: none; cursor: pointer; white-space: nowrap; }
.bidding-new-session > summary::-webkit-details-marker { display: none; }
.bidding-session-page-actions { display: flex; align-items: center; gap: 8px; }
.bidding-session-page-actions form { margin: 0; }
.bidding-new-session-form { position: absolute; z-index: 20; top: calc(100% + 8px); right: 0; width: min(620px, calc(100vw - 40px)); padding: 18px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); box-shadow: var(--shadow-lg); }
.bidding-new-session-form .field + .field { margin-top: 12px; }
.bidding-new-session-form > .button { margin-top: 14px; width: 100%; }
.bidding-session-counts { display: flex; flex-wrap: wrap; gap: 5px; }
.bidding-session-counts span { padding: 4px 7px; border-radius: 999px; font-size: .68rem; font-weight: 750; white-space: nowrap; }
.bidding-session-counts .recommendation--bid { color: #146344; background: rgba(40,122,90,.13); }
.bidding-session-counts .recommendation--review { color: #8a5914; background: rgba(191,137,39,.17); }
.bidding-session-counts .recommendation--pass { color: #942039; background: rgba(164,30,52,.11); }
.bidding-session-counts .recommendation--pending { color: var(--ink-soft); background: var(--canvas); }
.bidding-session-counts .recommendation--failed { color: #942039; background: rgba(164,30,52,.12); }
.bidding-session-counts .recommendation--excluded { color: #942039; background: rgba(164,30,52,.08); }
.bidding-sessions-table td { vertical-align: middle; }
.bidding-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 18px; }
.bidding-summary__item { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 16px 18px; border: 1px solid var(--line); border-radius: 15px; color: var(--ink); text-decoration: none; background: var(--surface); box-shadow: var(--shadow-sm); }
.bidding-summary__item span { font-size: .84rem; font-weight: 700; }
.bidding-summary__item strong { font-size: 1.45rem; }
.bidding-summary__item.recommendation--bid { border-color: rgba(40,122,90,.35); }
.bidding-summary__item.recommendation--review { border-color: rgba(191,137,39,.42); }
.bidding-summary__item.recommendation--pass { border-color: rgba(164,30,52,.28); }
.bidding-summary__item.recommendation--pending { border-color: var(--line); }
.bidding-summary__item.recommendation--failed { border-color: rgba(164,30,52,.38); }
.bidding-summary__item.recommendation--excluded { border-color: rgba(164,30,52,.18); }
.bidding-privacy-note { margin-top: 12px; line-height: 1.55; }
.form-actions--static { position: static; margin-top: 18px; padding: 0; background: none; box-shadow: none; backdrop-filter: none; }
.bidding-import-steps { margin: 0 0 1rem; padding-left: 1.25rem; color: var(--ink-soft); font-size: .9rem; line-height: 1.55; }
.bidding-import-steps li + li { margin-top: .3rem; }
.bidding-new-session-form textarea { min-height: 12rem; font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; font-size: .78rem; }
.bidding-list-heading { margin-top: 28px; }
.bidding-bulk-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 0 0 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.bidding-bulk-select-all { display: inline-flex; align-items: center; gap: 7px; font-size: .82rem; font-weight: 700; cursor: pointer; }
.bidding-bulk-count { margin-right: auto; color: var(--ink-soft); font-size: .78rem; }
.bidding-select-column { width: 44px; text-align: center; }
.bidding-select-column input,.bidding-record-card__select input,.bidding-bulk-select-all input { width: 17px; height: 17px; margin: 0; }
.bidding-table td { vertical-align: middle; }
.recommendation-pill { display: inline-flex; align-items: center; justify-content: center; min-width: 66px; padding: 5px 9px; border-radius: 999px; font-size: .7rem; font-weight: 800; letter-spacing: .06em; }
.recommendation-pill.recommendation--bid { color: #146344; background: rgba(40,122,90,.13); }
.recommendation-pill.recommendation--review { color: #8a5914; background: rgba(191,137,39,.17); }
.recommendation-pill.recommendation--pass { color: #942039; background: rgba(164,30,52,.11); }
.recommendation-pill.recommendation--pending { color: var(--ink-soft); background: var(--canvas); }
.recommendation-pill.is-ai-queued::before,.recommendation-pill.is-ai-researching::before { content: ''; width: 6px; height: 6px; margin-right: 6px; border-radius: 50%; background: currentColor; }
.recommendation-pill.is-ai-researching::before { animation: bidding-ai-pulse 1.2s ease-in-out infinite; }
.recommendation-pill.recommendation--failed { color: #942039; background: rgba(164,30,52,.12); }
.recommendation-pill.recommendation--excluded { color: #942039; background: rgba(164,30,52,.08); }
.bidding-row-decision { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.bidding-row-decision form { margin: 0; }
.bidding-record-card { color: inherit; }
.bidding-record-card__link { display: block; color: inherit; text-decoration: none; }
.bidding-record-card__actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.bidding-record-card__actions form { margin: 0; }
.bidding-record-card__select { display: inline-flex; align-items: center; gap: 7px; color: var(--ink-soft); font-size: .78rem; font-weight: 700; }
.bidding-decision-hero { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 1px; margin-bottom: 18px; overflow: hidden; border: 1px solid var(--line); border-radius: 17px; background: var(--line); box-shadow: var(--shadow-sm); }
.bidding-decision-hero > div { min-width: 0; padding: 18px; background: var(--surface); }
.bidding-decision-hero span,.bidding-decision-hero small,.bidding-metrics span,.bidding-metrics small { display: block; color: var(--ink-soft); font-size: .75rem; }
.bidding-decision-hero strong { display: block; margin: 6px 0 3px; font-size: 1.18rem; overflow-wrap: anywhere; }
.bidding-decision-hero.recommendation--bid { border-top: 4px solid #287a5a; }
.bidding-decision-hero.recommendation--review { border-top: 4px solid #bf8927; }
.bidding-decision-hero.recommendation--pass { border-top: 4px solid #a41e34; }
.bidding-decision-hero.recommendation--pending { border-top: 4px solid var(--line); }
.bidding-decision-hero.recommendation--failed { border-top: 4px solid #a41e34; }
.bidding-decision-hero.recommendation--excluded { border-top: 4px solid rgba(164,30,52,.55); }
.bidding-detail-grid { display: grid; grid-template-columns: minmax(0,1fr) minmax(260px,340px); gap: 18px; align-items: start; }
.bidding-detail-grid > section,.bidding-detail-grid > aside { min-width: 0; }
.bidding-metrics { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 10px; }
.bidding-metrics > div { padding: 13px; border: 1px solid var(--line); border-radius: 12px; background: var(--canvas); }
.bidding-metrics strong { display: block; margin: 5px 0 2px; }
.bidding-reasons { margin: 18px 0 0; padding-left: 20px; }
.bidding-reasons li { margin-top: 8px; line-height: 1.55; }
.bidding-facts { grid-template-columns: repeat(3,minmax(0,1fr)); }
.bidding-decision-card { margin-top: 0; }
.bidding-pass-form { margin-bottom: 18px; }
.bidding-excluded-note { margin: 0 0 18px; }
.bidding-ai-research-card,.bidding-detail-grid > section > .card + .card,.bidding-detail-grid > section > .card + .bidding-research-grid,.bidding-research-grid + .card { margin-top: 18px; }
.bidding-research-basis { margin: 0 0 16px; color: var(--ink-soft); line-height: 1.6; }
.bidding-comparables { display: grid; gap: 10px; }
.bidding-comparable { padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--canvas); }
.bidding-comparable__heading { display: flex; justify-content: space-between; gap: 14px; }
.bidding-comparable__heading a,.bidding-source-list a { flex: 0 0 auto; color: var(--forest-700); font-size: .75rem; font-weight: 800; text-decoration: none; }
.bidding-comparable dl { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 7px; margin: 12px 0; }
.bidding-comparable dl div { padding: 8px; border-radius: 8px; background: var(--surface-solid); }
.bidding-comparable dt { color: var(--ink-soft); font-size: .66rem; }
.bidding-comparable dd { margin: 3px 0 0; font-size: .78rem; font-weight: 800; }
.bidding-comparable p { margin: 5px 0 0; color: var(--ink-soft); font-size: .78rem; line-height: 1.5; }
.bidding-comparable small { display: block; margin-top: 8px; color: var(--ink-soft); }
.bidding-research-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.bidding-research-grid .card { margin: 0; }
.bidding-research-totals { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; margin-bottom: 14px; }
.bidding-research-totals div { padding: 11px; border-radius: 10px; background: var(--canvas); }
.bidding-research-totals span { display: block; color: var(--ink-soft); font-size: .68rem; }
.bidding-research-totals strong { display: block; margin-top: 4px; font-size: .88rem; }
.bidding-cost-list,.bidding-source-list { list-style: none; margin: 0; padding: 0; }
.bidding-cost-list li,.bidding-source-list li { display: flex; justify-content: space-between; gap: 14px; padding: 11px 0; border-top: 1px solid var(--line); }
.bidding-cost-list small,.bidding-source-list small { display: block; margin-top: 3px; color: var(--ink-soft); font-size: .7rem; line-height: 1.4; }
.bidding-research-subheading { margin: 0 0 9px; font-size: .84rem; }
.bidding-research-subheading:not(:first-child) { margin-top: 20px; }
.bidding-evidence-grid { display: grid; grid-template-columns: 1.2fr .8fr; gap: 24px; }
.bidding-evidence-grid h3 { margin: 0 0 11px; font-size: .9rem; }
.bidding-source-list p { margin: 5px 0 0; color: var(--ink-soft); font-size: .75rem; line-height: 1.45; }
.bidding-ai-metadata { display: flex; flex-wrap: wrap; gap: 6px 15px; padding: 13px 18px; color: var(--ink-soft); border-top: 1px solid var(--line); font-size: .68rem; }
@media (max-width: 980px) {
    .bidding-detail-grid { grid-template-columns: minmax(0,1fr); }
    .bidding-decision-hero { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .bidding-ai-runner { grid-template-columns: minmax(0,1fr) minmax(200px,280px); }
    .bidding-ai-runner__actions { grid-column: 1 / -1; flex-direction: row; }
}
@media (max-width: 650px) {
    .bidding-heading-actions,.bidding-candidate-heading-actions { width: 100%; }
    .bidding-heading-actions > *,.bidding-candidate-heading-actions > * { flex: 1; }
    .bidding-candidate-heading-actions .button { width: 100%; }
    .bidding-ai-connection { grid-template-columns: auto minmax(0,1fr); }
    .bidding-ai-connection__aside { grid-column: 1 / -1; align-items: stretch; justify-content: space-between; padding-top: 12px; border-top: 1px solid var(--line); }
    .bidding-ai-wallet { flex: 1; min-width: 0; }
    .bidding-ai-connection__status { flex-direction: column; align-items: flex-end; justify-content: center; }
    .bidding-ai-runner { grid-template-columns: minmax(0,1fr); }
    .bidding-ai-runner__progress,.bidding-ai-runner__actions { grid-column: auto; }
    .bidding-ai-runner__actions { flex-direction: column; }
    .bidding-new-session { width: 100%; }
    .bidding-new-session > summary { justify-content: center; width: 100%; }
    .bidding-session-page-actions { align-items: stretch; display: flex; width: 100%; }
    .bidding-session-page-actions > * { flex: 1; }
    .bidding-new-session-form { position: static; width: 100%; margin-top: 8px; }
    .bidding-summary { grid-template-columns: 1fr; }
    .bidding-bulk-bar { position: sticky; top: 66px; z-index: 8; box-shadow: var(--shadow-sm); }
    .bidding-decision-hero,.bidding-metrics,.bidding-facts { grid-template-columns: 1fr 1fr; }
    .bidding-research-grid,.bidding-evidence-grid { grid-template-columns: 1fr; }
    .bidding-comparable dl { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 430px) {
    .bidding-decision-hero,.bidding-metrics,.bidding-facts { grid-template-columns: 1fr; }
}
