:root {
  --ink: #14181f;
  --paper: #f6f4ee;
  --card: #ffffff;
  --line: #d9d5c8;
  --yellow: #f7c600;
  --red: #d7263d;
  --muted: #5d6470;
  --radius: 10px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
.top {
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px;
  padding: 12px 20px; background: var(--ink); color: #fff; border-bottom: 5px solid var(--yellow);
  position: sticky; top: 0; z-index: 5;
}
.brand { font-weight: 900; letter-spacing: .14em; font-size: 18px; }
.brand span { color: var(--yellow); }
.top nav { display: flex; gap: 16px; flex-wrap: wrap; }
.top a { color: #fff; text-decoration: none; font-size: 14px; opacity: .85; }
.top a:hover { opacity: 1; color: var(--yellow); }

main { max-width: 860px; margin: 0 auto; padding: 20px 16px 80px; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; margin-bottom: 18px; border-left: 6px solid var(--yellow);
}
h2 { margin: 0 0 4px; font-size: 22px; text-transform: uppercase; letter-spacing: .04em; }
h3 { margin: 24px 0 4px; font-size: 17px; }
.hint { color: var(--muted); font-size: 14px; margin: 0 0 12px; }
.opt { color: var(--muted); font-weight: 400; font-size: 13px; }
.count { margin: 8px 0 0; font-size: 14px; color: var(--muted); font-weight: 600; }
.count.bad { color: var(--red); }

label { display: block; font-weight: 600; font-size: 14px; margin: 10px 0 0; }
input, select, textarea {
  display: block; width: 100%; margin-top: 4px; padding: 9px 10px; font: inherit;
  border: 1px solid #b9b4a4; border-radius: 6px; background: #fff; color: var(--ink);
}
input:focus, select:focus, textarea:focus { outline: 3px solid rgba(247,198,0,.55); border-color: var(--ink); }
textarea { resize: vertical; }
.row { display: flex; gap: 10px; flex-wrap: wrap; }
.row label { flex: 1 1 140px; }
.row label.grow { flex: 3 1 220px; }
label.check { display: flex; align-items: center; gap: 8px; font-weight: 500; }
label.check input { width: auto; margin: 0; }

.station {
  position: relative; display: flex; gap: 12px; padding: 14px; margin-bottom: 12px;
  background: #fbfaf6; border: 1px solid var(--line); border-radius: 8px;
}
.stnum {
  flex: none; width: 34px; height: 34px; border-radius: 50%; background: var(--ink); color: var(--yellow);
  display: grid; place-items: center; font-weight: 800;
}
.stbody { flex: 1; min-width: 0; }
.stbody > label:first-child, .stbody .row:first-child label { margin-top: 0; }
.x {
  position: absolute; top: 6px; right: 8px; border: 0; background: none; font-size: 24px;
  line-height: 1; color: var(--muted); cursor: pointer;
}
.x:hover { color: var(--red); }

.teamrows { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.teamrow { display: flex; gap: 6px; align-items: center; }
.teamrow input { flex: 1; min-width: 0; margin: 0; }
.x.inline { position: static; flex: none; width: 40px; height: 40px; }

.btn {
  font: inherit; font-weight: 700; padding: 10px 18px; border-radius: 6px; cursor: pointer;
  border: 2px solid var(--ink); background: #fff; color: var(--ink);
}
.btn.primary { background: var(--yellow); }
.btn.primary:hover { background: #ffd21f; }
.btn.ghost { border-color: var(--line); font-weight: 600; }
.btn:hover { border-color: var(--ink); }
.go { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; border-left-color: var(--red); }
.errors { list-style: none; padding: 0; margin: 0; flex-basis: 100%; }
.errors li { color: var(--red); font-weight: 600; margin-top: 6px; }
.errors li.warn { color: #7a5a00; background: #fff6d1; padding: 6px 10px; border-radius: 6px; font-weight: 500; }
#plan .errors { margin-top: 12px; }

.printbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 12px 0; }
.scroll { overflow-x: auto; }
table.grid { border-collapse: collapse; font-size: 13px; width: 100%; }
table.grid th, table.grid td { border: 1px solid var(--line); padding: 6px 8px; text-align: left; vertical-align: top; }
table.grid thead th, table.grid tr:first-child th { background: var(--ink); color: #fff; }
table.grid tr th:first-child { background: #efece0; color: var(--ink); }
table.grid tr:first-child th:first-child { background: var(--ink); color: #fff; }
table.grid td.start { color: var(--muted); }
table.grid td.fin { background: #fff6d1; font-weight: 700; }

.place { border: 1px solid var(--line); border-radius: 8px; padding: 10px 14px; margin: 10px 0; }
.place h4 { margin: 0 0 4px; font-size: 16px; }
.place ul { margin: 0; padding-left: 20px; }


.chip { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.tl { display: inline-block; font-size: 11px; font-weight: 800; background: var(--ink); color: var(--yellow); border-radius: 4px; padding: 0 5px; }
.code { font-family: ui-monospace, Consolas, monospace; font-weight: 800; background: #efece0; border-radius: 4px; padding: 0 5px; }
.summary { display: flex; gap: 12px; flex-wrap: wrap; margin: 12px 0; }
.summary div { background: #fff6d1; border: 1px solid #ecd66b; border-radius: 8px; padding: 8px 14px; font-size: 14px; }
.summary b { font-size: 20px; margin-right: 4px; }
label.skip { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-weight: 500; }
label.skip input { width: 70px; margin: 0; }


.fb { --bwe: var(--bw, 0.26in); }
input[type=range] {
  -webkit-appearance: none; appearance: none; width: 100%; height: 44px; margin: 0; padding: 0; border: 0;
  background: transparent; cursor: pointer; touch-action: pan-y;
}
input[type=range]::-webkit-slider-runnable-track { height: 8px; border-radius: 4px; background: #d9d5c8; }
input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; width: 28px; height: 28px; margin-top: -10px; border-radius: 50%;
  background: var(--ink); border: 3px solid var(--yellow); box-shadow: 0 1px 3px rgba(0, 0, 0, .35);
}
input[type=range]::-moz-range-track { height: 8px; border-radius: 4px; background: #d9d5c8; }
input[type=range]::-moz-range-thumb {
  width: 22px; height: 22px; border-radius: 50%; background: var(--ink); border: 3px solid var(--yellow); box-shadow: 0 1px 3px rgba(0, 0, 0, .35);
}
input[type=range]:focus-visible { outline: 3px solid rgba(247, 198, 0, .6); outline-offset: 2px; border-radius: 6px; }
label.slider .sv { font-weight: 700; margin-left: 6px; }
label.slider .sl { display: flex; justify-content: space-between; font-size: 12px; font-weight: 500; color: var(--muted); }

/* ---------- Puzzles (shared by preview and print) ---------- */
.pz-row { align-items: flex-end; }
.pzbar { margin: 10px 0 0; }
.btn.small { padding: 5px 12px; font-size: 13px; }
.pzcard { border: 1px dashed #b9b4a4; border-radius: 8px; padding: 14px; background: #fff; margin-top: 6px; overflow-x: auto; }
.pzhint { font-size: 13px; color: var(--muted); margin: 8px 0 0; }
.pz-err { color: #7a5a00; background: #fff6d1; padding: 6px 10px; border-radius: 6px; font-size: 13px; margin: 8px 0 0; }
.pz-inst { font-size: 12px; margin: 0 0 6px; line-height: 1.3; }
.ws { display: flex; gap: 0.25in; align-items: flex-start; }
.ws-grid { border-collapse: collapse; flex: none; font-family: Consolas, ui-monospace, monospace; }
.ws-grid td { width: var(--cell); height: var(--cell); padding: 0; border: 0; text-align: center; vertical-align: middle;
  font-weight: 700; font-size: calc(var(--cell) * 0.62); line-height: 1; }
.ws-side { flex: 1; min-width: 1.4in; }
.ws-bank { list-style: none; margin: 0; padding: 0; columns: 2; column-gap: 0.2in; font-weight: 800; letter-spacing: .06em; font-size: 11pt; }
.ws-bank li { padding: 2px 0; break-inside: avoid; }
.fb-words { display: flex; flex-wrap: wrap; gap: 0.07in 0.2in; margin: 2px 0 8px; }
.fw { display: inline-flex; gap: 0.02in; }
.fl { width: var(--bwe, 0.26in); height: 0.25in; border-bottom: 2px solid #000; text-align: center;
  font-weight: 800; font-size: calc(var(--bwe, 0.26in) * 0.7); line-height: 0.25in; font-family: Consolas, ui-monospace, monospace; }
.fl.blank { background: rgba(0, 0, 0, .07); }
.fb-miss { display: flex; flex-wrap: wrap; gap: 3px; align-items: center; }
.fb-miss .lbl { flex: 0 0 100%; font-size: 7.5pt; letter-spacing: .1em; text-transform: uppercase; font-weight: 700; }
.ml { display: inline-grid; place-items: center; width: 0.24in; height: 0.24in; border: 1.5px solid #000; border-radius: 4px;
  font: 800 11pt Consolas, ui-monospace, monospace; }


/* ---------- Scrambled words and ciphers (shared by preview and print) ---------- */
.sc-rows { margin: 2px 0 0; }
.sc-rows.two { columns: 2; column-gap: 0.3in; }
.sc-row { display: flex; align-items: flex-end; gap: 0.12in; margin: 0 0 0.07in; break-inside: avoid; }
.sc-word { font: 800 14pt/1.1 Consolas, ui-monospace, monospace; letter-spacing: .14em; white-space: nowrap; }
.sc-ans { flex: 1; min-width: 0.6in; height: 0.2in; border-bottom: 2px solid #000; }
.cz-words { display: flex; flex-wrap: wrap; gap: 0.1in 0.24in; margin: 4px 0 8px; }
.cz-w { display: inline-flex; gap: 0.03in; }
.cz-cell { display: inline-flex; flex-direction: column; align-items: center; width: 0.27in; }
.cz-c { font: 800 11pt/1.2 Consolas, ui-monospace, monospace; }
.cz-a { width: 100%; height: 0.24in; border-bottom: 2px solid #000; }
.cz-text { display: flex; flex-wrap: wrap; gap: 0.08in 0.22in; font: 800 15pt/1.2 Consolas, ui-monospace, monospace; letter-spacing: .12em; margin: 4px 0; }
.cz-key { display: grid; grid-template-columns: repeat(13, 0.2in); width: 2.6in; margin-top: 0.06in;
  font: 700 8.5pt/1.5 Consolas, ui-monospace, monospace; text-align: center; }
.cz-key .kl { background: rgba(0, 0, 0, .09); font-weight: 800; }
.cz-key .kn { border-bottom: 1px solid #000; margin-bottom: 3px; }

/* ---------- Locked box controls ---------- */
.lockcheck { margin-top: 16px; }
.notice { background: #fff2c2; border: 1px solid #ecd66b; border-left: 4px solid #e9a800; border-radius: 6px; padding: 10px 14px; margin-bottom: 12px; font-size: 14px; }
.remind { color: #8a5a00; font-weight: 600; font-size: 13px; margin: 8px 0 0; }
.boxbadge { margin-top: 10px; padding: 8px 12px; border-left: 4px solid var(--ink); background: #eef3f7; border-radius: 0 6px 6px 0; font-size: 14px; }
.boxask { margin-top: 10px; padding: 8px 12px; border: 1px dashed #e9a800; background: #fff9e0; border-radius: 6px; font-size: 14px; }
.boxask .btn { margin-top: 6px; }
.judge { font-size: 13px; font-weight: 600; margin: 4px 0 0; }
.judge.none { color: #2b6a3a; }
.judge.needed { color: #8a5a00; }
.lockbox { margin-top: 8px; padding: 4px 14px 12px; border-left: 4px solid var(--yellow); background: #fff9e0; border-radius: 0 8px 8px 0; }
.kflag { font-size: 12px; font-weight: 700; background: var(--ink); color: var(--yellow); border-radius: 4px; padding: 1px 6px; white-space: nowrap; }

.print-only { display: none; }

/* ---------- Print: US Letter ---------- */
/* Page margins are built into the content (padding, repeating spacers) instead of @page, so they print
   the same whatever the browser's margin setting is. */
@page { size: letter; margin: 0; }
/* ---------- Print layouts (kept outside @media print so they can be measured on screen) ---------- */
.print-only .sheet { display: grid; grid-template-rows: repeat(3, 1fr); box-sizing: border-box; width: 8.5in; height: 10.9in; padding: 0.7in; page-break-after: always; break-after: page; }
.print-only .irow { display: grid; grid-template-columns: 1fr 1fr; min-height: 0; }
.print-only .sheet:last-child { page-break-after: auto; break-after: auto; }
.print-only .insert { border: 1px dashed #888; padding: 0.18in; display: flex; flex-direction: column; break-inside: avoid; overflow: hidden; }
.print-only .insert { border-top: 0.14in solid var(--tc, #000); }
.print-only .ins-top { display: flex; justify-content: space-between; align-items: baseline; font-weight: 900; letter-spacing: .12em; font-size: 10pt; border-bottom: 3px solid #000; padding-bottom: 4px; }
.print-only .ins-code { font-size: 20pt; letter-spacing: 0; font-family: Consolas, ui-monospace, monospace; }
.print-only .ins-clue { flex: 1; font-size: calc(13pt * var(--fit, 1)); line-height: 1.35; padding: 0.12in 0; font-family: Georgia, serif; }
.print-only .ins-clue.empty { color: #b00; font-style: italic; }
.print-only .ins-clue.intro { flex: none; font-size: calc(9pt * var(--fit, 1)); font-style: italic; line-height: 1.25; padding: 0.03in 0 0.05in; }
.print-only .ins-puzzle { flex: 1; min-width: 0; min-height: 0; overflow: hidden; display: flex; align-items: center; }
.print-only .ins-puzzle .pz-inst { font-size: calc(8.5pt * var(--fit, 1)); }
.print-only .ins-puzzle > div { width: 100%; zoom: var(--fit, 1); }
  /* Word searches: full-width card, code and note in a left column */
.print-only .insert.wide { grid-column: 1 / -1; flex-direction: row; gap: 0.2in; }
.print-only .w-side { flex: 0 0 1.5in; display: flex; flex-direction: column; border-right: 3px solid #000; padding-right: 0.12in; }
.print-only .w-side .ins-code { font-size: 28pt; line-height: 1.1; font-family: Consolas, ui-monospace, monospace; font-weight: 900; }
.print-only .w-label { font-weight: 900; letter-spacing: .1em; font-size: 8pt; }
.print-only .w-side .ins-host { margin-top: auto; }
.print-only .ins-host { font-size: 7.5pt; color: #444; border-top: 1px solid #aaa; padding-top: 4px; line-height: 1.3; }
.print-only .hostpage { font-size: 11pt; }
.print-only .hostpage h1 { margin: 0 0 4px; }
.print-only .hostpage h2 { margin: 18px 0 6px; font-size: 14pt; text-transform: none; letter-spacing: 0; border-bottom: 2px solid #000; }
.print-only .checklist { padding-left: 20px; }
.print-only .checklist li { margin-bottom: 10px; break-inside: avoid; }
.print-only .pt { font-size: 10pt; color: #333; }
.print-only .pe { font-size: 10pt; }
.print-only table.grid { font-size: 9pt; }
  /* Labels: 30-up (Avery 5160 and compatibles): 2-5/8" x 1", 3 across, 10 down */
.print-only .lsheet { display: grid; grid-template-columns: repeat(3, 2.625in); column-gap: 0.125in; grid-template-rows: repeat(10, 1in); align-content: start; box-sizing: border-box; width: 8.5in; height: 10.9in; padding: 0.5in 0.1875in 0; page-break-after: always; break-after: page; }
.print-only .lsheet:last-child { page-break-after: auto; break-after: auto; }
.print-only .label { display: flex; align-items: center; gap: 0.08in; padding: 0 0.1in 0 0; overflow: hidden; border-left: 0.16in solid var(--tc, #000); }
.print-only .label.blank { border-left: 0; }
.print-only .lb-code { font: 800 22pt/1 Consolas, ui-monospace, monospace; padding-left: 0.08in; }
.print-only .lb-main { min-width: 0; }
.print-only .lb-team { font-weight: 800; font-size: 13pt; line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.print-only .lb-at { font-size: 6.5pt; color: #555; margin-top: 2px; }
  /* Bag slips */
.print-only .signsheet { display: flex; flex-direction: column; gap: 0.25in; box-sizing: border-box; width: 8.5in; height: 10.9in; padding: 0.7in; page-break-after: always; break-after: page; }
.print-only .signsheet:last-child { page-break-after: auto; break-after: auto; }
.print-only table.flow { width: 100%; border-collapse: collapse; }
.print-only table.flow > thead > tr > td, .print-only table.flow > tfoot > tr > td { padding: 0; }
.print-only table.flow .pad { height: 0.7in; }
.print-only table.flow > tbody > tr > td { padding: 0 0.7in; vertical-align: top; }
.print-only .sign { border: 3px solid #000; padding: 0.3in; flex: 1; min-height: 0; break-inside: avoid; display: flex; flex-direction: column; }
.print-only .sign-eyebrow { font-size: 10pt; letter-spacing: .2em; font-weight: 800; color: #555; }
.print-only .sign-title { font-size: 28pt; line-height: 1.1; font-weight: 800; margin: 4px 0 12px; }
.print-only .sign-body { font-size: 16pt; line-height: 1.4; }
.print-only .sign-lock { font-size: 13pt; font-weight: 700; border: 2px solid #000; padding: 8px 10px; margin-top: 14px; }
.print-only .sign-foot { margin-top: auto; font-size: 12pt; border-top: 2px solid #000; padding-top: 8px; }
.print-only .sign-host { font-size: 8pt; color: #777; margin-top: 4px; }
.print-only .setup { margin: 0; padding-left: 1.1em; }
.print-only .setup li { margin-bottom: 6px; }
.print-only .setup .su { font-size: 10pt; color: #333; }
.print-only .bagpage { display: grid; grid-template-columns: 1fr 1fr; gap: 0.2in; align-items: stretch; }
.print-only .bag { border: 2px dashed #555; padding: 0.14in; break-inside: avoid; }
.print-only .bag.finale { border-style: solid; }
.print-only .bag-head { display: flex; flex-direction: column; border-bottom: 2px solid #000; padding-bottom: 4px; }
.print-only .bag-n { font-size: 8pt; letter-spacing: .12em; font-weight: 800; color: #555; }
.print-only .bag-title { font-size: 15pt; line-height: 1.15; }
.print-only .bag-meta { font-size: 9pt; color: #444; margin: 4px 0; }
.print-only .bag-task { font-size: 9pt; margin-bottom: 6px; }
.print-only .bag-list { list-style: none; margin: 0; padding: 0; }
.print-only .bag-list li { display: flex; align-items: center; gap: 4px; font-size: 11pt; padding: 3px 0; border-bottom: 1px solid #ddd; }
.print-only .box { width: 12px; height: 12px; border: 2px solid #000; flex: none; margin-right: 4px; }
.print-only .bc { font-family: Consolas, ui-monospace, monospace; min-width: 2.6em; }
.print-only .bl { margin-left: auto; font-size: 8pt; color: #666; text-align: right; }
.print-only .chip { width: 10px; height: 10px; }
  /* Keys and locked boxes */
.print-only .ins-key { font-size: calc(9pt * var(--fit, 1)); font-weight: 700; border: 2px solid #000; border-radius: 4px; padding: 0.04in 0.08in; margin: 0.06in 0 0; }
.print-only .w-key { font-size: calc(8.5pt * var(--fit, 1)); font-weight: 700; border: 2px solid #000; border-radius: 4px; padding: 0.04in 0.06in; margin: 0.05in 0; line-height: 1.25; }
.print-only .w-side .ins-clue.intro { flex: 0 1 auto; overflow: hidden; min-height: 0; }
.print-only .lb-extra { font-size: 6.5pt; font-weight: 800; letter-spacing: .04em; margin-top: 1px; }
.print-only .bag-list li { flex-wrap: wrap; }
.print-only .keyline { flex: 0 0 100%; display: flex; align-items: center; gap: 4px; font-size: 9pt; padding: 2px 0 0 18px; }
.print-only .lockblock { margin: 8px 0 14px; break-inside: avoid; }
.print-only .lk-title { font-weight: 800; font-size: 11pt; }
.print-only .lk-meta { font-size: 9.5pt; color: #333; margin: 2px 0 6px; }
.print-only .locktable { width: 100%; border-collapse: collapse; font-size: 10pt; }
.print-only .locktable th { text-align: left; font-size: 8.5pt; text-transform: uppercase; letter-spacing: .06em; border-bottom: 2px solid #000; padding: 3px 8px 3px 0; }
.print-only .locktable td { padding: 5px 8px 5px 0; border-bottom: 1px solid #ccc; vertical-align: top; }
.print-only .locktable td.ck { width: 22px; }
.print-only .locktable .sub { display: block; font-size: 8.5pt; color: #555; }
.print-only .locktable .box { display: block; margin: 2px 0 0; }
  /* Headings stay with what follows them; short blocks do not split across pages. */
.print-only .hostpage h1,
.print-only .hostpage h2 { break-after: avoid; page-break-after: avoid; }
.print-only .hostpage ol,
.print-only .hostpage ul,
.print-only .hostpage table,
.print-only .hostpage p { orphans: 3; widows: 3; }
.print-only .hostpage .keep { break-inside: avoid; page-break-inside: avoid; }
.print-only .hostpage .setup li,
.print-only .hostpage .prep li,
.print-only .hostpage .checklist li { break-inside: avoid; }
.print-only .prep { padding-left: 20px; }
.print-only .teams { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.print-only .tm { white-space: nowrap; }

@media print {
  html, body { margin: 0; background: #fff; }
  .no-print { display: none !important; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  body[data-print="inserts"] #printInserts,
  body[data-print="labels"] #printLabels,
  body[data-print="bags"] #printBags,
  body[data-print="signs"] #printSigns,
  body[data-print="host"] #printHost,
  body[data-print="kit"] .print-only { display: block; }
  body[data-print="kit"] .print-only:empty { display: none; }
  body[data-print="kit"] .print-only { break-after: page; page-break-after: always; }
  body[data-print="kit"] .print-only:last-of-type { break-after: auto; page-break-after: auto; }
}

/* ---------- Phones ---------- */
.act-blurb { margin-top: 2px; }
.shop h4 { margin: 14px 0 4px; }
.shoplist { list-style: none; margin: 0; padding: 0; }
.shop-row { display: grid; grid-template-columns: 1fr auto auto; gap: 2px 12px; align-items: center; padding: 8px 0; border-bottom: 1px solid #e4dfce; }
.shop-have { display: flex; gap: 8px; align-items: center; font-weight: 600; }
.shop-have input { width: 20px; height: 20px; flex: none; }
.shop-qty { font-weight: 700; }
.shop-for { grid-column: 1 / 3; font-size: 13px; color: #6b6657; }
.shop-link { grid-column: 3; grid-row: 2; text-decoration: none; }
.shop-row.have .shop-name { text-decoration: line-through; color: #8a8576; }
.shop-row.have .shop-link { display: none; }
.disclosure { font-size: 12px; }
@media screen and (max-width: 600px) {
  .shop-row { grid-template-columns: 1fr auto; }
  .shop-for { grid-column: 1 / 3; }
  .shop-link { grid-column: 1 / 3; grid-row: auto; text-align: center; }
  main { padding: 12px 10px 60px; }
  .card { padding: 14px; }
  .top { padding: 10px 14px; }
  .station { flex-direction: column; gap: 6px; padding: 12px; }
  .stnum { flex: none; width: 28px; height: 28px; font-size: 14px; }
  .stbody > label:first-child { margin-top: 0; }
  .x { top: 8px; right: 10px; width: 36px; height: 36px; }
  .btn { padding: 12px 18px; }
  .btn.small { padding: 9px 14px; }
  .go .btn, .printbar .btn { flex: 1 1 100%; }
  /* Puzzle previews: shrink boxes so the longest word fits, stack the word search */
  .pzcard { padding: 10px; }
  .pzcard .fb { --bwe: min(var(--bw), calc((100vw - 110px) / var(--n, 8) - 2px)); }
  .pzcard .ws { flex-direction: column; gap: 12px; }
  .pzcard .ws-grid { max-width: 100%; }
}

/* ---------- Message chips, live preview, welcome ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: -4px 0 10px; }
.chips:empty { display: none; }
.chiplabel { font-size: 13px; color: #6b6657; }
.chipbtn { font: inherit; font-size: 13px; padding: 5px 10px; border: 1px solid #cfc9b6; border-radius: 999px; background: #fff; cursor: pointer; min-height: 32px; }
.chipbtn:hover { border-color: var(--ink); }
.linkbtn { font: inherit; background: none; border: 0; color: #0b5cad; cursor: pointer; padding: 6px 0; margin: 0 0 8px; text-decoration: underline; }
.pvwrap { margin-top: 14px; }
.pvlabel { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #6b6657; margin-bottom: 6px; }
.print-only.pv { display: block; overflow-x: auto; padding-bottom: 4px; }
.pv .pv-card { width: 3.55in; }
.pv .pv-card.wide { width: 7.1in; }
.pv .insert { height: 3.2in; background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.12); }
.welcome { border-left: 5px solid var(--ink); }
.welcome-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
@media screen and (max-width: 600px) {
  .pv .pv-card { zoom: 0.8; }
  .pv .pv-card.wide { zoom: 0.5; }
}
.pvcap { font-size: 13px; color: #6b6657; margin: -2px 0 8px; }
.pvcap:empty { display: none; }

/* Station reordering, helper/capacity fields, waiting rule on signs, spare spots */
.stside { display: flex; flex-direction: column; align-items: center; gap: 6px; flex: 0 0 34px; }
.stctl { display: flex; flex-direction: column; gap: 4px; }
.mv { width: 30px; height: 26px; border: 1px solid var(--line); background: #fff; border-radius: 5px; font-size: 11px; line-height: 1; color: var(--ink); cursor: pointer; padding: 0; }
.mv:hover:not(:disabled) { border-color: var(--ink); }
.mv:disabled { opacity: .3; cursor: default; }
.staff { margin-top: 4px; }
.count.warnc { color: #9a5b00; }
.print-only .sign-wait { font-size: 12pt; font-weight: 700; margin-top: 12px; padding: 6px 10px; border: 2px dashed #000; }
@media screen and (max-width: 600px) {
  .stside { flex-direction: row; flex: none; gap: 10px; }
  .stctl { flex-direction: row; }
  .mv { width: 40px; height: 32px; }
}

.tdot { flex: none; width: 14px; height: 14px; border-radius: 50%; border: 1px solid rgba(0,0,0,.15); }

.fieldwarn { color: #b3261e; font-size: 13px; font-weight: 600; margin: 4px 0 0; }
.sublabel { font-weight: 700; margin: 14px 0 4px; }

.subhead { margin: 24px 0 8px; padding-top: 16px; border-top: 1px solid var(--line); }

/* Titles on every printout */
.print-only .sheet, .print-only .signsheet { position: relative; }
.print-only table.flow .pad { position: relative; }
.print-only .pg-title { position: absolute; top: 0.3in; left: 0.7in; right: 0.7in; display: flex; justify-content: space-between; align-items: baseline; gap: 0.2in; font-size: 9pt; line-height: 1.2; color: #333; }
.print-only .pg-title b { letter-spacing: .12em; font-size: 10.5pt; color: #000; white-space: nowrap; }
.print-only .pg-title span { flex: 1; }
.print-only .pg-title i { font-style: normal; color: #666; white-space: nowrap; }
.print-only .lb-title { grid-column: 1 / -1; display: flex; align-items: center; gap: 0.2in; padding: 0 0.1in; border-bottom: 2px solid #000; font-size: 11pt; overflow: hidden; }
.print-only .lb-title b { letter-spacing: .12em; font-size: 14pt; white-space: nowrap; }
.print-only .lb-title span { flex: 1; }
.print-only .lb-title i { font-style: normal; color: #555; white-space: nowrap; }


/* ---------- Accounts, saved hunts and sharing ---------- */
.acct { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.acct .who { font-size: 13px; opacity: .85; max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top .btn { padding: 5px 12px; font-size: 13px; border-color: #5d6470; background: transparent; color: #fff; }
.top .btn:hover { border-color: #fff; }
.top .btn.primary { background: var(--yellow); color: var(--ink); border-color: var(--yellow); }
.link { background: none; border: 0; padding: 0; font: inherit; color: #1f4e9e; text-decoration: underline; cursor: pointer; }

.toast {
  position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 30; max-width: min(92vw, 520px);
  background: var(--ink); color: #fff; padding: 10px 18px; border-radius: 8px; font-weight: 600; font-size: 14px;
  box-shadow: 0 6px 24px rgba(0,0,0,.3);
}

.dlg { border: 0; border-radius: 12px; padding: 0; width: min(92vw, 420px); color: var(--ink); box-shadow: 0 12px 48px rgba(0,0,0,.35); }
.dlg.wide { width: min(94vw, 620px); }
.dlg::backdrop { background: rgba(20,24,31,.55); }
.dlg-in { padding: 22px 22px 20px; border-top: 6px solid var(--yellow); border-radius: 12px; }
.dlg h2 { font-size: 20px; margin-bottom: 6px; }
.dlg .x { position: absolute; top: 10px; right: 12px; background: none; border: 0; font-size: 26px; line-height: 1; cursor: pointer; color: var(--muted); }
.dlg form { margin: 0; }
.dlg .btn { margin-top: 14px; }
.dlg .btn.block { width: 100%; }
.dlg .alt { margin: 14px 0 0; font-size: 14px; color: var(--muted); }
.dlg .alt .link { margin-right: 10px; }
.msg-err { color: var(--red); font-weight: 600; font-size: 14px; margin: 10px 0 0; }
.msg-ok { color: #2b6a3a; font-weight: 600; font-size: 14px; margin: 10px 0 0; }
.pwrow { display: flex; gap: 8px; align-items: center; }
.pwrow input { flex: 1; }
.pwshow { margin-top: 4px; font-weight: 500; font-size: 13px; display: flex; align-items: center; gap: 6px; }
.pwshow input { width: auto; margin: 0; }

.savepanel { margin: 14px 0 0; padding: 14px 16px; border: 1px solid var(--line); border-radius: 8px; background: #fbfaf6; }
.savepanel h3 { margin: 0 0 4px; }
.savepanel.nudge { background: #fff6d1; border-color: #ecd66b; }
.savepanel .printbar { margin: 10px 0 0; }
.savepanel .hint { margin: 8px 0 0; }
.savepanel .state-ok { color: #2b6a3a; font-weight: 600; }
.savepanel .state-dirty { color: #8a5a00; font-weight: 600; }
.sharebox { margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--line); }
.sharebox h4 { margin: 0 0 4px; font-size: 15px; }
.sharerow { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 8px; }
.sharerow input { flex: 1 1 240px; margin: 0; font-size: 13px; }
.sharerow .btn { margin: 0; }

.hlist { list-style: none; margin: 12px 0 0; padding: 0; max-height: 52vh; overflow: auto; }
.hlist li { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 10px 0; border-top: 1px solid var(--line); }
.hlist li:first-child { border-top: 0; }
.hlist .hname { flex: 1 1 200px; min-width: 0; }
.hlist .hname b { display: block; overflow-wrap: anywhere; }
.hlist .hname span { font-size: 13px; color: var(--muted); }
.badge { display: inline-block; font-size: 11px; font-weight: 700; background: var(--ink); color: var(--yellow); border-radius: 4px; padding: 1px 6px; margin-left: 6px; vertical-align: middle; }
.hlist .btn { margin: 0; }
.shared-banner { border-left-color: var(--ink); background: #fff9e0; }
.shared-banner h2 { font-size: 18px; }
@media screen and (max-width: 600px) {
  .acct { width: 100%; }
  .toast { bottom: 12px; }
}
