:root {
  --paper: oklch(1 0 0);
  --surface: oklch(1 0 0);
  --soft: oklch(0.978 0.001 250);
  --ink: oklch(0.20 0.006 250);
  --muted: oklch(0.48 0.006 250);
  --muted-light: oklch(0.62 0.005 250);
  --line: oklch(0.925 0.002 250);
  --line-light: oklch(0.945 0.002 250);
  --line-strong: oklch(0.86 0.003 250);
  --blue: oklch(0.48 0.10 158);
  --blue-dark: oklch(0.42 0.10 158);
  --blue-pale: oklch(0.955 0.02 158);
  --green: oklch(0.48 0.10 158);
  --green-pale: oklch(0.955 0.02 158);
  --amber: oklch(0.46 0.11 55);
  --amber-pale: oklch(0.962 0.03 60);
  --red: oklch(0.49 0.16 25);
  --red-pale: oklch(0.955 0.025 25);
  --shadow: 0 1px 2px oklch(0.2 0 0 / 0.03), 0 16px 40px oklch(0.2 0 0 / 0.04);
  --sans: "Geist", "Instrument Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--paper); color: var(--ink); }
body { min-height: 100vh; margin: 0; font-family: var(--sans); font-size: 15px; display: flex; flex-direction: column; -webkit-font-smoothing: antialiased; }
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 3px solid oklch(0.48 0.10 158 / 0.22); outline-offset: 2px;
}
a { color: var(--ink); text-underline-offset: 3px; }
a:hover { color: var(--blue); }
::selection { background: oklch(0.48 0.10 158 / 0.14); }

.site-header {
  position: sticky; top: 0; z-index: 20; min-height: 68px; padding: 14px 32px;
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  background: oklch(1 0 0 / 0.86); border-bottom: 1px solid var(--line-light); backdrop-filter: blur(14px);
}
.wordmark { border: 0; padding: 8px 0; background: none; color: var(--ink); font-size: 17px; font-weight: 500; line-height: 1; letter-spacing: -.02em; cursor: pointer; text-decoration: none; }
.nav-links { display: flex; align-items: center; justify-content: flex-end; gap: 4px; }
.nav-button { border: 0; border-radius: 999px; padding: 9px 14px; background: none; color: var(--muted-light); font-size: 14px; cursor: pointer; white-space: nowrap; }
.nav-button:hover, .nav-button.active { color: var(--ink); background: oklch(0.965 0.002 250); }
.nav-button.primary { border: 1px solid var(--ink); color: white; background: var(--ink); padding: 10px 18px; font-weight: 500; }
.nav-button.primary:hover { border-color: oklch(0.34 0.006 250); background: oklch(0.34 0.006 250); }

#app { flex: 1; min-width: 0; }
#app:focus { outline: none; }
.loading-screen { min-height: 65vh; display: grid; place-content: center; justify-items: center; color: var(--muted); }
.spinner { width: 28px; height: 28px; border: 2px solid oklch(0.93 0.002 250); border-top-color: var(--blue); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.hero { max-width: 920px; margin: 0 auto; padding: 96px 32px 42px; text-align: center; }
.hero h1 { margin: 0; font-size: clamp(42px, 5.4vw, 64px); font-weight: 500; line-height: 1.04; letter-spacing: -.032em; text-wrap: pretty; }
.hero p { margin: 20px auto 0; max-width: 660px; color: var(--muted); font-size: 20px; line-height: 1.55; text-wrap: pretty; }
.eyebrow { margin: 0 0 14px; color: var(--muted-light); font-size: 13.5px; line-height: 1.4; font-weight: 400; letter-spacing: 0; text-transform: none; }

.upload-shell { max-width: 760px; margin: 0 auto; padding: 0 28px 48px; }
.drop-zone {
  min-height: 300px; padding: 48px 30px; display: grid; place-content: center; justify-items: center;
  border: 1px dashed var(--line-strong); border-radius: 20px; background: var(--soft); text-align: center;
  transition: border-color .2s, background .2s, transform .2s;
}
.drop-zone.dragging { border-color: var(--blue); background: var(--blue-pale); transform: translateY(-2px); }
.shape-row { display: flex; align-items: center; gap: 13px; margin-bottom: 22px; }
.shape { width: 42px; height: 42px; background: oklch(0.94 0.03 158); }
.shape.square { border-radius: 12px; }
.shape.circle { border-radius: 50%; }
.shape.diamond { transform: rotate(45deg) scale(.78); }
.drop-title { margin: 0; font-size: 17px; font-weight: 500; line-height: 1.2; letter-spacing: -.005em; }
.drop-help { margin: 9px 0 0; color: var(--muted-light); font-size: 14.5px; }
.upload-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 26px; }
.privacy-note { max-width: 580px; margin: 20px auto 0; color: var(--muted-light); font-size: 13px; line-height: 1.65; }

.button { min-height: 44px; border: 1px solid var(--ink); border-radius: 999px; padding: 12px 22px; background: var(--ink); color: white; font-size: 15px; font-weight: 500; cursor: pointer; transition: background .16s, border-color .16s, transform .16s; }
.button:hover { background: oklch(0.34 0.006 250); border-color: oklch(0.34 0.006 250); transform: translateY(-1px); }
.button.blue { border-color: var(--ink); background: var(--ink); }
.button.blue:hover { background: oklch(0.34 0.006 250); border-color: oklch(0.34 0.006 250); }
.button.secondary { border-color: var(--line); background: var(--surface); color: var(--ink); }
.button.secondary:hover { border-color: oklch(0.80 0.004 250); background: var(--soft); }
.button.green { border-color: var(--green); background: var(--green); }
.button.green:hover { border-color: var(--blue-dark); background: var(--blue-dark); }
.button.danger { border-color: oklch(0.88 0.02 55); background: white; color: var(--amber); }
.button.danger:hover { border-color: var(--amber); background: var(--amber); color: white; }
.button.small { min-height: 38px; padding: 9px 17px; font-size: 14px; }
.button:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.link-button { border: 0; padding: 2px; background: none; color: var(--blue); font-size: 13.5px; cursor: pointer; }

.examples-strip { margin-top: 34px; padding: 30px 0 34px; overflow: hidden; border-block: 1px solid var(--line-light); background: var(--soft); }
.examples-strip .eyebrow { text-align: center; }
.example-cards { display: flex; gap: 12px; width: max-content; animation: marquee 42s linear infinite; }
.example-card { display: flex; gap: 14px; align-items: center; border: 1px solid oklch(0.93 0.002 250); border-radius: 999px; padding: 12px 20px; background: var(--paper); font-size: 14.5px; white-space: nowrap; }
.example-card strong { color: var(--green); font-weight: 500; font-variant-numeric: tabular-nums; }
@keyframes marquee { to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .example-cards { animation: none; } * { scroll-behavior: auto !important; } }

.section-shell { width: min(1040px, 100%); margin: 0 auto; padding: 48px 30px 100px; }
.section-narrow { width: min(720px, 100%); }
.section-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 18px; margin-bottom: 26px; }
.section-heading h1, .section-heading h2 { margin: 0; font-size: clamp(28px, 3.2vw, 38px); font-weight: 500; line-height: 1.1; letter-spacing: -.025em; }
.section-heading p { margin: 10px 0 0; color: var(--muted); font-size: 16px; line-height: 1.6; }

.estimate-card, .panel {
  border: 1px solid var(--line); border-radius: 20px; background: var(--surface); box-shadow: var(--shadow);
}
.estimate-card { max-width: 720px; margin: 0 auto; padding: 40px 32px; border-radius: 22px; text-align: center; }
.file-meta { color: var(--muted-light); font: 12.5px/1.7 var(--mono); word-break: break-word; }
.estimate-amount { margin: 16px 0 4px; color: var(--ink); font-size: clamp(44px, 6.4vw, 62px); font-weight: 500; line-height: 1; letter-spacing: -.035em; font-variant-numeric: tabular-nums; }
.estimate-caption { margin: 0; color: var(--muted-light); font-size: 14.5px; }
.pill-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 22px 0; }
.pill { border-radius: 999px; padding: 6px 14px; background: oklch(0.965 0.002 250); color: oklch(0.42 0.006 250); font-size: 13px; line-height: 1; font-weight: 500; }
.pill.green { background: var(--green-pale); color: #1b6d39; }
.pill.amber { background: var(--amber-pale); color: var(--amber); }
.pill.red { background: var(--red-pale); color: var(--red); }

.progress-panel { max-width: 720px; margin: 30px auto 0; padding: 30px; text-align: center; }
.progress-bar { height: 6px; margin: 24px 0 0; overflow: hidden; border-radius: 99px; background: oklch(0.955 0.002 250); }
.progress-bar span { display: block; width: 42%; height: 100%; border-radius: inherit; background: var(--blue); animation: progress 1.25s ease-in-out infinite alternate; }
@keyframes progress { to { width: 86%; } }

.auth-shell { width: min(440px, calc(100% - 40px)); margin: 0 auto; padding: 72px 0 100px; }
.auth-shell h1 { margin: 0; font-size: clamp(28px, 3vw, 34px); font-weight: 500; line-height: 1.1; letter-spacing: -.025em; }
.auth-shell > p { margin: 10px 0 30px; color: var(--muted); font-size: 16px; line-height: 1.6; }
.form-stack { display: grid; gap: 15px; }
.field { display: grid; gap: 7px; }
.field label, .field legend { color: var(--muted); font-size: 13.5px; font-weight: 500; }
.field input, .field textarea, .field select {
  width: 100%; border: 1px solid oklch(0.90 0.003 250); border-radius: 12px; padding: 13px 15px; background: var(--surface); color: var(--ink); font-size: 15.5px;
}
.field textarea { min-height: 96px; resize: vertical; line-height: 1.5; }
.field-help { margin: 0; color: var(--muted-light); font-size: 13px; line-height: 1.65; }
.checkbox-field { display: flex; align-items: flex-start; gap: 11px; color: var(--muted); font-size: 14px; line-height: 1.55; }
.checkbox-field input { width: 17px; height: 17px; margin-top: 1px; flex: none; accent-color: var(--blue); }
.auth-switch { margin-top: 18px; color: var(--muted); text-align: center; font-size: 13px; }
.auth-assurance { text-align: center; }
.auth-sent { text-align: center; }
.auth-sent strong { color: var(--ink); overflow-wrap: anywhere; }
.mail-mark { display: grid; width: 52px; height: 52px; margin: 0 auto 24px; place-items: center; border-radius: 50%; background: var(--blue-pale); color: var(--blue); font-size: 22px; }
.error-message { padding: 12px 14px; border-radius: 12px; background: var(--red-pale); color: var(--red); font-size: 13px; line-height: 1.55; }

.context-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.context-grid .full { grid-column: 1 / -1; }
.context-form { padding: 28px; }

.findings { display: grid; gap: 12px; }
.finding { padding: 22px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.finding-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.finding h3 { margin: 0; font-size: 16.5px; font-weight: 500; line-height: 1.3; letter-spacing: -.01em; }
.finding-path { margin: 12px 0 0; color: var(--muted-light); font: 12.5px/1.6 var(--mono); overflow-wrap: anywhere; }
.finding-preview { margin: 12px 0 0; padding: 14px 16px; border-radius: 12px; background: var(--soft); color: oklch(0.42 0.006 250); font: 12.5px/1.6 var(--mono); overflow-wrap: anywhere; }
.finding-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 13px; }

.license-box { max-height: 240px; overflow: auto; margin: 22px 0; padding: 20px; border: 1px solid oklch(0.93 0.002 250); border-radius: 14px; background: var(--soft); color: oklch(0.42 0.006 250); font: 13.5px/1.75 var(--sans); white-space: pre-wrap; text-align: left; }

.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px; }
.metric { min-width: 0; padding: 20px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.metric-label { color: var(--muted-light); font-size: 13.5px; }
.metric-value { margin-top: 10px; font-size: clamp(24px, 2.4vw, 30px); font-weight: 500; line-height: 1.1; letter-spacing: -.022em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.metric-value.green { color: var(--green); }

.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(280px, .75fr); gap: 22px; margin-top: 24px; align-items: start; }
.panel { padding: 24px; box-shadow: none; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 17px; }
.panel-heading h2, .panel-heading h3 { margin: 0; font-size: 19px; font-weight: 500; letter-spacing: -.015em; }
.submission-list { display: grid; gap: 10px; }
.submission-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 18px; align-items: center; padding: 18px; border: 1px solid var(--line-light); border-radius: 14px; background: var(--surface); }
.submission-name { margin: 0; font-size: 15.5px; font-weight: 500; line-height: 1.3; overflow-wrap: anywhere; }
.submission-summary { margin: 6px 0 0; color: var(--muted-light); font-size: 13.5px; line-height: 1.5; }
.submission-money { font-size: 17px; font-weight: 500; line-height: 1.2; font-variant-numeric: tabular-nums; text-align: right; }
.status-line { margin-top: 5px; color: oklch(0.74 0.004 250); font-size: 12.5px; text-align: right; }
.payout-summary { display: grid; gap: 12px; }
.payout-state { padding: 14px; border-radius: 12px; background: var(--soft); color: var(--muted); font-size: 13.5px; line-height: 1.6; }
.panel-actions { display: grid; gap: 9px; margin-top: 16px; }

.demand-list { display: grid; gap: 11px; }
.demand-card { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 20px 22px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.demand-card h3 { margin: 0; font-size: 16px; font-weight: 500; letter-spacing: -.01em; }
.demand-card p { margin: 6px 0 0; color: var(--green); font-size: 13px; }
.demand-range { color: var(--ink); font-size: 17px; font-weight: 500; line-height: 1.2; font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }

.empty-state { padding: 40px 20px; border: 1px dashed var(--line-strong); border-radius: 12px; color: var(--muted); text-align: center; }
.trust-row { max-width: 880px; margin: 0 auto; padding: 34px 30px 84px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.trust-item h3 { margin: 0 0 9px; font-size: 17px; font-weight: 500; letter-spacing: -.01em; }
.trust-item p { margin: 0; color: var(--muted); font-size: 14.5px; line-height: 1.65; text-wrap: pretty; }

.toast { position: fixed; right: 22px; bottom: 22px; z-index: 50; max-width: min(380px, calc(100vw - 44px)); padding: 13px 16px; border-radius: 12px; background: var(--ink); color: white; box-shadow: var(--shadow); opacity: 0; pointer-events: none; transform: translateY(8px); transition: opacity .2s, transform .2s; font-size: 13px; }
.toast.show { opacity: 1; transform: translateY(0); }
.site-footer { min-height: 70px; padding: 24px 32px; display: flex; align-items: center; justify-content: space-between; gap: 16px; border-top: 1px solid var(--line-light); color: var(--muted-light); font-size: 13px; }
.site-footer > div { display: flex; align-items: center; gap: 16px; }
.site-footer a { color: var(--muted-light); }
.environment-badge { padding: 5px 10px; border-radius: 999px; background: oklch(0.965 0.002 250); font-size: 12px; }

.legal-page { display: block; }
.legal-shell { max-width: 760px; margin: 0 auto; padding: 72px 30px 100px; }
.legal-shell h1 { margin: 0 0 26px; font-size: 42px; letter-spacing: -.04em; }
.legal-copy { white-space: pre-wrap; color: #46443f; font: 14px/1.75 var(--mono); }

@media (max-width: 820px) {
  .site-header { position: relative; min-height: auto; padding: 14px 20px; align-items: flex-start; }
  .nav-links { flex-wrap: wrap; gap: 2px; }
  .nav-button { padding: 8px 9px; font-size: 13px; }
  .hero { padding-top: 68px; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-grid { grid-template-columns: 1fr; }
  .context-grid { grid-template-columns: 1fr; }
  .context-grid .full { grid-column: auto; }
  .trust-row { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
  .site-header { display: block; padding: 13px 16px 10px; }
  .wordmark { display: block; margin-bottom: 8px; }
  .nav-links { justify-content: flex-start; }
  .nav-button { padding: 7px 8px; }
  .nav-button.primary { padding-inline: 12px; }
  .hero { padding: 54px 20px 30px; }
  .hero h1 { font-size: 42px; }
  .upload-shell { padding-inline: 15px; }
  .drop-zone { min-height: 270px; padding: 36px 16px; }
  .upload-actions { display: grid; width: 100%; }
  .button { width: 100%; }
  .section-shell { padding: 34px 16px 72px; }
  .section-heading { align-items: flex-start; flex-direction: column; }
  .estimate-card { padding: 30px 17px; }
  .estimate-amount { font-size: 40px; }
  .metric-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .metric { padding: 14px 12px; }
  .metric-value { font-size: 20px; }
  .panel { padding: 16px; }
  .submission-row { grid-template-columns: 1fr; gap: 10px; }
  .submission-money, .status-line { text-align: left; }
  .demand-card { align-items: flex-start; flex-direction: column; }
  .demand-range { text-align: left; }
  .site-footer { padding: 20px 16px; align-items: flex-start; flex-direction: column; }
  .site-footer > div { flex-wrap: wrap; }
}
