@font-face {
  font-family: "Figtree";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("/static/fonts/Figtree.woff2") format("woff2");
}
:root {
  --bg: #faf8f5;
  --surface: #fff;
  --text: #161a23;
  --muted: #5b6472;
  --line: #ebe7e1;
  --accent: #c2410c;
  --action: #ff5a1f;
  --soft: #f4f1ec;
  --tap: 44px;
  --tabbar: 64px;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font: 16px/1.45 Figtree, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow-wrap: anywhere;
}
main, .top { max-width: 36rem; margin: 0 auto; padding: 0 12px; }
main { padding-bottom: 32px; }
a { color: var(--accent); }
h1 { font-size: 1.35rem; margin: 12px 0; }
h2 { font-size: 1.1rem; margin: 16px 0 8px; }
p { margin: 4px 0; }
.brand, .where a {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap);
  min-width: var(--tap);
}
.brand { gap: 8px; padding-top: 6px; font-weight: 700; text-decoration: none; }
.brand img { display: block; width: auto; height: 48px; }

.tiles {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.tile {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  min-height: 96px;
  padding: 10px;
  border-radius: 14px;
  color: #fff;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
}
.tile-1 { background: #0b6aa8; }
.tile-2 { background: #1d7a46; }
.tile-3 { background: #9b3b8f; }
.tile-4 { background: #6246b8; }
.tile-5 { background: #b0463a; }
.tile-6 { background: #96600a; }
.tile-7 { background: #2f6f73; }
.tile-8 { background: #b3325f; }
.tile-9 { background: #4a5a86; }
.tile-10 { background: #55606d; }
.tile-all { background: #2b2f36; }
.tile-wide { grid-column: 1 / -1; }
.tiles:not(.compact) .tile-wide .tile { min-height: 64px; flex-direction: row; gap: 10px; }
.tiles.compact .tile-all { grid-column: 1 / -1; }

/* Browse: the stub takes its kind of class's colour (the start screen's tiles);
   the day still shows in the day header and the group's tint. */
.tone-1 { --tone: #0b6aa8; } .tone-2 { --tone: #1d7a46; } .tone-3 { --tone: #9b3b8f; }
.tone-4 { --tone: #6246b8; } .tone-5 { --tone: #b0463a; } .tone-6 { --tone: #96600a; }
.tone-7 { --tone: #2f6f73; } .tone-8 { --tone: #b3325f; } .tone-9 { --tone: #4a5a86; }
.tone-10 { --tone: #55606d; }
.browse .ticket .stub { background: var(--tone, var(--day)); }
.browse .ticket .face .cat { color: var(--tone, var(--muted)); font-weight: 800; }
.face .cat { font-size: 0.78rem; }
.hide-chips { display: flex; gap: 6px; overflow-x: auto; margin: 8px 0 4px; padding-bottom: 2px; scrollbar-width: none; }
.hide-chip {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--tone);
  border-radius: 18px;
  background: color-mix(in srgb, var(--tone) 10%, var(--surface));
  color: var(--tone);
  font-size: 0.85rem;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}
/* A sideways strip is hard to scroll with a mouse: on laptops the chips wrap instead. */
@media (min-width: 700px), (hover: hover) and (pointer: fine) {
  .hide-chips, .day-strip, .me-chips { flex-wrap: wrap; overflow-x: visible; }
}
.hide-chip .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--tone); }
.hide-chip.off { border-style: dashed; border-color: #b8b1a7; background: transparent; color: #7a7368; text-decoration: line-through; }
.hide-chip.off .dot { background: transparent; border: 1px solid #b8b1a7; }
.hidden-note { margin: 2px 0 6px; color: var(--muted); font-size: 0.875rem; }
.quick-search { margin: 8px 0; }
.quick-search input {
  width: 100%;
  min-height: 44px;
  padding: 0 14px 0 40px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' fill='none' stroke='%235b6472' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='8' cy='8' r='6'/%3E%3Cpath d='m13 13 4 4'/%3E%3C/svg%3E") no-repeat 14px center;
  color: var(--text);
  font: inherit;
  font-size: 16px;
}
.quick-search input:focus { outline: 2px solid var(--action); outline-offset: 1px; }
#browse-body[aria-busy="true"] #results { opacity: 0.6; transition: opacity 0.2s 0.15s; }
/* A folded ticket: one class at several centres or times. */
.fold-line { display: flex; justify-content: space-between; gap: 8px; font-size: 0.875rem; }
.fold-place { font-weight: 700; }
.fold-times { color: var(--muted); white-space: nowrap; }
.fold-more { color: var(--accent); font-size: 0.875rem; font-weight: 700; }
.fold-where { color: var(--muted); }
.fold-hint { color: var(--muted); font-size: 0.875rem; margin-top: 8px; }
.fold-centre { padding: 10px 0; border-top: 1px solid var(--line); }
.fold-centre-head { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.fold-meta { color: var(--muted); font-size: 0.875rem; text-align: right; }
.fold-picks { display: flex; flex-wrap: wrap; gap: 6px; }
.fold-pick {
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid #d9d3ca;
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 0.875rem;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
}
.fold-pick[aria-pressed="true"] { background: var(--tone, var(--action)); border-color: var(--tone, var(--action)); color: #fff; }
.session { margin: 10px 0; padding: 10px 12px; border-radius: 14px; background: color-mix(in srgb, var(--tone, var(--action)) 8%, var(--surface)); }
.session-head { display: flex; flex-wrap: wrap; gap: 4px 10px; }
.session-head span { color: var(--muted); }
html.js .fold .session { display: none; }
html.js .fold .session.on { display: block; }

.summary {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 0;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.summary p { min-width: 0; font-size: 0.9rem; }
.summary .button { flex: none; }

/* Chip rows wrap, so nothing ever scrolls sideways. */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.chip, .tab, .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--tap);
  padding: 6px 14px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  text-decoration: none;
  cursor: pointer;
}
.chip.on, .tab.on, .button.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 10px 0; }
.tab { text-align: center; }

.card {
  margin: 10px 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
}
.card h2 { margin: 0 0 4px; }
.age, .dates, .city { color: var(--muted); }
.when, .where, .facts { display: flex; flex-wrap: wrap; align-items: center; column-gap: 10px; }
.price { font-weight: 700; }
.spots.full, .spots.waitlist { color: #a3261a; font-weight: 700; }
.badge {
  padding: 1px 8px;
  border-radius: 10px;
  background: #fdecc8;
  font-size: 0.8rem;
}
.actions, .pager { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.pager { justify-content: center; }
.empty { padding: 32px 0; text-align: center; }

/* Filter sections: one closed row each, coloured down the left edge. */
.sections { margin: 8px 0; }
.section {
  margin: 0 0 6px;
  border: 1px solid var(--line);
  border-left: 6px solid var(--sec, var(--accent));
  border-radius: 10px;
  background: var(--surface);
}
.section > summary {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: var(--tap);
  padding: 4px 12px;
  cursor: pointer;
  list-style: none;
}
.section > summary::-webkit-details-marker { display: none; }
.section > summary::after { content: "\25BE"; margin-left: auto; color: var(--muted); }
.section[open] > summary::after { content: "\25B4"; }
.sec-title { flex: none; font-weight: 700; }
.sec-sel {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.9rem;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.sec-body { padding: 0 12px 12px; }
.sec-category { --sec: #0b6aa8; }
.sec-age { --sec: #1d7a46; }
.sec-place { --sec: #9b3b8f; }
.sec-month { --sec: #b0463a; }
.sec-time { --sec: #96600a; }
.sec-more { --sec: #55606d; }
.filters .section fieldset { margin: 8px 0; }
.filters .sec-body > .button { width: 100%; margin-top: 4px; }
.place .pick:first-of-type span { font-weight: 700; }
.place-name { width: 100%; margin: 8px 0 0; font-weight: 700; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.tiles.compact { grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr)); gap: 6px; margin: 4px 0 8px; }
.tile.compact {
  min-height: 52px;
  padding: 6px 8px;
  border: 3px solid transparent;
  border-radius: 10px;
  font-size: 0.9rem;
  opacity: 0.9;
}
.tile.compact.on { border-color: var(--text); opacity: 1; box-shadow: 0 0 0 2px #fff inset; }
.tile.compact.on::before { content: "\2713\00a0"; }
.centre { display: inline-flex; align-items: center; }
.pin {
  min-width: var(--tap);
  min-height: var(--tap);
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 1.2rem;
  cursor: pointer;
}
.pin[aria-pressed="true"] { color: #c58a00; }
.your-centres { align-items: center; gap: 6px; margin: 8px 0 4px; }
.your-centres .label { font-weight: 700; font-size: 0.9rem; }
.your-centres .chip { min-height: 38px; padding: 4px 12px; font-size: 0.9rem; }
/* Where: starred centres, the home area or anywhere. */
.where-scope { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 10px; }
.where-scope .chip { min-height: 40px; padding: 4px 12px; font-size: 0.9rem; }
.centre-filter { display: block; margin: 0 0 8px; }
.centre-filter input, .places input[type=search] {
  width: 100%; min-height: var(--tap); padding: 0 12px; border: 1px solid var(--line);
  border-radius: 10px; background: var(--surface); font: inherit; font-size: 16px;
}
.mins { color: var(--muted); font-size: 0.85rem; font-weight: 400; white-space: nowrap; }
.pick .mins { margin-left: 6px; color: inherit; opacity: 0.8; }
.other-cities { margin: 8px 0; }
.other-cities > summary, .old-cities > summary {
  min-height: var(--tap); display: flex; align-items: center; cursor: pointer; color: var(--accent);
}
.area-line { margin: 10px 0 0; font-size: 0.95rem; }
.places { display: grid; gap: 10px; margin: 8px 0 12px; }
.area-card, .area-setup {
  display: grid; gap: 8px; padding: 14px; border: 1px solid var(--line);
  border-radius: 14px; background: var(--surface);
}
.area-setup { border-color: var(--accent); }
.area-title { margin: 0; font-weight: 700; }
.area-card .button { justify-self: start; }
.button.wide { width: 100%; }
.place-matches { list-style: none; margin: 0; padding: 0; }
.match-row {
  display: flex; justify-content: space-between; align-items: center; gap: 8px; width: 100%;
  min-height: var(--tap); padding: 6px 4px; border: 0; border-bottom: 1px solid var(--line);
  background: none; color: var(--text); font: inherit; text-align: left; cursor: pointer;
}
.within { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px;
  margin: 0; padding: 4px; border: 0; border-radius: 12px; background: var(--soft); }
.within legend { padding: 0 0 6px; font-weight: 700; }
.seg { position: relative; display: flex; }
.seg input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.seg span {
  flex: 1; display: flex; align-items: center; justify-content: center; min-height: 40px;
  border-radius: 9px; color: var(--muted); font-weight: 600; font-size: 0.9rem;
}
.seg input:checked + span { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12); }
.seg input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 1px; }
.area-group { border-top: 1px solid var(--line); }
.area-city { margin: 8px 0 0; font-size: 0.85rem; font-weight: 700; color: var(--muted); }
.area-row { display: flex; align-items: center; gap: 8px; min-height: var(--tap); }
.area-name { flex: 1; min-width: 0; }
.filters fieldset {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
  margin: 12px 0;
  padding: 0;
  border: 0;
}
.filters legend { padding: 0 0 6px; font-weight: 700; }
.keyword { display: block; font-weight: 700; }
.keyword input {
  display: block;
  width: 100%;
  min-height: var(--tap);
  margin-top: 6px;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font: inherit;
}
.filters > .button { width: 100%; }

/* Tap-to-toggle chips: the real checkbox stays for keyboards and screen readers. */
.pick, .cell { position: relative; display: inline-flex; cursor: pointer; }
.pick input, .cell input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}
.pick span, .cell span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--tap);
  min-width: var(--tap);
  padding: 6px 14px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--surface);
}
.pick input:checked + span, .cell input:checked + span {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.pick input:focus-visible + span, .cell input:focus-visible + span {
  outline: 3px solid #f2a100;
}
.grid {
  display: grid;
  grid-template-columns: auto repeat(3, minmax(0, 1fr));
  gap: 6px;
  width: 100%;
  align-items: center;
}
.grid .head { font-size: 0.85rem; text-align: center; }
.cell span { width: 100%; padding: 0; border-radius: 10px; }
.cell span.hide { font-size: 0; }
.cell input:checked + span.hide::after { content: "\2713"; font-size: 1.1rem; }

.top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; }
.top nav { display: flex; flex-wrap: wrap; column-gap: 14px; }
.top nav a { display: inline-flex; align-items: center; min-height: var(--tap); }
[hidden] { display: none !important; }
.note { color: var(--muted); font-size: 0.9rem; }
.error { color: #a3261a; font-weight: 700; }
.kids { list-style: none; margin: 10px 0; padding: 0; }
.kids li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; margin: 8px 0; }
.filters select {
  display: block;
  width: 100%;
  min-height: var(--tap);
  margin-top: 6px;
  font: inherit;
}
.filters fieldset .keyword { width: 100%; }
.combo { margin-top: 10px; padding-top: 6px; border-top: 1px solid var(--line); }
.match h3 { margin: 4px 0; font-size: 1rem; }
.who { font-weight: 700; color: var(--accent); }
.extra h3 { margin: 12px 0 4px; font-size: 1rem; }
.match h4 { margin: 8px 0 2px; font-size: 0.95rem; }

.duration { color: var(--muted); }
.about { margin-top: 8px; }
.about > summary {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap);
  color: var(--accent);
  cursor: pointer;
}
.about p { margin: 6px 0; }


/* ---- Redesign: tickets, day colours, sheets, tab bar ------------------------ */

body { padding-bottom: calc(var(--tabbar) + env(safe-area-inset-bottom, 0px)); }
h1 { font-size: 1.85rem; line-height: 1.08; letter-spacing: -0.02em; font-weight: 800; margin: 14px 0 12px; }
h2 { font-weight: 800; }
.top { min-height: 52px; }
.brand { color: var(--action); font-size: 1.25rem; font-weight: 800; letter-spacing: -0.01em; }
.button.primary, .chip.on, .tab.on { background: var(--action); border-color: var(--action); }
.button { border-radius: 22px; font-weight: 700; }
.chip, .tab { font-weight: 600; }

/* Day colours. The day is always written too; colour only helps the eye. */
.day-mon { --day: #0f766e; --day-tint: #e7f3f2; }
.day-tue { --day: #7e22ce; --day-tint: #f3e9fb; }
.day-wed { --day: #be185d; --day-tint: #fbe8f0; }
.day-thu { --day: #4d7c0f; --day-tint: #eef4e5; }
.day-fri { --day: #a16207; --day-tint: #f8f0e3; }
.day-sat { --day: #1d4ed8; --day-tint: #e9effd; }
.day-sun { --day: #c2410c; --day-tint: #fcece5; }
.day-none { --day: #55606d; --day-tint: #eef0f3; }

.day-group {
  margin: 12px -4px;
  padding: 8px;
  border-radius: 20px;
  background: var(--day-tint);
}
.day-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 2px 4px 8px;
  color: var(--day);
  font-size: 1.2rem;
  letter-spacing: -0.01em;
}
.day-head::before {
  content: "";
  width: 12px;
  height: 12px;
  border-radius: 4px;
  background: var(--day);
}

.ticket {
  /* Tickets below the screen are laid out only when scrolled near: a page of
     results draws its first screen sooner on a phone. */
  content-visibility: auto;
  contain-intrinsic-size: auto 98px;
  margin: 0 0 8px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  overflow: hidden;
}
.ticket-face {
  display: flex;
  min-height: 96px;
  cursor: pointer;
  list-style: none;
}
.ticket-face::-webkit-details-marker { display: none; }
.ticket-face:focus-visible { outline: 3px solid var(--day); outline-offset: -3px; border-radius: 18px; }
.stub {
  position: relative;
  flex: 0 0 68px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 6px 2px;
  background: var(--day);
  color: #fff;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.stub::after {
  content: "";
  position: absolute;
  top: 0;
  right: -6px;
  bottom: 0;
  width: 12px;
  background: radial-gradient(circle at 6px 8px, var(--surface) 4px, transparent 4.5px) 0 0 / 12px 16px repeat-y;
}
.stub-days { font-size: 0.75rem; font-weight: 800; line-height: 1.15; opacity: 0.95; }
.stub-clock { font-size: 1.25rem; font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; }
.stub-ampm { font-size: 0.75rem; font-weight: 700; opacity: 0.95; }
.face {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 10px 12px 10px 16px;
}
.face .cat { color: var(--muted); font-size: 0.78rem; font-weight: 700; }
.face .title { font-size: 1.05rem; font-weight: 700; line-height: 1.2; }
.face .place { color: var(--muted); font-size: 0.875rem; }
.chips-row { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 2px; }
.tag {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 8px;
  background: var(--soft);
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
}
.tag.price { font-weight: 700; }
.tag.spots { background: #e7f6ec; color: #11692f; }
.tag.spots.low { background: #fde7e4; color: #b42318; }
.ticket[open] .ticket-face { border-bottom: 1px solid var(--line); }
/* Containment would trap the open ticket's sheet (position: fixed) inside it. */
.ticket[open] { content-visibility: visible; }
.ticket-panel { padding: 12px 14px 14px; }
.ticket-panel h2 { margin: 0 0 6px; font-size: 1.35rem; letter-spacing: -0.01em; }

/* Filters behind one button; a sheet without needing any script. */
.filters-sheet { margin: 8px 0; }
.filters-sheet > summary { list-style: none; width: 100%; gap: 8px; background: var(--text); border-color: var(--text); color: #fff; }
.filters-sheet > summary::-webkit-details-marker { display: none; }
.filters-sheet .count {
  min-width: 22px;
  padding: 0 7px;
  border-radius: 11px;
  background: var(--action);
  font-size: 0.8rem;
  text-align: center;
}
.sheet-body { padding-top: 4px; }

/* Classes / drop-ins as one segmented control. */
.tabs {
  gap: 4px;
  padding: 4px;
  border-radius: 14px;
  background: var(--soft);
}
.tabs .tab { min-height: 40px; border: 0; border-radius: 11px; background: transparent; color: var(--muted); font-weight: 700; }
.tabs .tab.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12); }

.summary { background: var(--bg); }

/* Home tiles with icons. */
.tile { flex-direction: column; gap: 6px; }
.tile .icon { width: 28px; height: 28px; }
.icon, .tabbar svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Bottom tab bar. */
.tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 5;
  display: flex;
  justify-content: center;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  border-top: 1px solid var(--line);
  background: var(--surface);
}
.tabbar a {
  flex: 0 1 8rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: var(--tabbar);
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 600;
  text-decoration: none;
}
.tabbar svg { width: 24px; height: 24px; }
.tabbar a[aria-current="page"] { color: var(--action); }

/* Phone sheets: the open ticket, and the filters, slide up over the list. */
.sheet-dim { display: none; }
@media (max-width: 700px) {
  html.sheet-open { overflow: hidden; }
  html.sheet-open .sheet-dim {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 20;
    background: rgba(16, 23, 31, 0.45);
  }
  html.js .ticket[open] .ticket-panel {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 21;
    max-height: 82vh;
    overflow-y: auto;
    padding: 20px 18px calc(22px + env(safe-area-inset-bottom, 0px));
    border-radius: 24px 24px 0 0;
    background: var(--surface);
    box-shadow: 0 -6px 24px rgba(0, 0, 0, 0.18);
  }
  html.js .ticket[open] .ticket-panel::before {
    content: "";
    display: block;
    width: 44px;
    height: 5px;
    margin: -8px auto 12px;
    border-radius: 3px;
    background: #d6d2cc;
  }
  html.js .ticket[open] .ticket-face { border-bottom: 0; }
  .filters-sheet[open] > .sheet-body {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 21;
    max-height: 80vh;
    overflow-y: auto;
    padding: 14px 14px calc(18px + env(safe-area-inset-bottom, 0px));
    border-radius: 24px 24px 0 0;
    background: var(--surface);
    box-shadow: 0 -6px 24px rgba(0, 0, 0, 0.18);
  }
  /* The page behind stays put; the Filters button stays under the dim so it
     never sits on top of the sheet. */
  html.filters-open { overflow: hidden; }
  html.filters-open body { overflow: hidden; }
}

/* A tighter top so the first ticket sits high on a phone. */
.summary { padding: 4px 0; }
.summary .button { min-height: 36px; padding: 4px 14px; font-size: 0.9rem; }
.filters-sheet { margin: 6px 0; }
.tabs { margin: 8px 0; }
.tabs .tab { min-height: 36px; font-size: 0.95rem; }
@media (max-width: 700px) {
  .filters-sheet[open]::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 20;
    background: rgba(16, 23, 31, 0.45);
  }
}

/* One line of filter words; the full list is in the tooltip and the sheet. */
.summary p { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; overflow-wrap: normal; }
.ticket-panel .cat { color: var(--muted); font-size: 0.8rem; font-weight: 700; margin: 0 0 2px; }
.stub { flex-basis: 74px; }
.stub-days { font-size: 0.7rem; letter-spacing: -0.01em; }
.stub-clock { font-size: 1.15rem; }
/* Session length under the start time on the ticket stub. */
.stub-length {
  margin-top: 4px;
  padding-top: 3px;
  border-top: 1px solid rgba(255, 255, 255, 0.45);
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1.1;
  white-space: nowrap;
}
/* Filters sheet header with a Done button (phone only). */
.sheet-head { display: none; }
@media (max-width: 700px) {
  .filters-sheet[open] .sheet-head {
    position: sticky;
    top: -14px;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: -14px -14px 6px;
    padding: 10px 14px;
    border-bottom: 1px solid var(--line);
    background: var(--surface);
    font-size: 1.1rem;
    font-weight: 800;
  }
}

/* My family: weekday preset per kid. */
.kid-week { width: 100%; margin: 4px 0 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.kid-week legend { padding: 0 4px; font-weight: 700; }
.kid-week select, .kid-week input[type="time"] { display: block; width: 100%; min-height: var(--tap); margin-top: 6px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 10px; font: inherit; background: var(--surface); }
.kid-week .times { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; margin: 8px 0; }
.kid-week .weekdays { display: flex; flex-wrap: wrap; gap: 6px; }

/* Week page. Kid lanes: coral and blue first, then two more. */
.kid-0 { --kid: #e2412d; --kid-fill: #ff6b57; }
.kid-1 { --kid: #2a74c0; --kid-fill: #3a8dde; }
.kid-2 { --kid: #7e22ce; --kid-fill: #9b5de5; }
.kid-3 { --kid: #0f766e; --kid-fill: #14a098; }
.week-kids { display: flex; flex-wrap: wrap; gap: 14px; margin: 4px 0 8px; font-size: 0.85rem; font-weight: 700; }
.week-kid { display: inline-flex; align-items: center; gap: 6px; }
.week-kid::before { content: ""; width: 14px; height: 14px; border-radius: 4px; background: var(--kid-fill); }
.week-axis { display: flex; justify-content: space-between; margin-left: 48px; color: var(--muted); font-size: 0.72rem; font-weight: 700; }
.week-row { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 8px; align-items: center; padding: 7px 0; border-bottom: 1px solid var(--line); }
.week-day { padding: 5px 0; border-radius: 8px; background: var(--day); color: #fff; font-size: 0.8rem; font-weight: 800; text-align: center; }
.week-lanes { display: flex; flex-direction: column; gap: 5px; }
.lane { position: relative; height: 36px; border-radius: 8px; background: #f1efea; }
.blk {
  position: absolute;
  top: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 8px;
  font: inherit;
  font-size: 0.72rem;
  font-weight: 800;
  white-space: nowrap;
  text-decoration: none;
}
.blk.busy { background: repeating-linear-gradient(45deg, #d6d2cc 0 3px, #e8e5df 3px 6px); color: #4b4f57; }
.blk.gap { border: 2px dashed var(--kid); background: var(--surface); color: var(--kid); }
.blk.gap:focus-visible, .blk.planned:focus-visible { outline: 3px solid var(--text); }
.blk.planned { z-index: 1; padding: 0 4px; border: 0; background: var(--kid-fill); color: #fff; cursor: pointer; }
/* A tapped gap fills in at once, so the tap shows while the results load. */
.blk.gap:active, .blk.gap.going { border-style: solid; background: var(--kid); color: #fff; }

/* For me: the same parts at night. */
body.me {
  --bg: #10171f;
  --surface: #1a2430;
  --text: #f2f5f7;
  --muted: #9aa8b5;
  --line: #223040;
  --accent: #c8f25a;
  --action: #c8f25a;
  --soft: #223040;
  background: var(--bg);
  color: var(--text);
}
body.me .brand { color: var(--action); }
body.me a { color: var(--accent); }
body.me .chip, body.me .button { background: var(--surface); border-color: var(--line); color: var(--text); }
body.me .chip.on, body.me .button.primary { background: var(--action); border-color: var(--action); color: #10171f; }
body.me .tabbar { background: var(--bg); border-top-color: var(--line); }
body.me .tabbar a[aria-current="page"] { color: var(--action); }
body.me .day-group { background: transparent; padding: 0; margin: 12px 0; }
body.me .day-head { color: var(--muted); font-size: 1rem; }
body.me .day-head::before { display: none; }
body.me .stub { background: #223040; color: var(--action); }
body.me .tag.price { color: var(--text); }
body.me .tag.spots { background: #223040; color: var(--action); }
body.me .tag.spots.low { background: #3a2420; color: #ff9c85; }
body.me .tabs .tab.on { background: var(--surface); }
.day-strip { display: flex; gap: 6px; overflow-x: auto; margin: 10px 0; padding-bottom: 2px; }
.day-strip a {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 52px;
  min-height: 56px;
  border-radius: 14px;
  background: var(--surface);
  color: var(--text);
  font-size: 0.75rem;
  font-weight: 700;
  text-decoration: none;
}
.day-strip a b { font-size: 1.1rem; }
.day-strip a.on { background: var(--action); color: #10171f; }
.me-chips { flex-wrap: nowrap; overflow-x: auto; }
.me-chips .chip { flex: none; }

/* Start screen: two doors before the tiles. */
.doors { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; margin: 8px 0 4px; }
.door {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 4px;
  min-height: 132px;
  padding: 14px;
  border-radius: 20px;
  text-decoration: none;
}
.door b { font-size: 1.45rem; line-height: 1.05; letter-spacing: -0.02em; font-weight: 800; }
.door span { font-size: 0.85rem; line-height: 1.3; }
.door-kids { background: #c2410c; color: #fff; }
.door-me { background: #10171f; color: #f2f5f7; }
.door-me b { color: #c8f25a; }
body.me .badge { background: #3a3320; color: #ffe08a; }
.me-time { margin: 8px 0; }
.me-time > summary { list-style: none; cursor: pointer; }
.me-time > summary::-webkit-details-marker { display: none; }
.me-time > summary::after { content: " \25BE"; }
.me-times { margin-top: 8px; padding: 12px; border-radius: 16px; background: var(--surface); }
.me-times input[type="time"] { display: block; width: 100%; min-height: var(--tap); margin-top: 6px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--text); font: inherit; color-scheme: dark; }
.me-times .keyword { margin-bottom: 10px; }
.me-times .save { margin: 4px 0 8px; }
body.me .pick input:checked + span { color: #10171f; }
body.me .pick span { background: var(--bg); border-color: var(--line); color: var(--text); }

/* Page loading: a thin bar along the top from the tap until the next page shows. */
html.navigating body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  z-index: 100;
  width: 100%;
  height: 3px;
  background: var(--action);
  transform-origin: left;
  animation: nav-progress 3s cubic-bezier(0.1, 0.7, 0.3, 1) forwards;
}
@keyframes nav-progress { from { transform: scaleX(0.08); } to { transform: scaleX(0.92); } }
@media (prefers-reduced-motion: reduce) {
  html.navigating body::before { animation: none; transform: scaleX(0.6); }
}

/* For my kids with no kids saved: ask where first. */
.week-where { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 8px 0 16px; }
.week-where h2, .week-where p { flex-basis: 100%; margin: 0; }
