:root {
    color-scheme: light;
    --ink: #17201c;
    --muted: #65716b;
    --paper: #f6f7f4;
    --surface: #ffffff;
    --line: #dce2de;
    --green: #0d6a48;
    --green-soft: #eaf4ef;
    --blue: #2859ad;
    --danger: #b42318;
    --content-width: 1040px;
    --radius-control: 12px;
    --radius-panel: 18px;
    --header-bg: linear-gradient(180deg, rgb(5 12 9 / .94), rgb(10 23 16 / .88));
    --ease: 180ms ease;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scrollbar-gutter: stable; }
body {
    margin: 0;
    min-width: 280px;
    background: var(--paper);
    color: var(--ink);
    font: 400 16px/1.55 Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .45; }
[hidden] { display: none !important; }
a { color: var(--green); text-underline-offset: 4px; }
:focus-visible { outline: 3px solid #79a993; outline-offset: 3px; }
h1, h2, h3, p { overflow-wrap: break-word; }
h1, h2, h3 { line-height: 1.12; letter-spacing: -.035em; }
img { max-width: 100%; }
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Landing */
.site-header {
    height: 76px;
    padding: 0 24px;
    display: grid;
    place-items: center;
    position: absolute;
    z-index: 10;
    top: 0;
    right: 0;
    left: 0;
    border-bottom: 1px solid rgb(255 255 255 / .14);
    background: linear-gradient(180deg, rgb(5 12 9 / .82), rgb(7 15 11 / .52));
    -webkit-backdrop-filter: blur(12px) saturate(115%);
    backdrop-filter: blur(12px) saturate(115%);
}
.agent-open .site-header { display: none; }
.brand { display: flex; }
.brand-logo { width: 150px; height: auto; filter: brightness(0) invert(1); }
.landing {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    min-height: 100svh;
    display: flex;
    flex-direction: column;
    background: #26332d;
    color: #fff;
}
.ambient-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
}
.landing-video { z-index: 0; }
.video-shade {
    position: absolute;
    z-index: 1;
    inset: 0;
    background:
        linear-gradient(180deg, rgb(9 17 13 / .50) 0%, rgb(8 16 12 / .68) 58%, rgb(8 15 12 / .90) 100%),
        linear-gradient(90deg, rgb(9 20 15 / .20), rgb(9 20 15 / .02));
}
.landing-main {
    position: relative;
    z-index: 2;
    width: 100%;
    flex: 1;
    padding: clamp(72px, 12vh, 150px) 24px 80px;
    display: grid;
    place-items: center;
}
.hero-content { width: min(880px, 100%); text-align: center; }
.hero-kicker {
    margin: 0 0 22px;
    color: #dce9e2;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .16em;
    text-transform: uppercase;
}
.landing h1 {
    margin: 0;
    font-size: clamp(44px, 8.6vw, 94px);
    font-weight: 730;
    letter-spacing: -.06em;
}
.landing h1 span { color: #c3d3cb; }
.hero-copy {
    max-width: 620px;
    margin: 30px auto 0;
    color: #e1e7e3;
    font-size: clamp(16px, 2vw, 19px);
    line-height: 1.7;
}
.hero-action {
    margin-top: 34px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
}
.offer-pill { display: grid; gap: 2px; color: #c0cbc5; font-size: 12px; }
.offer-pill b { color: #fff; font-size: 15px; }
.landing-divider { position: relative; z-index: 2; width: 100%; height: 1px; background: rgb(255 255 255 / .24); }
.landing-footer {
    position: relative;
    z-index: 2;
    padding: 30px 24px 34px;
    background: rgb(8 15 12 / .72);
    backdrop-filter: blur(12px);
    color: #aebbb4;
    text-align: center;
    font-size: 12px;
}
.legal-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 26px; }
.legal-links a { color: #e0e8e3; text-decoration: none; }
.landing-footer p { margin: 13px 0 0; }

/* Shared controls */
.primary-button, .secondary-button {
    min-height: 50px;
    padding: 12px 20px;
    border: 1px solid var(--ink);
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-weight: 750;
    line-height: 1.3;
    transition: transform var(--ease), background var(--ease), box-shadow var(--ease);
}
.primary-button { background: var(--ink); color: #fff; box-shadow: 0 10px 30px rgb(18 39 29 / .10); }
.secondary-button { background: transparent; color: var(--ink); border-color: #bfc7c2; }
.hero-button { min-width: 220px; background: #fff; color: var(--ink); border-color: #fff; box-shadow: 0 14px 40px rgb(0 0 0 / .18); }
.text-button {
    min-height: 44px;
    padding: 4px 0;
    border: 0;
    background: transparent;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

/* Assessment workspace */
.agent-shell {
    min-height: 100svh;
    background:
        radial-gradient(circle at 15% 0%, rgb(211 229 220 / .35), transparent 34rem),
        var(--paper);
}
.agent-topbar {
    min-height: 76px;
    padding: 14px 24px;
    border-bottom: 1px solid rgb(255 255 255 / .12);
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    background: var(--header-bg);
    -webkit-backdrop-filter: blur(14px) saturate(115%);
    backdrop-filter: blur(14px) saturate(115%);
    box-shadow: 0 8px 30px rgb(9 20 14 / .08);
    position: sticky;
    top: 0;
    z-index: 20;
}
.agent-brand { min-height: 44px; grid-column: 2; display: flex; align-items: center; }
.agent-brand img { width: 150px; height: auto; filter: brightness(0) invert(1); }
.agent-content {
    width: min(var(--content-width), calc(100% - 40px));
    margin: 0 auto;
    padding: 64px 0 28px;
}
.panel { display: none; }
.panel.active { display: block; animation: appear .2s ease; }
@keyframes appear { from { opacity: 0; transform: translateY(4px); } }
.panel-heading { max-width: 700px; margin-bottom: 42px; }
.panel-heading h2 { margin: 0; font-size: clamp(34px, 6vw, 58px); font-weight: 720; }
.panel-heading p { margin: 13px 0 0; color: var(--muted); font-size: 17px; }
.panel-heading-with-action {
    max-width: none;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
}
.edit-vehicle-button { flex: 0 0 auto; text-decoration: underline; text-underline-offset: 4px; }
.eyebrow, .card-kicker {
    margin: 0 0 10px;
    color: var(--green);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
}

/* Forms */
.form-grid, .card-form, .observation-composer {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
}
.narrow-form, .restore-access, .checkout-card { max-width: 640px; }
.card-form, .observation-composer { padding: 0; border: 0; background: transparent; }
.card-form h3 { margin: 0; }
.price-field { grid-column: 1 / -1; max-width: 360px; }
.full-width { grid-column: 1 / -1; }
label { display: block; min-width: 0; color: #34433c; font-size: 13px; font-weight: 700; }
input:not([type=checkbox]):not([type=file]), select, textarea {
    width: 100%;
    min-width: 0;
    min-height: 52px;
    margin-top: 8px;
    padding: 12px 14px;
    border: 1px solid #bdc7c1;
    border-radius: var(--radius-control);
    background: rgb(255 255 255 / .92);
    color: var(--ink);
    font-size: 16px;
    transition: border var(--ease), box-shadow var(--ease);
}
textarea { min-height: 136px; resize: vertical; }
input:focus, select:focus, textarea:focus {
    outline: 0;
    border-color: #478369;
    box-shadow: 0 0 0 3px rgb(71 131 105 / .13);
}
input[type=checkbox] {
    width: 18px;
    height: 18px;
    margin: 2px 0 0;
    flex: 0 0 18px;
    accent-color: var(--green);
}
.file-upload-label { position: relative; }
.file-upload-input {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
}
.file-upload-control {
    width: 100%;
    min-height: 52px;
    margin-top: 8px;
    padding: 7px;
    border: 1px solid #bdc7c1;
    border-radius: var(--radius-control);
    background: rgb(255 255 255 / .92);
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: border var(--ease), box-shadow var(--ease);
}
.file-upload-button {
    min-height: 36px;
    padding: 8px 13px;
    border-radius: 999px;
    background: #e9eeeb;
    color: var(--ink);
    display: inline-flex;
    align-items: center;
    font-size: 12px;
    font-weight: 750;
    white-space: nowrap;
}
.selected-file-name {
    min-width: 0;
    overflow: hidden;
    color: var(--muted);
    font-size: 12px;
    font-weight: 500;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.file-upload-label:focus-within .file-upload-control {
    border-color: #478369;
    box-shadow: 0 0 0 3px rgb(71 131 105 / .13);
}
.file-upload-input:disabled + .file-upload-control { cursor: not-allowed; opacity: .55; }
.consent-box {
    padding: 18px 0 18px 18px;
    border-left: 2px solid #b7c5be;
    display: grid;
    gap: 14px;
}
.consent-box label { display: flex; align-items: flex-start; gap: 10px; font-size: 12px; font-weight: 400; }
.restore-access, .advanced-fields, .submitted-data, .report-details details {
    border: 0;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    border-radius: 0;
    background: transparent;
}
.restore-access { margin-top: 30px; }
.restore-access summary, .advanced-fields summary, .submitted-data summary, .report-details summary {
    min-height: 58px;
    padding: 17px 0;
    cursor: pointer;
    font-weight: 750;
    list-style: none;
}
.restore-access summary::-webkit-details-marker,
.advanced-fields summary::-webkit-details-marker,
.submitted-data summary::-webkit-details-marker,
.report-details summary::-webkit-details-marker { display: none; }
.restore-access summary::after, .advanced-fields summary::after,
.submitted-data summary::after, .report-details summary::after {
    content: "+";
    float: right;
    color: var(--muted);
}
details[open] > summary::after { content: "–"; }
.restore-form { padding: 4px 0 24px; display: grid; gap: 18px; }
.advanced-fields { padding: 0; }
.advanced-fields summary span { margin-left: 8px; color: var(--muted); font-size: 11px; font-weight: 500; }
.advanced-grid { padding: 4px 0 24px; display: grid; gap: 18px; }
.form-actions {
    grid-column: 1 / -1;
    margin-top: 14px;
    padding-top: 24px;
    border-top: 1px solid var(--line);
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
}
.form-actions p { margin: 0; max-width: 520px; color: var(--muted); font-size: 12px; }
.checkout-card {
    margin-top: 34px;
    padding: 26px;
    border-radius: var(--radius-panel);
    background: linear-gradient(135deg, #173b2d, #10271e);
    color: #fff;
    display: flex;
    flex-direction: column;
    gap: 18px;
}
.checkout-card strong { font-size: 40px; }
.checkout-card p { margin: 5px 0; color: #b8c3be; }
.checkout-card .primary-button { background: #fff; color: var(--ink); }

/* Evidence and clarification */
.observation-upload-row { display: grid; gap: 18px; }
.analysis-progress, .clarification-box, .message, .delivery-box { padding: 18px 20px; border-radius: var(--radius-control); }
.analysis-progress {
    margin-bottom: 26px;
    display: flex;
    gap: 14px;
    align-items: center;
    background: #eaf1fb;
    color: #2853a3;
}
.analysis-progress p { margin: 3px 0 0; font-size: 12px; }
.progress-spinner {
    width: 24px;
    height: 24px;
    border: 3px solid #c8d6ee;
    border-top-color: #2853a3;
    border-radius: 50%;
    animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.selected-request {
    padding: 14px 16px;
    border-left: 3px solid var(--blue);
    border-radius: var(--radius-control);
    background: #edf3fc;
    display: grid;
    color: var(--blue);
    font-size: 12px;
}
.clarification-box { margin: 34px 0; border: 1px solid #d6e2f3; border-radius: var(--radius-panel); background: #edf3fc; }
.clarification-heading { display: flex; gap: 12px; align-items: center; }
.clarification-heading h3 { margin: 0; }
.ai-mark {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: #d7e4f7;
    color: #2853a3;
    display: grid;
    place-items: center;
    font-size: 11px;
    font-weight: 800;
}
.clarification-help { color: #53627b; font-size: 12px; }
.clarification-list, .observation-list, .repair-item-list { display: grid; }
.clarification-item {
    padding: 14px 0;
    border-top: 1px solid #c5d3e7;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px;
}
.clarification-select { padding: 0; border: 0; background: transparent; text-align: left; display: grid; gap: 4px; }
.clarification-select > span, .clarification-select small { font-size: 10px; color: #2853a3; }
.clarification-skip {
    min-height: 44px;
    padding: 6px 0 6px 12px;
    border: 0;
    background: transparent;
    color: #53627b;
    font-size: 11px;
    text-decoration: underline;
}
.finalize-available { width: 100%; margin-top: 16px; }
.section-block { margin-top: 30px; }
.submitted-data { padding: 0; }
.submitted-data .observation-list { padding-bottom: 4px; }
.counter { color: var(--muted); font-size: 11px; }
.observation-item {
    padding: 16px 0;
    border-top: 1px solid var(--line);
    display: grid;
    grid-template-columns: 54px 1fr;
    gap: 14px;
}
.observation-item img, .observation-icon { width: 54px; height: 54px; border-radius: 10px; object-fit: cover; }
.observation-icon { display: grid; place-items: center; background: #e6e9e7; }
.observation-item p { margin: 4px 0 0; color: var(--muted); font-size: 12px; white-space: pre-wrap; }
.empty-observations, .empty-state {
    padding: 36px 18px;
    border-top: 1px solid var(--line);
    text-align: center;
    color: var(--muted);
    font-size: 13px;
}
.empty-state { padding: 68px 20px; border-bottom: 1px solid var(--line); }
.empty-state h3 { margin: 10px 0 4px; }

/* Report */
.verdict-card {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    min-height: 270px;
    padding: clamp(30px, 6vw, 58px);
    border-radius: var(--radius-panel);
    background: #20342a;
    color: #fff;
    display: flex;
    flex-direction: column;
    gap: 24px;
}
.verdict-video { z-index: 0; }
.verdict-shade {
    position: absolute;
    z-index: 1;
    inset: 0;
    background: linear-gradient(90deg, rgb(7 17 12 / .88) 0%, rgb(8 20 14 / .72) 58%, rgb(8 18 13 / .50) 100%);
}
.verdict-content { position: relative; z-index: 2; max-width: 760px; }
.verdict-card .card-kicker { color: #91b4a3; }
.verdict-card strong { font-size: clamp(30px, 6vw, 48px); line-height: 1.1; }
.deal-assessment { max-width: 640px; margin: 12px 0 0; color: #c9d4cf; font-size: 14px; }
.confidence { color: #aebbb5; font-size: 12px; }
.confidence b { margin-left: 8px; color: #fff; font-size: 20px; }
.report-summary { margin: 26px 0; color: #44534c; font-size: 15px; line-height: 1.75; }
.decision-reasons {
    margin: 18px 0;
    padding: 20px 22px;
    border: 1px solid #ead8aa;
    border-radius: var(--radius-control);
    background: #fff9ea;
}
.decision-reasons h3 { margin: 0 0 10px; font-size: 16px; }
.decision-reasons ul { margin: 0; padding-left: 20px; }
.decision-reasons li { margin: 7px 0; color: #544725; line-height: 1.5; }
.metric-grid { display: grid; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.metric-grid article { padding: 26px 0; border-bottom: 1px solid var(--line); display: grid; gap: 7px; }
.metric-grid article:last-child { border-bottom: 0; }
.metric-grid span, .metric-grid small { color: var(--muted); font-size: 12px; }
.metric-grid strong { font-size: 26px; }
.accent-metric { background: linear-gradient(135deg, var(--green-soft), #f3f8f5); }
.delivery-box, .message { margin: 20px 0; background: #e7f3ed; color: #216140; font-size: 13px; }
.message.error { background: #fff0ee; color: var(--danger); }
.report-details { margin-top: 30px; display: grid; gap: 12px; }
.report-details details { padding: 0; }
.report-details details > div { padding-bottom: 18px; }
.repair-item { padding: 18px 0; border-top: 1px solid var(--line); }
.repair-item-top { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; }
.repair-item h4 { margin: 10px 0 5px; }
.repair-item p { margin: 5px 0; color: var(--muted); font-size: 13px; }
.repair-item small { color: var(--muted); }
.repair-item > p, .repair-item > small { max-width: 840px; }
.action-badge {
    font-size: 10px;
    font-weight: 800;
    color: var(--green);
    text-transform: uppercase;
    letter-spacing: .06em;
}
.customer-statement { padding-left: 16px; border-left: 2px solid #9bc4ad; }
.missing-box { margin-top: 12px; padding: 16px; border-radius: var(--radius-control); background: #fff3d8; color: #76581a; font-size: 12px; }
.missing-box h3 { margin: 0; }
.report-details ul { padding-left: 20px; }
.report-details li { margin: 7px 0; font-size: 12px; overflow-wrap: anywhere; }
.new-vehicle-card {
    margin-top: 30px;
    padding: 24px 0;
    border-top: 1px solid var(--line);
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.new-vehicle-card p { margin: 4px 0; color: var(--muted); font-size: 12px; }
.save-state {
    margin: 54px 0 0;
    padding-top: 18px;
    border-top: 1px solid var(--line);
    color: var(--muted);
    text-align: center;
    font-size: 11px;
}
#source-details:has(#market-sources:empty), #risk-details:has(#ai-risks:empty):has(#missing-box[hidden]) { display: none; }

@media (hover: hover) {
    .primary-button:hover:not(:disabled), .secondary-button:hover:not(:disabled) {
        transform: translateY(-1px);
        box-shadow: 0 6px 18px rgb(24 48 36 / .12);
    }
    .legal-links a:hover { color: #fff; }
    .text-button:hover { color: var(--green); }
}

@media (min-width: 680px) {
    .hero-action { flex-direction: row; justify-content: center; gap: 26px; }
    .agent-content { width: min(var(--content-width), calc(100% - 72px)); padding-top: 72px; }
    .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .advanced-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .observation-upload-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .form-actions { flex-direction: row; justify-content: space-between; align-items: center; }
    .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .metric-grid article { padding: 24px; border-bottom: 1px solid var(--line); }
    .metric-grid article:nth-child(odd) { border-right: 1px solid var(--line); }
    .metric-grid article:nth-last-child(-n+2) { border-bottom: 0; }
    .verdict-card, .new-vehicle-card { flex-direction: row; align-items: center; justify-content: space-between; }
    .checkout-card { flex-direction: row; align-items: center; justify-content: space-between; }
}

@media (max-width: 679px) {
    .site-header { height: 76px; }
    .brand-logo { width: 142px; }
    .landing { min-height: 100svh; }
    .landing-main { padding: 112px 20px 58px; }
    .agent-topbar { min-height: 76px; grid-template-columns: 1fr; padding: 13px 18px; }
    .agent-brand { grid-column: 1; justify-self: center; }
    .agent-brand img { width: 142px; }
    .agent-content { width: min(100% - 32px, var(--content-width)); padding-top: 46px; }
    .panel-heading { margin-bottom: 32px; }
    .panel-heading-with-action { align-items: flex-start; flex-direction: column; gap: 8px; }
    .edit-vehicle-button { min-height: 44px; margin: -8px 0; }
    .primary-button, .secondary-button { width: 100%; }
    .file-upload-control { align-items: flex-start; flex-direction: column; gap: 5px; }
    .file-upload-button { width: 100%; justify-content: center; }
    .selected-file-name { width: 100%; padding: 3px 6px 1px; }
    .landing-footer { padding-inline: 18px; }
    .verdict-card { min-height: 240px; border-radius: 16px; }
}

@media (max-width: 420px) {
    .repair-item-top { align-items: flex-start; flex-direction: column; }
    .repair-item-top strong { font-size: 15px; }
}

@media (prefers-reduced-motion: reduce) {
    * { animation: none !important; transition: none !important; }
    html { scroll-behavior: auto; }
    .ambient-video { display: none; }
    .landing, .verdict-card {
        background-image: linear-gradient(rgb(8 16 12 / .70), rgb(8 16 12 / .86)), url("carcv-aerial-poster.f9e5759476d1.jpg");
        background-position: center;
        background-size: cover;
    }
}
