@font-face {
  font-family: "Courier Prime";
  src: url("fonts/courier-prime-700.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}
:root {
  --bg: #e9eef0;
  --paper: #ffffff;
  --ink: #172126;
  --muted: #4a5961;
  --line: #c4cfd4;
  --rule: #dfe6e9;
  --accent: #0b5866;
  --accent-ink: #ffffff;
  --accent-soft: #d8eaed;
  --stamp: #b1261c;
  --stamp-soft: #fbe9e7;
  --ok: #1d6a39;
  --ok-soft: #e3f3e8;
  --warn: #7a4b00;
  --warn-soft: #fdf1d8;
  --type: "Courier Prime", "Courier New", ui-monospace, monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --r: 6px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1417;
    --paper: #172025;
    --ink: #e4ebee;
    --muted: #a6b4bb;
    --line: #34444c;
    --rule: #26333a;
    --accent: #6cc0cc;
    --accent-ink: #0d1a1d;
    --accent-soft: #1d3a40;
    --stamp: #ff8f84;
    --stamp-soft: #3a1d1b;
    --ok: #86d7a0;
    --ok-soft: #173525;
    --warn: #f3c46b;
    --warn-soft: #3a2d12;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 17px/1.5 var(--sans); }
a { color: var(--accent); }
.wrap { max-width: 860px; margin: 0 auto; padding: 0 16px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: -999px; top: 0; background: var(--paper); padding: 8px 12px; z-index: 10; }
.skip-link:focus { left: 8px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }

.top { border-bottom: 3px solid var(--ink); background: var(--paper); }
.top-in { display: flex; align-items: center; min-height: 54px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font: 700 19px var(--type); }

.hero { padding-top: 22px; }
h1 { font: 700 clamp(28px, 6vw, 40px)/1.1 var(--type); margin: 0 0 10px; letter-spacing: -0.5px; }
.lede { margin: 0 0 18px; max-width: 62ch; color: var(--muted); }

/* holiday picker */
.holpick { display: grid; gap: 8px; }
.lbl { font-weight: 600; font-size: 15px; }
select, input[type="text"], input[type="number"], textarea {
  font: inherit; font-size: 17px; color: var(--ink); background: var(--paper);
  border: 1.5px solid var(--line); border-radius: var(--r); padding: 9px 10px; min-height: 44px; max-width: 100%;
}
#hol { font-weight: 600; width: 100%; max-width: 440px; }
.holinfo { display: grid; gap: 8px; margin-top: 2px; }
.hi-main { font-size: 18px; }
.hi-k { color: var(--muted); }
.hi-line { margin: 0; font-size: 15px; color: var(--muted); }
.stamp {
  justify-self: start; border: 2.5px solid var(--stamp); color: var(--stamp); border-radius: 4px;
  padding: 6px 12px; font-family: var(--type); font-size: 17px; line-height: 1.35; background: var(--paper);
}
.stamp strong { font-weight: 700; }
.st-k { text-transform: uppercase; letter-spacing: 1px; }
.st-when { display: block; font-family: var(--sans); font-size: 14px; }
.stamp.late { border-style: dashed; }

/* mode switch */
.modes { display: flex; margin: 20px 0 14px; border: 2px solid var(--ink); border-radius: var(--r); overflow: hidden; max-width: 440px; }
.mode { flex: 1 1 50%; position: relative; }
.mode input { position: absolute; opacity: 0; inset: 0; margin: 0; }
.mode span { display: flex; align-items: center; justify-content: center; min-height: 44px; padding: 6px 8px; font-weight: 600; font-size: 15px; text-align: center; cursor: pointer; }
.mode + .mode span { border-left: 2px solid var(--ink); }
.mode input:checked + span { background: var(--ink); color: var(--bg); }
.mode input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: -5px; }

.example-note { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 0 0 12px; padding: 10px 12px; border-left: 4px solid var(--accent); background: var(--accent-soft); font-size: 15px; }
.example-note p { margin: 0; }

/* result */
.result { display: grid; gap: 16px; margin-bottom: 26px; }
.empty { padding: 18px; background: var(--paper); border: 1.5px dashed var(--line); border-radius: var(--r); }
.empty p { margin: 0; }
.day { background: var(--paper); border-top: 5px solid var(--ink); border-radius: 2px; padding: 14px 14px 10px; box-shadow: 0 1px 0 var(--line); }
.day-h { font: 700 21px/1.25 var(--type); margin: 0 0 8px; }
.day-h { margin-bottom: 0; }
.d-tag { margin: 0 0 10px; font-weight: 600; font-size: 15px; color: var(--muted); }
.des-note { margin: 0 0 10px; font-size: 15px; color: var(--muted); }
.need { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-bottom: 10px; }
.need-l { font-weight: 600; font-size: 15px; }
.stepper { display: inline-flex; align-items: stretch; }
.step { width: 44px; min-height: 44px; font-size: 22px; line-height: 1; border: 1.5px solid var(--line); background: var(--bg); color: var(--ink); cursor: pointer; }
.step:first-child { border-radius: var(--r) 0 0 var(--r); }
.step:last-child { border-radius: 0 var(--r) var(--r) 0; }
.need-in { width: 64px; text-align: center; border-radius: 0; border-left: 0; border-right: 0; font-weight: 700; -moz-appearance: textfield; }
.need-in::-webkit-inner-spin-button, .need-in::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.need-hint { flex-basis: 100%; margin: -2px 0 0; font-size: 14px; color: var(--muted); }
.chk { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; font-size: 15px; cursor: pointer; }
.chk input { width: 20px; height: 20px; margin: 0; accent-color: var(--accent); flex: none; }
.short { font-size: 14px; color: var(--muted); }

.sched { list-style: none; margin: 0; padding: 0; }
.s-row { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; border-bottom: 1px solid var(--rule); }
.s-row.new-tier { border-top: 1px solid var(--line); }
.sched .s-row:first-child { border-top: 0; }
.s-n { flex: none; width: 28px; font: 700 18px/1.4 var(--type); color: var(--muted); text-align: right; }
.s-main { min-width: 0; }
.s-name { font-weight: 700; overflow-wrap: anywhere; }
.s-cat { font: 700 14px var(--type); color: var(--muted); white-space: nowrap; }
.s-why { display: block; font-size: 14.5px; color: var(--muted); line-height: 1.4; }
.g-head { padding: 9px 0 3px 38px; font-size: 14.5px; font-weight: 600; color: var(--muted); border-top: 1px solid var(--line); }
.sched .g-head:first-child { border-top: 0; padding-top: 2px; }
.g-head.forced { color: var(--stamp); }
.g-pick { font-weight: 400; }
.sched:not(.check) .s-row { padding: 4px 0; border-bottom: 0; }
.none { margin: 4px 0 8px; color: var(--muted); }
.choice, .info { margin: 10px 0 0; font-size: 15px; color: var(--muted); }
.warn { margin: 0 0 10px; padding: 8px 10px; background: var(--warn-soft); color: var(--warn); border-radius: var(--r); font-size: 15px; }
.off { margin-top: 8px; }
.off summary, .paste summary, .order-box summary, .skipped summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 15px; list-style: none; }
.off summary::-webkit-details-marker, .paste summary::-webkit-details-marker, .skipped summary::-webkit-details-marker, .order-box summary::-webkit-details-marker { display: none; }
.off summary::before, .paste summary::before, .skipped summary::before, .order-box summary::before { content: ""; width: 8px; height: 8px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-45deg); margin: 0 4px 0 2px; flex: none; }
.off[open] > summary::before, .paste[open] > summary::before, .skipped[open] > summary::before, .order-box[open] > summary::before { transform: rotate(45deg); }
.off-list { list-style: none; margin: 0 0 6px; padding: 0; }
.off-list li { padding: 5px 0; border-bottom: 1px solid var(--rule); font-size: 15px; }
.off-list .s-why { display: inline; }

/* check mode */
.check .s-row { align-items: center; }
.post-chk { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 44px; min-height: 44px; cursor: pointer; }
.post-chk input { width: 22px; height: 22px; margin: 0; accent-color: var(--ink); }
.check .s-row.is-bad { background: var(--stamp-soft); }
.check .s-row.is-bad .s-name { color: var(--stamp); }
.check .s-row.is-passed .s-why { color: var(--stamp); }
.verdict { margin: 4px 0 10px; padding: 10px 12px; border-radius: var(--r); font-size: 15.5px; }
.verdict p { margin: 0; }
.verdict.ok { background: var(--ok-soft); color: var(--ok); font-weight: 600; }
.verdict.neutral { background: var(--bg); color: var(--muted); }
.verdict.bad { background: var(--stamp-soft); color: var(--ink); border-left: 5px solid var(--stamp); }
.verdict.bad strong { color: var(--stamp); }
.viol { margin: 6px 0 0; padding-left: 20px; }
.viol li { margin: 4px 0; }
.skipped { margin: 4px 0 2px; }
.skipped summary { font-size: 14.5px; color: var(--ink); }
.skipped p { margin: 2px 0 0; font-size: 14.5px; }
.cite { display: block; font: 700 13.5px var(--type); color: var(--muted); }
.remedy { margin: 10px 0 4px; font-size: 14.5px; color: var(--muted); }

/* roster */
.h-tool { font: 700 24px/1.2 var(--type); margin: 8px 0 4px; }
.hint { margin: 0 0 10px; font-size: 15px; color: var(--muted); }
.roster { list-style: none; margin: 0; padding: 0; border-top: 2px solid var(--ink); }
.car {
  display: grid; grid-template-columns: 26px minmax(0, 1fr) auto auto; gap: 6px 8px; align-items: center;
  grid-template-areas: "sen nm cat btns" ". opts opts opts" ". vols vols vols";
  padding: 8px 0; border-bottom: 1px solid var(--line);
}
.car .sen { grid-area: sen; } .car .nm { grid-area: nm; } .car .cat { grid-area: cat; } .car .row-btns { grid-area: btns; }
.car .opts { grid-area: opts; } .car .vols { grid-area: vols; }
@media (max-width: 479px) { /* phones: name gets the full first line; type, day off, ODL and leave share the second; rows 2-3 use the full width */
  .car { grid-template-columns: 26px auto minmax(0, 1fr) auto; grid-template-areas: "sen nm nm btns" "cat cat opts opts" "vols vols vols vols"; }
  .car .opts { gap: 0 8px; } .car .opts .nsd { padding: 6px 4px; }
  .car .cat { align-self: start; }
}
@media (min-width: 760px) {
  .car { grid-template-columns: 26px minmax(140px, 1fr) auto auto auto; grid-template-areas: "sen nm cat opts btns" ". vols vols vols vols"; }
}
.sen { font: 700 16px var(--type); color: var(--muted); text-align: right; }
.car .nm { width: 100%; min-width: 0; }
.car .cat { padding-right: 4px; }
.row-btns { display: inline-flex; }
.ib { width: 40px; min-height: 44px; border: 0; background: transparent; color: var(--muted); font-size: 19px; cursor: pointer; border-radius: var(--r); }
.ib:hover { background: var(--bg); color: var(--ink); }
.ib:disabled { opacity: 0.3; cursor: default; background: transparent; }
.ib.del:hover { color: var(--stamp); }
.opts { display: flex; flex-wrap: wrap; align-items: center; gap: 0 14px; }
.opts .nsd { min-height: 40px; padding: 6px 8px; font-size: 16px; }
.opts .nsd.unset { border-color: var(--warn); }
.vols { display: flex; flex-wrap: wrap; align-items: center; gap: 0 10px; }
.vols-l { font-size: 14px; color: var(--muted); }
.vol-what { color: var(--muted); font-size: 13.5px; }
.roster-actions { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: flex-start; margin: 12px 0 18px; }
.paste { flex: 1 1 260px; }
.paste-body { display: grid; gap: 8px; padding-bottom: 8px; }
.paste-body label { font-size: 15px; }
.paste-body textarea { width: 100%; font-size: 16px; }
.paste-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.paste-msg { font-size: 15px; color: var(--muted); }

/* order editor */
.order-box { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin: 8px 0 18px; }
.o-title { font: 700 19px var(--type); }
.o-sum { font-weight: 500; color: var(--muted); }
.order-body { padding-bottom: 12px; }
.tiers { list-style: none; margin: 0 0 10px; padding: 0; }
.tier { padding: 8px 0 10px; border-bottom: 1px solid var(--rule); }
.tier-top { display: flex; align-items: center; gap: 8px; }
.tier-n { font: 700 20px var(--type); width: 24px; flex: none; }
.tier-name { flex: 1; font-weight: 600; font-size: 15.5px; min-width: 0; }
.tier-cats { display: flex; flex-wrap: wrap; gap: 0 10px; padding-left: 32px; }
.tier-sel { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; padding-left: 32px; max-width: 520px; }
.tier-sel select { font-size: 16px; min-height: 44px; padding: 6px 8px; width: 100%; }
@media (min-width: 700px) { .tier-sel { grid-template-columns: repeat(4, minmax(0, 1fr)); max-width: none; } }
.tier-actions { display: flex; flex-wrap: wrap; gap: 8px; }

.station { display: grid; gap: 6px; margin-bottom: 14px; max-width: 440px; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 8px 16px;
  font: 600 16px var(--sans); color: var(--ink); background: var(--paper); border: 1.5px solid var(--ink);
  border-radius: var(--r); cursor: pointer; text-decoration: none;
}
.btn:hover { background: var(--accent-soft); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.ghost { border-color: var(--line); }
.btn.danger { color: var(--stamp); }
.btn.small { min-height: 44px; padding: 6px 12px; font-size: 15px; }
.file-btn { position: relative; overflow: hidden; }
.file-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; font-size: 0; }
.file-btn:focus-within { outline: 3px solid var(--accent); outline-offset: 2px; }
.confirm { margin: 12px 0 0; padding: 12px 14px; border: 2px solid var(--stamp); border-radius: var(--r); background: var(--paper); }
.confirm p { margin: 0 0 10px; font-weight: 600; }
.confirm-btns { display: flex; gap: 10px; flex-wrap: wrap; }
.save-note { min-height: 1.5em; margin: 10px 0 0; font-size: 14.5px; color: var(--muted); }
.warn-t { color: var(--warn); }

.undo-bar {
  position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 20; display: flex; gap: 12px; align-items: center;
  background: var(--ink); color: var(--bg); padding: 6px 8px 6px 16px; border-radius: var(--r); max-width: calc(100% - 32px);
}
.undo-bar .btn { background: var(--bg); color: var(--ink); border-color: var(--bg); }

/* content */
.content { padding-top: 26px; padding-bottom: 30px; }
.content h2 { font: 700 24px/1.25 var(--type); margin: 26px 0 8px; }
.content p, .content li { max-width: 70ch; }
.steps { padding-left: 24px; }
.steps li { margin: 4px 0; }
.faq h3 { font-size: 17.5px; margin: 18px 0 4px; }
.faq p { margin: 0; }
.sources { font-size: 14.5px; color: var(--muted); margin: 14px 0 0; }

.foot { border-top: 3px solid var(--ink); background: var(--paper); padding: 18px 0 26px; font-size: 14.5px; color: var(--muted); }
.sb-footer p { margin: 6px 0; }

.print-root { display: none; }

@media (min-width: 700px) {
  .holinfo { grid-template-columns: auto auto; align-items: center; justify-content: start; gap: 8px 24px; }
  .hi-line { grid-column: 1 / -1; }
  .day { padding: 16px 20px 12px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }

/* ---------- print ---------- */
@page { margin: 14mm 13mm; }
@media print {
  :root { --ink: #000; --muted: #333; }
  body { background: #fff; color: #000; font: 10.5pt/1.35 var(--sans); }
  .top, .hero, .tool, .content, .foot, .undo-bar, .skip-link { display: none !important; }
  .print-root { display: block; }
  .p-head { border-bottom: 2pt solid #000; padding-bottom: 6pt; margin-bottom: 8pt; }
  .p-station { margin: 0; font-size: 11pt; font-weight: 600; }
  .p-title { font: 700 19pt/1.15 var(--type); margin: 3pt 0 4pt; }
  .p-sub { margin: 0; font-size: 10.5pt; }
  .p-day { margin: 0 0 12pt; }
  .p-day.p-keep { break-inside: avoid; }
  .p-day h3 { font: 700 13pt var(--type); margin: 10pt 0 3pt; break-after: avoid; }
  .p-note { margin: 0 0 4pt; font-size: 10pt; }
  .p-table { width: 100%; border-collapse: collapse; table-layout: fixed; margin: 2pt 0 4pt; }
  .p-table th, .p-table td { border: 0.75pt solid #555; padding: 3.5pt 5pt; text-align: left; vertical-align: top; font-size: 10pt; overflow-wrap: anywhere; }
  .p-table th { background: #eee; -webkit-print-color-adjust: exact; print-color-adjust: exact; font-size: 9.5pt; }
  .p-table tr { break-inside: avoid; }
  .p-table thead { display: table-header-group; }
  .p-table th { white-space: nowrap; }
  .p-table .c-n { width: 3.9em; }
  .p-table th:nth-child(2) { width: 30%; }
  .p-table .c-cat { width: 3.6em; }
  .p-table .c-post { width: 5.2em; text-align: center; }
  .p-table tr.blank td { height: 22pt; }
  .p-bad td { font-weight: 700; }
  .p-off { margin: 2pt 0 0; font-size: 10pt; }
  .p-find { margin: 4pt 0; padding: 4pt 6pt; border: 1.5pt solid #000; font-size: 10pt; break-inside: avoid; }
  .p-find p { margin: 0; }
  .p-find ul { margin: 3pt 0 0; padding-left: 14pt; }
  .p-foot { margin-top: 10pt; border-top: 1pt solid #000; padding-top: 6pt; font-size: 9.5pt; break-inside: avoid; break-before: avoid; }
  .p-foot p { margin: 0 0 6pt; }
  .p-sign { font-size: 11pt; margin-top: 14pt !important; }
  .p-small { font-size: 8.5pt; color: #333; }
}
