:root {
  color-scheme: light;
  --canvas: #f6f8f7;
  --surface: #ffffff;
  --ink: #102c3a;
  --muted: #61727b;
  --line: #dbe4e1;
  --primary: #087b78;
  --primary-hover: #066e6b;
  --primary-soft: #e8f5f3;
  --warning: #a95d18;
  --warning-soft: #fff5e9;
  --success: #15745b;
  --success-soft: #e9f6f0;
  --danger: #a64040;
  --radius: 18px;
  --shadow: 0 16px 40px rgba(16,44,58,.08);
  --focus: 0 0 0 4px rgba(8,123,120,.15);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button, input { font: inherit; }
button { cursor: pointer; }
a { color: inherit; }

.app-shell {
  width: min(100%, 980px);
  min-height: 100dvh;
  margin: 0 auto;
  padding: 20px 28px 28px;
}
.topbar {
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand {
  text-decoration: none;
  font-weight: 800;
  letter-spacing: -.03em;
  font-size: 20px;
}
.brand span { color: var(--primary); }
.save-status {
  min-height: 20px;
  font-size: 13px;
  color: var(--muted);
}
.stage {
  width: min(100%, 720px);
  min-height: calc(100dvh - 96px);
  margin: 0 auto;
  display: grid;
  align-content: center;
  padding: 24px 0 48px;
  outline: none;
}
.screen { width: 100%; }
.eyebrow {
  margin: 0 0 10px;
  color: var(--primary);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}
h1, h2 { margin: 0; letter-spacing: -.035em; }
h1 { font-size: clamp(36px, 6vw, 58px); line-height: 1.02; max-width: 650px; }
h2 { font-size: clamp(28px, 4vw, 36px); line-height: 1.12; }
p { color: var(--muted); line-height: 1.55; }
.lede { font-size: 18px; max-width: 620px; margin: 18px 0 28px; }
.micro { font-size: 13px; color: var(--muted); }
.file-meta { font-size: 13px; color: var(--muted); margin-bottom: 12px; overflow-wrap: anywhere; }
.progress-line { font-size: 13px; color: var(--muted); margin-bottom: 16px; }
.impact { font-size: 17px; color: var(--muted); margin: 10px 0 24px; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
}
.card.compact { padding: 22px; }
.form-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; }
.input {
  width: 100%;
  min-height: 52px;
  border: 1px solid #c9d5d1;
  border-radius: 12px;
  padding: 0 15px;
  color: var(--ink);
  background: #fff;
  outline: none;
}
.input:focus { border-color: var(--primary); box-shadow: var(--focus); }
.btn {
  border: 0;
  border-radius: 12px;
  min-height: 50px;
  padding: 0 18px;
  font-weight: 750;
  transition: transform .14s ease, background .14s ease, opacity .14s ease;
}
.btn:focus-visible, .choice:focus-visible, .text-link:focus-visible, .upload-zone:focus-visible {
  outline: none;
  box-shadow: var(--focus);
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-primary:active { transform: translateY(1px); }
.btn-secondary { background: #edf2f0; color: var(--ink); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.text-link {
  border: 0;
  background: transparent;
  color: var(--primary);
  font-weight: 700;
  padding: 0;
  min-height: 36px;
}
.secondary-row { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 18px; align-items: center; }
.trust-line { margin-top: 16px; color: var(--muted); font-size: 13px; }

.upload-zone {
  display: grid;
  gap: 7px;
  place-items: center;
  text-align: center;
  min-height: 220px;
  border: 1.5px dashed #aebfba;
  border-radius: 16px;
  background: #fbfcfc;
  padding: 24px;
  transition: border .14s ease, background .14s ease;
}
.upload-zone.drag { border-color: var(--primary); background: var(--primary-soft); }
.upload-icon {
  width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); font-weight: 900;
}

.choice-list { display: grid; gap: 10px; margin-top: 18px; }
.choice {
  width: 100%;
  display: grid;
  grid-template-columns: 22px 1fr auto;
  gap: 12px;
  align-items: center;
  text-align: left;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 14px;
  padding: 16px;
  color: var(--ink);
}
.choice:hover { border-color: #abc2bd; }
.choice.selected { border-color: var(--primary); background: var(--primary-soft); }
.choice-dot {
  width: 18px; height: 18px; border-radius: 50%; border: 2px solid #9fb0ac;
}
.choice.selected .choice-dot { border: 5px solid var(--primary); background: #fff; }
.choice-title { font-weight: 760; }
.choice-samples { color: var(--muted); font-size: 13px; margin-top: 4px; overflow-wrap: anywhere; }
.badge {
  justify-self: end;
  border-radius: 999px;
  padding: 5px 8px;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
  background: #eef2f1;
  color: #53645f;
}
.badge.strong { background: var(--success-soft); color: var(--success); }
.badge.possible { background: var(--warning-soft); color: var(--warning); }

.evidence {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.evidence summary { cursor: pointer; color: var(--primary); font-weight: 700; font-size: 14px; }
.evidence-body { margin-top: 12px; font-size: 13px; color: var(--muted); }
.evidence-table { width: 100%; border-collapse: collapse; margin-top: 10px; }
.evidence-table th, .evidence-table td { border-bottom: 1px solid var(--line); padding: 8px 6px; text-align: left; vertical-align: top; }

.result-box {
  border: 1px solid #c7e4d7;
  background: var(--success-soft);
  border-radius: 16px;
  padding: 22px;
}
.warning-box {
  border: 1px solid #efcfaa;
  background: var(--warning-soft);
  border-radius: 16px;
  padding: 22px;
}
.result-title { font-size: 27px; font-weight: 800; letter-spacing: -.03em; }

.loading {
  display: grid; gap: 14px; place-items: center; text-align: center; padding: 40px 10px;
}
.spinner {
  width: 30px; height: 30px; border-radius: 50%;
  border: 3px solid #dce7e4; border-top-color: var(--primary);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  padding: 10px 14px; border-radius: 999px; background: var(--ink); color: white;
  font-size: 13px; box-shadow: var(--shadow); z-index: 10;
}

.eval-panel {
  margin-top: 28px; padding: 18px; border: 1px solid var(--line); background: #fff; border-radius: 14px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px;
}
.eval-pass { color: var(--success); }
.eval-fail { color: var(--danger); }

@media (max-width: 620px) {
  .app-shell { padding: 12px 16px 20px; }
  .topbar { height: 44px; }
  .stage { min-height: calc(100dvh - 68px); padding: 18px 0 28px; align-content: start; }
  .screen { padding-top: 7vh; }
  .card { padding: 20px; border-radius: 16px; box-shadow: none; }
  .form-row { grid-template-columns: 1fr; }
  .btn { width: 100%; }
  .choice { grid-template-columns: 20px 1fr; }
  .badge { grid-column: 2; justify-self: start; margin-top: 2px; }
  .secondary-row { gap: 12px; }
  h1 { font-size: 40px; }
  h2 { font-size: 28px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
