/* The year planner.
 *
 * Follows the Claude Design canvas (Termtime.dc.html): a control bar of chips,
 * a headline with the year's numbers beside it, the calendar grid next to a
 * rail, and the long-form rules folded away underneath.
 *
 * Three rules run through the whole file:
 *
 * 1. Colour is never the only signal. Every week cell carries a word and a
 *    glyph as well as a fill, so the calendar reads in greyscale, to a screen
 *    reader, and to the ~8% of men with a colour vision deficiency.
 * 2. Nothing is smaller than 24x24 CSS pixels that can be pressed (WCAG 2.2
 *    2.5.8), and nothing relies on hover alone.
 * 3. The sticky chrome stops being sticky on a phone. A bar pinned to the top
 *    of a 640px-tall viewport eats a quarter of it and hides the element that
 *    keyboard focus has just moved to (WCAG 2.2 2.4.11).
 */

/* ── Shell ─────────────────────────────────────────────────────────────── */

.tt-planner { display: block; }
.tt-planner-inner { padding-block: 28px 0; }

.tt-headline {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 16px 40px;
  margin-bottom: 22px;
}
.tt-title {
  font-size: clamp(1.75rem, 1.15rem + 2.4vw, 2.375rem);
  line-height: 1.05;
  letter-spacing: -0.025em;
  max-width: 30ch;
}
.tt-standfirst {
  margin: 0;
  font-size: 0.9375rem;
  line-height: 1.55;
  color: var(--ink-3);
  max-width: 46ch;
}

/* ── Control bar ───────────────────────────────────────────────────────── */

.tt-bar {
  background: var(--paper-2);
  border-block: 1px solid var(--line);
  border-top-color: transparent;
}
.tt-bar-inner {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding-block: 10px;
}
.tt-bar-rule {
  width: 1px;
  align-self: stretch;
  min-height: 22px;
  background: var(--line-3);
  margin-inline: 6px;
}

.tt-chips {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.tt-chips-label {
  font-family: var(--mono);
  font-size: 0.625rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-4);
  margin-right: 2px;
}

.tt-chip {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 5px 12px;
  border: 1px solid var(--line-3);
  border-radius: var(--r-pill);
  background: var(--card);
  color: var(--ink-2);
  font-size: 0.78125rem;
  font-weight: 500;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  transition: border-color 0.12s ease, background 0.12s ease, color 0.12s ease;
}
.tt-chip:hover { border-color: var(--ink); color: var(--ink); }
.tt-chip.is-on {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--card);
  font-weight: 600;
}
.tt-chip.is-on:hover { background: var(--teal-deep); border-color: var(--teal-deep); color: var(--card); }

/* More options, as a native disclosure. */
.tt-opts { position: relative; margin-left: auto; }
.tt-opts-summary {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 32px;
  padding: 5px 12px;
  border: 1px solid var(--line-3);
  border-radius: var(--r-pill);
  background: transparent;
  color: var(--ink-2);
  font-size: 0.78125rem;
  font-weight: 500;
  cursor: pointer;
  list-style: none;
  white-space: nowrap;
}
.tt-opts-summary::-webkit-details-marker { display: none; }
.tt-opts-summary::after {
  content: "";
  width: 6px; height: 6px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
  transition: transform 0.15s ease;
}
.tt-opts[open] > .tt-opts-summary { background: var(--card); border-color: var(--ink); color: var(--ink); }
.tt-opts[open] > .tt-opts-summary::after { transform: translateY(1px) rotate(-135deg); }
.tt-opts-summary:hover { border-color: var(--ink); color: var(--ink); }
.tt-opts-count {
  display: inline-grid;
  place-items: center;
  min-width: 17px; height: 17px;
  padding-inline: 4px;
  border-radius: 9px;
  background: var(--teal);
  color: var(--card);
  font-family: var(--mono);
  font-size: 0.625rem;
  font-weight: 700;
}

.tt-opts-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 30;
  width: 21rem;
  max-width: calc(100vw - 2 * var(--pad));
  padding: 6px;
  background: var(--card);
  border: 1px solid var(--ink);
  border-radius: var(--r-md);
  box-shadow: 0 12px 32px rgba(16, 20, 24, 0.14);
}
.tt-opt {
  display: flex;
  gap: 11px;
  align-items: flex-start;
  padding: 11px 12px;
  border-radius: 7px;
  cursor: pointer;
}
.tt-opt:hover { background: var(--paper-3); }
.tt-opt-input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.tt-opt-track {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  width: 32px; height: 19px;
  margin-top: 1px;
  padding: 2px;
  border-radius: var(--r-pill);
  background: #b8b2a2;
  transition: background 0.12s ease, justify-content 0s;
}
.tt-opt-knob {
  display: block;
  width: 15px; height: 15px;
  border-radius: 50%;
  background: var(--card);
  transition: transform 0.14s ease;
}
.tt-opt-input:checked + .tt-opt-track { background: var(--teal); }
.tt-opt-input:checked + .tt-opt-track .tt-opt-knob { transform: translateX(13px); }
.tt-opt-input:focus-visible + .tt-opt-track { outline: 2px solid var(--ink); outline-offset: 2px; }
.tt-opt-label { display: block; font-size: 0.78125rem; font-weight: 600; letter-spacing: -0.01em; }
.tt-opt-hint { display: block; font-size: 0.71875rem; color: var(--ink-3); margin-top: 3px; line-height: 1.45; }
.tt-opts-note {
  margin: 2px 12px 8px;
  font-size: 0.6875rem;
  color: var(--ink-4);
  line-height: 1.5;
}

/* ── Stats ─────────────────────────────────────────────────────────────── */

.tt-numbers { margin-bottom: 22px; }
.tt-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 18px 34px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.tt-stat { min-width: 8rem; max-width: 13rem; }
.tt-stat-value {
  display: block;
  font-family: var(--mono);
  font-size: 1.375rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.02em;
  /* Digits are the one place the display letter-spacing has to come off:
     -0.02em on a mono figure closes the gaps a mono face exists to keep. */
  font-variant-numeric: tabular-nums;
}
.tt-stat-label {
  display: block;
  margin-top: 5px;
  font-size: 0.71875rem;
  line-height: 1.3;
  color: var(--ink-2);
}
.tt-stat-note {
  display: block;
  margin-top: 3px;
  font-size: 0.6875rem;
  line-height: 1.35;
  color: var(--ink-4);
}

/* ── Two columns ───────────────────────────────────────────────────────── */

.tt-cols {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  align-items: flex-start;
}
.tt-cal {
  flex: 1 1 38rem;
  min-width: 0;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 18px 20px 20px;
}
.tt-rail {
  position: sticky;
  /* Clears the site header and the control bar, both of which are sticky at
     this width. Below the breakpoint neither is, and neither is this. */
  top: calc(var(--head-h) + 44px);
  flex: 1 1 20rem;
  max-width: 26rem;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* ── The grid ──────────────────────────────────────────────────────────── */

.tt-grid-scroll { overflow-x: auto; }
.tt-grid-scroll:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
.tt-grid {
  width: 100%;
  min-width: 41rem;
  border-collapse: collapse;
}
/* The rows are laid out with grid so a month's weeks line up down the page.
   Table semantics are restored with explicit ARIA roles in the markup — see
   the comment on grid() in uae-planner-markup.js. */
.tt-grid thead tr,
.tt-grid tbody tr {
  display: grid;
  grid-template-columns: 7rem repeat(var(--tt-cols, 5), minmax(0, 1fr));
  gap: 6px;
  align-items: stretch;
}
.tt-grid thead tr {
  align-items: center;
  padding-bottom: 8px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--line-2);
}
.tt-grid tbody tr { margin-bottom: 6px; }
.tt-grid th {
  font-family: var(--mono);
  font-size: 0.59375rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-align: left;
  color: var(--ink-4);
}
.tt-grid-month {
  display: flex;
  align-items: center;
  font-family: var(--font);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-transform: none;
  color: var(--ink);
}
.tt-grid-month-short { display: none; }
.tt-cell { padding: 0; }

.tt-week {
  display: flex;
  flex-direction: column;
  gap: 2px;
  align-items: flex-start;
  text-align: left;
  width: 100%;
  min-height: 54px;
  padding: 7px 9px 6px;
  border: 1px solid var(--w-teach-bd);
  border-radius: var(--r);
  background: var(--w-teach-bg);
  color: var(--ink);
  cursor: pointer;
}
.tt-week-dates {
  font-family: var(--mono);
  font-size: 0.59375rem;
  letter-spacing: 0.01em;
  /* Each state sets this to its own tone below. A single quiet grey looked
     right on white and came in at 4.4:1 on the break and Ramadan fills — under
     AA on exactly the three weeks people look at hardest. */
  color: var(--w-teach-fg);
}
.tt-week-label {
  font-size: 0.71875rem;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.01em;
}
.tt-week-glyphs {
  margin-top: auto;
  font-size: 0.5625rem;
  letter-spacing: 0.12em;
  min-height: 0.75em;
  color: var(--w-teach-fg);
}

/* State: fill, border and text tone together, plus the word in the label and
   the glyph row underneath. Three carriers, so none of them is load-bearing. */
.tt-week.is-teaching { background: var(--w-teach-bg); border-color: var(--w-teach-bd); }
.tt-week.is-teaching .tt-week-dates,
.tt-week.is-teaching .tt-week-glyphs { color: var(--w-teach-fg); }
.tt-week.is-mixed,
.tt-week.is-holiday { background: var(--w-holiday-bg); border-color: var(--w-holiday-bd); }
.tt-week.is-mixed .tt-week-dates,
.tt-week.is-mixed .tt-week-glyphs,
.tt-week.is-holiday .tt-week-dates,
.tt-week.is-holiday .tt-week-glyphs { color: var(--w-holiday-fg); }
.tt-week.is-break { background: var(--w-break-bg); border-color: var(--w-break-bd); }
.tt-week.is-break .tt-week-dates,
.tt-week.is-break .tt-week-glyphs { color: var(--w-break-fg); }
.tt-week.is-out { background: var(--w-out-bg); border-color: var(--w-out-bd); }
.tt-week.is-out .tt-week-label,
.tt-week.is-out .tt-week-dates,
.tt-week.is-out .tt-week-dates,
.tt-week.is-out .tt-week-glyphs { color: var(--w-out-fg); }
.tt-week.has-ramadan.is-teaching,
.tt-week.has-ramadan.is-mixed { background: var(--w-ramadan-bg); border-color: var(--w-ramadan-bd); }
.tt-week.has-ramadan.is-teaching .tt-week-dates,
.tt-week.has-ramadan.is-teaching .tt-week-glyphs,
.tt-week.has-ramadan.is-mixed .tt-week-dates,
.tt-week.has-ramadan.is-mixed .tt-week-glyphs { color: var(--w-ramadan-fg); }

/* The pastoral layer is an underline, not a fill: it has to be readable on top
   of whichever state the week already is. */
.tt-week.has-pressure { box-shadow: inset 0 -3px 0 var(--pink); }
/* And a dashed border for the weeks whose dates can still move, so "expected"
   survives greyscale, a printout, and a reader who cannot see the badge. */
.tt-week.is-expected { border-style: dashed; }
.tt-week.is-school-set { border-style: dotted; }

.tt-week:hover { border-color: var(--ink-3); }
.tt-week[aria-expanded="true"] {
  border-color: var(--ink);
  outline: 2px solid var(--ink);
  outline-offset: 1px;
}
.tt-cell.is-empty { min-height: 0; }

/* ── Legend ────────────────────────────────────────────────────────────── */

.tt-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  margin: 16px 0 0;
  padding-top: 14px;
  border-top: 1px solid var(--line-2);
  list-style: none;
}
.tt-legend-item {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 0.6875rem;
  color: var(--ink-2);
}
.tt-legend-swatch {
  display: grid;
  place-items: center;
  width: 15px; height: 15px;
  border-radius: 3px;
  border: 1px solid var(--line);
  background: var(--card);
  font-size: 0.5rem;
  line-height: 1;
}
.tt-legend-swatch.is-teaching { background: var(--w-teach-bg); border-color: var(--w-teach-bd); }
.tt-legend-swatch.is-mixed,
.tt-legend-swatch.is-holiday { background: var(--w-holiday-bg); border-color: var(--w-holiday-bd); color: var(--w-holiday-fg); }
.tt-legend-swatch.is-break { background: var(--w-break-bg); border-color: var(--w-break-bd); color: var(--w-break-fg); }
.tt-legend-swatch.is-out { background: var(--w-out-bg); border-color: var(--w-out-bd); color: var(--w-out-fg); }
.tt-legend-swatch.is-ramadan { background: var(--w-ramadan-bg); border-color: var(--w-ramadan-bd); color: var(--w-ramadan-fg); }
.tt-legend-swatch.is-assessment { background: var(--w-exam-bg); border-color: var(--w-exam-bd); color: var(--w-exam-fg); }
.tt-legend-swatch.is-pressure { box-shadow: inset 0 -3px 0 var(--pink); color: var(--pink); }

/* ── Rail: milestones ──────────────────────────────────────────────────── */

.tt-next {
  background: var(--teal-deep);
  color: #f3f7f6;
  border-radius: var(--r-lg);
  padding: 18px;
}
.tt-next-title {
  font-family: var(--mono);
  font-size: 0.625rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--teal-text);
}
.tt-next-list {
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
  /* Long enough to be worth reading, short enough not to own the page. The
     client trims it to what is still ahead; this is the no-JavaScript cap. */
  max-height: 24rem;
  overflow-y: auto;
}
.tt-next-item {
  display: flex;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.tt-next-item:last-child { border-bottom: 0; }
.tt-next-item[hidden] { display: none; }
.tt-next-when {
  flex-shrink: 0;
  width: 4rem;
  padding-top: 2px;
  font-family: var(--mono);
  font-size: 0.6875rem;
  color: var(--teal-text);
  font-variant-numeric: tabular-nums;
}
.tt-next-body { flex: 1; min-width: 0; }
.tt-next-label { display: block; font-size: 0.8125rem; font-weight: 600; letter-spacing: -0.01em; }
.tt-next-note { display: block; margin-top: 2px; font-size: 0.71875rem; line-height: 1.4; color: var(--teal-text-2); }
.tt-next-flag { display: block; margin-top: 4px; }
.tt-next-hint { margin: 14px 0 0; font-size: 0.71875rem; line-height: 1.5; color: var(--teal-text-2); }
/* The badge inverts inside the dark panel. */
.tt-next .tt-badge { border-color: rgba(255, 255, 255, 0.34); background: transparent; color: #f3f7f6; }

/* ── Rail: the chosen week ─────────────────────────────────────────────── */

.tt-sel[hidden] { display: none; }
.tt-sel {
  background: var(--card);
  border: 1px solid var(--ink);
  border-radius: var(--r-lg);
  overflow: hidden;
}
.tt-sel-head { padding: 16px 18px 14px; border-bottom: 1px solid var(--line-2); }
.tt-sel-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.tt-sel-kicker {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.625rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.tt-sel-range { margin: 5px 0 0; font-size: 1.0625rem; font-weight: 700; letter-spacing: -0.02em; line-height: 1.2; }
.tt-sel-close {
  flex-shrink: 0;
  min-height: 28px;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--paper);
  color: var(--ink-3);
  font-size: 0.6875rem;
  font-weight: 600;
  cursor: pointer;
}
.tt-sel-close:hover { border-color: var(--ink); color: var(--ink); }
.tt-sel-summary { margin: 8px 0 0; font-size: 0.78125rem; color: var(--ink-3); line-height: 1.5; }
.tt-sel-marks { margin: 10px 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; }
.tt-sel-mark { font-size: 0.78125rem; line-height: 1.45; color: var(--ink-2); }
.tt-sel-mark-name { font-weight: 600; color: var(--ink); }
.tt-sel-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }

.tt-sel-note { padding: 15px 18px 16px; background: var(--pink-wash); border-top: 1px solid var(--pink-line); }
.tt-sel-note-kicker {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.59375rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--pink);
}
.tt-sel-note-title { margin: 6px 0 0; font-size: 0.875rem; font-weight: 700; letter-spacing: -0.015em; }
.tt-sel-note-body { margin: 6px 0 0; font-size: 0.78125rem; color: var(--ink-2); line-height: 1.55; }
.tt-sel-advice { margin: 12px 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; }
.tt-sel-advice li {
  background: var(--card);
  border: 1px solid var(--pink-line);
  border-left: 3px solid var(--pink);
  border-radius: var(--r-sm);
  padding: 9px 11px;
}
.tt-sel-who {
  display: block;
  font-family: var(--mono);
  font-size: 0.5625rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink-4);
}
.tt-sel-what { display: block; margin-top: 4px; font-size: 0.78125rem; line-height: 1.45; color: var(--ink); }

/* ── Rail: export ──────────────────────────────────────────────────────── */

.tt-export {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 16px 18px;
}
.tt-export-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.tt-export-title {
  font-family: var(--mono);
  font-size: 0.625rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-4);
  padding-top: 4px;
}
.tt-export-lede { margin: 8px 0 0; font-size: 0.78125rem; color: var(--ink-3); line-height: 1.5; }
.tt-export-actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.tt-export-status { margin: 8px 0 0; font-size: 0.71875rem; color: var(--teal); min-height: 1em; }
.tt-export-status:empty { margin: 0; min-height: 0; }
.tt-nowrap { white-space: nowrap; }

.tt-btn {
  flex: 1 1 8rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 9px 12px;
  border: 1px solid #d8d3c5;
  border-radius: var(--r);
  background: var(--card);
  color: var(--ink);
  font-size: 0.75rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}
.tt-btn:hover { border-color: var(--ink); color: var(--ink); }
.tt-btn--solid { background: var(--ink); border-color: var(--ink); color: var(--card); }
.tt-btn--solid:hover { background: var(--teal); border-color: var(--teal); color: var(--card); }
.tt-btn[hidden] { display: none; }

/* ── Embed button and its tooltip ──────────────────────────────────────── */

.tt-embed-btn {
  position: relative;
  flex-shrink: 0;
  display: inline-grid;
  place-items: center;
  width: 30px; height: 30px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--paper);
  color: var(--ink-3);
  text-decoration: none;
}
.tt-embed-btn:hover { border-color: var(--teal); color: var(--teal); background: var(--teal-pale); }
.tt-embed-icon { display: grid; place-items: center; }

.tt-tip {
  position: absolute;
  right: 0;
  top: calc(100% + 7px);
  z-index: 20;
  width: max-content;
  max-width: 12rem;
  padding: 6px 9px;
  border-radius: var(--r-sm);
  background: var(--ink);
  color: var(--paper);
  font-size: 0.6875rem;
  font-weight: 500;
  line-height: 1.35;
  /* WCAG 1.4.13: the tooltip stays while the pointer travels into it, and the
     client dismisses it on Escape. `visibility` rather than `display` so it can
     animate — but a hidden absolutely positioned box still has a box, and this
     one sits 12rem wide against the right edge of a phone. Hidden or not, it
     was extending the document and giving every page a sideways scroll. Hence
     `pointer-events: none` and, below, no tooltip at all where there is no
     pointer to hover with. */
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.12s ease, visibility 0s linear 0.12s;
}
.tt-embed-btn:hover .tt-tip,
.tt-embed-btn:focus-visible .tt-tip,
.tt-tip:hover {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition-delay: 0s;
}

/* No pointer, no hover, no tooltip. On a touch device it can never be shown,
   and the button's accessible name already says the same words. */
@media (hover: none) {
  .tt-tip { display: none; }
}
.tt-embed-btn.is-tip-dismissed .tt-tip { opacity: 0; visibility: hidden; }

/* ── Badges ────────────────────────────────────────────────────────────── */

.tt-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: var(--paper);
  font-family: var(--mono);
  font-size: 0.625rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.tt-badge-glyph { font-size: 0.75em; line-height: 1; }
.tt-badge--confirmed { border-color: var(--w-exam-bd); background: var(--w-exam-bg); color: var(--w-exam-fg); }
.tt-badge--expected { border-color: var(--w-holiday-bd); background: var(--w-holiday-bg); color: var(--w-holiday-fg); border-style: dashed; }
.tt-badge--school-set { border-color: var(--w-break-bd); background: var(--w-break-bg); color: var(--w-break-fg); border-style: dotted; }

/* ── Disclosures ───────────────────────────────────────────────────────── */

.tt-disclosures {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 26px;
  max-width: 52rem;
}
.tt-disc {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  overflow: hidden;
}
.tt-disc-summary {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  min-height: 44px;
  cursor: pointer;
  list-style: none;
}
.tt-disc-summary::-webkit-details-marker { display: none; }
.tt-disc-summary:hover { background: var(--paper); }
.tt-disc-mark {
  flex-shrink: 0;
  position: relative;
  width: 12px; height: 12px;
  color: var(--teal);
}
/* A drawn plus/minus rather than a glyph: it lines up at any font size and
   cannot be read out as "plus sign" by a screen reader. */
.tt-disc-mark::before,
.tt-disc-mark::after {
  content: "";
  position: absolute;
  inset: 50% 0 auto;
  height: 1.5px;
  background: currentColor;
  transform: translateY(-50%);
  transition: transform 0.15s ease, opacity 0.15s ease;
}
.tt-disc-mark::after { transform: translateY(-50%) rotate(90deg); }
.tt-disc[open] .tt-disc-mark::after { transform: translateY(-50%) rotate(0deg); opacity: 0; }
.tt-disc-title { flex: 1; font-size: 0.84375rem; font-weight: 600; letter-spacing: -0.01em; }
.tt-disc-hint { font-size: 0.71875rem; color: var(--ink-4); text-align: right; }
.tt-disc-body {
  padding: 0 18px 18px 42px;
  font-size: 0.8125rem;
  color: var(--ink-2);
  line-height: 1.65;
}
.tt-disc-body > * + * { margin-top: 10px; }
.tt-disc-body p { margin: 0; }
.tt-moon-list { margin: 0; padding-left: 1.1rem; }
.tt-moon-list li { margin-top: 4px; }
.tt-flag { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.tt-more { font-size: 0.78125rem; }

.tt-verified { margin: 4px 2px 0; font-size: 0.71875rem; color: var(--ink-4); line-height: 1.6; }
.tt-verified.is-stale { color: var(--w-holiday-fg); }

/* ── Tables ────────────────────────────────────────────────────────────── */

.tt-table { overflow-x: auto; margin-top: 14px; }
.tt-table table { width: 100%; border-collapse: collapse; font-size: 0.8125rem; }
.tt-table caption {
  text-align: left;
  padding-bottom: 8px;
  font-weight: 700;
  font-size: 0.875rem;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.tt-term-count { font-weight: 500; color: var(--ink-4); font-family: var(--mono); font-size: 0.6875rem; }
.tt-table th,
.tt-table td {
  text-align: left;
  vertical-align: top;
  padding: 8px 12px 8px 0;
  border-bottom: 1px solid var(--line-2);
}
.tt-table thead th {
  font-family: var(--mono);
  font-size: 0.59375rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-4);
}
.tt-table tbody th { font-weight: 600; }
.tt-cell-note { display: block; margin-top: 3px; font-size: 0.71875rem; color: var(--ink-4); line-height: 1.45; }

/* ── Three lenses ──────────────────────────────────────────────────────── */

.tt-lens {
  background: var(--card);
  border: 1px solid var(--line);
  border-left: 3px solid var(--pink);
  border-radius: var(--r-md);
  padding: 18px 20px;
  margin: 22px 0;
}
.tt-lens-kicker {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.625rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--pink);
}
.tt-lens-dates { color: var(--ink-4); }
.tt-lens-title { margin: 6px 0 0; font-size: 1.0625rem; }
.tt-lens-what { margin: 8px 0 0; font-size: 0.875rem; line-height: 1.6; color: var(--ink-2); }
.tt-lens-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
  gap: 10px;
  margin-top: 14px;
}
.tt-lens-card { background: var(--paper); border: 1px solid var(--line-2); border-radius: var(--r-sm); padding: 11px 13px; }
.tt-lens-card-label {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.5625rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink-4);
}
.tt-lens-card-body { margin: 5px 0 0; font-size: 0.8125rem; line-height: 1.5; color: var(--ink); }

/* ── Sources ───────────────────────────────────────────────────────────── */

.tt-refs { margin-top: 32px; }
.tt-refs-title { font-size: 0.875rem; letter-spacing: -0.01em; }
.tt-refs-list { margin: 10px 0 0; padding-left: 1.25rem; font-size: 0.8125rem; color: var(--ink-2); line-height: 1.7; }
.tt-refs-list li { margin-top: 4px; }

/* ══ Narrow screens ═══════════════════════════════════════════════════════
 *
 * Two changes matter more than the rest.
 *
 * The sticky chrome stops being sticky. A header plus a control bar is ~100px;
 * on a 640px-tall phone that is a sixth of the viewport permanently gone, and
 * it is the band that keyboard focus lands behind (WCAG 2.2 2.4.11).
 *
 * The calendar stops being a grid and becomes a list. Five week columns cannot
 * be made legible inside 360px, and a horizontally scrolling calendar is a
 * calendar most people never see the right-hand half of. Same buttons, same
 * data, one week per row, no sideways scroll anywhere on the page.
 */

@media (max-width: 60rem) {
  .tt-rail {
    position: static;
    max-width: none;
    flex-basis: 100%;
  }
}

/* The chrome unsticks earlier than the calendar reflows.
 *
 * At 768px the nav wraps to two rows and the chips to three: a header and a
 * control bar together came to ~220px of a 1024px tablet, pinned. The calendar
 * itself is still perfectly readable as a grid at that width, so only the
 * chrome changes here. */
@media (max-width: 52rem) {
  .site-head { position: static; }
  .tt-bar { position: static; }
  .tt-bar-inner { gap: 8px; padding-block: 10px; }
  .tt-bar-rule { display: none; }

  /* Thirteen chips wrap to five rows on a phone: a quarter of the screen of
     controls before the calendar starts. One scrolling row per group instead.
     Nothing becomes unreachable by it — every chip is also a link in the
     footer, and tabbing scrolls the row along by itself. */
  .tt-chips {
    width: 100%;
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    scroll-padding-inline: 5.5rem;
    padding-block: 2px;
  }
  .tt-chips::-webkit-scrollbar { display: none; }
  .tt-chip { flex-shrink: 0; }
  /* The group's name stays put while its chips slide under it, so you can
     always see which row you are scrolling. */
  .tt-chips-label {
    position: sticky;
    left: 0;
    flex-shrink: 0;
    align-self: center;
    padding-right: 8px;
    margin-right: 0;
    background: linear-gradient(90deg, var(--paper-2) 78%, transparent);
  }
  .tt-opts { margin-left: 0; width: 100%; }
  .tt-opts-summary { width: 100%; justify-content: space-between; }
  .tt-opts-panel {
    position: static;
    width: auto;
    max-width: none;
    margin-top: 8px;
    box-shadow: none;
  }

  /* Four figures across a tablet land three-and-one, which reads as a mistake
     rather than a wrap. Two by two is the honest shape at any width that will
     not take all four. */
  .tt-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 18px; }
  .tt-stat { min-width: 0; max-width: none; }
}

@media (max-width: 45rem) {
  .tt-planner-inner { padding-block: 20px 0; }
  .tt-headline { gap: 10px; margin-bottom: 18px; }
  .tt-stat-value { font-size: 1.25rem; }

  .tt-cal { padding: 14px 14px 16px; border-radius: var(--r-md); }
  .tt-grid-scroll { overflow: visible; }
  .tt-grid { min-width: 0; }
  .tt-grid thead { display: none; }
  .tt-grid tbody tr { display: block; margin-bottom: 14px; }
  .tt-grid-month {
    display: block;
    padding: 0 0 6px;
    font-size: 0.8125rem;
    border-bottom: 1px solid var(--line-2);
    margin-bottom: 6px;
  }
  .tt-cell { display: block; }
  .tt-cell + .tt-cell { margin-top: 5px; }
  .tt-cell.is-empty { display: none; }
  .tt-week {
    flex-direction: row;
    align-items: center;
    gap: 10px;
    min-height: 44px;
    padding: 9px 12px;
  }
  .tt-week-dates { flex: 0 0 6.5rem; }
  .tt-week-label { flex: 1; min-width: 0; }
  .tt-week-glyphs { margin-top: 0; flex-shrink: 0; }

  .tt-disc-summary { flex-wrap: wrap; padding: 13px 14px; }
  .tt-disc-title { flex: 1 1 100%; order: 2; }
  .tt-disc-mark { order: 1; }
  .tt-disc-hint { order: 3; flex: 1 1 100%; text-align: left; padding-left: 24px; }
  .tt-disc-body { padding: 0 14px 16px; }

}

@media (max-width: 26rem) {
  .tt-week-dates { flex-basis: 5.75rem; font-size: 0.5625rem; }
  .tt-stats { gap: 12px; }
  .tt-btn { flex-basis: 100%; }
}

/* ── Motion, print and forced colours ──────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  .tt-opt-knob,
  .tt-opts-summary::after,
  .tt-disc-mark::before,
  .tt-disc-mark::after,
  .tt-chip,
  .tt-tip { transition: none; }
}

@media print {
  .tt-bar, .tt-rail, .tt-embed-btn, .tt-export-actions { display: none; }
  .tt-cal { border: 0; padding: 0; }
  .tt-disc[open] .tt-disc-body,
  .tt-disc .tt-disc-body { display: block; }
  .tt-grid-scroll { overflow: visible; }
  .tt-week { break-inside: avoid; }
}

/* Windows High Contrast strips background colours, which is most of how a week
   cell says what it is. The border style and the word survive; these put the
   selected state back as something the mode actually paints. */
@media (forced-colors: active) {
  .tt-week { border: 1px solid ButtonBorder; }
  .tt-week[aria-expanded="true"] { outline: 3px solid Highlight; }
  .tt-week.has-pressure { border-bottom-width: 4px; }
  .tt-legend-swatch { border: 1px solid ButtonBorder; }
  .tt-chip.is-on { forced-color-adjust: none; background: Highlight; color: HighlightText; }
}

/* Assessment weeks keep the shape of the week they interrupt and take the
   assessment tone, since an exam fortnight is still a teaching fortnight. */
.tt-week.has-assessment.is-teaching { background: var(--w-exam-bg); border-color: var(--w-exam-bd); }
.tt-week.has-assessment.is-teaching .tt-week-dates,
.tt-week.has-assessment.is-teaching .tt-week-glyphs { color: var(--w-exam-fg); }
.tt-week.has-assessment.has-ramadan.is-teaching {
  /* Both at once: Ramadan's fill, the assessment border. Never a third colour
     nobody has seen before. */
  background: var(--w-ramadan-bg);
  border-color: var(--w-exam-bd);
}

.tt-next-more {
  margin-top: 10px;
  min-height: 32px;
  padding: 6px 10px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--teal-text);
  font-size: 0.71875rem;
  font-weight: 600;
  cursor: pointer;
}
.tt-next-more:hover { border-color: #f3f7f6; color: #f3f7f6; }

/* The headline and the year's numbers, side by side as the canvas has them —
   the numbers wrap under on a narrow screen rather than squeezing the title. */
.tt-headline-text { flex: 1 1 22rem; min-width: 0; }
.tt-headline > [data-tt-stats] { flex: 0 1 auto; padding-bottom: 4px; }
