:root {
    color-scheme: light;
    --ink: #0e1b23;
    --muted: #5c6b75;
    --line: #dfe5e8;
    --paper: #fff;
    --soft: #f4f7f8;
    --navy: #173e54;
    --navy-hover: #0e3042;
    --green: #087a5b;
    --gold: #a96305;
    --red: #a8231b;
    --shadow: 0 20px 55px rgba(15, 38, 51, .10);
}
* { box-sizing: border-box; }
html, body { min-height: 100%; }
body { margin: 0; color: var(--ink); font: 15px/1.45 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
button, input, textarea { font: inherit; }
a { color: inherit; }
.landing-page, .auth-page, .app-page { background: radial-gradient(circle at 8% 0, rgba(84, 154, 183, .13), transparent 34rem), #f2f5f6; }
.coming-soon { min-height: 100vh; display: grid; align-content: center; justify-items: center; gap: 34px; padding: 32px; }
.coming-soon img { width: min(410px, 72vw); height: auto; object-fit: contain; }
.coming-soon h1 { margin: 0; color: #2d5368; font-size: clamp(28px, 4vw, 48px); font-weight: 600; letter-spacing: -.04em; }
.auth-shell { width: min(430px, calc(100% - 32px)); min-height: 100vh; display: grid; align-content: center; gap: 24px; margin: auto; padding: 42px 0; }
.auth-brand { display: inline-flex; justify-self: center; }
.auth-brand img { width: 190px; max-height: 72px; object-fit: contain; }
.auth-card { padding: 34px; border: 1px solid rgba(16, 36, 48, .09); border-radius: 18px; background: rgba(255,255,255,.96); box-shadow: var(--shadow); }
.auth-card-wide { width: min(500px, calc(100vw - 32px)); justify-self: center; }
.eyebrow { margin: 0 0 5px; color: #356a82; font-size: 11px; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.auth-card h1, .predict-card h1 { margin: 0 0 25px; font-size: 30px; line-height: 1.1; letter-spacing: -.04em; }
label { display: block; margin: 15px 0 7px; color: #2e414d; font-size: 12px; font-weight: 750; }
input, textarea { width: 100%; padding: 11px 12px; border: 1px solid #c9d2d7; border-radius: 9px; color: var(--ink); background: #fff; outline: none; }
textarea { resize: vertical; }
input:focus, textarea:focus { border-color: #5b91aa; box-shadow: 0 0 0 3px rgba(45, 108, 137, .12); }
.code-input { font-size: 22px; letter-spacing: .18em; text-align: center; }
.primary-button { width: 100%; margin-top: 20px; padding: 11px 14px; border: 0; border-radius: 9px; background: var(--navy); color: white; font-weight: 780; cursor: pointer; }
.primary-button:hover { background: var(--navy-hover); }
.primary-button:disabled { opacity: .55; cursor: wait; }
.auth-links { display: flex; justify-content: space-between; gap: 12px; margin-top: 19px; }
.auth-links a { color: #356a82; font-size: 12px; font-weight: 700; text-decoration: none; }
.auth-links a:hover { text-decoration: underline; }
.form-message { margin: 14px 0 0; font-size: 12px; }
.form-message.error { color: var(--red); }
.form-message.success { color: var(--green); }
.auth-instruction { margin: -12px 0 20px; color: #3e505b; font-size: 13px; }
.setup-key { overflow-wrap: anywhere; padding: 14px; border-radius: 9px; background: #eef3f5; font: 600 13px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .05em; }
.optional { color: #6f7d85; font-weight: 500; }
.honeypot { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.topbar { height: 74px; display: flex; align-items: center; justify-content: space-between; padding: 0 clamp(20px, 4vw, 56px); border-bottom: 1px solid rgba(16,36,48,.08); background: rgba(255,255,255,.90); backdrop-filter: blur(14px); }
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; }
.brand img { width: 112px; height: 38px; object-fit: contain; }
.brand strong { font-size: 20px; letter-spacing: -.025em; }
.nav-button { padding: 8px 11px; border: 0; border-radius: 8px; color: #42545f; background: transparent; font-size: 13px; cursor: pointer; }
.nav-button:hover { background: #edf2f4; }
.app-shell { width: min(1440px, calc(100% - 44px)); min-height: calc(100vh - 120px); display: grid; grid-template-columns: 330px minmax(0,1fr); gap: 22px; margin: 24px auto; }
.rail { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.predict-card, .history-card, .result-panel { border: 1px solid rgba(16,36,48,.09); border-radius: 16px; background: var(--paper); box-shadow: var(--shadow); }
.predict-card { padding: 24px; }
.choose-scan { width: 100%; display: flex; align-items: center; gap: 12px; margin-top: 14px; padding: 13px; border: 1px dashed #a8b6be; border-radius: 10px; background: #f7f9fa; color: var(--ink); text-align: left; cursor: pointer; }
.choose-scan:hover { border-color: #3d748c; background: #f1f6f8; }
.choose-icon { width: 32px; height: 32px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 8px; background: #e3eef2; color: var(--navy); font-size: 22px; line-height: 1; }
.choose-scan span:last-child { min-width: 0; display: grid; }
.choose-scan strong { font-size: 13px; }
.choose-scan small { margin-top: 2px; overflow: hidden; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.progress { height: 4px; margin-top: 14px; overflow: hidden; border-radius: 999px; background: #e6ecef; }
.progress span { display: block; width: 0; height: 100%; background: #326f89; transition: width .2s ease; }
.form-status { min-height: 18px; margin: 9px 0 0; color: #40535e; font-size: 11px; }
.form-status.error { color: var(--red); }
.predict-button { margin-top: 5px; }
.history-card { min-height: 180px; overflow: hidden; }
.section-heading { display: flex; align-items: center; justify-content: space-between; padding: 17px 18px 12px; }
.section-heading h2 { margin: 0; font-size: 14px; }
.section-heading a { color: #356a82; font-size: 12px; font-weight: 750; text-decoration: none; }
.scan-history { max-height: 390px; overflow: auto; padding: 0 9px 10px; }
.history-empty { padding: 18px 10px; color: #687984; font-size: 12px; }
.scan-item { width: 100%; display: grid; grid-template-columns: 9px minmax(0,1fr) auto; align-items: center; gap: 10px; padding: 11px 10px; border: 0; border-radius: 9px; background: transparent; color: inherit; text-align: left; cursor: pointer; }
.scan-item:hover { background: #f4f7f8; }
.scan-item.selected { background: #e9f2f5; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: #8998a1; }
.status-dot.complete { background: var(--green); }
.status-dot.processing, .status-dot.queued, .status-dot.receiving { background: #d58a15; }
.status-dot.failed { background: var(--red); }
.scan-copy { min-width: 0; display: grid; }
.scan-copy strong { overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.scan-copy small { margin-top: 2px; color: #5c6c76; font-size: 10px; }
.scan-value { min-width: 38px; padding: 3px 6px; border-radius: 6px; font-size: 11px; font-weight: 850; text-align: center; font-variant-numeric: tabular-nums; }
.vbq-low { color: #05624b; background: #dcf3eb; }
.vbq-elevated { color: #83500a; background: #fff0cf; }
.vbq-high { color: #972119; background: #fee4e2; }
.result-panel { min-width: 0; min-height: 680px; overflow: hidden; }
.empty-result, .processing-result, .failed-result { min-height: 680px; display: grid; align-content: center; justify-items: center; padding: 40px; text-align: center; }
.empty-mark { width: 54px; height: 72px; border: 2px solid #c4d0d6; border-radius: 50% 50% 44% 44%; transform: rotate(4deg); }
.empty-result h2, .processing-result h2, .failed-result h2 { margin: 18px 0 5px; font-size: 20px; letter-spacing: -.02em; }
.spinner { width: 34px; height: 34px; border: 3px solid #d8e2e6; border-top-color: #326f89; border-radius: 50%; animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.result-header { display: flex; align-items: center; justify-content: flex-end; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.result-actions { display: flex; gap: 8px; }
.result-actions a, .result-actions button, .failed-delete { padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: #344954; font-size: 11px; font-weight: 750; text-decoration: none; cursor: pointer; }
.result-actions .delete-scan, .failed-delete { color: var(--red); border-color: #efc2be; }
.result-body { display: grid; grid-template-columns: minmax(0,1fr) 290px; min-height: 620px; }
.image-stage { min-width: 0; min-height: 620px; display: grid; place-items: center; padding: 14px; background: #0b1114; }
.image-stage img { display: block; max-width: 100%; max-height: 760px; object-fit: contain; }
.image-error { color: #d9e2e6; font-size: 13px; }
.metrics { padding: 24px 22px; border-left: 1px solid var(--line); }
.vbq-hero { padding: 19px 20px 18px; border: 1px solid; border-radius: 14px; }
.vbq-hero.vbq-low { border-color: #86d3ba; }
.vbq-hero.vbq-elevated { border-color: #eac071; }
.vbq-hero.vbq-high { border-color: #eeaaa5; }
.vbq-label, .z-metric span, .intensity-row span { font-size: 11px; font-weight: 780; }
.vbq-hero > strong { display: block; margin-top: 3px; font-size: 56px; line-height: 1; letter-spacing: -.055em; font-variant-numeric: tabular-nums; }
.vbq-threshold-list { display: grid; gap: 5px; margin-top: 14px; padding-top: 11px; border-top: 1px solid currentColor; }
.vbq-threshold-list div { display: flex; align-items: baseline; justify-content: space-between; }
.vbq-threshold-list span, .vbq-threshold-list b { font-size: 11px; }
sup { position: relative; top: -.45em; font-size: .65em; line-height: 0; vertical-align: baseline; }
.z-metric { display: flex; align-items: baseline; justify-content: space-between; margin-top: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; }
.z-metric strong { font-size: 20px; font-variant-numeric: tabular-nums; }
.vbq-footnotes { display: flex; flex-wrap: wrap; gap: 5px 12px; margin-top: 9px; padding: 0 2px; }
.vbq-footnotes a { color: #285d75; font-size: 10px; font-weight: 650; text-underline-offset: 2px; }
.intensity-list { margin-top: 22px; }
.intensity-list h3 { margin: 0 0 9px; font-size: 12px; }
.intensity-row { display: flex; align-items: baseline; justify-content: space-between; padding: 7px 0; border-bottom: 1px solid #edf0f2; }
.intensity-row strong { font-size: 12px; font-variant-numeric: tabular-nums; }
.failed-delete { margin-top: 18px; }
@media (max-width: 980px) { .app-shell { grid-template-columns: 1fr; } .rail { display: grid; grid-template-columns: minmax(280px,.75fr) 1.25fr; } .result-panel, .empty-result, .processing-result, .failed-result { min-height: 560px; } .result-body, .image-stage { min-height: 500px; } }
@media (max-width: 700px) { .topbar { height: 66px; padding: 0 16px; } .app-shell { width: calc(100% - 24px); } .rail { display: flex; } .result-body { grid-template-columns: 1fr; } .image-stage { min-height: 420px; padding: 10px; } .metrics { border-top: 1px solid var(--line); border-left: 0; } .auth-card { padding: 28px 24px; } }
@media (prefers-reduced-motion: reduce) { .spinner { animation: none; } }
