:root {
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --paper: #f6f5f0;
  --surface: #ffffff;
  --surface-deep: #ebe9e0;
  --text: #17181c;
  --text-soft: #3b3d45;
  --text-muted: #43464f;
  --rule: #d6d3c8;
  --rule-strong: #aaa697;
  --accent: #9a4408;
  --focus: #1c4f86;
  --yes-bg: #dff1e5; --yes-text: #0d3f22; --yes-ink: #125a30;
  --no-bg: #fae1e3; --no-text: #6a0f1a; --no-ink: #941a27;
  --cond-bg: #fbecc9; --cond-text: #4d3000; --cond-ink: #7a4900;
  --check-bg: #dde9f5; --check-text: #16344f; --check-ink: #24527f;
  --shadow: 0 16px 36px -22px rgba(23, 24, 28, .4);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #121318; --surface: #1a1c22; --surface-deep: #252830;
    --text: #f1f0ea; --text-soft: #d2d0c8; --text-muted: #bcbab1;
    --rule: #34373f; --rule-strong: #4f535e; --accent: #f2a35c; --focus: #8fc0ee;
    --yes-bg: #14301e; --yes-text: #c6efd3; --yes-ink: #7fd39c;
    --no-bg: #3b1418; --no-text: #f8c3c8; --no-ink: #f08a94;
    --cond-bg: #3a2a08; --cond-text: #f8dc9a; --cond-ink: #f0bf5a;
    --check-bg: #152838; --check-text: #c2dbf3; --check-ink: #8fc0ee;
    --shadow: 0 16px 36px -22px rgba(0, 0, 0, .7);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #121318; --surface: #1a1c22; --surface-deep: #252830;
  --text: #f1f0ea; --text-soft: #d2d0c8; --text-muted: #bcbab1;
  --rule: #34373f; --rule-strong: #4f535e; --accent: #f2a35c; --focus: #8fc0ee;
  --yes-bg: #14301e; --yes-text: #c6efd3; --yes-ink: #7fd39c;
  --no-bg: #3b1418; --no-text: #f8c3c8; --no-ink: #f08a94;
  --cond-bg: #3a2a08; --cond-text: #f8dc9a; --cond-ink: #f0bf5a;
  --check-bg: #152838; --check-text: #c2dbf3; --check-ink: #8fc0ee;
  --shadow: 0 16px 36px -22px rgba(0, 0, 0, .7);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { transition: none !important; animation: none !important; } }
body { margin: 0; background: var(--paper); color: var(--text); font-family: var(--sans); font-size: 1.0625rem; line-height: 1.55; -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-underline-offset: .14em; }
a:focus-visible, button:focus-visible, select:focus-visible, input:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.skip { position: absolute; left: -9999px; top: 0; background: var(--surface); color: var(--text); padding: .5rem .8rem; z-index: 50; }
.skip:focus { left: .5rem; top: .5rem; }
.wrap { width: min(100% - 2rem, 44rem); margin: 0 auto; }
.wrap.wide { width: min(100% - 2rem, 62rem); }

/* Topbar, one line */
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: .6rem; height: 3rem; padding: 0 1rem; background: var(--surface); border-bottom: 1px solid var(--rule); font-family: var(--sans); font-size: .875rem; }
.topbar .home { font-weight: 650; text-decoration: none; color: var(--text-soft); flex: none; }
.topbar .spacer { flex: 1; }
.topnav { display: flex; gap: .15rem; overflow-x: auto; scrollbar-width: none; min-width: 0; }
.topnav::-webkit-scrollbar { display: none; }
.topnav a { color: var(--text-muted); text-decoration: none; padding: .3rem .55rem; border-radius: .4rem; white-space: nowrap; }
.topnav a:hover { color: var(--text); }
.topnav a[aria-current="true"] { color: var(--text); background: var(--surface-deep); font-weight: 650; }
.icon-btn { width: 2rem; height: 2rem; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; color: var(--text-muted); background: var(--surface); border: 1px solid var(--rule-strong); cursor: pointer; flex: none; padding: 0; }
.icon-btn:hover { color: var(--accent); border-color: var(--accent); }
.icon-btn svg { display: block; }
.icon-btn svg[hidden] { display: none; }
@media (max-width: 30rem) { .topbar .home { max-width: 6.4rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .topbar { gap: .35rem; } }
section { scroll-margin-top: 3.4rem; }

/* Reading rail, desktop only */
.rail { display: none; position: fixed; right: 1.1rem; top: 50%; transform: translateY(-50%); flex-direction: column; gap: .55rem; z-index: 15; }
@media (min-width: 76rem) { .rail { display: flex; } }
.rail-dot { position: relative; display: flex; align-items: center; justify-content: flex-end; height: 1rem; text-decoration: none; }
.rail-dot .dot { width: .55rem; height: .55rem; border-radius: 50%; background: var(--rule-strong); transition: transform .2s, background .2s; }
.rail-dot:hover .dot, .rail-dot:focus-visible .dot { background: var(--text-soft); }
.rail-dot.active .dot { background: var(--accent); transform: scale(1.45); }
.rail-label { position: absolute; right: 1.2rem; white-space: nowrap; font-size: .75rem; color: var(--text-soft); background: var(--surface); border: 1px solid var(--rule); border-radius: .35rem; padding: .15rem .5rem; opacity: 0; transform: translateX(.3rem); transition: opacity .2s, transform .2s; pointer-events: none; }
.rail-dot:hover .rail-label, .rail-dot:focus-visible .rail-label { opacity: 1; transform: none; }
.rail-dot.active .rail-label { color: var(--text); border-color: var(--rule-strong); }
@media print { .rail, .topbar { display: none; } }

/* Hero */
.hero { padding: 2.4rem 0 1.2rem; }
.kicker { font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted); margin: 0 0 .6rem; font-weight: 650; }
h1 { font-family: var(--serif); font-size: clamp(2.4rem, 7vw, 4rem); line-height: 1.02; margin: 0 0 .9rem; letter-spacing: -.01em; }
.deck { font-size: 1.2rem; line-height: 1.45; color: var(--text-soft); margin: 0 0 .8rem; max-width: 36rem; }
.byline { font-size: .8rem; color: var(--text-muted); margin: 0; }
h2 { font-family: var(--serif); font-size: clamp(1.6rem, 4vw, 2.1rem); line-height: 1.12; margin: 0 0 .9rem; letter-spacing: -.005em; }
h3 { font-size: 1.05rem; margin: 1.4rem 0 .4rem; }
p { margin: 0 0 1rem; }
.lede { font-size: 1.15rem; color: var(--text-soft); }
section { padding: 2.2rem 0; border-top: 1px solid var(--rule); }
section.plain { border-top: 0; }
ul, ol { padding-left: 1.3rem; margin: 0 0 1rem; }
li { margin: .25rem 0; }
small, .small { font-size: .875rem; color: var(--text-muted); }

/* Checker */
.checker { background: var(--surface); border: 1px solid var(--rule); border-radius: 1rem; box-shadow: var(--shadow); padding: 1.2rem; display: grid; gap: 1rem; }
@media (min-width: 52rem) { .checker { grid-template-columns: minmax(0, 22rem) minmax(0, 1fr); padding: 1.5rem; gap: 1.5rem; } }
.controls { display: grid; gap: .9rem; align-content: start; }
.field { display: grid; gap: .3rem; }
.field > label, .field > .lbl { font-size: .8rem; font-weight: 650; letter-spacing: .04em; text-transform: uppercase; color: var(--text-muted); }
select, input[type="number"] { font: inherit; font-size: 1.05rem; color: var(--text); background: var(--paper); border: 1.5px solid var(--rule-strong); border-radius: .55rem; padding: .55rem .7rem; width: 100%; min-height: 2.9rem; }
select { appearance: none; -webkit-appearance: none; background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%); background-position: calc(100% - 1.1rem) 50%, calc(100% - .75rem) 50%; background-size: .36rem .36rem; background-repeat: no-repeat; padding-right: 2rem; }
.sizes { display: flex; flex-wrap: wrap; gap: .35rem; }
.chip { font: inherit; font-size: .85rem; padding: .3rem .6rem; border-radius: 999px; border: 1px solid var(--rule-strong); background: var(--surface); color: var(--text-soft); cursor: pointer; min-height: 2rem; }
.chip:hover { border-color: var(--accent); color: var(--text); }
.chip[aria-pressed="true"] { background: var(--text); color: var(--paper); border-color: var(--text); }
.inline { display: flex; flex-wrap: wrap; gap: .4rem 1rem; align-items: center; }
.inline label { display: inline-flex; align-items: center; gap: .4rem; font-size: .95rem; min-height: 2rem; }
input[type="radio"], input[type="checkbox"] { width: 1.15rem; height: 1.15rem; accent-color: var(--accent); margin: 0; }
.field[hidden] { display: none; }
details.ret summary { cursor: pointer; font-size: .95rem; color: var(--accent); font-weight: 650; list-style: none; min-height: 2rem; display: flex; align-items: center; gap: .4rem; }
details.ret summary::-webkit-details-marker { display: none; }
details.ret summary::before { content: "+"; font-weight: 800; width: 1.2rem; height: 1.2rem; border-radius: 50%; border: 1.5px solid currentColor; display: inline-flex; align-items: center; justify-content: center; font-size: .9rem; }
details.ret[open] summary::before { content: "–"; }
details.ret .lbl-inline { font-size: .8rem; font-weight: 650; letter-spacing: .04em; text-transform: uppercase; color: var(--text-muted); margin-top: .5rem; }
@media (max-width: 40rem) { .chip[data-ml="101"], .chip[data-ml="2001"] { display: none; } }

.result { border-radius: .8rem; padding: 1.1rem 1.2rem 1.2rem; background: var(--surface-deep); display: grid; gap: .6rem; align-content: start; min-height: 14rem; border: 1px solid var(--rule); }
.result .who { font-size: .8rem; letter-spacing: .05em; text-transform: uppercase; color: var(--text-muted); font-weight: 650; margin: 0; }
.verdict { font-family: var(--sans); font-weight: 800; font-size: clamp(2.6rem, 8vw, 4.2rem); line-height: 1; letter-spacing: -.02em; margin: 0; }
.verdict.small { font-size: clamp(1.7rem, 5vw, 2.4rem); }
.result.yes { background: var(--yes-bg); color: var(--yes-text); border-color: transparent; }
.result.no { background: var(--no-bg); color: var(--no-text); border-color: transparent; }
.result.cond { background: var(--cond-bg); color: var(--cond-text); border-color: transparent; }
.result.check { background: var(--check-bg); color: var(--check-text); border-color: transparent; }
.result p { margin: 0; }
.result .reason { font-size: 1.05rem; line-height: 1.45; }
.result ul { margin: .2rem 0 0; padding-left: 1.1rem; font-size: .92rem; }
.result a { color: inherit; font-weight: 650; }
.result .who, .result small { color: inherit; opacity: .85; }
.legs { display: grid; gap: .6rem; }
.leg { border-radius: .6rem; padding: .7rem .85rem; background: var(--surface); color: var(--text); border-left: .4rem solid var(--rule-strong); }
.leg.yes { border-left-color: var(--yes-ink); } .leg.no { border-left-color: var(--no-ink); } .leg.cond { border-left-color: var(--cond-ink); } .leg.check { border-left-color: var(--check-ink); }
.leg b { display: block; font-size: .78rem; letter-spacing: .05em; text-transform: uppercase; color: var(--text-muted); margin-bottom: .15rem; }
.leg .v { font-weight: 800; font-size: 1.25rem; }
.leg .v.yes { color: var(--yes-ink); } .leg .v.no { color: var(--no-ink); } .leg .v.cond { color: var(--cond-ink); } .leg .v.check { color: var(--check-ink); }
.result-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .3rem; }
.btn { font: inherit; font-size: .9rem; font-weight: 650; padding: .5rem .85rem; border-radius: .55rem; border: 1.5px solid currentColor; background: transparent; color: inherit; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: .4rem; min-height: 2.4rem; }
.btn:hover { background: rgba(127, 127, 127, .12); }
.copied { font-size: .85rem; align-self: center; }
.nojs { margin: 0; }

/* Examples strip */
.examples { display: grid; gap: .6rem; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); margin: 1.2rem 0 0; padding: 0; list-style: none; }
.examples li { border: 1px solid var(--rule); border-radius: .7rem; padding: .7rem .85rem; background: var(--surface); display: grid; gap: .1rem; }
.examples .ex-item { color: var(--text-soft); font-size: .9rem; }
.examples .ex-v { font-weight: 800; font-size: 1.1rem; }
.ex-v.yes { color: var(--yes-ink); } .ex-v.no { color: var(--no-ink); } .ex-v.cond { color: var(--cond-ink); }
.examples a { color: inherit; text-decoration: none; }
.examples a:hover .ex-v { text-decoration: underline; }

/* Airport table */
.tablewrap { overflow-x: auto; border: 1px solid var(--rule); border-radius: .8rem; background: var(--surface); }
table { border-collapse: collapse; width: 100%; font-size: .92rem; }
caption { text-align: left; padding: .8rem 1rem .4rem; font-size: .85rem; color: var(--text-muted); caption-side: top; }
th, td { text-align: left; padding: .6rem .8rem; border-top: 1px solid var(--rule); vertical-align: top; }
thead th { border-top: 0; font-size: .75rem; letter-spacing: .05em; text-transform: uppercase; color: var(--text-muted); background: var(--surface-deep); position: sticky; top: 0; }
th[scope="row"] { font-weight: 650; white-space: nowrap; }
td.lim { font-weight: 800; white-space: nowrap; }
td.lim.big { color: var(--yes-ink); } td.lim.std { color: var(--no-ink); }
td .q { display: block; white-space: normal; font-size: .82rem; color: var(--text-muted); margin-top: .2rem; max-width: 26rem; }
.split { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); margin: 1.2rem 0; }
.split div { border-radius: .8rem; padding: 1rem 1.1rem; }
.split .big { background: var(--yes-bg); color: var(--yes-text); }
.split .std { background: var(--no-bg); color: var(--no-text); }
.split b { display: block; font-size: 2rem; font-weight: 800; line-height: 1; margin-bottom: .4rem; }
.split p { margin: 0; font-size: .95rem; }

.note { border-left: .35rem solid var(--accent); background: var(--surface); padding: .8rem 1rem; border-radius: 0 .6rem .6rem 0; margin: 1.2rem 0; }
.note p:last-child { margin: 0; }
dl { margin: 0 0 1rem; }
dt { font-weight: 700; margin-top: .8rem; }
dd { margin: .15rem 0 0 0; color: var(--text-soft); }
.sources ol li { margin: .45rem 0; word-break: break-word; }
footer { border-top: 1px solid var(--rule); padding: 1.6rem 0 2.4rem; font-size: .875rem; color: var(--text-muted); }
footer p { margin: .3rem 0; }
.totop { position: fixed; right: 1rem; bottom: 1rem; z-index: 15; opacity: 0; pointer-events: none; transition: opacity .2s; }
.totop.show { opacity: 1; pointer-events: auto; }
@media (min-width: 76rem) { .totop { right: 3.2rem; } }

/* Phone: the verdict card stays pinned under the bar while the controls scroll beneath it. */
@media (max-width: 52rem) {
  .result { order: -1; position: sticky; top: 3.3rem; z-index: 5; max-height: 62vh; overflow: auto; min-height: 0; box-shadow: var(--shadow); }
  .checker { padding: .9rem; }
  .hero { padding-top: 1.6rem; }
  .deck { font-size: 1.08rem; }
}
