/* Turnario — "tabellone turni": a ward roster board. Colour carries the data
   (one hue per shift, red only for public holidays); the chrome stays ink on white. */
:root {
  --ink: #1b1f24;
  --muted: #545d69;
  --line: #dde1e6;
  --line-strong: #b9c0c9;
  --panel: #f2f4f6;
  --bg: #ffffff;
  --red: #d0213b;
  --focus: #26338a;
  --M: #ffd23f; --M-ink: #3a2c00;
  --P: #ff8f4f; --P-ink: #3b1400;
  --N: #26338a; --N-ink: #ffffff;
  --G: #127a73; --G-ink: #ffffff;
  --S: #cfcbf2; --S-ink: #2a2466;
  --R: #e6f4df; --R-ink: #2d5a1d;
  --FE: #ffc9dc; --FE-ink: #6b1236;
  --MA: #dadde2; --MA-ink: #2b2f36;
  --round: ui-rounded, "SF Pro Rounded", "Arial Rounded MT Bold", "Segoe UI Variable Display", system-ui, sans-serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 12px; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.5 var(--sans); }
a { color: var(--focus); text-underline-offset: 3px; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -60px; background: var(--ink); color: #fff; padding: 10px 14px; z-index: 20; }
.skip:focus { top: 12px; }

/* shift colour classes (cells, chips, tiles) */
.c-M { background: var(--M); color: var(--M-ink); }
.c-P { background: var(--P); color: var(--P-ink); }
.c-N { background: var(--N); color: var(--N-ink); }
.c-G { background: var(--G); color: var(--G-ink); }
.c-S { background: var(--S); color: var(--S-ink); }
.c-R { background: var(--R); color: var(--R-ink); }
.c-FE { background: var(--FE); color: var(--FE-ink); }
.c-MA { background: var(--MA); color: var(--MA-ink); }

/* ---------- top ---------- */
.ribbon { display: grid; grid-template-columns: 2fr 2fr 2fr 3fr; height: 6px; }
.ribbon .m, .brand-mark .m { background: var(--M); }
.ribbon .p, .brand-mark .p { background: var(--P); }
.ribbon .n, .brand-mark .n { background: var(--N); }
.ribbon .r, .brand-mark .r { background: #b9e3a6; }
.top { max-width: 1400px; margin: 0 auto; padding: 10px 24px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font: 800 22px/1 var(--round); letter-spacing: -.01em; min-height: 44px; }
.brand-mark { display: grid; grid-template-columns: 12px 12px; gap: 2px; }
.brand-mark i { width: 12px; height: 12px; border-radius: 3px; }
.topnav { display: flex; gap: 4px; flex-wrap: wrap; }
.topnav a { color: var(--ink); text-decoration: none; padding: 10px 12px; border-radius: 8px; font-size: 15px; }
.topnav a:hover { background: var(--panel); }

.intro { max-width: 1400px; margin: 0 auto; padding: 4px 24px 14px; display: flex; align-items: flex-end; gap: 32px; }
h1 { font: 800 40px/1.05 var(--round); letter-spacing: -.02em; margin: 0; flex: 0 0 auto; }
.lead { margin: 0; color: var(--muted); font-size: 16px; max-width: 64ch; }

/* ---------- band (setup) ---------- */
.band { background: var(--panel); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.band-inner { max-width: 1400px; margin: 0 auto; padding: 10px 24px 12px; display: grid; gap: 8px; }
.band-inner > * { min-width: 0; }
.status-box { margin-left: auto; display: flex; align-items: center; gap: 4px 12px; flex-wrap: wrap; justify-content: flex-end; }
.status { margin: 0; font-size: 15px; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.tag { display: inline-block; background: var(--ink); color: #fff; font: 800 12px/1 var(--round); letter-spacing: .08em; text-transform: uppercase; padding: 6px 9px; border-radius: 6px; }
.tag.saved { background: #2d5a1d; }
.link-btn { background: none; border: 0; padding: 8px 4px; min-height: 40px; color: var(--focus); text-decoration: underline; text-underline-offset: 3px; font-size: 15px; }
.link-btn.danger { color: var(--red); }
.row-label { font-size: 13px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; min-width: 104px; }
.people-row, .preset-row { display: flex; align-items: center; gap: 10px; }
.people { display: flex; gap: 6px; flex-wrap: wrap; min-width: 0; }
.person { min-height: 40px; padding: 6px 14px; border: 1px solid var(--line-strong); background: #fff; border-radius: 999px; font-weight: 600; font-size: 15px; }
.person[aria-selected="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }
.add-person { min-height: 40px; padding: 6px 12px; border: 1px dashed var(--line-strong); background: transparent; border-radius: 999px; font-size: 15px; color: var(--muted); }
.add-person:disabled { opacity: .45; cursor: not-allowed; }
.presets { display: flex; gap: 6px; flex-wrap: wrap; min-width: 0; }
.preset { min-height: 44px; display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px 6px 14px; border: 1px solid var(--line-strong); background: #fff; border-radius: 10px; font-weight: 700; font-size: 15px; }
.preset .mini { display: inline-flex; gap: 2px; }
.preset .mini i { width: 7px; height: 16px; border-radius: 2px; }
.preset[aria-pressed="true"] { border-color: var(--ink); box-shadow: inset 0 0 0 2px var(--ink); }
.preset:hover { border-color: var(--ink); }
.preset-desc { margin: 0 0 0 114px; font-size: 15px; color: var(--ink); max-width: 110ch; }
.preset-desc .d-short { display: none; }

.editor { border-top: 1px solid var(--line); padding-top: 8px; }
.editor > summary { list-style: none; cursor: pointer; display: flex; gap: 10px; align-items: center; min-height: 40px; font-weight: 700; font-size: 15px; }
.editor > summary::-webkit-details-marker { display: none; }
.editor > summary::before { content: "▸"; display: inline-block; transition: transform .15s; }
.editor[open] > summary::before { transform: rotate(90deg); }
.editor > summary b { font-weight: 500; color: var(--muted); font-family: var(--mono); font-size: 14px; }
.editor-grid { display: grid; grid-template-columns: minmax(0, 1.8fr) minmax(260px, 1fr) minmax(180px, .7fr); gap: 24px; padding: 4px 0 0; }
.field-seq { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.field-seq > label, .field-seq > .help, .field-seq > .err { flex: 0 0 100%; }
.field-seq > label { margin-bottom: 0; }
.field-seq #cycle { flex: 1 1 160px; margin-top: 0; }
@media (min-width: 761px) {
  .editor > summary { display: none; }
  .editor { padding-top: 10px; }
}
.field label, .exp-line label { display: block; font-weight: 700; font-size: 14px; margin-bottom: 6px; }
input[type="text"], input[type="date"], input[type="time"], input[type="number"], select {
  min-height: 44px; border: 1px solid var(--line-strong); border-radius: 8px; background: #fff; padding: 8px 10px; font-size: 16px; width: 100%;
}
input[aria-invalid="true"] { border-color: var(--red); box-shadow: 0 0 0 2px #f6c9d0; }
#cycle { font-family: var(--mono); letter-spacing: .02em; }
.seq { display: flex; flex-wrap: wrap; gap: 4px; }
.tile { width: 40px; height: 40px; border: 0; border-radius: 8px; font: 800 17px/1 var(--round); display: inline-grid; place-items: center; }
.tile:hover { filter: brightness(.95); }
.tile-op { background: #fff; border: 1px solid var(--line-strong); color: var(--ink); font-size: 20px; }
.tile-op:disabled { opacity: .4; cursor: not-allowed; }
.date-row { display: flex; gap: 6px; }
.date-row input { flex: 1; min-width: 0; }
.nudge { min-width: 48px; min-height: 44px; border: 1px solid var(--line-strong); background: #fff; border-radius: 8px; font-weight: 700; font-family: var(--mono); }
.help { margin: 6px 0 0; font-size: 13px; color: var(--muted); }
.err { margin: 6px 0 0; font-size: 14px; color: var(--red); font-weight: 600; }
.field-name .link-btn { margin-top: 4px; }

/* ---------- board ---------- */
.board { max-width: 1400px; margin: 0 auto; padding: 12px 24px 40px; display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 28px; align-items: start; }
.cal-col, .rail { min-width: 0; }
.cal-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.views { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 10px; overflow: hidden; }
.views button { min-height: 40px; padding: 6px 16px; border: 0; background: #fff; font-weight: 600; font-size: 15px; }
.views button + button { border-left: 1px solid var(--line-strong); }
.views button[aria-selected="true"] { background: var(--ink); color: #fff; }
.month-nav { display: flex; align-items: center; gap: 6px; }
.month-nav h2 { font: 800 26px/1 var(--round); margin: 0 6px; min-width: 7.5em; text-align: center; letter-spacing: -.01em; }
.month-nav button { min-width: 44px; min-height: 44px; border: 1px solid var(--line-strong); background: #fff; border-radius: 10px; font-size: 22px; line-height: 1; }
.month-nav .today-btn { font-size: 15px; font-weight: 600; padding: 0 14px; }
.big-err { padding: 10px 12px; border-left: 4px solid var(--red); background: #fdeef0; color: #8a1023; }

.weekdays { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin-bottom: 4px; }
.weekdays span { font-size: 13px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; padding-left: 8px; }
.weekdays .sun { color: var(--red); }
.calendar { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.calendar.dim { min-height: 200px; background: repeating-linear-gradient(-45deg, #f6f7f9 0 10px, #fff 10px 20px); border-radius: 8px; }
.day { position: relative; min-height: 78px; border: 0; border-radius: 8px; padding: 6px 8px; text-align: left; display: grid; grid-template-rows: auto 1fr auto; align-items: start; font: inherit; overflow: hidden; }
.day.blank { background: transparent; }
.day:hover { filter: brightness(.96); }
.d-head { display: flex; align-items: baseline; gap: 6px; min-width: 0; }
.d-num { font: 800 16px/1.1 var(--round); }
.d-hol { font-size: 12px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.d-code { font: 800 26px/1 var(--round); align-self: center; justify-self: end; opacity: .9; }
.d-time { font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.d-extra { position: absolute; right: 6px; bottom: 6px; background: var(--ink); color: #fff; font-size: 12px; font-weight: 700; padding: 1px 6px; border-radius: 999px; }
.day.hol { box-shadow: inset 0 4px 0 var(--red); }
.day.hol .d-num, .day.sun .d-num { color: #9e0f24; }
.day.c-P.hol .d-num, .day.c-P.sun .d-num { color: var(--P-ink); text-decoration: underline; text-decoration-color: var(--red); text-decoration-thickness: 3px; }
.day.c-N.hol .d-num, .day.c-N.sun .d-num, .day.c-G.hol .d-num, .day.c-G.sun .d-num { color: #fff; text-decoration: underline; text-decoration-color: #ff8a9b; text-decoration-thickness: 3px; }
.day.edited::after { content: ""; position: absolute; inset: 3px; border: 2px dashed currentColor; border-radius: 6px; opacity: .55; pointer-events: none; }
.day.today { outline: 3px solid var(--ink); outline-offset: 1px; }
.day.today:focus-visible { outline-color: var(--focus); outline-width: 4px; }
.cal-hint { margin: 10px 0 0; font-size: 13px; color: var(--muted); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 10px; font-size: 14px; }
.lg { display: inline-flex; align-items: center; gap: 4px; }
.chip { display: inline-grid; place-items: center; min-width: 24px; height: 24px; padding: 0 4px; border-radius: 6px; font: 800 13px/1 var(--round); font-style: normal; }
.hol-chip { background: #fff; color: var(--red); box-shadow: inset 0 3px 0 var(--red), inset 0 0 0 1px var(--line-strong); }
.hol-list h3 { font-size: 15px; margin: 14px 0 4px; }
.hol-list ul { margin: 0; padding: 0; list-style: none; font-size: 15px; }
.hol-list li { padding: 4px 0; border-bottom: 1px solid var(--line); }
.hol-list li b { color: var(--red); display: inline-block; min-width: 4.2em; }

/* year view */
.year { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px 16px; }
.ymonth { min-width: 0; }
.ym-head { display: flex; width: 100%; justify-content: space-between; align-items: baseline; border: 0; background: none; padding: 4px 0; min-height: 40px; font: 800 17px/1 var(--round); border-bottom: 2px solid var(--ink); }
.ym-head small { font: 600 13px/1 var(--sans); color: var(--muted); }
.ymonth.cur .ym-head { color: var(--focus); border-color: var(--focus); }
.ym-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; margin-top: 6px; }
.ym-day { aspect-ratio: 1; display: grid; place-items: center; font-size: 12px; font-weight: 700; border-radius: 4px; font-variant-numeric: tabular-nums; }
.ym-day.hol { box-shadow: inset 0 0 0 2px var(--red); }
.ym-day.today { outline: 2px solid var(--ink); }

/* team view */
.team-tools { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.team-tools p { margin: 0; font-size: 14px; color: var(--muted); max-width: 60ch; }
.team-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: 8px; }
.team { border-collapse: separate; border-spacing: 2px; font-size: 13px; min-width: 100%; }
.team th, .team td { padding: 0; text-align: center; }
.team thead th { font-weight: 700; padding: 4px 0; min-width: 24px; line-height: 1.1; }
.team thead th small { display: block; font-weight: 500; color: var(--muted); font-size: 12px; }
.team thead th.hol, .team thead th.sun { color: var(--red); }
.team thead th.hol { background: #fbe3e7; border-radius: 4px; }
.team .tname { position: sticky; left: 0; background: #fff; text-align: left; padding: 0 8px 0 4px; white-space: nowrap; z-index: 1; font-weight: 700; }
.team tfoot .tname { font-weight: 500; color: var(--muted); font-size: 13px; }
.tn-btn { border: 0; background: none; font-weight: 700; padding: 8px 2px; min-height: 40px; text-align: left; }
.team tr.cur .tn-btn { text-decoration: underline; text-decoration-thickness: 3px; text-underline-offset: 4px; }
.team td { border-radius: 4px; }
.team td.hol { box-shadow: inset 0 3px 0 var(--red); }
.team td.edited { outline: 2px dashed rgba(0, 0, 0, .35); outline-offset: -3px; }
.tcell { width: 100%; min-width: 24px; height: 40px; border: 0; background: transparent; color: inherit; font: 800 13px/1 var(--round); }
.team .ttot { padding: 0 4px; white-space: nowrap; font-variant-numeric: tabular-nums; text-align: right; }
.team .cov { font-variant-numeric: tabular-nums; color: var(--muted); }
.team .cov.zero { color: var(--red); font-weight: 800; }
.terr { color: var(--red); text-align: left !important; padding: 0 8px !important; }

/* ---------- rail ---------- */
.rail { border-left: 1px solid var(--line); padding-left: 24px; display: grid; gap: 0; }
.rail-sec { padding: 14px 0; border-bottom: 1px solid var(--line); }
.rail-sec:first-child { padding-top: 0; }
.rail-h { font: 800 16px/1.3 var(--round); margin: 0 0 10px; }
.rail-h span { font: 500 14px/1.3 var(--sans); color: var(--muted); }
.today-sec { display: grid; gap: 6px; }
.td { display: flex; align-items: center; gap: 8px; font-size: 15px; }
.td-l { width: 4.4em; font-weight: 700; color: var(--muted); font-size: 13px; text-transform: uppercase; letter-spacing: .05em; }
.total { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.total strong { font: 800 38px/1 var(--round); letter-spacing: -.02em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.total span { font-size: 14px; color: var(--muted); line-height: 1.3; }
.total small { font-size: 13px; }
.kpis { display: grid; grid-template-columns: 1fr; margin: 0; }
.kpis div { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; padding: 5px 0; border-top: 1px solid var(--line); }
.kpis dt { font-size: 14px; color: var(--muted); }
.kpis dt small { font-size: 12px; }
.kpis dd { margin: 0; font: 800 16px/1.2 var(--round); font-variant-numeric: tabular-nums; white-space: nowrap; }
.reminders { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 14px; }
.reminders li { padding: 6px 10px; border-radius: 6px; }
.reminders .warn { background: #fff4d6; border-left: 4px solid #c98a00; }
.reminders .ok { background: var(--R); color: var(--R-ink); }
.fine { margin: 8px 0 0; font-size: 13px; color: var(--muted); }
.exp-line { margin-bottom: 8px; }
.exp-btns { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin-bottom: 14px; }
.btn { min-height: 44px; padding: 8px 16px; border-radius: 10px; font-weight: 700; font-size: 15px; border: 1px solid var(--ink); }
.btn.primary { background: var(--ink); color: #fff; }
.btn.primary:hover { background: #000; }
.btn.ghost { background: #fff; color: var(--ink); }
.btn.ghost:hover { background: var(--panel); }
.btn.wide { width: 100%; }
.check { display: flex; align-items: center; gap: 8px; min-height: 40px; font-size: 15px; margin-bottom: 6px; }
.check input { width: 20px; height: 20px; accent-color: var(--ink); }
.settings > summary { list-style: none; cursor: pointer; min-height: 40px; display: flex; align-items: center; margin: 0; }
.settings > summary::-webkit-details-marker { display: none; }
.settings > summary::after { content: "+"; margin-left: auto; font-size: 22px; font-weight: 400; }
.settings[open] > summary::after { content: "–"; }
.times { display: grid; gap: 8px; margin-top: 8px; }
.time-row { display: grid; grid-template-columns: 24px 1fr 92px 10px 92px; align-items: center; gap: 6px; font-size: 14px; }
.time-row input { padding: 6px; font-size: 15px; }
.time-row label { font-weight: 600; }
.patrono { display: grid; grid-template-columns: 110px 1fr; gap: 8px; margin-top: 14px; }
.patrono .help, .patrono .err { grid-column: 1 / -1; margin-top: 0; }
.undo { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 12px 10px 16px; border-radius: 10px; display: flex; gap: 12px; align-items: center; z-index: 30; font-size: 15px; max-width: calc(100% - 32px); }
.undo[hidden] { display: none; }
.offer { flex-wrap: wrap; justify-content: center; bottom: 76px; width: min(560px, calc(100% - 32px)); }
.offer-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.undo .alt { background: transparent; color: #fff; box-shadow: inset 0 0 0 2px #fff; }
.share-box { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.share-url { width: 100%; margin-top: 8px; font: 13px/1.4 var(--mono); padding: 8px; border: 1px solid var(--line-strong); border-radius: 8px; }
/* Space for content the script fills in, so the board does not jump on first paint. */
#people:empty { min-height: 40px; }
#presets:empty { min-height: 44px; }
#seq-tiles:empty { min-height: 40px; }
.preset-desc { min-height: 3em; min-height: 2lh; }
.calendar:empty { min-height: calc(5 * 78px + 4 * 4px); }
#today-box:empty { min-height: 69px; }
.undo button { background: #fff; color: var(--ink); border: 0; border-radius: 8px; min-height: 40px; padding: 4px 12px; font-weight: 700; }

/* ---------- dialog ---------- */
.day-dlg { border: 0; border-radius: 14px; padding: 0; width: min(520px, calc(100% - 24px)); color: var(--ink); }
.day-dlg::backdrop { background: rgba(27, 31, 36, .45); }
.day-dlg form { padding: 20px; }
.day-dlg h2 { font: 800 21px/1.2 var(--round); margin: 0 0 4px; }
.dlg-info { margin: 0 0 12px; color: var(--muted); font-size: 15px; }
.day-dlg fieldset { border: 0; padding: 0; margin: 0 0 14px; }
.day-dlg legend { font-weight: 700; font-size: 14px; margin-bottom: 8px; }
.dlg-codes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.dlg-opt { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 6px 10px; border-radius: 8px; font-weight: 600; font-size: 15px; cursor: pointer; border: 2px solid transparent; }
.dlg-opt.c-cycle { background: #fff; border-color: var(--line-strong); grid-column: 1 / -1; }
.dlg-opt input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.dlg-opt:has(input:checked) { border-color: var(--ink); box-shadow: 0 0 0 2px #fff inset; }
.dlg-opt:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 2px; }
.dlg-code { font: 800 15px/1 var(--round); min-width: 1.6em; }
.dlg-opt:has(input:checked) .dlg-code::after { content: " ✓"; }
.dlg-extra input { max-width: 160px; }
.dlg-btns { display: flex; gap: 8px; margin-top: 16px; }

/* ---------- guide sections ---------- */
.guide { max-width: 1400px; margin: 0 auto; padding: 36px 24px; border-top: 1px solid var(--line); }
.guide h2 { font: 800 28px/1.15 var(--round); letter-spacing: -.01em; margin: 0 0 8px; }
.guide-lead { margin: 0 0 20px; color: var(--muted); max-width: 80ch; }
.schemes { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 28px 32px; }
.schemes article { border-top: 3px solid var(--ink); padding-top: 12px; }
.schemes h3 { font: 800 19px/1.2 var(--round); margin: 0 0 8px; }
.schemes p { margin: 0 0 10px; font-size: 15px; }
.seqline { display: flex; gap: 3px; }
.seqline i { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 6px; font: 800 14px/1 var(--round); font-style: normal; }
.fest-tables { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; max-width: 900px; }
.fest { border-collapse: collapse; width: 100%; font-size: 15px; }
.fest caption { text-align: left; font: 800 20px/1 var(--round); padding-bottom: 8px; }
.fest th { text-align: left; font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; border-bottom: 2px solid var(--ink); padding: 6px 4px; }
.fest td { padding: 7px 4px; border-bottom: 1px solid var(--line); }
.fest td:first-child { font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--red); font-weight: 600; width: 42%; }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; }
.cols h3 { font: 800 19px/1.2 var(--round); margin: 0 0 8px; }
.cols ul { padding-left: 20px; margin: 0 0 12px; }
.cols li { margin-bottom: 8px; }
.ccnl { background: #fff4d6; border-left: 6px solid #c98a00; padding: 16px 20px; }
.ccnl p { margin: 0 0 10px; }
.faq details { border-bottom: 1px solid var(--line); max-width: 860px; }
.faq summary { cursor: pointer; padding: 12px 0; font-weight: 700; min-height: 44px; }
.faq details p { margin: 0 0 14px; }
.faq .btn { margin-top: 20px; }

/* ---------- footer ---------- */
.foot { border-top: 1px solid var(--line); padding: 20px 24px 28px; max-width: 1400px; margin: 0 auto; display: flex; flex-wrap: wrap; gap: 8px 16px; color: var(--muted); font-size: 14px; }
.foot-main { display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center; width: 100%; }
.foot-brand { font: 800 18px/1 var(--round); color: var(--ink); }
.foot-nav { display: flex; gap: 4px 16px; margin-left: auto; }
.foot-nav a, .foot .tw-xlinks a { color: var(--ink); display: inline-block; padding: 4px 0; }
/* The shared analytics script appends its own Privacy link to the footer; ours is already in .foot-nav */
.foot > a[href="/privacy"] { display: none; }

/* ---------- print (window.print) ---------- */
.print-sheet { display: none; }
@media print {
  @page { size: A4 landscape; margin: 10mm; }
  body > *:not(.print-sheet) { display: none !important; }
  .print-sheet { display: block; color: #000; }
  .print-sheet h1 { font: 800 20pt/1.1 var(--round); margin: 0 0 2mm; }
  .ps-sub { margin: 0 0 4mm; font-size: 10pt; }
  .ps-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 1.2mm; }
  .ps-wd { font-size: 9pt; text-transform: uppercase; }
  .ps-day { position: relative; height: 24mm; padding: 1.5mm 2mm; border-radius: 1.5mm; -webkit-print-color-adjust: exact; print-color-adjust: exact; display: grid; grid-template-rows: auto 1fr auto; }
  .ps-day.hol { box-shadow: inset 0 1.2mm 0 var(--red); }
  .ps-n { font-weight: 800; font-size: 11pt; }
  .ps-c { font: 800 16pt/1 var(--round); justify-self: end; align-self: center; }
  .ps-t { font-size: 8.5pt; }
  .ps-h { position: absolute; top: 2mm; right: 2mm; font-size: 7.5pt; font-weight: 700; max-width: 70%; text-align: right; }
  .ps-foot { font-size: 8pt; margin-top: 3mm; }
}

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  .board { grid-template-columns: minmax(0, 1fr); }
  .rail { border-left: 0; padding-left: 0; grid-template-columns: 1fr 1fr; gap: 0 28px; }
  .rail-sec:first-child { padding-top: 14px; }
  .year { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .intro { flex-direction: column; align-items: flex-start; gap: 6px; }
}
@media (max-width: 900px) {
  .editor-grid { grid-template-columns: 1fr 1fr; }
  .field-seq { grid-column: 1 / -1; }
  .preset-desc { margin-left: 0; }
}
@media (max-width: 760px) {
  body { font-size: 16px; }
  .top { padding: 6px 16px; }
  .topnav { display: none; }
  .intro { padding: 2px 16px 10px; }
  h1 { font-size: 27px; }
  .lead { font-size: 15px; }
  .band-inner { padding: 8px 16px 10px; gap: 8px; }
  .row-label { min-width: 0; font-size: 12px; }
  .people-row, .preset-row { flex-wrap: nowrap; }
  .people-row .row-label, .preset-row .row-label { display: none; }
  .people, .presets { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding: 2px; margin: -2px; }
  .people::-webkit-scrollbar, .presets::-webkit-scrollbar { display: none; }
  .person, .preset { flex: 0 0 auto; }
  .add-person { flex: 0 0 auto; }
  .preset-desc { font-size: 14px; }
  .preset-desc .d-short { display: inline; }
  .preset-desc .d-long { display: none; }
  .lead { display: none; }
  #status-text { display: none; }
  .status { font-size: 14px; }
  .people-row { flex-wrap: wrap; }
  .status-box { margin-left: 0; order: -1; width: 100%; justify-content: space-between; flex-wrap: nowrap; }
  .status-box .link-btn { flex: 0 0 auto; }
  .people-row .people { flex: 1 1 0; }
  .presets { flex: 1 1 auto; }
  .editor-grid { grid-template-columns: 1fr; gap: 14px; }
  .board { padding: 10px 16px 32px; }
  .cal-bar { gap: 8px; }
  .views { order: 2; width: 100%; }
  .views button { flex: 1; }
  .month-nav { width: 100%; justify-content: space-between; }
  .month-nav h2 { font-size: 21px; min-width: 0; flex: 1; }
  .weekdays { gap: 3px; }
  .weekdays span { font-size: 12px; padding-left: 0; text-align: center; letter-spacing: 0; }
  .calendar { gap: 3px; }
  .day { min-height: 54px; padding: 3px 4px; border-radius: 6px; grid-template-rows: auto 1fr; }
  .calendar:empty { min-height: calc(5 * 54px + 4 * 3px); }
  #people:empty { min-height: 44px; }
  #presets:empty { min-height: 48px; }
  .d-num { font-size: 14px; }
  .d-hol, .d-time { display: none; }
  .d-code { font-size: 19px; justify-self: center; }
  .d-extra { right: 2px; top: 2px; bottom: auto; font-size: 12px; padding: 0 4px; line-height: 16px; }
  .d-extra .u { display: none; }
  .day.hol { box-shadow: inset 0 3px 0 var(--red); }
  .day.edited::after { inset: 2px; }
  .rail { grid-template-columns: 1fr; }
  .time-row { grid-template-columns: 24px 1fr 84px 10px 84px; }
  .year { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 12px; }
  .ym-day { font-size: 12px; }
  .dlg-codes { grid-template-columns: repeat(2, 1fr); }
  .guide { padding: 28px 16px; }
  .guide h2 { font-size: 23px; }
  .fest-tables, .cols { grid-template-columns: 1fr; gap: 24px; }
  .foot { padding: 20px 16px 28px; }
  .foot-nav { margin-left: 0; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

/* ---------- about / privacy ---------- */
.page { max-width: 760px; margin: 0 auto; padding: 24px 24px 48px; }
.page .kicker { margin: 0 0 6px; font: 800 13px/1 var(--round); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.page h1 { font-size: 36px; margin-bottom: 14px; }
.page-lead { font-size: 18px; color: var(--muted); margin: 0 0 24px; }
.page h2 { font: 800 21px/1.2 var(--round); margin: 28px 0 8px; }
.page li { margin-bottom: 6px; }
.page code { font-family: var(--mono); background: var(--panel); padding: 1px 6px; border-radius: 4px; font-size: 15px; }
.page .small { font-size: 14px; color: var(--muted); margin-top: 28px; }
@media (max-width: 760px) {
  .page { padding: 16px 16px 40px; }
  .page h1 { font-size: 28px; }
  .page-lead { font-size: 16px; }
}
