:root {
  --ink: #f2eee6;
  --ink-soft: #b9b3c6;
  --night: #0d0f1a;
  --raised: #161a2b;
  --line: rgba(232, 200, 120, 0.22);
  --gold: #e8c878;
  --focus: #a8c8ff;
  --agree: #8fd9a8;
  --disagree: #ffc48a;
  color-scheme: dark;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--night);
  color: var(--ink);
  font: 17px/1.65 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  padding-inline: clamp(1rem, 4vw, 2.5rem);
}
main { max-width: 68ch; margin-inline: auto; padding-block: 2rem 4rem; }
h1, h2, h3 { font-family: Georgia, "Times New Roman", serif; line-height: 1.15; text-wrap: balance; }
h1 { font-size: clamp(1.9rem, 5vw, 2.8rem); margin: 0 0 1.5rem; }
h2 { font-size: clamp(1.3rem, 3.4vw, 1.75rem); margin: 2.25rem 0 .75rem; }
h3 { font-size: 1.1rem; margin: 1.5rem 0 .5rem; color: var(--gold); }
p, li { max-width: 70ch; }
a { color: var(--gold); }
a:focus-visible, button:focus-visible, input:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

/* Hidden by moving it, not by collapsing it. `left: -9999px` leaves a real
   element with a near-zero box, which the responsive matrix reads as an
   undersized touch target on every phone -- and a skip link that is a few
   pixels tall once focused is a broken skip link, not a styling detail. */
.skip-link {
  position: fixed; top: .75rem; left: .75rem; z-index: 20;
  display: inline-flex; align-items: center; min-height: 44px;
  padding: .65rem 1rem; border-radius: .5rem;
  background: var(--ink); color: var(--night); text-decoration: none;
  transform: translateY(-200%); transition: transform .2s ease;
}
.skip-link:focus { transform: translateY(0); }

.site-header {
  max-width: 68ch; margin-inline: auto; display: flex; flex-wrap: wrap; gap: .75rem 1.25rem;
  align-items: center; justify-content: space-between; padding-block: 1.25rem; border-bottom: 1px solid var(--line);
}
/* 44px is the documented minimum touch target, and the brand and skip link are
   navigation rather than prose, so neither gets the in-a-sentence exemption. */
.brand { font-family: Georgia, serif; font-size: 1.15rem; text-decoration: none; color: var(--ink); display: inline-flex; align-items: center; gap: .4rem; min-height: 44px; }
.brand span { color: var(--gold); }
nav[aria-label] { display: flex; flex-wrap: wrap; gap: .35rem 1rem; }
nav[aria-label] a { display: inline-flex; align-items: center; min-height: 44px; text-decoration: none; }
nav[aria-label] a:hover { text-decoration: underline; }

.breadcrumbs { display: flex; flex-wrap: wrap; gap: .5rem; font-size: .85rem; color: var(--ink-soft); margin-bottom: 1.5rem; }
.breadcrumbs a { display: inline-flex; align-items: center; min-height: 44px; }

.lead, .positioning { color: var(--ink-soft); border-left: 2px solid var(--line); padding-left: 1rem; }
.prose h2:first-child { margin-top: 0; }
.facts, .steps, .index-list, .divergence { list-style: none; padding: 0; display: grid; gap: .6rem; }
.index-list li, .facts li { border-top: 1px solid var(--line); padding-top: .6rem; }
.cta { border-top: 1px solid var(--line); padding-top: 1.5rem; margin-top: 2.5rem; }

.tool { background: var(--raised); border: 1px solid var(--line); border-radius: 1rem; padding: clamp(1rem, 4vw, 2rem); margin-block: 2rem; }
.tool h2:first-child { margin-top: 0; }
.tool label { display: block; margin-top: 1.25rem; margin-bottom: .35rem; font-weight: 600; }
.tool .optional { font-weight: 400; color: var(--ink-soft); }
.tool input {
  width: 100%; min-height: 48px; padding: .6rem .8rem; font: inherit;
  color: var(--ink); background: var(--night); border: 1px solid var(--line); border-radius: .6rem;
}
.tool button {
  margin-top: 1.5rem; min-height: 48px; padding: .7rem 1.4rem; font: inherit; font-weight: 600;
  color: var(--night); background: var(--gold); border: 0; border-radius: .6rem; cursor: pointer;
}
.tool form + output { display: block; margin-top: 1.5rem; }
.privacy-note { color: var(--ink-soft); font-size: .9rem; border-top: 1px solid var(--line); padding-top: 1rem; margin-top: 2rem; }

.result-block { border-top: 1px solid var(--line); padding-top: 1rem; }
.step strong { color: var(--gold); }
.agree { color: var(--agree); }
.disagree { color: var(--disagree); }
.limit, .error { color: var(--ink-soft); }
.divergence li { border-left: 2px solid var(--disagree); padding-left: .75rem; }

footer { max-width: 68ch; margin-inline: auto; border-top: 1px solid var(--line); padding-block: 2rem 3rem; color: var(--ink-soft); }
footer nav { margin-block: .75rem; }
.copyright { font-size: .85rem; }

.date-fields { border: 1px solid var(--line); border-radius: .6rem; padding: 1rem; margin-top: 1.25rem; display: flex; flex-wrap: wrap; gap: .75rem; }
.date-fields legend { padding-inline: .4rem; font-weight: 600; }
.date-part { display: grid; gap: .25rem; flex: 1 1 6rem; }
.date-part label { margin: 0; font-size: .85rem; color: var(--ink-soft); font-weight: 400; }
/* `appearance: none` is load-bearing, not cosmetic. WebKit sizes a native
   menulist from its own metrics and ignored min-height, so every iPhone in the
   matrix reported a select under the 44px touch minimum while Chromium and
   Firefox looked fine. Dropping the native appearance lets the height apply,
   so the arrow is drawn here instead. */
.date-part select {
  appearance: none; -webkit-appearance: none;
  height: 48px; min-height: 48px; width: 100%;
  padding: 0 2rem 0 .7rem; font: inherit; line-height: 48px;
  color: var(--ink); background: var(--night); border: 1px solid var(--line); border-radius: .5rem;
  background-image: linear-gradient(45deg, transparent 50%, var(--gold) 50%), linear-gradient(135deg, var(--gold) 50%, transparent 50%);
  background-position: right 1.1rem center, right .75rem center;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}
.form-error { color: var(--disagree); border-left: 2px solid var(--disagree); padding-left: .75rem; }
