@font-face {
  font-family: "Geist";
  src: url("/fonts/geist-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Instrument Serif";
  src: url("/fonts/instrument-serif-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* The design reference PDF's structure (header card, headed table, venue
   chips, red holiday rows) in midnight navy with ivory type and one gold
   accent. Every colour is a variable so the light theme below is the same
   design on warm paper. theme.js sets data-theme before the first paint. */
:root {
  --bg: #070a12;
  --glow: rgba(217, 185, 124, 0.1);
  --card: #0d1220;
  --card-2: #0b0f1b;
  --band: #121829;
  --raised: #161d30;
  --field: rgba(7, 10, 18, 0.55);
  --line: rgba(222, 200, 160, 0.13);
  --line-strong: rgba(222, 200, 160, 0.24);
  --text: #f4f0e8;
  --text-2: #b9b6ae;
  --text-3: #86857f;
  --gold: #d9b97c;
  --gold-soft: rgba(217, 185, 124, 0.11);
  --gold-1: #e6c98f;
  --gold-2: #cfad6c;
  --gold-ink: #1b1508;
  --now-1: rgba(217, 185, 124, 0.17);
  --now-2: rgba(217, 185, 124, 0.05);
  --rose: #eaa3a3;
  --rose-soft: rgba(190, 70, 70, 0.14);
  --rose-line: rgba(234, 163, 163, 0.28);
  --rose-fill: rgba(190, 70, 70, 0.22);
  --ok: #7ad3a0;
  --sheet-1: #121829;
  --sheet-2: #0b0f1b;
  --backdrop: rgba(3, 5, 10, 0.62);
  --scrim: rgba(7, 10, 18, 0.82);
  --shadow: 0 1px 0 rgba(255, 255, 255, 0.03) inset, 0 18px 40px -24px rgba(0, 0, 0, 0.8);
  --past: 0.5;
  --serif: "Instrument Serif", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --radius: 18px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --spring: cubic-bezier(0.32, 0.72, 0, 1); /* the curve iOS uses for its own sheets */
  color-scheme: dark;
}

:root[data-theme="light"] {
  --bg: #f4f1ea;
  --glow: rgba(201, 160, 80, 0.16);
  --card: #ffffff;
  --card-2: #fefdfb;
  --band: #f5f1e8;
  --raised: #ffffff;
  --field: #ffffff;
  --line: rgba(70, 54, 20, 0.1);
  --line-strong: rgba(70, 54, 20, 0.2);
  --text: #171c2b;
  --text-2: #4b5060;
  --text-3: #7c808c;
  --gold: #8a6516;
  --gold-soft: rgba(201, 160, 80, 0.14);
  --gold-1: #e6c98f;
  --gold-2: #d2ae69;
  --gold-ink: #1b1508;
  --now-1: rgba(214, 174, 96, 0.3);
  --now-2: rgba(214, 174, 96, 0.08);
  --rose: #b03a3a;
  --rose-soft: rgba(190, 70, 70, 0.08);
  --rose-line: rgba(176, 58, 58, 0.24);
  --rose-fill: rgba(190, 70, 70, 0.1);
  --ok: #2f9e63;
  --sheet-1: #ffffff;
  --sheet-2: #fbf9f4;
  --backdrop: rgba(22, 26, 40, 0.34);
  --scrim: #0d1322; /* stays navy: iOS draws the clock and battery in white over it */
  --shadow: 0 1px 2px rgba(40, 30, 10, 0.05), 0 14px 30px -22px rgba(40, 30, 10, 0.35);
  --past: 0.55;
  color-scheme: light;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  background: var(--bg);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 15px/1.45 "Geist", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}

/* Installed on a phone, the page runs under the status bar. This strip keeps
   the clock and battery readable over whatever scrolls beneath them. */
body::before {
  content: "";
  position: fixed;
  inset: 0 0 auto 0;
  height: env(safe-area-inset-top);
  background: var(--scrim);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  backdrop-filter: saturate(160%) blur(14px);
  z-index: 5;
  pointer-events: none;
}

/* switching theme in Settings: colours cross-fade rather than snap */
html.theming, html.theming *, html.theming *::before {
  transition: background-color 0.36s ease, color 0.36s ease, border-color 0.36s ease, box-shadow 0.36s ease !important;
}

.page {
  position: relative;
  max-width: 820px;
  min-height: 100dvh;
  margin: 0 auto;
  overflow-x: hidden; /* the table slides sideways between weeks; the page must not */
  overflow-x: clip;
  padding: calc(12px + env(safe-area-inset-top)) calc(14px + env(safe-area-inset-right))
    calc(36px + env(safe-area-inset-bottom)) calc(14px + env(safe-area-inset-left));
}
/* soft gold light falling from the top */
.page::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 420px;
  background: radial-gradient(70% 90% at 50% 0%, var(--glow), transparent 70%);
  pointer-events: none;
}
.page > * { position: relative; }

p, h1, h2 { margin: 0; }

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
  cursor: pointer;
  transition: transform 0.22s var(--spring), background-color 0.2s ease, opacity 0.2s ease, border-color 0.2s ease;
}
button:active:not(:disabled) { transform: scale(0.965); transition-duration: 0.08s; }
button:disabled { cursor: default; }
:focus-visible { outline: 1.5px solid var(--gold); outline-offset: 2px; }

svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

.surface {
  background: linear-gradient(180deg, var(--card), var(--card-2));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* ---------- header card: navy in both themes ---------- */
.hero {
  --text: #f4f0e8;
  --text-2: #b9b6ae;
  --text-3: #86857f;
  --line: rgba(222, 200, 160, 0.13);
  --ok: #7ad3a0;
  --rose: #eaa3a3;
  --gold: #d9b97c;
  padding: 13px 14px 15px 18px;
  border-radius: var(--radius);
  border: 1px solid rgba(222, 200, 160, 0.24);
  color: var(--text);
  background:
    radial-gradient(90% 160% at 100% 0%, rgba(217, 185, 124, 0.16), transparent 60%),
    linear-gradient(165deg, #172038, #0d1322 70%);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.05) inset, 0 24px 50px -28px rgba(0, 0, 0, 0.9);
}
:root[data-theme="light"] .hero { box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06) inset, 0 18px 34px -22px rgba(13, 19, 34, 0.55); }
.hero-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.hero-actions { flex: 0 0 auto; display: flex; align-items: center; gap: 8px; }
.hero h1 { font: 400 30px/1.1 var(--serif); letter-spacing: -0.005em; white-space: nowrap; }
.hero #subtitle { margin-top: 4px; font-size: 12.5px; color: var(--text-2); }
.sync {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 32px;
  padding: 0 11px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(7, 10, 18, 0.5);
  font-size: 12px;
  color: var(--text-2);
}
.icon-btn {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: rgba(7, 10, 18, 0.5);
  color: var(--text-2);
}
.icon-btn svg { width: 16px; height: 16px; transition: transform 0.5s var(--spring); }
.icon-btn:active svg { transform: rotate(50deg); }
.dot { position: relative; width: 6px; height: 6px; border-radius: 50%; background: var(--text-3); transition: background-color 0.3s ease; }
.dot.live { background: var(--ok); }
/* a ring that breathes out from the dot while the timetable is live */
.dot.live::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--ok); animation: ring 2.6s ease-out infinite; }
.dot.busy { background: var(--gold); animation: pulse 1s ease-in-out infinite; }
.dot.bad { background: var(--rose); }
@keyframes pulse { 50% { opacity: 0.3; } }
@keyframes ring { 0% { transform: scale(1); opacity: 0.55; } 70%, 100% { transform: scale(3.2); opacity: 0; } }

/* ---------- week switcher: in the page, under the timetable ---------- */
.weeknav { display: flex; gap: 8px; margin-top: 12px; }
.weeknav button { min-height: 58px; }
.weeknav button:disabled { opacity: 0.4; }
.arrow { flex: 0 0 54px; display: grid; place-items: center; color: var(--text-2); }
.weekpick {
  flex: 1 1 auto;
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 8px;
  padding: 6px 14px 8px 16px;
  text-align: left;
}
.weekpick-label { font: 400 24px/1.1 var(--serif); }
.weekpick-label b { margin-left: 9px; font: 500 10px/1 "Geist", sans-serif; letter-spacing: 0.14em; text-transform: uppercase; color: var(--gold); vertical-align: 3px; }
.weekpick-meta { grid-column: 1; margin-top: 1px; font-size: 12.5px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.weekpick svg { grid-column: 2; grid-row: 1 / span 2; color: var(--gold); }

/* ---------- the table ---------- */
#schedule { margin-top: 10px; touch-action: pan-y; }
#schedule.in-next { animation: in-next 0.42s var(--spring); }
#schedule.in-prev { animation: in-prev 0.42s var(--spring); }
#schedule.in-fade { animation: in-fade 0.36s var(--ease); }
#schedule.settle { transition: transform 0.42s var(--spring), opacity 0.3s ease; }
#schedule.leave { transition: transform 0.14s ease-in, opacity 0.14s ease-in; }
@keyframes in-next { from { opacity: 0; transform: translate3d(44px, 0, 0); } }
@keyframes in-prev { from { opacity: 0; transform: translate3d(-44px, 0, 0); } }
@keyframes in-fade { from { opacity: 0; transform: translate3d(0, 10px, 0); } }
/* first appearance: the days arrive one after another */
#schedule.in-first .tt-head, #schedule.in-first .day, #schedule.in-first .tt-divider {
  animation: arrive 0.6s var(--spring) both;
  animation-delay: calc(var(--i, 0) * 45ms);
}
@keyframes arrive { from { opacity: 0; transform: translate3d(0, 14px, 0); } }

.tt { overflow: hidden; }

.tt-head, .row {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  column-gap: 10px;
  padding-left: 16px;
  padding-right: 16px;
}
.tt-head {
  padding-top: 13px;
  padding-bottom: 12px;
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
}
.wide { display: none; }

.day { scroll-margin-top: 16px; }
.day-band {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 11px 16px 10px;
  background: var(--band);
  border-top: 1px solid var(--line);
}
.day-band h2 { font: 400 22px/1.1 var(--serif); }
.day-band h2 span { margin-left: 10px; font: 400 12px/1 "Geist", sans-serif; letter-spacing: 0.02em; color: var(--text-3); }
.day-count { margin-left: auto; font-size: 12px; color: var(--text-3); white-space: nowrap; }
.day-band .pill { align-self: center; }

.rows { list-style: none; margin: 0; padding: 0; }
.row {
  position: relative;
  grid-template-areas: "time name" "time chips";
  align-content: start;
  padding-top: 14px;
  padding-bottom: 15px;
  border-top: 1px solid var(--line);
}

.time { grid-area: time; padding-top: 2px; font-size: 12.5px; font-weight: 500; color: var(--text-2); }
.time span { white-space: nowrap; }
.name { grid-area: name; font-size: 15.5px; font-weight: 600; line-height: 1.3; letter-spacing: -0.01em; overflow-wrap: break-word; text-wrap: pretty; }
.name.long { font-size: 14px; font-weight: 500; line-height: 1.4; letter-spacing: 0; }
.chips { grid-area: chips; display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.chip {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  color: var(--text-2);
  font-size: 11.5px;
}
button.chip { padding: 5px 11px; color: var(--gold); }
.chip.kind { border-color: transparent; padding-left: 0; padding-right: 2px; font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--gold); }
.row.empty .name { font-size: 13.5px; font-weight: 400; color: var(--text-3); }

.pill {
  display: inline-block;
  padding: 3px 8px 2px;
  border-radius: 999px;
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.time .pill { display: table; margin-top: 7px; }
.pill.now, .pill.today { background: linear-gradient(180deg, var(--gold-1), var(--gold-2)); color: var(--gold-ink); }
.pill.next { box-shadow: inset 0 0 0 1px var(--gold); color: var(--gold); }

/* today, now */
.day.is-today .day-band { box-shadow: inset 2px 0 0 var(--gold); }
.row.is-now { background: linear-gradient(90deg, var(--now-1), var(--now-2)); }
.row.is-now .time { color: var(--gold); }
.time .left { display: block; margin-top: 5px; font-size: 11px; font-weight: 400; color: var(--text-2); }
/* how far through the session in progress: a gold line along the row's foot */
.progress { position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--gold-soft); overflow: hidden; }
.progress::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, var(--gold-2), var(--gold-1));
  transform-origin: left;
  transform: scaleX(var(--p, 0));
}

/* holiday: the PDF's red row */
.day.is-holiday .day-band, .row.holiday { background: var(--rose-soft); }
.day.is-holiday .day-band h2, .row.holiday .name { color: var(--rose); }
.day.is-holiday .day-band h2 span, .row.holiday .time { color: var(--rose); opacity: 0.75; }

/* what is already over this week, moved below what is still to come */
.tt-divider {
  padding: 14px 16px 12px;
  border-top: 1px solid var(--line-strong);
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-3);
}
.day.is-past > * { opacity: var(--past); }

.day.flash { animation: flash 1.8s ease-out; }
@keyframes flash { 0%, 30% { box-shadow: inset 0 0 0 1.5px var(--gold); } 100% { box-shadow: inset 0 0 0 1.5px transparent; } }

/* loading placeholder: a light sweeps across it */
.skel { position: relative; height: 320px; overflow: hidden; }
.skel::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 20%, var(--gold-soft) 50%, transparent 80%);
  transform: translateX(-100%);
  animation: sweep 1.5s ease-in-out infinite;
}
@keyframes sweep { to { transform: translateX(100%); } }

/* ---------- note + footer ---------- */
.note { margin-top: 12px; padding: 15px 16px; font-size: 12.5px; line-height: 1.65; color: var(--text-3); }
.note b { font-weight: 500; color: var(--gold); }
.note #note { color: var(--text-2); }
.foot { margin-top: 16px; padding: 0 12px; text-align: center; font-size: 11.5px; line-height: 1.6; color: var(--text-3); text-wrap: balance; }
.sheet-link {
  /* deliberately quiet: the same small grey as the line above it */
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 36px;
  margin-top: 4px;
  padding: 0 10px;
  font-size: 11.5px;
  color: var(--text-3);
  text-decoration: underline;
  text-decoration-color: var(--line-strong);
  text-underline-offset: 3px;
}
.sheet-link:active { opacity: 0.6; }
.sheet-link svg { width: 11px; height: 11px; }

/* ---------- slide-up panels (weeks, sign-up, settings) ---------- */
dialog.sheet {
  width: 100%;
  max-width: 560px;
  max-height: 88dvh;
  margin: auto auto 0;
  padding: 10px 16px calc(18px + env(safe-area-inset-bottom));
  border: 1px solid var(--line-strong);
  border-bottom: 0;
  border-radius: 26px 26px 0 0;
  background: linear-gradient(180deg, var(--sheet-1), var(--sheet-2));
  color: var(--text);
  overflow-y: auto;
  overscroll-behavior: contain;
  box-shadow: 0 -20px 60px -20px rgba(0, 0, 0, 0.45);
}
/* while a panel is open the page behind it stays put */
html:has(dialog[open]) { overflow: hidden; }
dialog.sheet { touch-action: pan-y; }
/* the grabber: drag the panel down to close it */
dialog.sheet::before { content: ""; display: block; width: 38px; height: 5px; margin: 0 auto 10px; border-radius: 3px; background: var(--line-strong); }
dialog.sheet:focus, dialog.sheet:focus-visible { outline: none; }
dialog.sheet::backdrop {
  background: var(--backdrop);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
dialog.sheet[open] { animation: rise 0.5s var(--spring); }
dialog.sheet[open]::backdrop { animation: fade 0.35s ease; }
dialog.sheet.closing { animation: fall 0.3s cubic-bezier(0.4, 0, 1, 1) forwards; }
dialog.sheet.closing::backdrop { animation: fade 0.3s ease reverse forwards; }
dialog.sheet.dragging { animation: none; transition: none; }
dialog.sheet.snapping { animation: none; transition: transform 0.45s var(--spring); }
@keyframes rise { from { transform: translate3d(0, 100%, 0); } }
@keyframes fall { to { transform: translate3d(0, 100%, 0); } }
@keyframes fade { from { opacity: 0; } }
.sheet-head { display: flex; align-items: center; justify-content: space-between; }
.sheet h2 { font: 400 30px/1.1 var(--serif); }
.text-btn { min-height: 44px; padding-left: 16px; color: var(--text-2); font-size: 14px; }
.today-btn { width: 100%; min-height: 46px; margin-top: 10px; border-radius: 12px; border: 1px solid var(--line-strong); color: var(--gold); font-size: 14px; }
.weeklist { list-style: none; margin: 12px 0 0; padding: 0; }
.weeklist li + li { border-top: 1px solid var(--line); }
.weeklist button {
  width: 100%;
  min-height: 60px;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  column-gap: 12px;
  padding: 9px 6px;
  text-align: left;
}
.weeklist button:active { transform: none; opacity: 0.6; }
.wl-label { font: 400 20px/1.15 var(--serif); }
.wl-label b { margin-left: 9px; font: 500 9.5px/1 "Geist", sans-serif; letter-spacing: 0.14em; text-transform: uppercase; color: var(--gold); vertical-align: 2px; }
.wl-dates { grid-column: 1; font-size: 12.5px; color: var(--text-3); }
.wl-meta { grid-column: 2; grid-row: 1 / span 2; font-size: 12.5px; color: var(--text-3); text-align: right; }
.wl-meta em { display: block; font-style: normal; color: var(--rose); }
.weeklist button[aria-current="true"] .wl-label { color: var(--gold); }

/* ---------- buttons and links shared by the newer screens ---------- */
.primary, .ghost, .danger {
  width: 100%;
  min-height: 50px;
  border-radius: 14px;
  font-size: 15px;
  font-weight: 600;
}
.primary { background: linear-gradient(180deg, var(--gold-1), var(--gold-2)); color: var(--gold-ink); box-shadow: 0 8px 20px -12px rgba(170, 130, 50, 0.7); }
.primary:disabled { opacity: 0.6; }
.ghost { border: 1px solid var(--line-strong); color: var(--text-2); font-weight: 500; }
.danger { background: var(--rose-fill); border: 1px solid var(--rose-line); color: var(--rose); }
.danger:disabled { opacity: 0.6; }
.text-link { min-height: 44px; padding: 0 8px; font-size: 13.5px; color: var(--gold); }
.text-link:disabled { color: var(--text-3); }
.text-link.inline { min-height: 0; padding: 0; font-size: inherit; text-decoration: underline; }

/* ---------- notices: timetable updating, offline ---------- */
.notice { margin-top: 10px; padding: 14px 16px; border-radius: var(--radius); font-size: 13.5px; color: var(--text-2); background: var(--rose-soft); border: 1px solid var(--rose-line); }
.notice strong { display: block; margin-bottom: 2px; font-size: 14.5px; font-weight: 600; color: var(--rose); }
.notice.calm { background: var(--gold-soft); border-color: var(--line-strong); }
.notice.calm strong { color: var(--gold); }

/* ---------- first visit: pick a course ---------- */
.welcome { margin-top: 26px; text-align: center; }
.welcome h2 { font: 400 32px/1.1 var(--serif); animation: arrive 0.6s var(--spring) both; }
.lede { margin-top: 8px; font-size: 14px; color: var(--text-2); animation: arrive 0.6s var(--spring) 60ms both; }
.courses { list-style: none; margin: 20px 0 6px; padding: 0; overflow: hidden; text-align: left; animation: arrive 0.65s var(--spring) 120ms both; }
.courses li + li { border-top: 1px solid var(--line); }
.course {
  width: 100%;
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px 12px 18px;
  text-align: left;
  font-size: 15.5px;
  font-weight: 500;
  line-height: 1.3;
}
.course:active:not(:disabled) { transform: none; background: var(--gold-soft); }
.course svg { flex: 0 0 auto; color: var(--gold); transition: transform 0.3s var(--spring); }
.course:active svg { transform: translateX(4px); }
.years { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 18px 14px; }
.years .chip { min-height: 36px; padding: 0 14px; }
.course-msg { padding: 18px; font-size: 13.5px; color: var(--text-2); }
.courses .skel { height: 290px; }

/* ---------- visitors: save your course ---------- */
.save-row {
  width: 100%;
  min-height: 46px;
  margin-top: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px 8px 16px;
  text-align: left;
  font-size: 13px;
  color: var(--text-2);
  border-color: var(--line-strong);
}
.save-row b { font-weight: 600; color: var(--gold); }
.save-row svg { flex: 0 0 auto; color: var(--gold); }
.save { margin-top: 12px; padding: 22px 18px 10px; text-align: center; border-color: var(--line-strong); }
.save h2 { font: 400 28px/1.1 var(--serif); }
.save p { margin: 8px auto 18px; max-width: 34ch; font-size: 14px; color: var(--text-2); text-wrap: balance; }

/* ---------- one-time install hint ---------- */
.hint { margin-top: 10px; display: flex; align-items: center; gap: 10px; padding: 10px 6px 10px 16px; font-size: 13px; line-height: 1.5; color: var(--text-2); border-color: var(--line-strong); }
.hint p { flex: 1 1 auto; }
.hint b { font-weight: 600; color: var(--text); }
.hint .share { width: 16px; height: 16px; margin: 0 1px -3px; color: var(--gold); }
.hint-go { flex: 0 0 auto; min-height: 34px; padding: 0 14px; border-radius: 999px; background: linear-gradient(180deg, var(--gold-1), var(--gold-2)); color: var(--gold-ink); font-size: 13px; font-weight: 600; }
.hint-x { flex: 0 0 auto; width: 40px; height: 40px; display: grid; place-items: center; color: var(--text-3); }
.hint-x svg { width: 16px; height: 16px; }

/* ---------- sponsor slot (hidden until one is set) ---------- */
.sponsor { margin-top: 12px; padding: 14px 16px; font-size: 13.5px; color: var(--text-2); }
.sponsor a { display: block; color: inherit; text-decoration: none; }
.sponsor b { display: block; font-size: 15px; font-weight: 600; color: var(--text); }
.sponsor-label { display: block; margin-bottom: 4px; font-size: 9.5px; font-weight: 500; letter-spacing: 0.16em; text-transform: uppercase; color: var(--text-3); }

/* ---------- forms inside the slide-up panels ---------- */
.sheet-lede { margin-top: 6px; font-size: 14px; line-height: 1.5; color: var(--text-2); }
.sheet-lede b { font-weight: 500; color: var(--text); overflow-wrap: anywhere; }
.field { display: block; margin-top: 14px; }
.field > span { display: block; margin-bottom: 6px; font-size: 11px; font-weight: 500; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-3); }
.field input, .field select {
  width: 100%;
  min-height: 50px;
  padding: 0 14px;
  border-radius: 14px;
  border: 1px solid var(--line-strong);
  background-color: var(--field);
  color: var(--text);
  font: inherit;
  font-size: 16px; /* below 16px, iOS zooms the page when the field is tapped */
  -webkit-appearance: none;
  appearance: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.field select {
  padding-right: 38px;
  text-overflow: ellipsis;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23b08a3e' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 10l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 20px;
}
.field input::placeholder { color: var(--text-3); opacity: 0.7; }
.field input:focus, .field select:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 4px var(--gold-soft); }
.field .code { font-size: 26px; font-weight: 500; letter-spacing: 0.4em; text-align: center; padding-left: 0.4em; }
.form-error { margin-top: 12px; font-size: 13.5px; color: var(--rose); animation: nudge 0.4s var(--ease); }
@keyframes nudge { 25% { transform: translateX(-5px); } 60% { transform: translateX(4px); } }
.sheet .primary { margin-top: 18px; }
.sheet form > .text-link { display: block; width: 100%; margin-top: 2px; }
.split { display: flex; justify-content: space-between; margin-top: 4px; }
/* The privacy line is deliberately quiet: plain grey text. */
.fine { margin-top: 12px; text-align: center; font-size: 11.5px; color: var(--text-3); }
.fine a { color: inherit; text-decoration: none; cursor: text; }

/* ---------- settings ---------- */
/* Automatic / Light / Dark: a thumb slides under the chosen one */
.seg {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  padding: 3px;
  border-radius: 14px;
  border: 1px solid var(--line-strong);
  background-color: var(--field);
}
.seg::before {
  content: "";
  position: absolute;
  top: 3px;
  bottom: 3px;
  left: 3px;
  width: calc((100% - 6px) / 3);
  border-radius: 11px;
  background: linear-gradient(180deg, var(--gold-1), var(--gold-2));
  box-shadow: 0 4px 10px -6px rgba(0, 0, 0, 0.5);
  transform: translateX(calc(var(--at, 0) * 100%));
  transition: transform 0.42s var(--spring);
}
.seg button { position: relative; min-height: 42px; font-size: 14px; color: var(--text-2); transition: color 0.25s ease; }
.seg button:active { transform: none; }
.seg button[aria-pressed="true"] { color: var(--gold-ink); font-weight: 600; }
/* rows grouped in one card with hairlines between them */
.group { margin-top: 18px; border-radius: 14px; border: 1px solid var(--line); overflow: hidden; }
.group > * + * { border-top: 1px solid var(--line); }
.row-btn {
  width: 100%;
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  font-size: 15px;
  text-align: left;
}
.row-btn:active:not(:disabled) { transform: none; background: var(--gold-soft); }
.row-btn input { width: 22px; height: 22px; accent-color: var(--gold); }
#setLogout { color: var(--text-2); }
.row-plain { display: block; width: 100%; min-height: 44px; margin-top: 22px; padding: 0 4px; text-align: left; font-size: 12.5px; color: var(--text-3); }
.small-links { display: flex; gap: 22px; margin-top: 22px; padding-bottom: 6px; font-size: 12.5px; }
.small-links a, .small-links button { min-height: 32px; display: inline-flex; align-items: center; color: var(--text-3); text-decoration: underline; text-underline-offset: 3px; }
.split-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 20px; }

/* ---------- the Privacy Note page ---------- */
.prose { max-width: 640px; font-size: 15px; line-height: 1.65; color: var(--text-2); }
.prose .back { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; margin-left: -6px; color: var(--gold); text-decoration: none; font-size: 14px; }
.prose h1 { margin-top: 10px; font: 400 40px/1.1 var(--serif); color: var(--text); }
.prose .dated { margin-top: 6px; font-size: 12.5px; color: var(--text-3); }
.prose h2 { margin-top: 28px; font: 400 24px/1.2 var(--serif); color: var(--text); }
.prose p, .prose ul { margin-top: 10px; }
.prose ul { padding-left: 20px; }
.prose li + li { margin-top: 4px; }
.prose b { font-weight: 600; color: var(--text); }
.prose a:not(.back) { color: var(--gold); }

/* ---------- toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(22px + env(safe-area-inset-bottom));
  translate: -50% 0;
  width: max-content;
  max-width: calc(100vw - 32px);
  padding: 12px 16px;
  border-radius: 14px;
  background: var(--raised);
  border: 1px solid var(--line-strong);
  color: var(--text);
  font-size: 13.5px;
  box-shadow: 0 16px 40px -10px rgba(0, 0, 0, 0.45);
  z-index: 10;
  animation: pop 0.5s var(--spring);
}
@keyframes pop { from { opacity: 0; transform: translate3d(0, 26px, 0) scale(0.96); } }

/* a mouse: gentle hover states (phones never see these) */
@media (hover: hover) {
  .course:hover, .row-btn:hover, .weeklist button:hover { background: var(--gold-soft); }
  .primary:hover { filter: brightness(1.04); }
}

/* narrow phones: give the session column the room, let the time wrap at the dash */
@media (max-width: 359px) {
  .tt-head, .row { grid-template-columns: 96px minmax(0, 1fr); }
  .hero h1 { font-size: 26px; }
}

/* wider screens: the PDF's separate venue column */
@media (min-width: 680px) {
  .page { padding-top: 32px; }
  .hero { padding: 18px 20px 20px 26px; }
  .hero h1 { font-size: 40px; }
  .hero #subtitle { font-size: 14px; }
  .tt-head, .row { grid-template-columns: 190px minmax(0, 1fr) 260px; column-gap: 16px; padding-left: 24px; padding-right: 24px; }
  .row { grid-template-areas: "time name chips"; }
  .chips { margin-top: 0; }
  .day-band { padding: 12px 24px 11px; }
  .tt-divider { padding-left: 24px; padding-right: 24px; }
  .wide { display: inline; }
  .narrow { display: none; }
  .time { font-size: 13.5px; }
  .time .pill { display: inline-block; margin: 0 0 0 8px; }
  .welcome { max-width: 520px; margin-left: auto; margin-right: auto; }
  dialog.sheet { margin: auto; border-radius: 26px; border-bottom: 1px solid var(--line-strong); }
  dialog.sheet::before { display: none; }
  dialog.sheet[open] { animation: rise-mid 0.4s var(--spring); }
  dialog.sheet.closing { animation: fall-mid 0.22s ease-in forwards; }
}
@keyframes rise-mid { from { opacity: 0; transform: translate3d(0, 24px, 0) scale(0.97); } }
@keyframes fall-mid { to { opacity: 0; transform: translate3d(0, 16px, 0) scale(0.98); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after, *::backdrop { animation: none !important; transition: none !important; }
}
