:root {
  color-scheme: light;
  --bg: #f8f9f4;
  --ink: #172d26;
  --soft: #485d52;
  --edge: #d2dcd0;
  --control-edge: #758776;
  --paper: #fdfef9;
  --surface: #edf3e8;
  --accent: #276044;
  --focus: #49712c;
  --action: #d1f28a;
  --action-hover: #e3f8b6;
  --action-ink: #172d26;
  --track: #dce8d9;
  --meter-fill: #346a48;
  --error: #a12b20;
  --table-head: #e5eee1;
  --table-row: #f1f6ed;
  --note-bg: #fff5dd;
  --note-ink: #69460e;
  --note-edge: #dab96f;
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #0e1814;
    --ink: #edf3e8;
    --soft: #bbcabf;
    --edge: #43584d;
    --control-edge: #839b89;
    --paper: #172820;
    --surface: #22372b;
    --accent: #c3e6aa;
    --focus: #c3ee80;
    --track: #475d4c;
    --meter-fill: #c3e6aa;
    --error: #ffb3a9;
    --table-head: #294239;
    --table-row: #1b3028;
    --note-bg: #332920;
    --note-ink: #f5d9a2;
    --note-edge: #735b37;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 1rem/1.55 system-ui, sans-serif;
}
.site-head { border-bottom: 1px solid var(--edge); }
.site-head-inner, main {
  max-width: 68rem;
  margin-inline: auto;
  padding-inline: clamp(1rem, 5vw, 3rem);
}
.site-head-inner {
  min-height: 4.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .75rem 1.5rem;
  padding-block: .55rem;
}
a { color: var(--accent); text-underline-offset: .2em; }
a:hover { text-decoration-thickness: .12em; }
.brand, .guide-link {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
}
.brand {
  gap: .55rem;
  color: var(--ink);
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: -.045em;
  text-decoration: none;
}
.brand img { display: block; }
.guide-link { font-size: .9rem; font-weight: 650; }
main { padding-block: clamp(1.55rem, 5vw, 3.6rem) 3rem; }
h1 {
  margin: 0;
  font-size: clamp(2.25rem, 6.4vw, 4.2rem);
  line-height: 1.03;
  letter-spacing: -.055em;
  text-wrap: balance;
}
h2 { margin: 0 0 .45rem; font-size: clamp(1.33rem, 2.6vw, 1.75rem); line-height: 1.18; letter-spacing: -.025em; }
h3 { margin: 1.25rem 0 .35rem; font-size: 1.08rem; }
p { margin: .5rem 0; max-width: 66ch; }
.desktop-break { display: none; }
.opening { display: grid; gap: 1.35rem; }
.workspace { min-width: 0; align-self: center; }
.intro-copy { margin: .9rem 0 1.25rem; color: var(--soft); font-size: clamp(1rem, 1.8vw, 1.15rem); max-width: 43ch; }
#check-controls { max-width: 29rem; }
.privacy { color: var(--accent); font-size: .92rem; font-weight: 650; }
.sample {
  min-width: 0;
  overflow: hidden;
  background: #172d26;
  color: #f4f8ee;
  border: 1px solid #425949;
  border-radius: .85rem;
}
.sample-photo { display: block; width: 100%; height: 5.25rem; object-fit: cover; object-position: center 48%; }
.sample-body { padding: 1rem; }
.sample-body h2 { font-size: 1.27rem; }
.sample-body p { margin: 0 0 .85rem; color: #cfddd1; font-size: .94rem; }
.sample :focus-visible { outline-color: #d1f28a; }
@media (min-width: 48rem) {
  .opening { grid-template-columns: minmax(0, 1.36fr) minmax(0, 1fr); gap: clamp(1.5rem, 4vw, 3rem); }
  .desktop-break { display: initial; }
  .sample-photo { height: clamp(9rem, 16vw, 12.5rem); }
  .sample-body { padding: 1.2rem 1.35rem 1.35rem; }
}
@media (max-width: 27rem) {
  .site-head-inner { min-height: 3.65rem; }
  .opening { gap: 1.05rem; }
  .intro-copy { margin-block: .7rem .9rem; }
  .sample-body { padding: .85rem 1rem; }
}
main > section { margin-top: clamp(1.3rem, 3.5vw, 2.25rem); }
.panel { background: var(--paper); border: 1px solid var(--edge); border-radius: .85rem; padding: clamp(1rem, 3vw, 1.65rem); min-width: 0; }
label { display: block; font-weight: 650; margin: .55rem 0 .25rem; }
input, textarea, select, button {
  font: inherit;
  max-width: 100%;
  min-height: 2.75rem;
  border: 1px solid var(--control-edge);
  border-radius: .45rem;
  padding: .52rem .72rem;
}
input, textarea, select { width: 100%; min-width: 0; background: var(--bg); color: var(--ink); }
input[type="file"] { padding: .24rem .65rem .24rem .24rem; border-color: var(--control-edge); background: var(--paper); font-size: .94rem; }
input::file-selector-button {
  min-height: 2.75rem;
  cursor: pointer;
  font: inherit;
  font-weight: 750;
  color: var(--action-ink);
  background: var(--action);
  border: 1px solid #8daa63;
  border-radius: .3rem;
  padding: .5rem .78rem;
  margin-inline-end: .62rem;
}
button { background: var(--action); border-color: #8daa63; color: var(--action-ink); font-weight: 750; cursor: pointer; }
button:hover, input::file-selector-button:hover { background: var(--action-hover); }
button.secondary { background: transparent; color: var(--accent); border-color: var(--control-edge); }
button.secondary:hover { background: var(--surface); }
button.sample-action { color: #f4f8ee; background: transparent; border-color: #91ab95; }
button.sample-action:hover { background: #334b3c; }
button:active { transform: translateY(1px); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
[aria-invalid="true"] { border-color: var(--error); }
.skip { position: absolute; left: 1rem; top: -10rem; z-index: 1; background: var(--paper); padding: .4rem; }
.skip:focus { top: .5rem; }
.visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

fieldset { min-width: 0; border: 0; padding: 0; margin: 1.08rem 0 0; }
fieldset + fieldset { margin-top: 1.45rem; padding-top: .45rem; }
legend { font-weight: 750; padding: 0; }
.grid { display: grid; gap: .6rem 1rem; }
.grid > div { min-width: 0; }
@media (min-width: 36rem) { .dates { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 43rem) { .columns { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.short-field { max-width: 10rem; }
.hint, .period { color: var(--soft); font-size: .9rem; }
.period { font-variant-numeric: tabular-nums; }
#window-preview { font-weight: 650; }
#check-status:empty, #check-error:empty, .result-limit:empty { display: none; }
#check-status { margin-top: .8rem; font-weight: 650; }
#check-error { color: var(--error); font-weight: 650; }
#run-check { margin-top: .8rem; }

.result h2 { scroll-margin-top: 1rem; }
.result-header p { margin-block: .32rem; }
.coverage-band {
  background: var(--surface);
  border: 1px solid var(--edge);
  border-radius: .6rem;
  padding: clamp(.7rem, 2.5vw, 1.1rem);
  margin-block: .9rem;
}
.result-coverage { margin: 0; color: var(--accent); line-height: 1.25; }
.result-coverage strong {
  display: inline-block;
  font-size: clamp(1.75rem, 4.5vw, 2.6rem);
  letter-spacing: -.05em;
  font-variant-numeric: tabular-nums;
  margin-inline-end: .15em;
}
.result-state { margin-block: .5rem 0; font-weight: 650; }
.result[data-state="unknown"] .coverage-band { background: var(--note-bg); border-color: var(--note-edge); }
.result[data-state="unknown"] .result-coverage, .result[data-state="unknown"] .result-state { color: var(--note-ink); }
.result meter {
  display: block;
  width: 100%;
  height: .6rem;
  margin-top: .6rem;
  appearance: none;
  background: var(--track);
  border: 0;
  border-radius: 1rem;
}
.result meter::-webkit-meter-bar { background: var(--track); border: 0; border-radius: 1rem; box-shadow: none; }
.result meter::-webkit-meter-optimum-value { background: var(--meter-fill); border-radius: 1rem; }
.result meter::-moz-meter-bar { background: var(--meter-fill); border-radius: 1rem; }
dd { margin: 0; font-variant-numeric: tabular-nums; }
.result-counts > div { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .25rem 1rem; padding: .25rem 0; }
.key-counts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 9.5rem), 1fr)); gap: .6rem; margin-block: .9rem; }
.key-counts > div { display: flex; flex-direction: column-reverse; gap: .15rem; background: var(--bg); border: 1px solid var(--edge); border-radius: .55rem; padding: .6rem .8rem; }
.key-counts dt { font-size: .88rem; color: var(--soft); }
.key-counts dd { font-size: 1.23rem; line-height: 1.15; font-weight: 750; }
.counts { border-top: 1px solid var(--edge); padding-top: .6rem; }
.counts summary, .precision summary { cursor: pointer; font-weight: 650; }
.precision { margin: .65rem 0; }
.evidence ol { margin: .4rem 0 0; padding-left: 1.6rem; }
.evidence li { padding: .38rem 0; }
.evidence li + li { border-top: 1px solid var(--edge); }
.evidence time { font-variant-numeric: tabular-nums; }
dd, li, p, pre { overflow-wrap: anywhere; }
.format { margin-top: 2rem; padding-top: 1.55rem; border-top: 1px solid var(--edge); }
.format-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: .75rem 1.25rem; }
.format-head > div { flex: 1 1 27rem; }
.format-head p { margin-bottom: 0; }
.sample-table {
  width: 100%;
  margin: 1rem 0 .7rem;
  border: 1px solid var(--edge);
  border-spacing: 0;
  border-radius: .6rem;
  overflow: hidden;
  background: var(--paper);
  font-variant-numeric: tabular-nums;
}
.sample-table th, .sample-table td { padding: .6rem clamp(.55rem, 2.7vw, 1rem); text-align: left; }
.sample-table th { background: var(--table-head); font-size: .88rem; }
.sample-table td { border-top: 1px solid var(--edge); }
.sample-table tbody tr:nth-child(even) { background: var(--table-row); }
.sample-table :is(th, td):last-child { text-align: right; }
.guide-note { margin-block: .95rem; padding: .75rem 1rem; border: 1px solid var(--note-edge); border-radius: .55rem; background: var(--note-bg); color: var(--note-ink); }
.guide-note h3, .guide-note label { margin-top: 0; }
.guide-note p:last-child { margin-bottom: 0; }
.guide-note .hint, .guide-note .period { color: var(--note-ink); }
#file-zone-preview:empty { display: none; }
.file-zone select { max-width: 23rem; }
.technical { margin-block: .85rem; }
.technical summary { cursor: pointer; font-weight: 650; color: var(--accent); }
.technical summary:hover { text-decoration: underline; text-underline-offset: .2em; }
pre { white-space: pre-wrap; background: var(--paper); border: 1px solid var(--edge); padding: .8rem; border-radius: .45rem; }
