/* =========================================================
   WSP Member Hub: a spin-off of the GVRPJ site.
   Same system as gvrpj-site (Daylight sections + night sections, Montserrat 800 headings,
   Figtree body, pill buttons, 16px cards), with WSP blue in place of GVRPJ coral.
   --accent-fill (logo blue) for buttons, --accent (deeper blue) for text on Daylight.
   ========================================================= */
:root {
  --bg: #f6f5f2;
  --bg-alt: #efede8;
  --surface: #ffffff;
  --border: #e3e0da;
  --border-strong: #cfcbc3;
  --text: #15191f;
  --muted: #58616d;
  --accent: #2552c4;
  --accent-fill: #5b8cff;
  --accent-soft: rgba(91, 140, 255, 0.12);
  --on-accent: #08112b;
  --shadow: 0 1px 2px rgba(30, 40, 60, 0.06), 0 12px 32px -16px rgba(30, 40, 60, 0.2);
  --night: #0b0f14;
  --night-2: #141a22;
  --night-ink: #f5f7fa;
  --night-soft: #b9c2cc;
  --night-line: rgba(255, 255, 255, 0.08);
  --night-accent: #8fb0ff;
  --signal-red: #ff4d3d;
  --font: 'Figtree', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --display: 'Montserrat', var(--font);
  --mono: 'JetBrains Mono', ui-monospace, monospace;
  --radius: 16px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --wrap: 1200px;
  --gutter: clamp(16px, 4vw, 32px);
  --top: 68px;
  color-scheme: light;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--top) + 20px); -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 400 1.0625rem/1.65 var(--font); -webkit-font-smoothing: antialiased; overflow-x: clip; }
img { display: block; max-width: 100%; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
h1, h2, h3 { font-family: var(--display); line-height: 1.1; letter-spacing: -0.03em; margin: 0 0 0.5em; font-weight: 800; text-wrap: balance; }
h2 { font-size: clamp(1.6rem, 2.8vw, 2.2rem); }
h3 { font-family: var(--font); font-size: 1.125rem; font-weight: 700; letter-spacing: -0.01em; }
p { margin: 0 0 1em; }
ul, ol { padding-left: 1.2em; }
li { margin-bottom: 0.35em; }
code, kbd { font-family: var(--mono); font-size: 0.86em; background: var(--bg-alt); padding: 0.1em 0.4em; border-radius: 6px; }
::selection { background: var(--accent-fill); color: var(--on-accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }
.muted { color: var(--muted); }
.nw { white-space: nowrap; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--accent-fill); color: var(--on-accent); padding: 8px 14px; border-radius: 8px; }
.skip:focus { left: 8px; }
.lead { font-size: clamp(1.05rem, 1.5vw, 1.2rem); color: var(--muted); max-width: 60ch; }
.split .wd { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: 0.1em; margin-bottom: -0.1em; }
.split .wd > span { display: inline-block; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.5em; padding: 0.75em 1.35em; border-radius: 999px; font-weight: 500; font-size: 1rem; white-space: nowrap; border: 1px solid transparent; transition: transform 0.2s var(--ease), background-color 0.2s, border-color 0.2s; }
.btn:hover { text-decoration: none; }
.btn:active { transform: scale(0.98); }
.btn .btn-ext { opacity: 0.7; }
.btn-primary { background: var(--accent-fill); color: var(--on-accent); }
.btn-primary:hover { background: color-mix(in srgb, var(--accent-fill) 88%, var(--text)); color: var(--on-accent); }
.btn-ghost { background: var(--surface); border-color: var(--border-strong); color: var(--text); }
.btn-ghost:hover { border-color: var(--text); color: var(--text); }
.btn-dark { background: rgba(255, 255, 255, 0.06); border-color: rgba(255, 255, 255, 0.4); color: var(--night-ink); }
.btn-dark:hover { border-color: #fff; color: #fff; }
.btn-sm { padding: 0.5em 1em; font-size: 0.925rem; }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 1.8rem; }

/* ---------- Header: GVRPJ's dark bar + a ticket payoff countdown ---------- */
.top { position: sticky; top: 0; z-index: 50; background: var(--night); border-bottom: 1px solid var(--night-line); color: var(--night-ink); }
.top-in { height: var(--top); display: flex; align-items: center; gap: 22px; }
.brand { flex: none; display: inline-flex; align-items: center; gap: 10px; color: var(--night-ink); font-weight: 700; font-size: 1.125rem; letter-spacing: -0.02em; white-space: nowrap; }
.brand:hover { color: #fff; text-decoration: none; }
.brand img { width: 32px; height: 32px; }
.payoff-pill { display: inline-flex; align-items: center; gap: 7px; padding: 6px 13px 6px 10px; border-radius: 999px; background: rgba(255, 255, 255, 0.07); border: 1px solid rgba(255, 255, 255, 0.12); color: rgba(245, 247, 250, 0.85) !important; font-size: 0.82rem; font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; transition: background 0.2s, border-color 0.2s; }
.payoff-pill i { font-size: 1rem; color: var(--night-accent); }
.payoff-pill:hover { text-decoration: none; background: rgba(255, 255, 255, 0.12); }
.payoff-pill.is-open { background: rgba(91, 140, 255, 0.18); border-color: rgba(91, 140, 255, 0.45); color: #fff !important; }
.nav { display: flex; gap: 2px; margin-left: auto; }
.nav a { display: block; padding: 7px 12px; border-radius: 999px; color: rgba(245, 247, 250, 0.72); font-weight: 500; font-size: 0.95rem; white-space: nowrap; transition: color 0.2s, background-color 0.2s; }
.nav a:hover { color: #fff; text-decoration: none; }
.nav a[aria-current] { color: #fff; background: rgba(255, 255, 255, 0.1); }

/* ---------- Photo opener (home + every handbook page), from GVRPJ's department pages ---------- */
.opener { position: relative; min-height: 78svh; display: grid; align-items: end; overflow: clip; background: var(--night); color: #fff; }
.opener--doc { min-height: 56svh; }
.opener-img { position: absolute; inset: 0; width: 100%; height: 112%; max-width: none; object-fit: cover; }
.opener-scrim { position: absolute; inset: 0; background: linear-gradient(0deg, rgba(11, 15, 20, 0.97) 0%, rgba(11, 15, 20, 0.72) 45%, rgba(11, 15, 20, 0.15) 85%); }
.opener-copy { position: relative; z-index: 2; padding-block: clamp(96px, 14svh, 150px) clamp(40px, 7svh, 72px); }
.back { display: flex; width: fit-content; align-items: center; gap: 8px; margin-bottom: 1.3rem; font-weight: 600; font-size: 0.95rem; color: #dde3ea; }
.back:hover { color: #fff; }
.badge { display: inline-flex; align-items: center; gap: 10px; margin: 0 0 1rem; padding: 5px 14px 5px 5px; border-radius: 999px; background: rgba(255, 255, 255, 0.1); font-weight: 700; }
.badge img { width: 30px; height: 30px; border-radius: 50%; background: rgba(0, 0, 0, 0.3); }
.opener-title { margin: 0; max-width: 14ch; font-size: clamp(2.8rem, 7.5vw, 6.6rem); line-height: 0.95; letter-spacing: -0.05em; color: #fff; }
.opener--doc .opener-title { font-size: clamp(2.6rem, 6vw, 5rem); max-width: 16ch; }
.opener-title .acc { color: var(--accent-fill); }
.opener-title .line { display: block; overflow: hidden; padding-bottom: 0.05em; }
.opener-title .line > span { display: inline-block; }
.opener-lead { margin: 1.2rem 0 0; max-width: 50ch; font-size: clamp(1.05rem, 1.6vw, 1.25rem); color: #dde3ea; }
@media (prefers-reduced-motion: no-preference) {
  .opener-img { animation: settle 1.6s var(--ease) both; }
  .opener--doc .opener-copy > * { animation: rise 0.9s var(--ease) both; }
  .opener--doc .opener-copy > :nth-child(2) { animation-delay: 0.06s; }
  .opener--doc .opener-copy > :nth-child(3) { animation-delay: 0.12s; }
  .opener--doc .opener-copy > :nth-child(4) { animation-delay: 0.2s; }
}
@keyframes settle { from { transform: scale(1.06); } }
@keyframes rise { from { opacity: 0; transform: translateY(20px); } }

/* ---------- Section rhythm: Daylight + night ---------- */
.day { background: var(--bg); padding-block: clamp(56px, 8vw, 104px); }
.night { background: var(--night); color: var(--night-ink); padding-block: clamp(56px, 8vw, 104px); }
.night a { color: var(--night-accent); }
.h2 { margin: 0; font-size: clamp(2rem, 4.2vw, 3.2rem); letter-spacing: -0.04em; line-height: 1.02; }
.night .h2 { color: #fff; }
.sub { margin: 0.8rem 0 0; max-width: 60ch; font-size: 1.08rem; color: var(--muted); }
.night .sub { color: var(--night-soft); }
.night kbd { background: rgba(255, 255, 255, 0.1); color: #fff; }
.stat-label { font-family: var(--display); font-size: 0.75rem; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; color: var(--accent); margin: 0 0 0.6rem; }
.night .stat-label { color: var(--night-accent); }

/* Home: status band (big GVRPJ-style numbers) */
.status-band { padding-block: clamp(44px, 6vw, 72px); border-bottom: 1px solid var(--border); }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(24px, 4vw, 56px); }
.stats b { display: block; font-family: var(--display); font-size: clamp(2.2rem, 4.4vw, 3.6rem); font-weight: 800; letter-spacing: -0.05em; line-height: 1; margin-bottom: 0.4rem; }
.stats small { display: block; color: var(--muted); font-size: 0.98rem; max-width: 32ch; }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; margin-right: 8px; vertical-align: 1px; background: var(--signal-red); }
.dot.open { background: #1f9d55; box-shadow: 0 0 0 4px rgba(31, 157, 85, 0.18); }

/* Home: lookup + quick actions (night) */
.lookup { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-top: 2rem; }
.spot { flex: 1 1 420px; display: flex; align-items: center; gap: 12px; padding: 0 20px; border-radius: 999px; background: var(--night-2); border: 1px solid rgba(255, 255, 255, 0.14); transition: border-color 0.2s, box-shadow 0.2s; }
.spot:focus-within { border-color: var(--accent-fill); box-shadow: 0 0 0 4px rgba(91, 140, 255, 0.2); }
.spot > i { font-size: 1.25rem; color: var(--night-soft); }
.spot input { flex: 1; min-width: 0; background: none; border: 0; outline: 0; color: #fff; font: inherit; font-size: 1.05rem; padding: 15px 0; }
.spot input::placeholder { color: #8a95a3; }
.seg { display: flex; gap: 6px; }
.seg button { font: 600 0.9rem var(--font); color: var(--night-soft); background: none; border: 1px solid rgba(255, 255, 255, 0.18); border-radius: 999px; padding: 8px 14px; cursor: pointer; transition: all 0.2s; }
.seg button:hover { color: #fff; border-color: rgba(255, 255, 255, 0.4); }
.seg button[aria-pressed='true'] { background: var(--accent-fill); color: var(--on-accent); border-color: var(--accent-fill); }
.results { list-style: none; margin: 12px 0 0; padding: 0; }
.results li { margin: 0; }
.results button { width: 100%; display: grid; grid-template-columns: 140px 1fr auto; gap: 16px; align-items: baseline; padding: 11px 18px; border: 0; border-bottom: 1px solid var(--night-line); background: none; color: var(--night-ink); font: inherit; text-align: left; cursor: pointer; transition: background 0.15s; }
.results button:hover { background: rgba(255, 255, 255, 0.05); }
.results b { font: 500 0.9rem var(--mono); color: var(--night-accent); }
.results em { font-style: normal; font-size: 0.88rem; color: var(--night-soft); white-space: nowrap; }
.results .none { color: var(--night-soft); padding: 12px 18px; }
.actions { list-style: none; padding: 0; margin: 2.4rem 0 0; display: grid; grid-template-columns: repeat(6, 1fr); gap: 14px; }
.actions li { margin: 0; }
.action { display: grid; gap: 4px; align-content: start; height: 100%; padding: 18px; border-radius: var(--radius); background: var(--night-2); border: 1px solid var(--night-line); color: var(--night-ink) !important; transition: transform 0.3s var(--ease), border-color 0.2s; }
.action:hover { transform: translateY(-3px); border-color: rgba(91, 140, 255, 0.5); text-decoration: none; }
.action-icon { display: grid; place-items: center; width: 44px; height: 44px; margin-bottom: 10px; border-radius: 12px; background: rgba(91, 140, 255, 0.16); color: var(--night-accent); font-size: 1.35rem; }
.action b { font-weight: 700; line-height: 1.25; }
.action small { color: var(--night-soft); font-size: 0.85rem; line-height: 1.35; }

/* Home: handbook photo cards (Daylight) */
.hb-grid { list-style: none; padding: 0; margin: 2.2rem 0 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.hb-grid li { margin: 0; }
.hb-card { display: flex; flex-direction: column; height: 100%; border-radius: var(--radius); overflow: hidden; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); color: var(--text); transition: transform 0.3s var(--ease), box-shadow 0.3s; }
.hb-card:hover { transform: translateY(-4px); text-decoration: none; color: var(--text); box-shadow: 0 1px 2px rgba(30, 40, 60, 0.06), 0 20px 40px -18px rgba(30, 40, 60, 0.3); }
.hb-media { aspect-ratio: 16 / 9; overflow: hidden; }
.hb-media img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s var(--ease); }
.hb-card:hover .hb-media img { transform: scale(1.04); }
.hb-body { display: grid; gap: 4px; padding: 18px 20px 22px; }
.hb-body b { font-family: var(--display); font-size: 1.2rem; font-weight: 800; letter-spacing: -0.02em; }
.hb-body small { color: var(--muted); font-size: 0.95rem; }
.tag { justify-self: start; display: inline-block; margin-bottom: 6px; padding: 3px 11px; border-radius: 999px; font-size: 0.78rem; font-weight: 700; background: var(--accent-soft); color: var(--accent); }

/* Home: chain of command as a numbered path (night) */
.path { list-style: none; counter-reset: p; padding: 0; margin: 2.2rem 0 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; }
.path li { counter-increment: p; position: relative; margin: 0; padding: 64px 20px 22px; border-radius: var(--radius); background: var(--night-2); border: 1px solid var(--night-line); }
.path li::before { content: counter(p); position: absolute; left: 20px; top: 18px; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; font-family: var(--display); font-weight: 800; background: var(--accent-fill); color: var(--on-accent); }
.path b { display: block; color: #fff; font-size: 1.08rem; line-height: 1.3; margin-bottom: 4px; }
.path span { color: var(--night-soft); font-size: 0.93rem; }
.more { margin: 1.6rem 0 0; }
.more a { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }

/* Home: links + agreement, credits (Daylight) */
.links-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: clamp(28px, 5vw, 64px); align-items: start; }
.links { display: grid; margin-top: 1.6rem; }
.link-row { display: grid; grid-template-columns: auto 1fr auto; gap: 16px; align-items: center; padding: 16px 4px; border-top: 1px solid var(--border); color: var(--text); }
.link-row:last-child { border-bottom: 1px solid var(--border); }
.link-row:hover { text-decoration: none; color: var(--text); }
.link-row > i:first-child { font-size: 1.3rem; color: var(--accent); background: var(--accent-soft); padding: 10px; border-radius: 12px; }
.link-row b { display: block; }
.link-row small { color: var(--muted); font-size: 0.93rem; }
.link-row .go { color: var(--muted); transition: transform 0.3s var(--ease), color 0.2s; }
.link-row:hover .go { transform: translate(3px, -3px); color: var(--accent); }
.card { padding: clamp(22px, 3vw, 32px); border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); }
.agree h3 { font-family: var(--display); font-size: 1.4rem; font-weight: 800; letter-spacing: -0.03em; }
.agree p:last-child { margin: 0; }
.credits-band { padding-top: 0; }
.credits { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; margin-top: 1.8rem; }
.credits ul { list-style: none; padding: 0; margin: 0; }
.credits li { margin-bottom: 10px; }
.credits b { display: block; }
.credits span { color: var(--muted); font-size: 0.93rem; }

/* ---------- Handbook pages: rail + content on Daylight ---------- */
.app { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: clamp(32px, 5vw, 64px); padding-top: 48px; padding-bottom: 96px; }
.rail { position: sticky; top: calc(var(--top) + 20px); align-self: start; max-height: calc(100dvh - var(--top) - 40px); overflow: auto; scrollbar-width: thin; padding: 14px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); }
.rail-mobile { display: none; }
.rail-h { font-family: var(--display); font-size: 0.7rem; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; color: var(--accent); margin: 16px 10px 6px; }
.rail-h:first-child { margin-top: 4px; }
.rail-nav > a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; color: var(--muted); font-weight: 500; font-size: 0.95rem; transition: background 0.15s, color 0.15s; }
.rail-nav > a i { font-size: 1.1rem; }
.rail-nav > a:hover { background: var(--bg); color: var(--text); text-decoration: none; }
.rail-nav > a[aria-current] { color: var(--text); background: var(--accent-soft); font-weight: 600; }
.rail-nav > a[aria-current] i { color: var(--accent); }
.rail-sub { margin: 2px 0 8px 20px; padding-left: 12px; border-left: 2px solid var(--border); display: grid; }
.rail-sub a { color: var(--muted); font-size: 0.88rem; padding: 4px 8px; }
.rail-sub a:hover { color: var(--text); text-decoration: none; }
.rail-sub a.on { color: var(--accent); font-weight: 600; }
.doc-body { max-width: 860px; }
.doc-sec { padding-bottom: 56px; }
.doc-sec > h2 { font-size: clamp(1.7rem, 3vw, 2.3rem); letter-spacing: -0.04em; }
.doc-sec .sub { margin-top: 1.6em; color: var(--text); font-family: var(--display); font-weight: 800; letter-spacing: -0.02em; }
.help { color: var(--muted); display: flex; gap: 8px; align-items: center; }
.help i { color: var(--accent); font-size: 1.3rem; }
.next { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 2px 20px; margin-top: 12px; padding: 24px 28px; border-radius: var(--radius); background: var(--night); color: #fff; transition: transform 0.3s var(--ease); }
.next:hover { color: #fff; text-decoration: none; transform: translateY(-3px); }
.next-k { grid-column: 1; font-family: var(--display); font-size: 0.72rem; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; color: var(--night-accent); }
.next-t { grid-column: 1; font-family: var(--display); font-size: 1.7rem; font-weight: 800; letter-spacing: -0.04em; }
.next i { grid-column: 2; grid-row: 1 / 3; font-size: 1.6rem; color: var(--accent-fill); transition: transform 0.35s var(--ease); }
.next:hover i { transform: translateX(6px); }

/* Notes */
.note { display: flex; gap: 12px; padding: 14px 18px; margin: 0 0 1.2em; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); }
.note > i { font-size: 1.3rem; flex: none; margin-top: 2px; color: var(--muted); }
.note > div > :last-child { margin-bottom: 0; }
.note-warn { background: var(--accent-soft); border-color: rgba(37, 82, 196, 0.25); }
.note-warn > i, .note-ok > i, .note-pin > i { color: var(--accent); }

/* Numbered rules (GVRPJ numbered-step circles) */
.rules { list-style: none; counter-reset: rule; padding: 0; }
.rules > li { counter-increment: rule; display: grid; grid-template-columns: 50px 1fr; gap: 10px; padding: 14px 0; margin: 0; }
.rules > li + li { border-top: 1px solid var(--border); }
.rules > li::before { content: counter(rule); display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; font-family: var(--display); font-weight: 800; font-size: 0.95rem; background: var(--accent-fill); color: var(--on-accent); }
.rules > li > div { padding-top: 5px; }
.rules p { margin: 0; }
.rule-title { font-weight: 700; margin-bottom: 4px !important; }

/* Tables */
.table-scroll { overflow-x: auto; margin: 0 0 1.2em; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); }
.data { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.data th, .data td { text-align: left; padding: 11px 16px; vertical-align: top; }
.data thead th { font-family: var(--display); font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); white-space: nowrap; border-bottom: 1px solid var(--border); background: var(--bg); }
.data tbody tr + tr { border-top: 1px solid var(--border); }
.data tbody tr:hover { background: var(--bg); }
.data tbody th { font-weight: 600; }
.data .num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.row-hot th, .row-hot td { color: var(--accent); font-weight: 600; }

/* Stat blocks */
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; margin-bottom: 1.2em; }
.pair .note { margin: 0; }
.stat { padding: 16px 18px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); }
.stat p { margin: 0; }
.stat-k { font-family: var(--display); font-size: 0.7rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent); margin-bottom: 6px !important; }
.stat-v b { font-family: var(--display); font-size: 1.4rem; font-weight: 800; margin: 0 2px; }
.stat-big { font-family: var(--display); font-size: 1.9rem; font-weight: 800; letter-spacing: -0.04em; }
.quota { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 1.4em; }
.quota .stat p:last-child { color: var(--muted); font-size: 0.9rem; margin-top: 4px; }
.cards3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 1.2em; }
.cards3 .card { padding: 18px; box-shadow: none; }
.card h3 { display: flex; gap: 8px; align-items: center; }
.card h3 i { color: var(--accent); }
.cards3 ul { margin: 0; padding-left: 1.1em; font-size: 0.95rem; }

/* Copyable commands */
.cmd { display: flex; width: 100%; align-items: center; justify-content: space-between; gap: 12px; text-align: left; font: inherit; color: var(--night-ink); background: var(--night); border: 1px solid var(--night); border-radius: 12px; padding: 11px 14px; margin: 0 0 1em; cursor: pointer; transition: transform 0.2s var(--ease), box-shadow 0.2s; }
.cmd:hover { transform: translateY(-1px); box-shadow: 0 8px 20px -10px rgba(11, 15, 20, 0.6); }
.cmd code { background: none; padding: 0; font-size: 0.9rem; color: #d7e3ff; }
.cmd i { color: var(--night-accent); flex: none; }
.callouts { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.callout-card { padding: 18px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); }
.callout-card h3 { display: flex; gap: 8px; align-items: center; }
.callout-card h3 i { color: var(--accent); }
.callout-card .cmd { margin-bottom: 8px; }
.callout-card p { font-size: 0.93rem; color: var(--muted); }
.callout-label { font-size: 0.8rem !important; margin-bottom: 4px !important; color: var(--muted); }
.command { padding: 22px 24px; margin: 0 0 16px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); }
.command h3 { display: flex; flex-wrap: wrap; gap: 10px; align-items: baseline; font-size: 1.2rem; }
.command h3 code { font-size: 0.95rem; color: var(--accent); background: var(--accent-soft); }
.fields-h { font-family: var(--display); font-size: 0.7rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent); margin: 1.3em 0 0.4em; }
.fields { margin: 0 0 1em; display: grid; }
.fields > div { display: grid; grid-template-columns: 180px 1fr; gap: 16px; padding: 8px 0; }
.fields > div + div { border-top: 1px solid var(--border); }
.fields dd { margin: 0; font-size: 0.96rem; }
.files { display: flex; gap: 8px; align-items: flex-start; font-size: 0.96rem; margin: 0; }
.files i { color: var(--accent); margin-top: 4px; }
.split-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.ids { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 1.4em; }
.ids li { padding: 14px 16px; margin: 0; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); }
.ids code { display: block; background: none; padding: 0; font-family: var(--display); font-weight: 800; font-size: 1.25rem; color: var(--accent); }
.ids span { font-size: 0.9rem; color: var(--muted); }

/* Search + filters */
.search { display: flex; align-items: center; gap: 10px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border-strong); padding: 0 18px; margin-bottom: 16px; transition: border-color 0.2s, box-shadow 0.2s; }
.search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.search i { color: var(--muted); font-size: 1.2rem; }
.search input { flex: 1; min-width: 0; background: none; border: 0; outline: 0; color: var(--text); font: inherit; padding: 13px 0; }
.search input::placeholder { color: #7a828d; }
.codes { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 6px; }
.codes li { display: flex; gap: 12px; align-items: baseline; margin: 0; padding: 9px 12px; border-radius: 10px; background: var(--surface); border: 1px solid var(--border); }
.codes b { font: 500 0.9rem var(--mono); color: var(--accent); min-width: 5.4em; }
.codes span { font-size: 0.95rem; }
.empty { color: var(--muted); padding: 20px 0; }
.miranda { counter-reset: m; list-style: none; padding: 0; }
.miranda li { counter-increment: m; position: relative; padding: 12px 0 12px 50px; margin: 0; font-size: 1.05rem; }
.miranda li + li { border-top: 1px solid var(--border); }
.miranda li::before { content: counter(m); position: absolute; left: 0; top: 10px; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-family: var(--display); font-weight: 800; background: var(--accent-fill); color: var(--on-accent); }
.phonetic { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 6px; }
.phonetic li { margin: 0; padding: 8px 12px; border-radius: 10px; background: var(--surface); border: 1px solid var(--border); display: flex; gap: 10px; align-items: baseline; }
.phonetic b { font-family: var(--display); font-size: 1.2rem; font-weight: 800; color: var(--accent); width: 1ch; }

/* Ranks */
.ladder { list-style: none; padding: 0; position: relative; }
.ladder::before, .ladder::after { content: ''; position: absolute; left: 17px; top: 18px; bottom: 18px; width: 2px; }
.ladder::before { background: var(--border-strong); }
.ladder::after { background: var(--accent-fill); transform-origin: top; transform: scaleY(var(--fill, 1)); }
.ladder li { position: relative; padding: 0 0 26px 54px; margin: 0; }
.ladder li::before { content: ''; position: absolute; left: 9px; top: 4px; width: 18px; height: 18px; border-radius: 50%; background: var(--bg); border: 3px solid var(--accent-fill); z-index: 1; }
.ladder h3 { font-family: var(--display); font-weight: 800; margin-bottom: 4px; }
.ladder p { margin: 0; color: var(--muted); }
.chain { display: grid; gap: 12px; margin-bottom: 1.2em; }
.chain-group { padding: 16px 20px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); }
.chain-group h3 { font-family: var(--display); font-size: 0.75rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent); }
.chain-group ul { list-style: none; padding: 0; margin: 0; }
.chain-group li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; margin: 0; }
.chain-group li + li { border-top: 1px solid var(--border); }
.chain-group li span:first-child { font-weight: 600; }
.chain-group li span:last-child { color: var(--muted); font-size: 0.92rem; }
.chain-group li.last span:last-child { color: var(--accent); font-weight: 600; }

/* Uniform tabs (radio + :checked, no JS) */
.tabs > input { position: absolute; opacity: 0; }
.tabs > label { display: inline-block; padding: 8px 16px; border: 1px solid var(--border-strong); border-radius: 999px; margin: 0 6px 16px 0; cursor: pointer; font-weight: 600; font-size: 0.95rem; color: var(--muted); background: var(--surface); transition: all 0.2s; }
.tabs > label:hover { color: var(--text); border-color: var(--text); }
.tabs > input:checked + label { background: var(--accent-fill); color: var(--on-accent); border-color: var(--accent-fill); }
.tabs > input:focus-visible + label { outline: 2px solid var(--accent); outline-offset: 3px; }
.tab-panel { display: none; }
#tab-wisp:checked ~ #panel-wisp, #tab-ocso:checked ~ #panel-ocso { display: block; }
.hats { margin: 0; overflow: hidden; border-radius: 12px; }

/* Vehicles embed */
.embed { border-radius: var(--radius); overflow: hidden; background: #fff; border: 1px solid var(--border); margin-bottom: 16px; }
.embed iframe { display: block; width: 100%; height: 640px; border: 0; }

/* Divisions */
.divs { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.div-card { border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); overflow: hidden; display: flex; flex-direction: column; }
.div-card img { aspect-ratio: 16 / 8; object-fit: cover; width: 100%; transition: transform 0.5s var(--ease); }
.div-card:hover img { transform: scale(1.04); }
.div-copy { padding: 22px; }
.div-copy > :last-child { margin-bottom: 0; }
.div-copy h3 { font-family: var(--display); font-weight: 800; font-size: 1.3rem; }
.div-wide { grid-column: 1 / -1; background: var(--night); color: var(--night-ink); border-color: var(--night); }
.div-wide h3 { color: #fff; }
.div-wide a { color: var(--night-accent); }
.div-wide .div-copy p { color: var(--night-soft); }
.div-tag { display: flex; gap: 10px; align-items: center; margin-bottom: 8px !important; }
.div-tag b { display: inline-block; padding: 3px 11px; border-radius: 999px; font-size: 0.8rem; font-weight: 700; background: var(--accent-soft); color: var(--accent); }
.div-wide .div-tag b { background: rgba(91, 140, 255, 0.18); color: var(--night-accent); }
.div-tag span { font-size: 0.8rem; font-weight: 600; color: var(--muted); }
.div-wide .div-tag span { color: var(--night-soft); }
.tagline { font-family: var(--display); font-size: 1.3rem; font-weight: 800; color: #fff !important; }

/* Penal codes */
.penal-bar { position: sticky; top: var(--top); z-index: 5; padding: 12px 0 4px; margin-bottom: 8px; background: var(--bg); }
.penal-bar .search { margin-bottom: 10px; }
.chips { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 8px; scrollbar-width: none; }
.chips a { flex: none; font-size: 0.88rem; font-weight: 600; padding: 6px 14px; border-radius: 999px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); white-space: nowrap; transition: all 0.2s; }
.chips a:hover { text-decoration: none; border-color: var(--text); }
.penal th[scope='row'] { min-width: 12em; }
.code-copy { font: 500 0.84rem var(--mono); color: var(--accent); background: var(--accent-soft); border: 0; border-radius: 8px; padding: 4px 9px; cursor: pointer; white-space: nowrap; transition: background 0.2s, color 0.2s; }
.code-copy:hover { background: var(--accent-fill); color: var(--on-accent); }
.type { font-size: 0.78rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; white-space: nowrap; background: var(--bg-alt); color: var(--muted); }
.t-felony { background: rgba(220, 38, 38, 0.1); color: #b42318; }
.t-misd { background: rgba(217, 119, 6, 0.12); color: #9a5b00; }
.yes { color: var(--accent); font-weight: 700; }

/* Footer, 404, toast */
.foot { background: var(--bg-alt); border-top: 1px solid var(--border); padding-top: 56px; }
.foot-in { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 40px; }
.foot .brand { color: var(--text); }
.foot-brand p { color: var(--muted); font-size: 0.93rem; max-width: 42ch; margin-top: 14px; }
.foot-h { font-family: var(--display); font-size: 0.72rem; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; color: var(--text); margin: 0 0 12px; }
.foot ul { list-style: none; padding: 0; margin: 0; }
.foot li { margin-bottom: 6px; }
.foot li a { color: var(--muted); font-size: 0.95rem; }
.foot li a:hover { color: var(--text); }
.foot-base { margin-top: 40px; padding-top: 20px; padding-bottom: 28px; border-top: 1px solid var(--border); color: var(--muted); font-size: 0.88rem; }
.lost { padding-top: 120px; padding-bottom: 150px; }
.lost-code { font: 500 1rem var(--mono); color: var(--accent); }
.lost h1 { font-size: clamp(2.4rem, 6vw, 4rem); letter-spacing: -0.05em; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 16px); opacity: 0; pointer-events: none; background: var(--night); color: #fff; padding: 10px 18px; border-radius: 999px; font-weight: 600; transition: opacity 0.25s, transform 0.35s var(--ease); z-index: 60; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* Reveals: without JS or with reduced motion everything is simply visible. */
.js-motion [data-reveal] { opacity: 0; transform: translateY(24px); }
.js-motion [data-reveal].in { opacity: 1; transform: none; transition: opacity 0.7s var(--ease), transform 0.8s var(--ease); }
@media (prefers-reduced-motion: no-preference) {
  #tab-wisp:checked ~ #panel-wisp, #tab-ocso:checked ~ #panel-ocso { animation: rise 0.45s var(--ease); }
}

/* ---------- Tablet and phone ---------- */
@media (max-width: 1100px) {
  .actions { grid-template-columns: repeat(3, 1fr); }
  .path { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 1024px) {
  .app { grid-template-columns: minmax(0, 1fr); gap: 0; padding-top: 28px; }
  .rail { display: none; }
  .rail-mobile { display: block; margin-bottom: 28px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); }
  .rail-mobile summary { cursor: pointer; padding: 14px 18px; font-weight: 600; display: flex; gap: 8px; align-items: center; }
  .rail-mobile .rail-nav { padding: 0 10px 12px; }
  .hb-grid { grid-template-columns: 1fr 1fr; }
  .quota { grid-template-columns: 1fr 1fr; }
  .cards3 { grid-template-columns: 1fr; }
  .foot-in { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 767px) {
  body { font-size: 1rem; }
  .top-in { gap: 10px; }
  .nav { display: none; }
  .top .btn { margin-left: auto; }
  .opener { min-height: 70svh; }
  .opener--doc { min-height: 48svh; }
  .stats, .links-grid, .credits, .pair, .split-2, .callouts, .divs { grid-template-columns: 1fr; }
  .stats { gap: 24px; }
  .actions { grid-template-columns: 1fr 1fr; }
  .path { grid-template-columns: 1fr; }
  .path li { padding: 18px 18px 18px 68px; }
  .path li::before { top: 16px; left: 18px; }
  .hb-grid { grid-template-columns: 1fr; }
  .results button { grid-template-columns: 100px 1fr; padding: 10px 12px; }
  .results em { display: none; }
  .fields > div { grid-template-columns: 1fr; gap: 4px; }
  .ids, .quota { grid-template-columns: 1fr 1fr; }
  .div-wide { grid-column: auto; }
  .link-row { grid-template-columns: auto 1fr; }
  .link-row .go { display: none; }
  .foot-in { grid-template-columns: 1fr; gap: 28px; }
}
@media (max-width: 560px) {
  .brand span, .pp-long { display: none; }
  .top .btn-sm { padding: 0.5em 0.85em; }
}
/* Tablet header: compact payoff pill, then no text links (pages keep the handbook menu). */
@media (max-width: 1023px) {
  .pp-long, .brand span { display: none; }
}
@media (max-width: 899px) {
  .nav { display: none; }
  .top .btn { margin-left: auto; }
}

/* Legal pages (Terms, Privacy) */
.legal-head { background: var(--night); color: #fff; padding-block: clamp(56px, 9vw, 104px) clamp(32px, 5vw, 56px); }
.legal-head .stat-label { color: var(--night-accent); }
.legal-head h1 { margin: 0; font-size: clamp(2.4rem, 5.5vw, 4.2rem); letter-spacing: -0.05em; color: #fff; }
.legal-date { margin: 0.8rem 0 0; color: var(--night-soft); }
.legal { max-width: 780px; padding-block: clamp(40px, 6vw, 72px) clamp(56px, 8vw, 96px); }
.legal h2 { font-size: 1.35rem; letter-spacing: -0.03em; margin-top: 2em; }
.legal ul { display: grid; gap: 10px; margin: 0 0 1em; }
.legal li { margin: 0; }
.foot-base { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; }
.foot-base p { margin: 0; }
.foot-legal { display: flex; gap: 20px; }
.foot-legal a { color: var(--muted); }
.foot-legal a:hover { color: var(--text); }
.foot .brand img { background: var(--night); border-radius: 9px; padding: 3px; }
.div-wide img { aspect-ratio: 16 / 5; }
