@font-face {
  font-family: "Secular One";
  src: url("fonts/secular-one-latin.woff2") format("woff2");
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2122, U+2212;
}

:root {
  --bg: #f5f4f2;
  --surface: #ffffff;
  --ink: #221a1d;
  --muted: #5d5256;
  --line: #ddd4d6;
  --wine: #6b1d33;
  --wine-2: #8d2a45;
  --wine-tint: #f6e9ed;
  --gold: #b7791f;
  --gold-tint: #fbf1dc;
  --done: #3b6b37;
  --done-tint: #e6f0e3;
  --shabbat: #ece9ee;
  --focus: #c98a12;
  --r: 6px;
  --head: "Secular One", "Trebuchet MS", system-ui, sans-serif;
  --body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #150c10;
    --surface: #20151a;
    --ink: #f2e9ec;
    --muted: #c3b3b9;
    --line: #3e2b33;
    --wine: #e48aa2;
    --wine-2: #f0a7ba;
    --wine-tint: #3a1a25;
    --gold: #e9b949;
    --gold-tint: #3a2c12;
    --done: #8fcf86;
    --done-tint: #1d3020;
    --shabbat: #2a2128;
    --focus: #e9b949;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 17px/1.5 var(--body); }
a { color: var(--wine); text-underline-offset: 2px; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 16px; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--surface); color: var(--ink); padding: 8px 12px; z-index: 50; }
.skip:focus { left: 8px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
[hidden] { display: none !important; }
h1, h2, h3 { font-family: var(--head); font-weight: 400; line-height: 1.15; letter-spacing: .005em; }

/* Header band with a row of matzah perforations along its lower edge */
.band { background: #6b1d33; color: #fff; padding: 14px 0 26px; position: relative; }
@media (prefers-color-scheme: dark) { .band { background: #3a1220; } }
.band::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 8px; height: 6px;
  background: radial-gradient(circle, rgba(255, 236, 200, .55) 2px, transparent 2.5px) 0 0 / 16px 6px repeat-x;
}
.brand { margin: 0 0 8px; display: flex; align-items: center; gap: 8px; font: 16px var(--head); color: #f6dfe5; }
.band h1 { margin: 0; font-size: clamp(30px, 6vw, 46px); }
.lede { margin: 6px 0 0; max-width: 62ch; color: #f7e8ec; font-size: 17px; }

/* Layout */
.app { display: grid; gap: 22px; padding-top: 18px; padding-bottom: 28px; }
@media (min-width: 1000px) {
  .app { grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); align-items: start; }
}
.plan { min-width: 0; }
.plan:focus { outline: none; }

/* Key dates */
.keydates { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: flex-start; }
.yearpick { display: flex; align-items: center; gap: 8px; font: 20px var(--head); color: var(--wine); }
.yearpick select { font: 600 17px var(--body); }
.fixed { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; flex: 1 1 300px; font-size: 16px; }
.fixed li { display: grid; grid-template-columns: 10.2em 1fr; gap: 8px; border-left: 3px solid var(--line); padding: 1px 0 1px 10px; }
.fixed li.key { border-left-color: var(--wine); }
.fixed b { font-weight: 600; }
@media (max-width: 420px) { .fixed { font-size: 15px; } .fixed li { grid-template-columns: 9.4em 1fr; gap: 6px; } }
@media (max-width: 359px) { .fixed li { grid-template-columns: 1fr; gap: 0; } }

.note-shabbat { margin-top: 12px; background: var(--gold-tint); border-left: 4px solid var(--gold); padding: 10px 12px; font-size: 16px; }
.note-shabbat p { margin: 0 0 6px; }
.note-shabbat p:last-child { margin: 0; }
.banner { margin-top: 12px; border: 2px solid var(--wine); border-radius: var(--r); padding: 10px 12px; background: var(--surface); }
.banner p { margin: 0 0 8px; }

.summary { margin: 14px 0 10px; font-size: 17px; }
.summary .big { font: 22px/1.25 var(--head); color: var(--ink); margin: 0 0 2px; }
.summary p { margin: 0; }
.short { border-left: 4px solid #b3261e; background: var(--surface); padding: 10px 12px; }
@media (prefers-color-scheme: dark) { .short { border-left-color: #ff8a80; } }
.short ul { margin: 6px 0 0; padding-left: 20px; }
.progress { height: 8px; background: var(--line); border-radius: 4px; overflow: hidden; margin-top: 8px; }
.progress span { display: block; height: 100%; background: var(--done); }

/* Tabs */
.tabs { display: flex; gap: 4px; border-bottom: 2px solid var(--wine); margin-top: 8px; }
.tabs button {
  font: 600 16px var(--body); color: var(--muted); background: none; border: 0; border-radius: var(--r) var(--r) 0 0;
  padding: 10px 14px; min-height: 44px; cursor: pointer;
}
.tabs button[aria-selected="true"] { background: var(--wine); color: #fff; }
@media (prefers-color-scheme: dark) { .tabs button[aria-selected="true"] { color: #1a0b10; } }
.view { background: var(--surface); border: 1px solid var(--line); border-top: 0; padding: 14px; min-height: 160px; }

/* Day lists */
.dayhead { font: 20px var(--head); margin: 0 0 4px; }
.daysub { margin: 0 0 10px; color: var(--muted); font-size: 16px; }
.who { font-weight: 700; font-size: 15px; color: var(--wine); margin: 12px 0 2px; }
.ticks { list-style: none; margin: 0; padding: 0; }
.ticks li { border-bottom: 1px solid var(--line); }
.ticks li:last-child { border-bottom: 0; }
.tick { display: flex; gap: 12px; align-items: flex-start; padding: 10px 2px; min-height: 44px; cursor: pointer; }
.tick input { width: 22px; height: 22px; margin: 2px 0 0; flex: none; accent-color: var(--done); }
.tick .t { flex: 1; min-width: 0; }
.tick .m { color: var(--muted); font-size: 15px; white-space: nowrap; }
.tick.done .t { text-decoration: line-through; text-decoration-color: var(--done); color: var(--muted); }
.ev { display: flex; gap: 10px; align-items: baseline; padding: 8px 10px; margin: 6px 0; background: var(--wine-tint); border-radius: var(--r); font-size: 16px; }
.ev b { font-weight: 700; color: var(--wine); }
.ev.ev-tick { padding: 0 10px; }
.empty { color: var(--muted); margin: 6px 0; }
.later { margin-top: 14px; border-top: 1px dashed var(--line); padding-top: 10px; }
.later summary { cursor: pointer; font-weight: 600; min-height: 32px; }
.next { margin-top: 14px; color: var(--muted); font-size: 16px; }
.next b { color: var(--ink); }

/* Calendar */
.cal-head, .cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; }
.cal-head { font-size: 13px; color: var(--muted); text-align: center; margin-bottom: 3px; font-weight: 600; }
.cell {
  appearance: none; border: 1px solid var(--line); background: var(--bg); color: var(--ink); border-radius: 4px;
  min-height: 62px; padding: 3px 4px; text-align: left; font: 13px/1.25 var(--body); display: flex; flex-direction: column;
  gap: 1px; cursor: pointer; min-width: 0; overflow: hidden;
}
.cell .d { font-weight: 700; font-size: 14px; }
.cell .h { font-size: 13px; }
.cell .mk { font-size: 11.5px; font-weight: 700; color: var(--wine); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cell.out { visibility: hidden; }
.cell.idle { background: transparent; color: var(--muted); cursor: default; border-style: dashed; }
.cell.shab { background: var(--shabbat); }
.cell.off { background: repeating-linear-gradient(135deg, var(--bg) 0 6px, var(--line) 6px 7px); }
.cell.today { border: 2px solid var(--gold); }
.cell.sel { outline: 3px solid var(--wine); outline-offset: -1px; }
.cell.alldone { background: var(--done-tint); }
.cell .bar { height: 4px; background: var(--wine); border-radius: 2px; margin-top: auto; }
.cell.alldone .bar { background: var(--done); }
.cell { position: relative; }
.cell .hl { display: none; }
.legend .l-key { background: linear-gradient(225deg, var(--wine) 0 7px, transparent 7px); }
@media (max-width: 559px) {
  .view { padding: 12px 8px; }
  .cal-head, .cal-grid { gap: 2px; }
  .cell { padding: 3px 3px; }
  .cell .mk { display: none; }
  .cell.key::after { content: ""; position: absolute; top: 0; right: 0; border-style: solid; border-width: 0 12px 12px 0; border-color: transparent var(--wine) transparent transparent; }
}
@media (min-width: 560px) {
  .cell { min-height: 74px; font-size: 14px; } .cell .mk { font-size: 12.5px; }
  .legend .l-keyli { display: none; }
  .cell .hl { display: inline; } .cell .hs { display: none; }
}
.daydetail { margin-top: 14px; border-top: 2px solid var(--wine); padding-top: 12px; }
.dayhours { margin-top: 12px; display: grid; gap: 8px; }
.dayhours .hrow { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.dayhours .hrow label { min-width: 7em; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 14px; color: var(--muted); margin: 10px 0 0; padding: 0; list-style: none; }
.legend i { display: inline-block; width: 14px; height: 14px; vertical-align: -2px; margin-right: 5px; border: 1px solid var(--line); border-radius: 3px; }
.legend .l-shab { background: var(--shabbat); }
.legend .l-today { border: 2px solid var(--gold); }
.legend .l-done { background: var(--done-tint); }
.legend .l-off { background: repeating-linear-gradient(135deg, var(--bg) 0 3px, var(--line) 3px 4px); }

/* Person view */
.seg { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.seg button { font: 600 15px var(--body); border: 1px solid var(--line); background: var(--bg); color: var(--ink); border-radius: 20px; padding: 8px 14px; min-height: 44px; cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--wine); border-color: var(--wine); color: #fff; }
@media (prefers-color-scheme: dark) { .seg button[aria-pressed="true"] { color: #1a0b10; } }
.pday { font-weight: 700; margin: 12px 0 0; font-size: 16px; }

/* Buttons and fields */
.btn {
  font: 600 16px var(--body); color: var(--ink); background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r); padding: 10px 14px; min-height: 44px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
.btn:hover { border-color: var(--wine); }
.btn.primary { background: var(--wine); border-color: var(--wine); color: #fff; }
@media (prefers-color-scheme: dark) { .btn.primary { color: #1a0b10; } }
.btn.small { padding: 8px 12px; font-size: 15px; }
.btn.danger { color: #b3261e; }
@media (prefers-color-scheme: dark) { .btn.danger { color: #ff8a80; } }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.filebtn { position: relative; overflow: hidden; }
.filebtn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; font-size: 0; }
.filebtn:focus-within { outline: 3px solid var(--focus); outline-offset: 2px; }
.savenote { font-size: 15px; color: var(--muted); margin: 8px 0 0; }
.savenote.off { color: #b3261e; }
input[type="text"], input[type="date"], select {
  font: 16px var(--body); color: var(--ink); background: var(--surface); border: 1px solid #a99ca1; border-radius: 4px;
  padding: 8px 9px; min-height: 44px; max-width: 100%;
}
@media (prefers-color-scheme: dark) { input[type="text"], input[type="date"], select { border-color: #6b5960; } }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* Setup column */
.setup h2 { font-size: 24px; margin: 0 0 8px; }
.block { border-top: 3px solid var(--wine); background: var(--surface); padding: 0 12px 12px; margin-bottom: 14px; }
.block > summary { list-style: none; cursor: pointer; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; padding: 10px 0 6px; min-height: 44px; }
.block > summary::-webkit-details-marker { display: none; }
.block > summary::before { content: "+"; font: 22px/1 var(--head); color: var(--wine); width: 14px; }
.block[open] > summary::before { content: "\2212"; }
.block > summary h3 { margin: 0; font-size: 20px; }
.sumline { color: var(--muted); font-size: 15px; }
.hint { color: var(--muted); font-size: 15px; margin: 0 0 8px; }
.field { margin: 10px 0 14px; }
.field > label { display: block; font-weight: 600; margin-bottom: 4px; }

.tasks { list-style: none; margin: 0 0 10px; padding: 0; }
.task { border-bottom: 1px solid var(--line); padding: 6px 0 8px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 8px; }
.task .tname { width: 100%; }
.task .tline { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: center; }
.task .hrs { width: 4.6em; text-align: right; }
.task .hl { font-size: 15px; color: var(--muted); }
.task select { font-size: 16px; }
.xbtn { width: 44px; height: 44px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); border-radius: var(--r); cursor: pointer; font: 22px/1 var(--body); }
.xbtn:hover { color: #b3261e; border-color: #b3261e; }
.setup { container-type: inline-size; min-width: 0; }
@container (min-width: 560px) {
  .task { grid-template-columns: minmax(0, 1fr) 4.6em auto auto 44px; align-items: center; }
  .task .tline { display: contents; }
  .task .tname { order: 1; } .task .hrs { order: 2; width: 100%; } .task .hl { order: 3; } .task select { order: 4; } .task .xbtn { order: 5; }
  .task .whochips { order: 6; grid-column: 1 / -1; }
}
.whochips { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; font-size: 15px; }
.whochips span { color: var(--muted); }
.chip { font: 14px var(--body); border: 1px solid var(--line); background: var(--bg); color: var(--ink); border-radius: 16px; padding: 4px 10px; min-height: 36px; cursor: pointer; }
.chip[aria-pressed="true"] { background: var(--wine-tint); border-color: var(--wine); color: var(--ink); font-weight: 700; }

.person { border-bottom: 1px solid var(--line); padding: 8px 0 12px; }
.person .prow { display: flex; gap: 8px; align-items: center; }
.person .pname { flex: 1; min-width: 0; }
.childbox { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; font-size: 15px; color: var(--muted); white-space: nowrap; cursor: pointer; }
.childbox input { width: 20px; height: 20px; accent-color: var(--wine); }
.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; margin-top: 8px; }
.week label { display: flex; flex-direction: column; justify-content: flex-end; font-size: 13px; line-height: 1.15; color: var(--muted); text-align: center; gap: 3px; }
.week input { width: 100%; text-align: center; padding: 8px 2px; }
.week .sat { color: var(--wine); }
.pweek { font-size: 14px; color: var(--muted); margin: 4px 0 0; }

.chips { list-style: none; padding: 0; margin: 8px 0 0; display: flex; flex-wrap: wrap; gap: 6px; }
.chips li { display: inline-flex; align-items: center; gap: 2px; background: var(--bg); border: 1px solid var(--line); border-radius: 18px; padding: 0 0 0 10px; font-size: 15px; }
.chips button { border: 0; background: none; color: var(--muted); width: 40px; height: 40px; cursor: pointer; font-size: 20px; }

.copies { list-style: none; padding: 0; margin: 0 0 10px; }
.copies li { display: flex; gap: 8px; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); padding: 6px 0; font-size: 15px; }
.confirm { margin-top: 10px; padding: 10px; border: 2px solid #b3261e; border-radius: var(--r); }
.confirm p { margin: 0 0 8px; }

.undo, .toast {
  position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 40; max-width: calc(100% - 32px);
  background: #2a1b20; color: #fff; border-radius: var(--r); padding: 8px 10px 8px 14px; display: flex; gap: 12px; align-items: center;
  box-shadow: 0 4px 18px rgba(0, 0, 0, .25); font-size: 16px;
}
.toast { bottom: 76px; }
.undo button { background: none; color: #ffd27a; border: 1px solid #ffd27a; border-radius: var(--r); font: 600 15px var(--body); min-height: 40px; padding: 4px 12px; cursor: pointer; }
@media (prefers-color-scheme: dark) { .undo, .toast { background: #f2e9ec; color: #1a0b10; } .undo button { color: #6b1d33; border-color: #6b1d33; } }

/* Content */
.content { padding-bottom: 30px; }
.content section { max-width: 72ch; }
.content h2 { font-size: 26px; margin: 28px 0 8px; color: var(--wine); }
.content h3 { font-size: 19px; margin: 18px 0 4px; }
.content p { margin: 0 0 10px; }
.rabbi { border-left: 4px solid var(--wine); padding-left: 12px; }
.sources ul { padding-left: 20px; }
.sources li { margin-bottom: 6px; }

footer { border-top: 1px solid var(--line); padding: 20px 0 30px; font-size: 15px; color: var(--muted); }
footer a { color: inherit; }
.sb-more { line-height: 1.7; }

@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }

.print-root { display: none; }

/* ---------- Print ---------- */
@page { margin: 12mm 12mm 14mm; }
@media print {
  :root { --ink: #000; --muted: #333; --line: #999; --wine: #6b1d33; }
  body { background: #fff; color: #000; font: 10.5pt/1.35 var(--body); }
  body > *:not(.print-root) { display: none !important; }
  .print-root { display: block !important; }
  .pr-sec + .pr-sec { break-before: page; }
  .pr-title { font: 18pt/1.1 var(--head); margin: 0 0 3pt; color: #6b1d33; }
  .pr-sub { margin: 0 0 6pt; font-size: 10pt; }
  .pr-keys { display: flex; flex-wrap: wrap; gap: 2pt 14pt; margin: 0 0 8pt; padding: 4pt 0; border-top: 1.5pt solid #6b1d33; border-bottom: .75pt solid #999; font-size: 9.5pt; }
  .pr-keys b { font-weight: 700; }
  .pr-cal { width: 100%; border-collapse: collapse; table-layout: fixed; margin-bottom: 10pt; }
  .pr-cal th { font-size: 8.5pt; font-weight: 700; padding: 2pt; border: .75pt solid #999; background: #fff; }
  .pr-cal td { border: .75pt solid #999; vertical-align: top; height: 40pt; padding: 2pt 3pt; font-size: 8pt; line-height: 1.2; }
  .pr-cal td.shab { background: #ececec; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  .pr-cal td.out { border: 0; background: none; }
  .pr-cal .dn { font-weight: 700; font-size: 9pt; }
  .pr-cal .mk { font-weight: 700; color: #6b1d33; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  .pr-cal tr { break-inside: avoid; }
  .pr-list { width: 100%; border-collapse: collapse; table-layout: fixed; }
  .pr-list col.c-box { width: 16pt; }
  .pr-list col.c-time { width: 58pt; }
  .pr-list col.c-who { width: 80pt; }
  .pr-list tbody { break-inside: avoid; }
  .pr-list thead th { text-align: left; font-size: 8pt; font-weight: 400; color: #333; padding: 0 4pt 1pt 0; border-bottom: .5pt solid #999; }
  .pr-list th.day { text-align: left; font-size: 10.5pt; padding: 5pt 0 1.5pt; border-bottom: 1pt solid #6b1d33; }
  .pr-list th.day span { font-weight: 400; color: #333; }
  .pr-list td { padding: 2.2pt 4pt 2.2pt 0; border-bottom: .5pt solid #bbb; vertical-align: top; overflow-wrap: break-word; }
  .pr-list td.box::before { content: ""; display: inline-block; width: 9pt; height: 9pt; border: .9pt solid #000; vertical-align: -1pt; }
  .pr-list tr.pr-done td { color: #444; }
  .pr-list tr.pr-done td.box::before { content: "\2713"; font-size: 8pt; line-height: 9pt; text-align: center; }
  .pr-list tr.pr-ev td { font-weight: 700; color: #6b1d33; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  .pr-list td.time { white-space: nowrap; }
  .pr-list td.pr-who { overflow-wrap: normal; word-break: normal; }
  /* A page per person: a little tighter, so a full fortnight's list doesn't push the seder day onto a page of its own. */
  .pr-person .pr-list td { padding-top: 1.6pt; padding-bottom: 1.6pt; }
  .pr-person .pr-list th.day { padding-top: 4pt; }
  .pr-list tr.pr-footrow td { border-bottom: 0; border-top: .75pt solid #999; padding-top: 8pt; font-size: 8.5pt; color: #333; }
  .pr-foot { margin-top: 10pt; font-size: 8.5pt; color: #333; border-top: .75pt solid #999; padding-top: 4pt; break-inside: avoid; }
  .pr-short { border: 1pt solid #000; padding: 4pt 6pt; margin: 0 0 8pt; font-size: 9.5pt; }
  .pr-note { font-size: 9.5pt; margin: 0 0 8pt; border-left: 2pt solid #b7791f; padding-left: 6pt; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
}
