:root {
  color-scheme: light;
  --ink: #122b28;
  --quiet: #50645f;
  --forest: #102e2a;
  --accent: #c6fa78;
  --accent-dark: #25533e;
  --line: #d9e4dc;
  --paper: #f4f7f3;
  --error: #932e27;
  font: 100%/1.55 "Segoe UI", system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper);
  scroll-behavior: smooth;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
h1, h2, h3, p { margin: 0; }
a { color: inherit; }
button, select, input { font: inherit; }
button, a, input, select { touch-action: manipulation; }
:focus-visible { outline: 3px solid #669b40; outline-offset: 4px; }
.wrap { width: min(1120px, calc(100% - 48px)); margin-inline: auto; }
.skip { position: absolute; z-index: 2; top: .5rem; left: 1rem; padding: .5rem 1rem; background: white; transform: translateY(-200%); }
.skip:focus { transform: none; }
.site-header, .hero { background: var(--forest); color: #f6fff8; }
.site-header { border-bottom: 1px solid #36534e; }
.header-inner { min-height: 68px; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.brand { display: inline-flex; align-items: center; gap: .65rem; text-decoration: none; font-size: 1.15rem; font-weight: 750; letter-spacing: -.035em; }
.brand-mark { width: 25px; height: 25px; border-radius: 7px; display: inline-grid; place-items: center; background: var(--accent); color: var(--forest); }
.brand-mark::before { content: ""; width: 11px; height: 11px; transform: rotate(-45deg) translateY(-2px); border-left: 2px solid; border-bottom: 2px solid; box-shadow: -3px 3px 0 -1px var(--accent), -5px 5px 0 -1px currentColor; }
nav { display: flex; gap: clamp(1rem, 4vw, 2rem); color: #d9e8df; }
nav a { text-decoration: none; font-size: .94rem; }
nav a:hover { text-decoration: underline; }
.hero-inner { display: grid; grid-template-columns: 1.65fr 1fr; align-items: center; gap: clamp(2rem, 7vw, 7rem); padding-block: clamp(2.8rem, 7vw, 5.3rem); }
.eyebrow { font-size: .81rem; text-transform: uppercase; letter-spacing: .11em; font-weight: 750; color: #b9ed89; margin-bottom: .8rem; }
h1 { font-size: clamp(2.55rem, 5.6vw, 4.65rem); line-height: 1.03; letter-spacing: -.062em; font-weight: 740; }
.hero-copy { color: #d1e2d8; font-size: 1.12rem; max-width: 45ch; margin-block: 1.25rem 1.5rem; }
.hero-note { color: #c7dacf; font-size: .88rem; margin-top: .7rem; }
.button { display: inline-flex; align-items: center; justify-content: center; text-align: center; min-height: 44px; max-width: 100%; padding: .63rem 1.04rem; border: 1px solid transparent; border-radius: 8px; font-weight: 700; text-decoration: none; cursor: pointer; line-height: 1.25; }
.button:disabled { opacity: .53; cursor: default; }
.primary { color: #143222; background: var(--accent); }
.primary:hover:not(:disabled) { background: #d7ffa2; }
.secondary { color: var(--forest); background: #fff; border-color: #b7ccc0; }
.secondary:hover:not(:disabled) { background: #e8f2e9; }
.hero-sample { background: #1c403a; border: 1px solid #45675d; border-radius: 16px; padding: 1.4rem; box-shadow: 0 12px 32px #071e1a42; }
.sample-heading, .sample-detail { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: .55rem; color: #d9e8df; }
.sample-label { font-size: .79rem; color: #d9f5d8; border: 1px solid #668a79; padding: .12rem .5rem; border-radius: 4px; }
.sample-sku { margin: 1rem 0 .55rem; font-family: ui-monospace, monospace; font-size: 1.15rem; font-weight: 700; }
.sample-detail { padding-block: .44rem; border-bottom: 1px solid #42615a; }
.sample-detail strong { color: #fff; font-variant-numeric: tabular-nums; }
.sample-delta { border: 0; padding-bottom: 0; }
.sample-delta strong { color: var(--accent); }
.workspace { padding-block: 2.7rem 2.15rem; scroll-margin-top: 1rem; }
.section-head { display: flex; align-items: start; justify-content: space-between; gap: 1rem; margin-bottom: 1.15rem; }
h2 { font-size: clamp(1.65rem, 3.6vw, 2.25rem); letter-spacing: -.04em; line-height: 1.16; }
.section-head p, .pilot-panel p:not(.eyebrow), .status, .file-status, .mapping-status, .footer p { color: var(--quiet); }
.section-head p { margin-top: .4rem; }
.section-head .button { flex-shrink: 0; }
.sources, .metrics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.source { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 1.2rem; min-width: 0; }
.source-head { display: flex; gap: .6rem; align-items: center; margin-bottom: .85rem; }
.source-mark { inline-size: 12px; block-size: 12px; border-radius: 3px; background: #327057; }
.source:nth-child(2) .source-mark { background: #6e8547; }
.source h3 { font-size: 1.12rem; }
.file-label, .mapping label { display: block; font-weight: 650; font-size: .9rem; min-width: 0; }
input[type=file] { display: block; width: 100%; margin-top: .35rem; padding: .42rem; border: 1px dashed #91ac9f; border-radius: 8px; background: #f8fbf8; font-size: .9rem; }
::file-selector-button { min-height: 34px; padding: .35rem .64rem; margin-right: .55rem; border: 0; border-radius: 5px; background: #e4efe6; color: var(--ink); font-weight: 700; cursor: pointer; }
.file-status, .mapping-status { font-size: .88rem; margin-top: .4rem; overflow-wrap: anywhere; }
.mapping { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .65rem; margin-top: .75rem; }
select { max-width: 100%; appearance: none; background: #fff; background-image: linear-gradient(45deg, transparent 50%, #48665c 50%), linear-gradient(135deg, #48665c 50%, transparent 50%); background-position: calc(100% - 14px) 53%, calc(100% - 9px) 53%; background-size: 5px 5px; background-repeat: no-repeat; border: 1px solid #a9beb0; border-radius: 6px; min-height: 40px; padding: .45rem 1.65rem .45rem .55rem; color: var(--ink); }
.mapping select { display: block; width: 100%; margin-top: .22rem; }
.actions { display: flex; align-items: center; flex-wrap: wrap; gap: .7rem 1rem; margin-top: 1rem; }
.actions .button, .pilot .button { color: #fff; background: var(--accent-dark); }
.actions .button:hover:not(:disabled), .pilot .button:hover:not(:disabled) { background: #32674e; }
.error { color: var(--error) !important; }
.results { padding-top: 2.35rem; }
.metrics { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 1rem; }
.metric { background: #fff; border-radius: 10px; border: 1px solid var(--line); padding: .8rem 1rem; }
.metric strong { display: block; font-size: 1.8rem; line-height: 1.15; font-variant-numeric: tabular-nums; }
.metric span, #row-count { color: var(--quiet); font-size: .9rem; }
.report { background: #fff; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.report-head { display: flex; align-items: center; justify-content: space-between; gap: .65rem; padding: .65rem 1rem; flex-wrap: wrap; }
.report-head label { font-size: .9rem; }
.table-scroll { overflow: auto; max-height: 29rem; }
.table-scroll:focus-visible { outline-offset: -4px; }
table { width: 100%; min-width: 590px; border-collapse: separate; border-spacing: 0; text-align: left; font-size: .91rem; }
th, td { padding: .65rem .8rem; border-bottom: 1px solid var(--line); }
th { background: #e8f1e9; position: sticky; top: 0; white-space: nowrap; }
td:first-child { font-weight: 650; overflow-wrap: anywhere; min-width: 7rem; max-width: 16rem; }
td:nth-child(n+2):nth-child(-n+4) { font-variant-numeric: tabular-nums; }
td:last-child { white-space: nowrap; }
.tag { display: inline-block; border-radius: 5px; padding: .1rem .45rem; font-size: .84rem; color: #224c38; background: #e5f4e7; white-space: normal; }
.tag.delta, .tag.missing { color: #67460a; background: #fff1ce; }
.tag.quality { color: #8a2c25; background: #fce8e4; }
.pilot { padding-bottom: 2rem; }
.pilot-panel { border: 1px solid #c7d9ca; background: #e8f2e8; border-radius: 14px; padding: clamp(1rem, 3vw, 1.8rem); display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 1rem 2rem; }
.pilot-panel .eyebrow { color: #345946; margin-bottom: .4rem; }
.pilot-panel p:not(.eyebrow) { margin-top: .45rem; max-width: 58ch; }
.pilot-action p { font-size: .87rem; max-width: 29ch !important; }
.footer { padding-block: 1.1rem 2rem; border-top: 1px solid var(--line); display: flex; align-items: start; justify-content: space-between; gap: 1rem; }
.footer p { font-size: .86rem; max-width: 62ch; }
@media (max-width: 740px) {
  .hero-inner { grid-template-columns: 1fr; gap: 1.5rem; }
  .hero-sample { max-width: 29rem; }
  .wide-break { display: none; }
  .pilot-panel { grid-template-columns: 1fr; }
}
@media (max-width: 550px) {
  .wrap { width: calc(100% - 32px); }
  .section-head, .footer { flex-direction: column; }
  .sources { grid-template-columns: minmax(0, 1fr); }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .workspace { padding-top: 2rem; }
  .sample-heading { font-size: .91rem; }
}
@media (prefers-reduced-motion: reduce) { :root { scroll-behavior: auto; } }
