:root {
  color-scheme: light;
  --ink: #10231d;
  --muted: #566760;
  --paper: #f5f1e8;
  --surface: #fffdf8;
  --line: #cbd2ca;
  --green: #0b6b4f;
  --green-dark: #084c3a;
  --lime: #c9f04f;
  --error: #a52b2b;
  --warning: #8a5a00;
  --skip: #47625a;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(rgba(16, 35, 29, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(16, 35, 29, 0.035) 1px, transparent 1px),
    var(--paper);
  background-size: 32px 32px;
  line-height: 1.65;
}

button, input { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: 0.55; }

.site-header {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
  padding: 24px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  letter-spacing: -0.02em;
  text-decoration: none;
}

.brand-mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  color: white;
  background: var(--green);
  border-radius: 50%;
  font-family: ui-monospace, monospace;
}

.privacy-badge {
  border: 1px solid var(--green);
  border-radius: 999px;
  color: var(--green-dark);
  font-size: 0.78rem;
  font-weight: 800;
  padding: 5px 11px;
  background: rgba(255, 253, 248, 0.8);
}

main { width: min(1120px, calc(100% - 40px)); margin: 0 auto; }

.hero {
  padding: clamp(56px, 9vw, 112px) 0 64px;
  max-width: 900px;
}

.eyebrow, .step-label {
  margin: 0 0 12px;
  color: var(--green);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  max-width: 14ch;
  font-size: clamp(2.65rem, 8vw, 6.3rem);
  line-height: 0.98;
  letter-spacing: -0.065em;
}

.lead {
  max-width: 680px;
  margin: 30px 0 0;
  color: var(--muted);
  font-size: clamp(1rem, 2.2vw, 1.22rem);
}

.checker, .results, .boundaries {
  margin: 0 0 48px;
  padding: clamp(24px, 5vw, 54px);
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  border: 1px solid var(--line);
  border-radius: 26px;
  box-shadow: 0 22px 70px rgba(16, 35, 29, 0.08);
}

.section-heading { margin-bottom: 30px; }
.section-heading h2, .progress-panel h2 { margin: 0; font-size: clamp(1.6rem, 3vw, 2.35rem); letter-spacing: -0.035em; line-height: 1.2; }

fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
legend, .field-row > label { margin-bottom: 12px; font-weight: 800; }

.choice-grid, .upload-grid, .boundary-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }

.choice-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: white;
}

.choice-card:has(input:checked) { border-color: var(--green); box-shadow: inset 0 0 0 1px var(--green); }
.choice-card input { margin-top: 5px; accent-color: var(--green); }
.choice-copy { display: grid; gap: 3px; }
.choice-copy small, .field-help, .scope-note, .upload-detail { color: var(--muted); font-size: 0.84rem; }
code { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 0.88em; }

.field-row { margin-top: 22px; }
.field-row > label { display: block; }
.prefix-input { display: flex; align-items: center; gap: 8px; max-width: 480px; font-family: ui-monospace, monospace; }
.prefix-input input { min-width: 0; flex: 1; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: white; color: var(--ink); }
.prefix-input input:focus, button:focus-visible, input:focus-visible, .upload-card:focus-within { outline: 3px solid color-mix(in srgb, var(--lime) 75%, white); outline-offset: 3px; }
.field-help { margin: 7px 0 0; }

.upload-grid { margin-top: 28px; }
.upload-card {
  min-height: 190px;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  text-align: center;
  border: 1.5px dashed var(--green);
  border-radius: 18px;
  background: #f4fae9;
  overflow: hidden;
}
.secondary-upload { background: #f5f7f4; border-color: #8aa198; }
.upload-card input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.upload-icon { display: grid; place-items: center; width: 54px; height: 54px; border-radius: 14px; background: var(--ink); color: white; font: 800 0.77rem/1 ui-monospace, monospace; }
.upload-title { font-weight: 900; }

.selection-status { min-height: 1.65em; margin: 16px 0 0; color: var(--green-dark); font-weight: 750; }
.action-row { display: flex; gap: 10px; margin-top: 20px; }
.primary-button, .secondary-button { min-height: 50px; padding: 0 22px; border-radius: 12px; font-weight: 900; }
.primary-button { border: 1px solid var(--green-dark); background: var(--green); color: white; box-shadow: 0 7px 0 var(--green-dark); transform: translateY(-3px); }
.primary-button:active { box-shadow: 0 3px 0 var(--green-dark); transform: translateY(1px); }
.secondary-button { border: 1px solid var(--line); background: white; color: var(--ink); }
.scope-note { margin: 20px 0 0; padding-top: 18px; border-top: 1px solid var(--line); }

.progress-panel {
  margin: 0 0 48px;
  padding: 28px;
  display: flex;
  align-items: center;
  gap: 18px;
  color: white;
  background: var(--ink);
  border-radius: 18px;
}
.progress-panel p { margin: 5px 0 0; color: #c7d6d0; }
.spinner { width: 38px; height: 38px; flex: 0 0 auto; border: 4px solid rgba(255,255,255,.24); border-top-color: var(--lime); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation: none; border-top-color: white; } }

.result-summary { padding: 22px; border-radius: 15px; background: #f1f6f2; }
.summary-title { margin: 0; font-size: 1.25rem; font-weight: 900; }
.summary-copy { margin: 5px 0 0; color: var(--muted); }
.count-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 15px; }
.count-chip { padding: 5px 10px; border: 1px solid var(--line); border-radius: 999px; background: white; font-size: 0.84rem; font-weight: 800; }
.result-list { display: grid; gap: 12px; margin-top: 20px; }
.issue-card { padding: 18px; border: 1px solid var(--line); border-left-width: 5px; border-radius: 12px; background: white; }
.issue-card[data-severity="error"] { border-left-color: var(--error); }
.issue-card[data-severity="warning"] { border-left-color: var(--warning); }
.issue-card[data-severity="skipped"] { border-left-color: var(--skip); }
.issue-label { margin: 0 0 7px; font-size: 0.75rem; font-weight: 900; letter-spacing: 0.08em; }
.issue-message { margin: 0; font-weight: 800; }
.issue-detail { display: grid; grid-template-columns: minmax(90px, auto) 1fr; gap: 3px 14px; margin: 12px 0 0; font-size: 0.85rem; }
.issue-detail dt { color: var(--muted); }
.issue-detail dd { min-width: 0; margin: 0; overflow-wrap: anywhere; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }
.result-truncation { margin: 15px 0 0; color: var(--muted); }

.boundary-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.boundary-grid article { padding: 22px; border-top: 3px solid var(--green); background: #f4f6f1; }
.boundary-grid article > span { color: var(--green); font: 900 0.8rem/1 ui-monospace, monospace; }
.boundary-grid h3 { margin: 18px 0 7px; line-height: 1.3; }
.boundary-grid p { margin: 0; color: var(--muted); font-size: 0.9rem; }

footer { width: min(1120px, calc(100% - 40px)); margin: 0 auto; padding: 10px 0 50px; color: var(--muted); font-size: 0.82rem; }

@media (max-width: 720px) {
  .site-header, main, footer { width: min(100% - 24px, 1120px); }
  .site-header { padding: 16px 0; }
  .brand { font-size: 0.88rem; }
  .privacy-badge { font-size: 0.7rem; }
  .hero { padding: 46px 0 42px; }
  h1 { font-size: clamp(2.55rem, 15vw, 4.5rem); }
  .checker, .results, .boundaries { padding: 22px; border-radius: 18px; }
  .choice-grid, .upload-grid, .boundary-grid { grid-template-columns: 1fr; }
  .upload-card { min-height: 150px; }
  .action-row { flex-direction: column; }
  .primary-button, .secondary-button { width: 100%; }
  .issue-detail { grid-template-columns: 1fr; gap: 1px; }
  .issue-detail dd { margin-bottom: 8px; }
}
