/* Birthday Issue - newsprint, a print shop's registration marks and a magenta masthead. */
:root {
  --bg: #f4f0e8; --paper: #fffdf8; --ink: #1c1a20; --muted: #66606b; --line: #ded6c8; --tint: #f8f3ea;
  --mag: #c8175d; --mag-ink: #fffdf8; --cyan: #0b84a5; --yel: #f2c230; --sheet: #fffefb; --sheet-ink: #1c1a20; --sheet-line: #d9d2c5;
  --ok: #1d7a55; --ok-bg: #def2e8; --warn: #a65f00; --warn-bg: #fbecd0; --bad: #b3261e; --bad-bg: #f9dedb;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --display: "Didot", "Bodoni 72", "Bodoni MT", "Playfair Display", Georgia, serif;
  --sans: "Gill Sans", "Gill Sans MT", "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #15141a; --paper: #1e1d25; --ink: #efeaf2; --muted: #a59eab; --line: #34323d; --tint: #25232d;
  --mag: #ff5c98; --mag-ink: #15141a; --cyan: #4cc3e0; --yel: #f2c230; --sheet: #fbf8f1; --sheet-ink: #1c1a20; --sheet-line: #d9d2c5;
  --ok: #6fd3a5; --ok-bg: #173a2c; --warn: #f0b35a; --warn-bg: #3d2e12; --bad: #ff8a80; --bad-bg: #431d1b;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 16px/1.5 var(--serif); }
a { color: var(--cyan); }
code { font: 0.86em var(--mono); background: var(--tint); padding: 0 4px; border-radius: 3px; }
.hidden { display: none !important; }
.small { font-size: 0.86rem; } .muted { color: var(--muted); } .mono { font-family: var(--mono); }
.warn { color: var(--warn); }

.bar { display: flex; align-items: center; gap: 12px; padding: 10px 16px; border-bottom: 3px double var(--ink); background: var(--paper); position: sticky; top: 0; z-index: 5; flex-wrap: wrap; }
.back { font: 0.85rem var(--sans); text-decoration: none; color: var(--muted); }
.brand { display: flex; align-items: center; gap: 8px; font: 700 1.05rem var(--display); letter-spacing: 0.02em; }
.logo { width: 26px; height: 26px; }
.lg-page { fill: var(--paper); stroke: var(--ink); stroke-width: 1.6; }
.lg-mast { stroke: var(--mag); stroke-width: 3.2; stroke-linecap: round; }
.lg-ln { stroke: var(--muted); stroke-width: 1.6; stroke-linecap: round; }
.session { margin-left: auto; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.pill { font: 600 0.84rem var(--sans); border: 1.5px solid var(--ink); background: transparent; color: var(--ink); border-radius: 2px; padding: 5px 11px; cursor: pointer; text-decoration: none; display: inline-block; }
.pill:hover { background: var(--tint); }
.pill.solid { background: var(--mag); border-color: var(--mag); color: var(--mag-ink); }
.pill.solid:hover { filter: brightness(1.08); background: var(--mag); }
.pill.ghost { border-style: dashed; cursor: default; }
.pill.tiny { padding: 1px 8px; font-size: 0.75rem; }
.pill.big { padding: 9px 18px; font-size: 1rem; }
.pill:disabled { opacity: 0.5; cursor: not-allowed; }

.wrap { max-width: 1180px; margin: 0 auto; padding: 18px 16px 40px; }
.hero { padding: 18px 0 10px; }
.kicker { font: 700 0.78rem var(--sans); letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); margin: 0 0 6px; display: flex; align-items: center; gap: 8px; }
.reg { width: 16px; height: 16px; border: 1.5px solid var(--ink); border-radius: 50%; position: relative; display: inline-block; }
.reg::before, .reg::after { content: ""; position: absolute; background: var(--ink); }
.reg::before { left: 50%; top: -4px; bottom: -4px; width: 1.5px; transform: translateX(-50%); }
.reg::after { top: 50%; left: -4px; right: -4px; height: 1.5px; transform: translateY(-50%); }
h1 { font: 400 clamp(2.2rem, 6vw, 4rem)/1.02 var(--display); margin: 0 0 10px; letter-spacing: -0.01em; }
.hl { color: var(--mag); font-style: italic; }
.lede { max-width: 760px; margin: 0 0 14px; font-size: 1.06rem; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.chips-label { font: 600 0.84rem var(--sans); color: var(--muted); }
.chip { font: 0.85rem var(--sans); border: 1px solid var(--line); background: var(--paper); color: var(--ink); padding: 5px 12px; border-radius: 999px; cursor: pointer; }
.chip.on { border-color: var(--mag); box-shadow: inset 0 0 0 1px var(--mag); color: var(--mag); }

.two { display: grid; grid-template-columns: 1fr 1.25fr; gap: 16px; margin-top: 14px; }
.card { background: var(--paper); border: 1px solid var(--line); border-radius: 3px; padding: 16px; margin-top: 16px; }
.two .card { margin-top: 0; }
.two > * { min-width: 0; }
h2 { font: 700 1.2rem var(--sans); margin: 0 0 10px; display: flex; align-items: center; gap: 8px; }
h3 { font: 700 0.95rem var(--sans); margin: 14px 0 6px; display: flex; align-items: center; gap: 8px; }
.stepno { display: inline-grid; place-items: center; width: 26px; height: 26px; background: var(--ink); color: var(--paper); font: 700 0.85rem var(--display); border-radius: 50%; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; }
.f { display: flex; flex-direction: column; gap: 3px; font: 600 0.84rem var(--sans); margin-bottom: 8px; }
.opt { font-weight: 400; color: var(--muted); }
input, select, textarea { font: 0.95rem var(--serif); color: var(--ink); background: var(--tint); border: 1px solid var(--line); border-radius: 2px; padding: 7px 9px; width: 100%; }
textarea { resize: vertical; font-family: var(--serif); line-height: 1.45; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--cyan); outline-offset: 1px; }
.drop { border: 1.5px dashed var(--line); border-radius: 3px; padding: 6px; }
.drop.over { border-color: var(--mag); background: var(--tint); }
.drop textarea { border: 0; background: transparent; }
.drop-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; justify-content: space-between; padding: 2px 4px; }
.filebtn { font: 600 0.8rem var(--sans); color: var(--cyan); cursor: pointer; text-decoration: underline; }
.filebtn input { display: none; }
.countdown { font: 0.9rem var(--sans); margin-top: 4px; }
.countdown b { color: var(--mag); font-size: 1.2rem; }
.factchips { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 5px; }
.fchip { font: 0.76rem var(--sans); border: 1px solid var(--line); border-radius: 3px; padding: 2px 7px; background: var(--tint); max-width: 100%; overflow-wrap: anywhere; }
.fchip b { font-family: var(--mono); color: var(--mag); margin-right: 4px; }
.fchip.held { opacity: 0.7; text-decoration: line-through; border-style: dashed; }
.fchip .k { color: var(--muted); margin-left: 4px; }
.notes { list-style: none; padding: 0; margin: 10px 0 0; }
.notes li { font: 0.86rem var(--sans); padding: 5px 9px; border-left: 3px solid var(--line); margin-bottom: 4px; background: var(--paper); }
.notes li.ok { border-color: var(--ok); background: var(--ok-bg); }
.notes li.info { border-color: var(--cyan); }
.notes li.warn { border-color: var(--warn); background: var(--warn-bg); color: var(--ink); }
.notes li.bad { border-color: var(--bad); background: var(--bad-bg); }
.notes li.none { color: var(--muted); }

.disp-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.verdict-tag { font: 700 0.8rem var(--sans); letter-spacing: 0.06em; text-transform: uppercase; padding: 3px 10px; border: 1.5px solid currentColor; border-radius: 2px; }
.verdict-tag:empty { display: none; }
.v-print { color: var(--ok); } .v-pad { color: var(--warn); } .v-hold { color: var(--bad); }
.viewtabs { display: flex; gap: 0; margin: 4px 0 12px; border-bottom: 1.5px solid var(--ink); }
.tab { font: 600 0.88rem var(--sans); background: transparent; color: var(--muted); border: 1.5px solid transparent; border-bottom: 0; padding: 6px 14px; cursor: pointer; margin-bottom: -1.5px; border-radius: 3px 3px 0 0; }
.tab.on { color: var(--ink); border-color: var(--ink); background: var(--paper); }
.readnav { display: flex; align-items: center; justify-content: center; gap: 12px; margin-bottom: 10px; }
.spread-label { font-size: 0.85rem; min-width: 90px; text-align: center; }
.readerbox { background: repeating-linear-gradient(45deg, var(--tint), var(--tint) 8px, var(--bg) 8px, var(--bg) 16px); padding: 18px; border-radius: 3px; }
.spread { display: grid; grid-template-columns: 1fr 1fr; max-width: 720px; margin: 0 auto; box-shadow: 0 8px 22px rgba(0,0,0,0.18); }
.spread.single { grid-template-columns: 1fr; max-width: 360px; }
.spread .pg + .pg { border-left: 1px solid var(--sheet-line); box-shadow: inset 10px 0 14px -12px rgba(0,0,0,0.35); }
.sheetwrap { overflow-x: auto; }
.sheetbox { padding: 4px 0 10px; }
.sheet { display: grid; grid-template-columns: repeat(4, 1fr); position: relative; min-width: 720px; max-width: 1100px; margin: 0 auto; background: var(--sheet); border: 1px solid var(--sheet-line); box-shadow: 0 6px 18px rgba(0,0,0,0.15); }
.cell { border: 1px dashed var(--sheet-line); }
.cell.flip .pg { transform: rotate(180deg); }
.slit { position: absolute; top: 50%; left: 25%; width: 50%; border-top: 2px dashed var(--mag); }
.slit::after { content: "cut"; position: absolute; left: 50%; top: -9px; transform: translateX(-50%); font: 700 10px var(--sans); background: var(--sheet); color: var(--mag); padding: 0 4px; letter-spacing: 0.1em; text-transform: uppercase; }

/* One mini page. Sizes follow the page's own width so the booklet and the sheet share one layout. */
.pg { container-type: inline-size; aspect-ratio: 11 / 17; background: var(--sheet); color: var(--sheet-ink); padding: 7% 7% 9%; position: relative; overflow: hidden; display: flex; flex-direction: column; font-family: var(--serif); }
.pg ul { list-style: none; margin: 0; padding: 0; }
.pg .ids { font: 3.4cqw var(--mono); color: #8b8592; margin-left: 0.4em; vertical-align: super; }
.pg .move { display: inline-block; font: 600 3.2cqw var(--sans); color: #0b84a5; border: 1px solid currentColor; border-radius: 2px; padding: 0 0.4em; margin-left: 0.4em; text-transform: uppercase; letter-spacing: 0.04em; }
.pg .flagged { background: linear-gradient(transparent 55%, rgba(242,194,48,0.55) 55%); }
.pg .blank { color: #8b8592; font-style: italic; }
.pg.draft li:not(.blank) { color: #5b5560; font-style: italic; }
.pg .none { color: #8b8592; font: italic 4.4cqw var(--serif); }
.folio { position: absolute; bottom: 3.5%; left: 0; right: 0; text-align: center; font: 3.6cqw var(--sans); color: #8b8592; }
.mast { font: 400 17cqw/0.92 var(--display); color: #c8175d; letter-spacing: -0.02em; border-bottom: 0.8cqw solid #1c1a20; padding-bottom: 2cqw; overflow-wrap: anywhere; }
.issue { font: 700 3.6cqw var(--sans); letter-spacing: 0.12em; text-transform: uppercase; margin: 2cqw 0 4cqw; color: #1c1a20; }
.cover-hl { font: italic 700 9cqw/1.05 var(--display); margin-bottom: 4cqw; }
.cl li { font: 700 5.1cqw/1.25 var(--sans); padding: 2cqw 0; border-top: 0.4cqw solid #1c1a20; }
.cl li:nth-child(2) { color: #0b84a5; } .cl li:nth-child(4) { color: #c8175d; }
.held-stamp { position: absolute; right: 6%; bottom: 14%; transform: rotate(-14deg); border: 0.9cqw solid #b3261e; color: #b3261e; font: 800 8cqw var(--sans); text-transform: uppercase; padding: 1cqw 3cqw; letter-spacing: 0.06em; }
.pg-t { font: 400 8.4cqw/1.05 var(--display); margin: 0 0 4cqw; border-bottom: 0.5cqw solid #c8175d; padding-bottom: 2cqw; }
.pl li { font: 5.2cqw/1.35 var(--serif); margin-bottom: 3.4cqw; }
.k-letter .pl li:last-child { font-style: italic; text-align: right; }
.k-numbers .pl li { font: 700 5.4cqw/1.3 var(--sans); border-left: 1.4cqw solid #f2c230; padding-left: 2.5cqw; }
.k-feature .pl li { font-size: 5cqw; }
.k-feature .pl li:first-child::first-letter { font: 400 13cqw/0.8 var(--display); float: left; margin: 1cqw 1.4cqw 0 0; color: #c8175d; }
.k-quiz .pl li { border: 0.4cqw dashed #8b8592; padding: 2cqw; font-size: 4.6cqw; }
.k-classifieds .pl li { border: 0.5cqw solid #1c1a20; padding: 2.4cqw; font: 4.5cqw/1.3 var(--mono); }
.k-forecast .pl li::before { content: "* "; color: #0b84a5; font-weight: 700; }
.colophon { margin-top: auto; font: italic 4cqw var(--serif); color: #5b5560; text-align: center; }

.flags h3 { margin-top: 16px; }
.readflags { list-style: none; padding: 0; margin: 0; }
.readflags li { font: 0.88rem var(--sans); padding: 4px 0; border-bottom: 1px dotted var(--line); }
.readflags .lv { font: 700 0.7rem var(--sans); text-transform: uppercase; letter-spacing: 0.06em; padding: 1px 6px; border-radius: 2px; margin-right: 4px; }
.readflags .lv-fix .lv { background: var(--warn-bg); color: var(--warn); }
.readflags .lv-info .lv { background: var(--tint); color: var(--cyan); }
.readflags li.ok { color: var(--ok); } .readflags li.none { color: var(--muted); }
.rules { margin-top: 12px; font: 0.86rem var(--sans); } .rules summary { cursor: pointer; font-weight: 600; } .rules li { margin: 4px 0; }

.ask .runrow { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 8px; }
.gate { font: 0.88rem var(--sans); background: var(--tint); border-left: 3px solid var(--mag); padding: 8px 10px; margin: 8px 0; }
.ptitle { font: 700 1rem var(--sans); margin: 0 0 8px; }
.steps { list-style: none; padding: 0; margin: 0 0 8px; }
.step { font: 0.9rem var(--sans); padding: 2px 0; color: var(--muted); }
.step.done { color: var(--ok); } .step.active { color: var(--ink); font-weight: 700; }
.step-ic { font-family: var(--mono); display: inline-block; width: 1.2em; }
.raw { white-space: pre-wrap; font: 0.8rem var(--mono); max-height: 320px; overflow: auto; background: var(--tint); padding: 10px; }
.rhead { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.rhead h2 { margin: 0; font-family: var(--display); font-weight: 400; font-size: 1.5rem; }
.stamp { font: 800 0.8rem var(--sans); text-transform: uppercase; letter-spacing: 0.08em; padding: 4px 10px; border: 2.5px solid currentColor; transform: rotate(-3deg); display: inline-block; }
.summary { font-size: 1.05rem; }
.twocol { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.coverlines { padding-left: 1.3em; margin: 0; } .coverlines li { margin-bottom: 6px; font-weight: 600; }
.coverlines .mv { font: 600 0.72rem var(--sans); color: var(--cyan); text-transform: uppercase; margin-left: 6px; letter-spacing: 0.04em; }
.coverlines .ids2 { font: 0.75rem var(--mono); color: var(--muted); margin-left: 6px; }
.asks, .lines-plain { padding-left: 1.2em; margin: 0; } .asks li, .lines-plain li { margin-bottom: 4px; }
.asks li.none, .coverlines li.none { list-style: none; margin-left: -1.2em; color: var(--muted); font-weight: 400; }
.tools { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 6px; }
.hist { list-style: none; padding: 0; margin: 8px 0 0; }
.hrow { display: flex; gap: 8px; align-items: center; padding: 7px 0; border-bottom: 1px dotted var(--line); }
.hinfo { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.hist .none { color: var(--muted); font: 0.88rem var(--sans); }
.foot { max-width: 1180px; margin: 0 auto; padding: 16px; font: 0.82rem var(--sans); color: var(--muted); border-top: 3px double var(--line); }
.toasts { position: fixed; right: 14px; bottom: 14px; display: flex; flex-direction: column; gap: 6px; z-index: 20; max-width: min(380px, calc(100vw - 28px)); }
.toast { font: 0.88rem var(--sans); background: var(--ink); color: var(--paper); padding: 8px 12px; border-radius: 3px; transition: opacity 0.5s; }
.toast.err { background: var(--bad); color: #fff; } .toast.gone { opacity: 0; }
.toast a { color: inherit; font-weight: 700; }

/* Docs pages (api.html, tokens.html). */
.doc { max-width: 900px; margin: 0 auto; padding: 24px 16px 48px; }
.doc h1 { font: 400 2.1rem/1.1 var(--display); }
.doc h2 { font-size: 1.3rem; margin-top: 32px; display: block; border-bottom: 1px solid var(--line); padding-bottom: 4px; }
.doc h3 { font-size: 1.05rem; margin-top: 22px; display: block; }
.doc pre { background: var(--tint); border: 1px solid var(--line); border-radius: 3px; padding: 12px; overflow-x: auto; font: 0.8rem/1.45 var(--mono); max-width: 100%; }
.doc pre code { background: none; border: none; padding: 0; white-space: pre; }
.doc table { border-collapse: collapse; width: 100%; font: 0.9rem var(--sans); display: block; overflow-x: auto; }
.doc th, .doc td { text-align: left; padding: 6px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.doc td code { white-space: normal; }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; margin: 12px 0 0; }
.tabs .tab { font: 600 0.8rem var(--sans); padding: 4px 10px; border: 1px solid var(--line); background: var(--paper); color: var(--ink); border-radius: 3px 3px 0 0; margin-bottom: 0; }
.tabs .tab.active { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.codegroup pre { margin-top: 0; border-top-left-radius: 0; }
.statebox { border: 1px solid var(--line); border-radius: 3px; padding: 12px 14px; background: var(--paper); font-family: var(--sans); }
.statebox p { margin: 4px 0 0; }
.tokenrow { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0; }
.tokenbox { font: 0.85rem var(--mono); background: var(--tint); border: 1px solid var(--line); border-radius: 3px; padding: 8px 10px; word-break: break-all; width: 100%; }

@media (max-width: 860px) { .two, .twocol { grid-template-columns: 1fr; } }
@media (max-width: 620px) {
  .spread { grid-template-columns: 1fr; max-width: 340px; }
  .spread .pg + .pg { border-left: 0; border-top: 1px solid var(--sheet-line); box-shadow: none; }
  .readerbox { padding: 10px; }
  .grid2 { grid-template-columns: 1fr 1fr; gap: 6px 8px; }
  .bar { gap: 8px; padding: 8px 12px; }
}

@page { size: landscape; margin: 0.25in; }
/* Print shows only the sheet, whichever view is open (Ctrl/Cmd+P included): everything else is display:none so it
 * leaves no blank trailing pages, and the sheet is sized by the page HEIGHT (4 x 2 panels of 11:17 = 22:17) so the
 * bottom row never spills onto a second page on letter or A4 landscape. */
@media print {
  body { background: #fff; }
  body > *:not(main), main.wrap > *:not(.issuesec), .issuesec > *:not(#sheetWrap) { display: none !important; }
  main.wrap, .issuesec { display: block !important; margin: 0 !important; padding: 0 !important; border: 0 !important; box-shadow: none !important; background: #fff !important; max-width: none !important; }
  #sheetWrap, #sheetWrap.hidden { display: block !important; overflow: visible; }
  #sheetWrap > p { display: none; }
  .sheet { min-width: 0; max-width: none; width: min(100%, calc(98vh * 22 / 17)); margin: 0 auto; box-shadow: none; border: 0; break-inside: avoid; }
  .pg .ids, .pg .move { display: none; }
  .pg .flagged { background: none; }
  .slit::after { background: #fff; }
}
