.month-nav { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.month-nav a, .month-nav button { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; border-radius: 24px; border: 1px solid currentColor; padding: 6px 16px; font: inherit; }
.month-nav button { background: var(--gold); color: var(--ink); cursor: pointer; }
.month-nav button[hidden], .month-print-header, .month-print-footer { display: none; }
#month-hint { margin: 0 0 10px; font-size: .9rem; color: var(--muted); }
@media (min-width: 900px) {
  .split { grid-template-columns: minmax(300px, 30fr) minmax(0, 70fr); }
  .sheet-in { max-width: none; }
}
.tt-scroll { position: relative; overflow-x: auto; } /* relative: the screen-reader-only spans stay inside the box instead of widening the page */
.tt-scroll:focus-visible { outline: 2px solid var(--purple); outline-offset: 2px; border-radius: 8px; }
.tt { width: 100%; border-collapse: collapse; font-size: 0.85rem; font-variant-numeric: tabular-nums; }
.tt th, .tt td { padding: 9px 6px; text-align: right; white-space: nowrap; border-top: 1px solid var(--line); font-weight: 400; }
.tt thead th { color: var(--muted); font-size: 0.72rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; border-top: 0; vertical-align: bottom; }
.tt thead .grp { text-align: center; border-bottom: 1px solid var(--line); }
.tt thead tr:nth-child(2) th { padding-top: 4px; }
.tt .g { border-left: 1px solid var(--line); }
.tt .day, .tt .date { text-align: left; }
.tt abbr { text-decoration: none; }
.tt .iq { color: var(--purple); font-weight: 700; }
.tt tbody th.date { font-weight: 600; }
/* Day and Date stay in view while the times slide. */
.tt .day { position: sticky; left: 0; z-index: 1; width: 72px; min-width: 72px; background: var(--sheet); }
.tt .date { position: sticky; left: 72px; z-index: 1; width: 64px; min-width: 64px; background: var(--sheet); }
.tt thead .day, .tt thead .date { background: var(--sheet); }
/* Fridays and today are marked in words as well as shade; the words sit under the day. */
.tt .tag { display: block; margin: 0; color: var(--purple); font-size: 0.72rem; font-weight: 700; line-height: 1.2; }
.tt tr.fri > * { background-image: linear-gradient(rgb(252 203 0 / 22%), rgb(252 203 0 / 22%)); }
.tt tr.today > * { background-color: var(--white); background-image: none; color: var(--purple); font-weight: 700; }
.tt tr.today .iq { color: var(--purple); }
.tt tr.fri.today > * { background-image: linear-gradient(rgb(252 203 0 / 22%), rgb(252 203 0 / 22%)); }

/* Narrow screens: the table scrolls inside its labelled box, and the hint says so. */

@media (max-width: 599px) {
  .tt { font-size: 0.8rem; }
  .tt th, .tt td { padding: 9px 5px; }
  .tt .day { width: 62px; min-width: 62px; }
  .tt .date { left: 62px; width: 56px; min-width: 56px; }
}

/* Short headings on screen; the prayer name comes before each one for screen readers. */
.vh { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.tt tbody tr.today th.date { font-weight: 700; color: var(--purple); }

@page { size: A4 landscape; margin: 8mm 10mm; }
@media print {
  html, body, body:not(.frame-map), .split, body:not(.frame-map) .split, body:not(.frame-map) .sheet, body:not(.frame-map) .sheet-in {
    display: block; position: static; margin: 0; padding: 0; min-height: 0; max-width: none; width: auto; height: auto;
    border: 0; border-radius: 0; box-shadow: none; color: #000; background: white;
  }
  body { animation: none !important; opacity: 1 !important; font-size: 9pt; line-height: 1.18; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  .stage, .nav, .skip, .foot, .tabbar, #month-hint { display: none; }
  .month-print-header, .month-print-footer { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
  .month-print-header { padding-bottom: 3px; border-bottom: 1.5px solid black; }
  .month-print-header h2 { margin: 0; font-size: 15pt; line-height: 1.1; }
  .month-print-header strong { font-size: 12pt; }
  .month-print-header > :last-child { text-align: right; }
  .month-print-header p, .month-print-footer p { margin: 0; }
  .month-print-footer { position: fixed; inset: auto 0 0; font-size: 8pt; }
  .tt-scroll { overflow: visible; }
  .tt { font-size: 9pt; margin-top: 3px; }
  .tt th, .tt td { padding: 1px 4px; line-height: 1.14; border-bottom: .5px solid #888; }
  .tt thead th { padding: 1px 4px; font-size: 8pt; color: #000; }
  .tt thead tr:nth-child(2) th { padding-top: 1px; }
  .tt .date, .tt .day { position: static; width: auto; min-width: 0; }
  .tt .g { border-color: #888; }
  .tt .tag { display: inline; margin-left: .3em; font-size: 8pt; }
  .tt .tag.now { display: none; }
  .tt .iq, .tt .tag, .tt tbody tr.today > *, .tt tbody tr.today th.date { color: #000; }
  .tt .day, .tt .date, .tt thead .day, .tt thead .date, .tt tr.today > * { background: white; }
  .tt tr.fri > *, .tt tr.fri.today > * { background: #eee; }
}

.range-print-title { display: none; }
.range-form { display: grid; gap: 10px; max-width: 24rem; margin-top: 16px; }
.range-form label { display: grid; gap: 4px; font-weight: 600; }
.range-form input, .range-form select, .range-form button {
  box-sizing: border-box; min-width: 0; min-height: 44px; padding: 6px 12px;
  border: 1px solid var(--line); border-radius: 8px; color: var(--ink); background: white; font: inherit;
}
.range-form button { justify-self: start; cursor: pointer; font-weight: 700; }
@media print {
  .range-print-title { display: table-row; }
  .range-print-title th { text-align: left; }
  .tt thead { display: table-header-group; }
  .tt tr { break-inside: avoid; }
  /* Start a new printed sheet before days 32, 63, and so on. */
  .tt tbody tr:nth-child(31n + 32) { break-before: page; }
}

.timetable-invite { margin-bottom: 1.25rem; padding: 1rem 1.25rem; border-inline-start: 4px solid var(--gold); border-radius: 12px; background: var(--sheet); box-shadow: 0 1px 5px #32164b22; }
.timetable-invite h2 { margin: 0; color: var(--purple); }
.timetable-invite p { margin: .4rem 0; }
.timetable-invite a { display: inline-flex; align-items: center; min-height: 44px; margin-inline-end: 1rem; font-weight: 600; }
@media print { .timetable-invite { display: none; } }
