:root {
  color-scheme: light;
  --paper: #f6f7f2;
  --white: #fff;
  --ink: #172a24;
  --muted: #4a6055;
  --line: #cdd9d0;
  --green: #16583e;
  --green-dark: #13382b;
  --mint: #e6f1e7;
  --yellow: #e1ef9e;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.55;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; }
button, input, textarea, select { font: inherit; }
a { color: var(--green); text-underline-offset: .22em; }
a:hover { color: var(--ink); }
:focus-visible { outline: 3px solid #986300; outline-offset: 3px; }
p { margin: 0; }
h1, h2, h3 { margin: 0; line-height: 1.1; letter-spacing: -.037em; }
[hidden] { display: none !important; }
.wrap { width: min(1120px, calc(100% - 2.5rem)); margin-inline: auto; }
.skip { position: absolute; top: .5rem; left: .5rem; padding: .6rem; background: var(--white); z-index: 1; }
.skip:not(:focus) { clip-path: inset(50%); }
.top { border-bottom: 1px solid var(--line); }
.top-inner, .footer { display: flex; align-items: center; justify-content: space-between; gap: .75rem; min-height: 4.25rem; }
.top-inner > a:last-child { font-size: .88rem; font-weight: 650; }
.brand { display: inline-flex; gap: .55rem; align-items: center; color: var(--ink); font-weight: 750; text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 1.85rem; height: 1.85rem; color: var(--yellow); background: var(--green-dark); border-radius: .45rem; }
.hero { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); align-items: center; gap: clamp(2rem, 6vw, 6rem); padding-block: clamp(3rem, 7vw, 6.25rem); }
.eyebrow { color: var(--green); font-size: .72rem; font-weight: 800; letter-spacing: .13em; margin-bottom: .85rem; }
h1 { font-size: clamp(2.42rem, 6vw, 5rem); letter-spacing: -.065em; }
.lede { color: var(--muted); font-size: clamp(1.05rem, 1.9vw, 1.28rem); max-width: 39ch; margin: 1.3rem 0 1.55rem; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: .65rem 1rem; }
.actions > a { font-weight: 700; }
.button, button { display: inline-flex; align-items: center; justify-content: center; gap: .65rem; padding: .58rem .95rem; min-height: 2.6rem; border: 1px solid transparent; border-radius: .46rem; font-weight: 700; text-decoration: none; cursor: pointer; }
.primary { color: var(--white); background: var(--green); }
.primary:hover:not(:disabled) { color: var(--white); background: #0e4530; }
.secondary { color: var(--ink); background: var(--white); border-color: #9baa9f; }
.secondary:hover:not(:disabled) { background: var(--mint); }
button:disabled { opacity: .58; cursor: default; }
.workflow { padding: clamp(1.2rem, 3.2vw, 2rem); color: var(--white); background: var(--green-dark); border-radius: 1.2rem; box-shadow: .48rem .48rem 0 #dde7d8; }
.workflow .eyebrow { color: var(--yellow); }
.workflow ol { list-style: none; padding: 0; margin: 0; }
.workflow li { display: flex; align-items: flex-start; gap: .8rem; padding: .8rem 0; border-top: 1px solid #426352; }
.workflow li > span { border: 1px solid #658470; border-radius: .45rem; padding: .13rem .38rem; color: var(--yellow); font: 700 .77rem/1.5 ui-monospace, monospace; }
.workflow small { display: block; color: #d3e2d7; }
.privacy { display: flex; align-items: center; gap: .45rem; color: var(--yellow); font-size: .82rem; padding-top: .75rem; }
.privacy span { width: .44rem; height: .44rem; border-radius: 50%; background: var(--yellow); }
.workspace { border-top: 1px solid var(--line); padding-block: 2.65rem; scroll-margin-top: 1rem; }
h2 { font-size: clamp(1.9rem, 4vw, 2.65rem); }
.section-heading > p:last-child { color: var(--muted); margin: .65rem 0 1.25rem; }
.input-panel, .results { background: var(--white); border: 1px solid var(--line); border-radius: .9rem; padding: clamp(.85rem, 3vw, 1.75rem); }
.input-heading, .results-head, .table-controls { display: flex; align-items: center; justify-content: space-between; gap: .65rem; flex-wrap: wrap; }
label, legend { font-weight: 700; }
.link-button { padding: .22rem .05rem; min-height: 2rem; background: transparent; color: var(--green); text-decoration: underline; text-underline-offset: .22em; }
textarea { display: block; width: 100%; margin-top: .35rem; padding: .75rem; resize: vertical; font-family: ui-monospace, monospace; font-size: .9rem; }
textarea, select { color: var(--ink); background: #f9fbf8; border: 1px solid #99aa9e; border-radius: .45rem; }
.hint { font-size: .86rem; color: var(--muted); margin-top: .55rem; }
.hint code { font-size: .84em; background: var(--mint); padding: .1em .3em; border-radius: .2rem; }
.settings { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; margin-block: 1.15rem; }
.file-field, fieldset { min-width: 0; }
.file-field label, .file-field input { display: block; }
.file-field input { width: 100%; margin-top: .25rem; }
input::file-selector-button { border: 1px solid #9baa9f; border-radius: .3rem; padding: .25rem .52rem; background: #f9fbf8; color: var(--ink); cursor: pointer; }
fieldset { margin: 0; padding: 0; border: 0; }
legend { padding: 0; }
.choices { display: flex; flex-wrap: wrap; gap: .25rem .85rem; margin-top: .35rem; }
.choices label { display: flex; align-items: center; gap: .25rem; font-size: .92rem; font-weight: 550; }
input[type="checkbox"] { accent-color: var(--green); margin: .15rem; }
.notice { margin-top: .65rem; color: var(--muted); font-weight: 600; }
.notice:empty { margin: 0; }
.notice.error { color: #982c22; }
.results { margin-top: 1rem; }
h3 { font-size: 1.42rem; }
.counts { display: grid; gap: .55rem; grid-template-columns: repeat(auto-fit, minmax(8.7rem, 1fr)); margin-block: 1.1rem .7rem; }
.metric { display: flex; flex-direction: column; min-height: 4.55rem; padding: .65rem; border-radius: .45rem; }
.metric strong { font-size: 1.42rem; line-height: 1.12; }
.metric span { margin-top: .24rem; font-size: .79rem; }
.tone-fix, .tone-past { background: #f8e7e1; color: #783126; }
.tone-today, .tone-soon { background: #f6efcf; color: #674910; }
.tone-later { background: var(--mint); color: #205138; }
.tone-duplicate { background: #edf0ef; color: #47574e; }
.table-controls { margin: 1rem 0 .6rem; }
.table-controls label, .pagination { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.pagination .hint { margin: 0; }
select { padding: .4rem; }
.table-scroll { overflow: auto; border: 1px solid var(--line); border-radius: .48rem; }
table { width: 100%; min-width: 40rem; border-collapse: collapse; font-size: .89rem; }
th, td { padding: .6rem; text-align: left; vertical-align: top; }
th { background: var(--mint); white-space: nowrap; }
td { border-top: 1px solid var(--line); overflow-wrap: anywhere; }
td:nth-child(3) { min-width: 7rem; }
.scope, .row-detail { display: block; font-size: .82rem; color: var(--muted); margin-top: .2rem; }
.badge { display: inline-block; font-size: .79rem; font-weight: 750; border-radius: .28rem; padding: .12rem .35rem; }
.guide { padding-block: 1.8rem 3.5rem; }
.guide-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; margin-top: 1rem; }
.guide-card { border-top: 2px solid #9ab6a0; padding-top: .9rem; }
.guide-card p { margin-top: .6rem; color: var(--muted); font-size: .92rem; }
.footer { border-top: 1px solid var(--line); color: var(--muted); font-size: .88rem; padding-block: .6rem; }

@media (max-width: 720px) {
  .hero, .guide-grid { grid-template-columns: minmax(0, 1fr); }
  .hero { gap: 1.8rem; }
  .guide-grid { gap: 1.35rem; }
}
@media (max-width: 490px) {
  .settings { grid-template-columns: minmax(0, 1fr); }
  .footer { flex-direction: column; align-items: flex-start; justify-content: center; gap: .2rem; }
}
