/* ============================================================
   OSTEOSTRONG MEMBER APP · CHARGE
   Dark, athletic, gold core with reactive accent theming.
   --accent is set dynamically by JS (theme preference).
   Book button uses status colors inline (always reactive).
   ============================================================ */

:root {
  --bg: #0E1210;
  --bg-2: #171C18;
  --bg-3: #1e241f;
  --line: #262e26;
  --line-2: #333d33;
  --ink: #F0F3EE;
  --ink-dim: #9aa39a;
  --ink-faint: #6b746b;
  --accent: #E5B345;          /* overridden by JS */
  --accent-glow: rgba(229,179,69,0.22);
  --accent-dim: rgba(229,179,69,0.12);
  --red: #FF5A4D;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

html, body {
  background: var(--bg);
  color: var(--ink);
  font-family: 'Archivo', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}
body { max-width: 480px; margin: 0 auto; position: relative; min-height: 100vh; }

.hidden { display: none !important; }

/* Loader */
.loader { position: fixed; inset: 0; background: var(--bg); display: flex; align-items: center; justify-content: center; z-index: 1000; }
.loader-ring { width: 40px; height: 40px; border: 3px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.8s linear infinite; }
.loader-ring.small { width: 26px; height: 26px; border-width: 2px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* App container */
#app { min-height: 100vh; padding-bottom: calc(76px + var(--safe-bottom)); }
.screen-scroll { padding-top: calc(12px + var(--safe-top)); animation: fadeIn 0.3s; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } }

/* Topbar */
.topbar { display: flex; align-items: center; justify-content: space-between; padding: 12px 22px 18px; }
.greet-sm { font-size: 13px; color: var(--ink-dim); font-weight: 500; }
.greet-name { font-family: 'Archivo', sans-serif; font-weight: 800; font-size: 26px; letter-spacing: -0.02em; }
.avatar-btn {
  width: 44px; height: 44px; border-radius: 50%; border: none;
  background: var(--accent); color: var(--bg);
  font-family: 'Archivo', sans-serif; font-weight: 800; font-size: 15px;
  cursor: pointer; transition: transform 0.15s;
}
.avatar-btn:active { transform: scale(0.94); }

/* Hero */
.hero {
  margin: 0 18px 14px; padding: 26px 24px;
  background: radial-gradient(circle at 85% 12%, var(--accent-glow), transparent 55%), var(--bg-2);
  border: 1px solid var(--line); border-radius: 26px;
  position: relative; overflow: hidden; cursor: pointer;
  min-height: 148px;
}
.hero-tag { font-family: 'JetBrains Mono', monospace; font-size: 10px; color: var(--accent); letter-spacing: 0.15em; text-transform: uppercase; margin-bottom: 14px; }
.hero-big { font-family: 'Archivo', sans-serif; font-weight: 900; font-size: 58px; line-height: 0.9; letter-spacing: -0.03em; color: var(--ink); }
.hero-big small { font-size: 20px; font-weight: 700; color: var(--ink-dim); }
.hero-sub { color: var(--ink-dim); font-size: 13px; margin-top: 10px; max-width: 78%; line-height: 1.4; }
.hero-ring { position: absolute; top: 22px; right: 20px; width: 60px; height: 60px; }
.hero-dots { display: flex; gap: 5px; margin-top: 16px; }
.hero-dots .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--line-2); transition: all 0.2s; }
.hero-dots .dot.on { background: var(--accent); width: 18px; border-radius: 3px; }

/* Book button — reactive */
.book-btn {
  margin: 0 18px 16px; width: calc(100% - 36px);
  padding: 18px 20px; border: none; border-radius: 20px;
  display: flex; align-items: center; justify-content: space-between;
  cursor: pointer; transition: transform 0.15s;
  font-family: inherit;
}
.book-btn:active { transform: scale(0.98); }
.book-btn-left { text-align: left; }
.book-btn-status { font-family: 'Archivo', sans-serif; font-weight: 800; font-size: 17px; }
.book-btn-label { font-size: 12px; opacity: 0.75; margin-top: 2px; font-weight: 600; }
.book-btn-arrow { width: 42px; height: 42px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 19px; font-weight: 700; }

/* Quick tiles */
.quick-row { display: flex; gap: 12px; margin: 0 18px 8px; }
.quick-tile {
  flex: 1; background: var(--bg-2); border: 1px solid var(--line);
  border-radius: 18px; padding: 16px; text-align: left; cursor: pointer;
  transition: border-color 0.2s; font-family: inherit;
}
.quick-tile:active { border-color: var(--accent); }
.qt-ic { font-size: 24px; margin-bottom: 10px; }
.qt-title { font-family: 'Archivo', sans-serif; font-weight: 700; font-size: 14px; color: var(--ink); }
.qt-sub { font-size: 11px; color: var(--ink-faint); margin-top: 3px; }

/* Section head */
.section-head { display: flex; justify-content: space-between; align-items: baseline; margin: 24px 22px 12px; }
.section-head span:first-child { font-family: 'Archivo', sans-serif; font-weight: 800; font-size: 18px; color: var(--ink); }
.sh-more { font-family: 'JetBrains Mono', monospace; font-size: 11px; color: var(--accent); letter-spacing: 0.05em; cursor: pointer; }

/* Content cards */
.content-list { margin: 0 18px; display: flex; flex-direction: column; gap: 10px; }
.content-card {
  display: flex; gap: 14px; padding: 10px;
  background: var(--bg-2); border: 1px solid var(--line);
  border-radius: 18px; cursor: pointer; text-align: left;
  font-family: inherit; transition: border-color 0.2s;
}
.content-card:active { border-color: var(--line-2); }
.cc-thumb { width: 72px; height: 72px; border-radius: 14px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 28px; }
.cc-body { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; }
.cc-tag { font-family: 'JetBrains Mono', monospace; font-size: 9px; color: var(--ink-faint); letter-spacing: 0.1em; margin-bottom: 5px; }
.cc-title { font-family: 'Archivo', sans-serif; font-weight: 700; font-size: 14px; color: var(--ink); line-height: 1.3; }
.cc-meta { font-size: 11px; color: var(--ink-dim); margin-top: 5px; }

/* Page top (book, progress, learn, settings) */
.page-top { padding: 8px 22px 18px; }
.page-eyebrow { font-family: 'JetBrains Mono', monospace; font-size: 11px; color: var(--accent); letter-spacing: 0.2em; text-transform: uppercase; margin-bottom: 10px; }
.page-h1 { font-family: 'Archivo', sans-serif; font-weight: 900; font-size: 34px; letter-spacing: -0.03em; line-height: 1; }
.back-link { background: none; border: none; color: var(--ink-dim); font-family: inherit; font-size: 13px; cursor: pointer; margin-bottom: 14px; padding: 0; }

/* Book: type list */
.type-list { margin: 0 18px; display: flex; flex-direction: column; gap: 10px; }
.type-card {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 20px; background: var(--bg-2); border: 1px solid var(--line);
  border-radius: 18px; cursor: pointer; font-family: inherit;
  transition: border-color 0.2s;
}
.type-card:active { border-color: var(--accent); }
.type-name { font-family: 'Archivo', sans-serif; font-weight: 700; font-size: 16px; color: var(--ink); text-align: left; }
.type-dur { font-size: 12px; color: var(--ink-dim); margin-top: 3px; text-align: left; }
.type-arrow { width: 34px; height: 34px; border-radius: 50%; background: var(--bg-3); color: var(--accent); display: flex; align-items: center; justify-content: center; font-size: 16px; }
.book-note { margin: 16px 22px; }
.book-note p { font-size: 12px; color: var(--ink-faint); line-height: 1.5; }

/* Book: selected type */
.selected-type { margin: 0 18px 16px; padding: 14px 18px; background: var(--accent-dim); border: 1px solid var(--accent); border-radius: 14px; display: flex; align-items: center; justify-content: space-between; }
.selected-type .type-name { color: var(--accent); }

/* Book: month calendar */
#calendar { margin: 0 18px 18px; }
.cal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.cal-month { font-family: 'Archivo', sans-serif; font-weight: 800; font-size: 17px; color: var(--ink); }
.cal-nav {
  width: 38px; height: 38px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--bg-2); color: var(--ink); font-size: 20px; cursor: pointer;
  display: flex; align-items: center; justify-content: center; font-family: inherit;
  transition: all 0.15s;
}
.cal-nav:active { background: var(--bg-3); }
.cal-nav.off { opacity: 0.25; pointer-events: none; }
.cal-dow-row, .cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-dow-row { margin-bottom: 6px; }
.cal-dow { text-align: center; font-family: 'JetBrains Mono', monospace; font-size: 10px; color: var(--ink-faint); letter-spacing: 0.05em; padding: 4px 0; }
.cal-cell {
  aspect-ratio: 1; border-radius: 12px; display: flex; flex-direction: column;
  align-items: center; justify-content: center; position: relative;
  font-family: 'Archivo', sans-serif; font-weight: 600; font-size: 15px;
  background: transparent; color: var(--ink); cursor: default;
}
.cal-cell.empty { background: transparent; }
.cal-cell.disabled { color: var(--line-2); }
.cal-cell.bookable { background: var(--bg-2); border: 1px solid var(--line); cursor: pointer; transition: all 0.12s; }
.cal-cell.bookable:active { transform: scale(0.94); }
.cal-cell.has-avail { border-color: var(--line-2); }
.cal-cell.no-avail { opacity: 0.5; }
.cal-cell.selected { background: var(--accent); border-color: var(--accent); color: var(--bg); }
.cal-num { line-height: 1; }
.cal-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--accent); position: absolute; bottom: 7px; }
.cal-cell.selected .cal-dot { background: var(--bg); }
.cal-legend { margin-top: 14px; display: flex; align-items: center; gap: 7px; font-size: 11px; color: var(--ink-faint); }
.cal-legend .cal-dot { position: static; }

/* Book: day header above times */
.times-header {
  margin: 0 18px 14px; font-family: 'Archivo', sans-serif; font-weight: 800;
  font-size: 16px; color: var(--ink); letter-spacing: -0.01em;
}

/* Book: times grid */
.times-grid { margin: 0 18px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.time-chip {
  padding: 14px 0; border-radius: 14px; background: var(--bg-2);
  border: 1px solid var(--line); color: var(--ink); cursor: pointer;
  font-family: 'Archivo', sans-serif; font-weight: 700; font-size: 14px;
  transition: all 0.15s;
}
.time-chip:active { background: var(--accent); color: var(--bg); border-color: var(--accent); }

/* Loading / empty blocks */
.loading-block, .empty-block { padding: 40px 24px; text-align: center; }
.loading-block p, .empty-block p { color: var(--ink-dim); font-size: 13px; margin-top: 12px; }
.loading-block .loader-ring { margin: 0 auto; }
.empty-block .dim { color: var(--ink-faint); font-size: 11px; margin-top: 6px; }

/* Progress */
.prog-summary { display: flex; gap: 10px; margin: 0 18px 20px; }
.ps-stat { flex: 1; background: var(--bg-2); border: 1px solid var(--line); border-radius: 16px; padding: 14px 10px; text-align: center; }
.ps-v { font-family: 'Archivo', sans-serif; font-weight: 800; font-size: 22px; color: var(--accent); }
.ps-l { font-family: 'JetBrains Mono', monospace; font-size: 9px; color: var(--ink-faint); letter-spacing: 0.08em; text-transform: uppercase; margin-top: 4px; }
.prog-grid { margin: 0 18px; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.prog-card { background: var(--bg-2); border: 1px solid var(--line); border-radius: 20px; padding: 18px; }
.prog-card.empty { opacity: 0.5; text-align: center; }
.pc-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.pc-icon { font-size: 24px; }
.pc-growth { font-family: 'Archivo', sans-serif; font-weight: 800; font-size: 15px; color: var(--accent); }
.pc-label { font-size: 12px; color: var(--ink-dim); font-weight: 600; }
.pc-best { font-family: 'Archivo', sans-serif; font-weight: 900; font-size: 36px; color: var(--ink); line-height: 1; margin-top: 6px; }
.pc-best small { font-size: 16px; color: var(--ink-dim); }
.pc-detail { font-size: 10px; color: var(--ink-faint); margin-top: 6px; }
.pc-empty { font-size: 12px; color: var(--ink-faint); margin-top: 10px; }

.session-history { margin: 0 18px; }
.sess-row { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.sr-date { font-family: 'JetBrains Mono', monospace; font-size: 11px; color: var(--ink-dim); width: 70px; flex-shrink: 0; }
.sr-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.sr-tag { font-family: 'JetBrains Mono', monospace; font-size: 10px; padding: 3px 7px; border-radius: 6px; background: var(--bg-3); color: var(--ink-dim); }

/* Settings */
.settings-block { margin: 0 18px 8px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 16px; padding: 4px 16px; }
.sb-row { display: flex; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.sb-row:last-child { border-bottom: 0; }
.sb-row span { color: var(--ink-dim); }
.sb-row strong { color: var(--ink); font-weight: 600; }

.theme-picker { margin: 0 18px; display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.theme-swatch {
  background: var(--bg-2); border: 2px solid var(--line); border-radius: 14px;
  padding: 12px 4px; cursor: pointer; font-family: inherit;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  transition: border-color 0.15s;
}
.theme-swatch.selected { border-color: var(--sw); }
.sw-dot { width: 26px; height: 26px; border-radius: 50%; }
.sw-name { font-size: 10px; color: var(--ink-dim); font-weight: 600; }
.theme-swatch.selected .sw-name { color: var(--ink); }
.theme-note { margin: 14px 22px; font-size: 12px; color: var(--ink-faint); line-height: 1.5; }
.theme-note strong { color: var(--ink-dim); }

.status-preview { margin: 0 18px; display: flex; gap: 8px; flex-wrap: wrap; }
.status-chip {
  padding: 10px 16px; border-radius: 100px; background: var(--bg-2);
  border: 1px solid var(--sc); color: var(--sc); cursor: pointer;
  font-family: 'Archivo', sans-serif; font-weight: 700; font-size: 13px;
  transition: all 0.15s;
}
.status-chip.active { background: var(--sc); color: var(--bg); }

/* Bottom nav */
.bottom-nav {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 480px;
  background: rgba(14,18,16,0.92); backdrop-filter: blur(16px);
  border-top: 1px solid var(--line);
  display: flex; justify-content: space-around;
  padding: 10px 8px calc(10px + var(--safe-bottom));
  z-index: 50;
}
.nav-item {
  background: none; border: none; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  color: var(--ink-faint); font-family: inherit; font-size: 10px; font-weight: 600;
  padding: 4px 12px; transition: color 0.15s;
}
.nav-item.active { color: var(--accent); }
.nav-item svg { transition: transform 0.15s; }
.nav-item.active svg { transform: translateY(-1px); }

/* Sheet / modal */
.sheet { position: fixed; inset: 0; z-index: 200; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.72); backdrop-filter: blur(6px); display: flex; align-items: flex-end; justify-content: center; animation: fadeIn 0.15s; }
.sheet-content {
  background: var(--bg-2); border: 1px solid var(--line-2); border-bottom: none;
  border-radius: 26px 26px 0 0; width: 100%; max-width: 480px;
  padding: 28px 24px calc(28px + var(--safe-bottom));
  animation: slideUp 0.28s cubic-bezier(0.2, 0.9, 0.3, 1);
  text-align: center;
  /* dvh first where supported — on iOS Safari 100vh is taller than the
     visible area while the toolbar is showing, which would leave the
     top of a full-height sheet under the chrome. vh stays as the
     fallback for older WebKit. */
  max-height: 92vh;
  max-height: 92dvh;
  overflow-y: auto;
  /* Don't hand the scroll to the page behind once the sheet hits its
     end — on iOS that reads as the sheet being stuck. */
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
@keyframes slideUp { from { transform: translateY(100%); } }
.sheet-content h2 { font-family: 'Archivo', sans-serif; font-weight: 800; font-size: 22px; margin-bottom: 10px; }
.sheet-content p { color: var(--ink-dim); font-size: 14px; line-height: 1.5; margin-bottom: 8px; }
.sheet-content p.dim { color: var(--ink-faint); font-size: 12px; }

.cool-emoji, .rems-icon, .confirm-icon, .success-check { font-size: 44px; margin-bottom: 14px; }
.confirm-icon { width: 68px; height: 68px; border-radius: 20px; display: inline-flex; align-items: center; justify-content: center; margin: 0 auto 14px; }
.success-check { width: 68px; height: 68px; border-radius: 50%; background: var(--accent); color: var(--bg); display: flex; align-items: center; justify-content: center; margin: 0 auto 16px; font-weight: 900; }

.confirm-details { background: var(--bg); border-radius: 16px; padding: 6px 16px; margin: 18px 0; text-align: left; }
.cd-row { display: flex; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.cd-row:last-child { border-bottom: 0; }
.cd-row span { color: var(--ink-dim); }
.cd-row strong { color: var(--ink); font-weight: 600; }

/* Buttons */
/* display:block matters. .btn is used on <a> as well as <button>, and
   an anchor is inline by default: width is ignored, vertical padding
   doesn't reserve any height, and the pill lands on top of whatever
   button sits above it. That was the crammed store sheet. */
.btn {
  display: block; box-sizing: border-box; width: 100%; padding: 16px;
  border-radius: 100px; border: none; font-family: 'Archivo', sans-serif;
  font-weight: 700; font-size: 15px; line-height: 1.2; cursor: pointer;
  margin-top: 10px; text-align: center; text-decoration: none;
}
.btn-accent { background: var(--accent); color: var(--bg); }
.btn-text { width: 100%; background: none; border: none; color: var(--ink-dim); font-family: inherit; font-size: 14px; padding: 14px; cursor: pointer; margin-top: 4px; }

/* Toast */
.toast {
  position: fixed; bottom: calc(90px + var(--safe-bottom)); left: 50%; transform: translateX(-50%);
  background: var(--bg-3); color: var(--ink); border: 1px solid var(--line-2);
  padding: 12px 20px; border-radius: 100px; font-size: 13px; font-weight: 500;
  z-index: 300; max-width: 88%; text-align: center;
  box-shadow: 0 8px 30px rgba(0,0,0,0.4);
  animation: toastIn 0.25s;
}
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 10px); } }
.toast-error { border-color: var(--red); }
.toast-success { border-color: var(--accent); }

/* Error screen */
.error-screen { padding: 60px 30px; text-align: center; }
.error-screen h2 { font-family: 'Archivo', sans-serif; font-weight: 800; font-size: 22px; margin-bottom: 12px; }
.error-screen p { color: var(--ink-dim); font-size: 14px; margin-bottom: 20px; }

/* ============================================================
   UPCOMING APPOINTMENTS (Home next-card + Book list)
   ============================================================ */

/* Home: next session card */
.next-card {
  margin: 0 18px 16px; padding: 16px 18px;
  background: var(--bg-2); border: 1px solid var(--line);
  border-left: 3px solid var(--accent); border-radius: 0 16px 16px 0;
}
.nc-tag {
  font-family: 'JetBrains Mono', monospace; font-size: 10px;
  letter-spacing: 0.15em; color: var(--accent); text-transform: uppercase;
  margin-bottom: 8px;
}
.nc-when { font-family: 'Archivo', sans-serif; font-weight: 800; font-size: 19px; color: var(--ink); line-height: 1.1; }
.nc-type { font-size: 12px; color: var(--ink-dim); margin-top: 4px; }
.nc-actions { display: flex; gap: 8px; margin-top: 12px; }
.nc-btn {
  flex: 1; padding: 9px; border-radius: 100px;
  border: 1px solid var(--line-2); background: transparent; color: var(--ink-dim);
  font-family: inherit; font-size: 12px; font-weight: 600; cursor: pointer;
}
.nc-btn:active { background: var(--bg-3); }

/* Book: upcoming list */
.upcoming-list { margin: 0 18px 8px; }
.upcoming-card {
  background: var(--bg-2); border: 1px solid var(--line);
  border-radius: 16px; padding: 14px 16px; margin-bottom: 10px;
}
.uc-top { display: flex; align-items: flex-start; justify-content: space-between; }
.uc-type { font-family: 'Archivo', sans-serif; font-weight: 700; font-size: 15px; color: var(--ink); }
.uc-when { font-size: 12px; color: var(--ink-dim); margin-top: 3px; }
.uc-badge {
  background: var(--bg-3); color: var(--accent);
  font-family: 'JetBrains Mono', monospace; font-size: 9px;
  padding: 3px 8px; border-radius: 100px; letter-spacing: 0.05em;
}
.uc-actions { display: flex; gap: 8px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.uc-btn {
  flex: 1; padding: 8px; border-radius: 100px;
  border: 1px solid var(--line-2); background: transparent; color: var(--ink-dim);
  font-family: inherit; font-size: 12px; font-weight: 600; cursor: pointer;
}
.uc-btn:active { background: var(--bg-3); }
.uc-btn.danger { border-color: rgba(255,90,77,0.25); color: var(--red); }

.upcoming-empty {
  margin: 0 18px 16px; padding: 20px; text-align: center;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 16px;
  font-size: 13px; color: var(--ink-dim);
  display: flex; flex-direction: column; gap: 5px;
}
.upcoming-empty .ue-note { font-size: 11px; color: var(--ink-faint); }

/* Cancel / reschedule sheet */
.cancel-sheet { text-align: center; }
.cancel-icon {
  width: 56px; height: 56px; border-radius: 16px; margin: 0 auto 14px;
  display: flex; align-items: center; justify-content: center; font-size: 24px;
  background: rgba(255,90,77,0.13); color: var(--red);
}
.btn-danger-solid { background: var(--red); color: var(--bg); }

/* ============================================================
   PROFILE EDITING (Settings)
   ============================================================ */
.chip-btn {
  background: var(--bg-2); border: 1px solid var(--line);
  color: var(--ink); padding: 7px 14px; border-radius: 100px;
  font-family: inherit; font-size: 12px; font-weight: 600; cursor: pointer;
}
.chip-btn.small { padding: 5px 12px; font-size: 11px; }
.chip-btn:active { border-color: var(--accent); color: var(--accent); }

.edit-sheet { text-align: left; }
.edit-sheet h2 { text-align: left; }
.ef-field { margin-bottom: 14px; }
.ef-field label {
  display: block; font-size: 12px; color: var(--ink-dim);
  margin-bottom: 6px; font-weight: 600;
}
.ef-field input {
  width: 100%; padding: 13px 14px; border-radius: 12px;
  background: var(--bg); border: 1px solid var(--line-2); color: var(--ink);
  font-family: inherit; font-size: 15px;
}
.ef-field input:focus { outline: none; border-color: var(--accent); }
.ef-readonly {
  font-size: 12px; color: var(--ink-faint); padding: 10px 0 4px;
  border-top: 1px solid var(--line); margin-top: 4px;
}
.ef-readonly strong { color: var(--ink-dim); }
.ef-error {
  background: rgba(255,90,77,0.12); color: var(--red);
  border-radius: 10px; padding: 10px 12px; font-size: 12px;
  margin: 4px 0 12px;
}

/* ============================================================
   AUTH — sign in with an emailed code
   Same Charge language as the app: emblem, mono eyebrow,
   heavy Archivo statement, gold action.
   ============================================================ */

#auth { min-height: 100vh; display: flex; align-items: center; }

.auth-screen {
  width: 100%; max-width: 420px; margin: 0 auto;
  padding: calc(30px + var(--safe-top)) 26px calc(30px + var(--safe-bottom));
  text-align: center;
  animation: fadeIn 0.35s;
}

/* Brand lockup — matches the coach app: centered, generous, stacked */
.auth-brand {
  display: flex; flex-direction: column; align-items: center;
  gap: 14px; margin-bottom: 44px;
}
.auth-brand.small { gap: 12px; margin-bottom: 36px; }
.auth-wordmark { height: 42px; width: auto; max-width: 100%; object-fit: contain; display: block; }
.auth-brand.small .auth-wordmark { height: 32px; }
.auth-locale { height: 52px; width: auto; max-width: 88%; object-fit: contain; display: block; opacity: 0.92; }
.auth-brand.small .auth-locale { height: 38px; }

.auth-eyebrow {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 12px;
}
.auth-h1 {
  font-family: 'Archivo', sans-serif; font-weight: 900;
  font-size: 38px; line-height: 0.98; letter-spacing: -0.03em;
  margin-bottom: 14px;
}
.auth-p {
  color: var(--ink-dim); font-size: 14px; line-height: 1.5;
  margin: 0 auto 14px; max-width: 32ch;
}
.auth-screen .ef-field label { text-align: left; }

@media (max-height: 700px) {
  .auth-wordmark { height: 34px; }
  .auth-locale { height: 40px; }
  .auth-brand { margin-bottom: 30px; }
  .auth-h1 { font-size: 32px; }
}

/* Keep browser autofill from painting the field white */
.ef-field input:-webkit-autofill,
.ef-field input:-webkit-autofill:hover,
.ef-field input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--ink);
  -webkit-box-shadow: 0 0 0 1000px var(--bg) inset;
  caret-color: var(--ink);
  transition: background-color 9999s ease-in-out 0s;
}
.auth-p strong { color: var(--ink); font-weight: 600; }
.auth-screen .ef-field { margin-top: 12px; }
.auth-screen .btn { margin-top: 6px; }
.auth-foot {
  color: var(--ink-faint); font-size: 12px; line-height: 1.5;
  margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line);
}

/* Six-digit code */
.code-input {
  font-family: 'JetBrains Mono', monospace !important;
  font-size: 24px !important; letter-spacing: 0.22em;
  text-align: center; padding: 16px 10px !important;
}
.code-input::placeholder {
  color: var(--line-2); letter-spacing: 0; font-size: 14px;
  font-family: 'Archivo', sans-serif;
}

@media (prefers-reduced-motion: reduce) {
  .auth-screen { animation: none; }
}

/* Sign out (Settings) */
.signout-btn {
  display: block; width: calc(100% - 36px); margin: 10px 18px 0;
  padding: 15px; border-radius: 14px;
  background: transparent; border: 1px solid var(--line-2);
  color: var(--ink-dim); font-family: inherit; font-size: 14px; font-weight: 600;
  cursor: pointer; transition: border-color 0.15s, color 0.15s;
}
.signout-btn:active { border-color: var(--red); color: var(--red); }

/* Plan chip + locked session types */
.plan-chip {
  margin: 0 18px 12px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--ink-faint);
}
.plan-chip strong { color: var(--accent); font-weight: 500; }

.type-card.locked {
  opacity: 0.45;
  border-style: dashed;
}
.type-card.locked .type-name { color: var(--ink-dim); }
.type-lock {
  font-size: 11px; color: var(--ink-faint);
  margin-top: 5px; line-height: 1.35;
}
.type-card.locked .type-arrow { font-size: 14px; }

/* ============================================================
   MESSAGES FROM THE CENTER
   ============================================================ */

/* Home banner */
.msg-banner {
  display: flex; align-items: flex-start; gap: 12px;
  margin: 0 18px 14px; padding: 14px 16px;
  background: var(--accent-dim); border: 1px solid var(--accent);
  border-radius: 16px; cursor: pointer;
}
.mb-text { flex: 1; min-width: 0; }
.mb-title {
  font-family: 'Archivo', sans-serif; font-weight: 700;
  font-size: 14px; color: var(--accent); margin-bottom: 3px;
}
.mb-body {
  font-size: 12.5px; color: var(--ink-dim); line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.mb-x {
  background: none; border: none; color: var(--ink-faint);
  font-size: 22px; line-height: 1; padding: 0 2px; cursor: pointer;
  flex-shrink: 0;
}

/* Popup sheet */
.msg-sheet-body {
  color: var(--ink-dim); font-size: 14.5px; line-height: 1.55;
  margin-bottom: 12px; white-space: pre-wrap; text-align: left;
}
.msg-sheet-meta {
  font-family: 'JetBrains Mono', monospace; font-size: 10px;
  color: var(--ink-faint); letter-spacing: 0.08em;
  margin-bottom: 18px; text-transform: uppercase;
}

/* Settings link row */
.settings-link {
  display: flex; align-items: center; justify-content: space-between;
  width: calc(100% - 36px); margin: 0 18px;
  background: var(--bg-2); border: 1px solid var(--line);
  border-radius: 16px; padding: 16px 18px;
  color: var(--ink); font-family: inherit; font-size: 14px; font-weight: 500;
  cursor: pointer;
}
.sl-right { display: flex; align-items: center; gap: 8px; color: var(--ink-faint); }
.sl-badge {
  background: var(--accent); color: var(--bg);
  font-size: 11px; font-weight: 800; min-width: 20px; height: 20px;
  border-radius: 100px; display: inline-flex; align-items: center;
  justify-content: center; padding: 0 6px;
}

/* Message list */
.msg-feed { margin: 0 18px; display: flex; flex-direction: column; gap: 12px; }
.msg-item {
  background: var(--bg-2); border: 1px solid var(--line);
  border-radius: 18px; padding: 16px 18px;
}
.msg-item.unread { border-color: var(--accent); background: var(--accent-dim); }
.mi-top { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.mi-title { font-family: 'Archivo', sans-serif; font-weight: 700; font-size: 15px; flex: 1; }
.mi-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex-shrink: 0; }
.mi-body { color: var(--ink-dim); font-size: 13.5px; line-height: 1.5; white-space: pre-wrap; margin-bottom: 8px; }
.mi-meta {
  font-family: 'JetBrains Mono', monospace; font-size: 9.5px;
  color: var(--ink-faint); letter-spacing: 0.08em; text-transform: uppercase;
}

/* Links in messages */
.msg-link {
  color: var(--accent); text-decoration: underline;
  text-underline-offset: 2px; word-break: break-word;
}
.msg-cta {
  display: block; text-align: center; text-decoration: none;
  margin-bottom: 8px; line-height: 1.2;
}
.mi-cta { margin: 4px 0 10px; }
.mi-cta .msg-cta {
  padding: 11px 16px; font-size: 13px; border-radius: 12px;
}

/* ============================================================
   STORE
   Added with the Store tab. A fifth nav item takes each one down to
   ~92px on a 480px frame, so the label needs to hold at that width.
   ============================================================ */
.nav-item span { white-space: nowrap; }

.st-intro { color: var(--ink-dim); font-size: 13px; margin-top: 8px; line-height: 1.45; max-width: 34ch; }

/* Featured — the one thing a coach wants seen first. */
/* The featured card. It has to win against a video sitting directly
   above it and a list directly below, so it gets the gold hairline,
   a stronger wash, and roughly half again the type size of a list
   card — not a list card with more padding. */
.st-featured {
  display: block; width: calc(100% - 36px); margin: 6px 18px 10px; padding: 22px;
  background: radial-gradient(circle at 84% 10%, var(--accent-glow), transparent 62%), var(--bg-2);
  border: 1px solid rgba(229,179,69,0.34); border-radius: 24px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.28);
  text-align: left; font-family: inherit; color: var(--ink); cursor: pointer;
}
.st-featured:active { transform: scale(0.99); }

/* Tile and tag on one line. Stacked, they pushed the name so far down
   that the card's first inch said nothing. */
.stf-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.stf-ic {
  width: 58px; height: 58px; border-radius: 16px; flex: 0 0 58px;
  display: flex; align-items: center; justify-content: center; font-size: 28px;
}
.stf-tag {
  font-family: 'JetBrains Mono', monospace; font-size: 10px; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--accent);
  padding: 5px 10px; border-radius: 100px;
  background: rgba(229,179,69,0.12); border: 1px solid rgba(229,179,69,0.3);
}
.stf-n { font-size: 24px; font-weight: 900; letter-spacing: -0.03em; line-height: 1.15; }
.stf-b { font-size: 13.5px; color: var(--ink-dim); margin-top: 8px; line-height: 1.5; }

/* A bar, not a chip. At this size a pill in the corner reads as a
   status label and the biggest thing on screen ends up with the
   least obvious way in. */
.stf-cta {
  margin-top: 16px; padding: 14px; border-radius: 100px;
  background: var(--accent); color: var(--bg);
  font-size: 14.5px; font-weight: 800; text-align: center;
}
.stf-cta.done {
  background: none; color: #C6FF3D;
  border: 1px solid rgba(198,255,61,0.34); font-weight: 700;
}

/* ---- Learn reader ----
   Long prose, so left-aligned inside a sheet that centres everything
   else. Four centred paragraphs is a poster, not a read. */
.ct-sheet { text-align: left; }
.ct-sheet h2 { font-size: 21px; line-height: 1.25; margin-top: 4px; }
.ct-tag {
  font-family: 'JetBrains Mono', monospace; font-size: 9.5px;
  letter-spacing: 0.14em; color: var(--accent);
}
.ct-src { font-size: 12px; color: var(--ink-faint); margin-top: 6px; }
.ct-blurb { font-size: 14px; color: var(--ink-dim); margin-top: 12px; line-height: 1.55; }
.ct-body { font-size: 14.5px; color: var(--ink-dim); line-height: 1.65; margin-top: 14px; }
.ct-body h2 { font-size: 17px; color: var(--ink); margin: 18px 0 7px; }
.ct-body h3 { font-size: 15px; color: var(--ink); margin: 15px 0 6px; }
.ct-body p { margin: 0 0 12px; }
.ct-body ul, .ct-body ol { margin: 0 0 12px; padding-left: 20px; }
.ct-body li { margin-bottom: 5px; }
.ct-body a { color: var(--accent); }
.ct-body strong { color: var(--ink); }
.ct-sheet .btn { margin-top: 16px; }

/* ---- Video ----
   16:9, click to play. Nothing is requested until the poster is
   tapped, so a member who never watches never downloads a player. */
.vd-wrap {
  position: relative; margin: 6px 18px 12px; border-radius: 20px;
  overflow: hidden; background: var(--bg-2); border: 1px solid var(--line);
  aspect-ratio: 16 / 9;
}
.vd-wrap iframe { width: 100%; height: 100%; display: block; border: 0; }
.vd-poster {
  position: absolute; inset: 0; width: 100%; height: 100%; padding: 0;
  border: 0; background: none; cursor: pointer; display: block;
}
.vd-thumb { width: 100%; height: 100%; object-fit: cover; display: block; }
/* YouTube's hqdefault is 4:3 with black bars; cover crops them off. */
.vd-fallback {
  display: flex; align-items: center; justify-content: center; font-size: 46px;
}
.vd-scrim {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.62), rgba(0,0,0,0.05) 55%);
}
.vd-play {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 62px; height: 62px; border-radius: 50%;
  background: var(--accent); color: var(--bg);
  display: flex; align-items: center; justify-content: center;
  font-size: 21px; padding-left: 4px;
  box-shadow: 0 6px 22px rgba(0,0,0,0.45);
}
.vd-label {
  position: absolute; left: 16px; right: 16px; bottom: 14px;
  color: #fff; font-size: 13.5px; font-weight: 700; text-align: left;
  line-height: 1.35; text-shadow: 0 1px 6px rgba(0,0,0,0.6);
}

/* In a sheet the video sits inside 24px of padding already, so it
   loses the screen-level margin. */
.st-sheet .vd-wrap { margin: 14px 0 4px; border-radius: 16px; }

/* The list */
.st-list { padding: 0 18px; display: flex; flex-direction: column; gap: 10px; }
.st-card {
  display: flex; gap: 12px; align-items: flex-start; width: 100%;
  padding: 13px; background: var(--bg-2); border: 1px solid var(--line);
  border-radius: 18px; text-align: left; font-family: inherit; color: var(--ink); cursor: pointer;
}
.st-card:active { transform: scale(0.99); }
.st-ic {
  width: 52px; height: 52px; border-radius: 13px; flex: 0 0 52px;
  display: flex; align-items: center; justify-content: center; font-size: 23px;
}
.st-body { flex: 1; min-width: 0; }
.st-tag {
  font-family: 'JetBrains Mono', monospace; font-size: 9px; letter-spacing: 0.12em;
  text-transform: uppercase; margin-bottom: 4px;
}
.st-tag.here { color: #C6FF3D; }
.st-tag.ship { color: #4D9FFF; }
.st-tag.out  { color: #E5B345; }
.st-n { font-size: 14.5px; font-weight: 700; letter-spacing: -0.01em; line-height: 1.25; }
.st-b { font-size: 11.5px; color: var(--ink-dim); margin-top: 4px; line-height: 1.4; }
.st-row { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.st-price { font-family: 'JetBrains Mono', monospace; font-size: 12px; color: var(--ink); }
.st-ask { font-size: 11px; color: var(--ink-faint); }

.st-cta {
  margin-left: auto; font-size: 11px; font-weight: 700;
  padding: 6px 11px; border-radius: 9px; border: 1px solid var(--line-2); color: var(--ink-dim);
}
.st-cta.want { background: rgba(198,255,61,0.14); border-color: rgba(198,255,61,0.4); color: #C6FF3D; }
.st-cta.buy  { background: #4D9FFF; border-color: #4D9FFF; color: #0E1210; }
.st-cta.both { background: rgba(229,179,69,0.16); border-color: rgba(229,179,69,0.44); color: var(--accent); }
.st-cta.done { background: none; border-color: rgba(198,255,61,0.32); color: #C6FF3D; }

/* Sheet */
.st-sheet { text-align: center; }
.st-sheet-ic {
  width: 62px; height: 62px; border-radius: 16px; margin: 0 auto 14px;
  display: flex; align-items: center; justify-content: center; font-size: 28px;
}
.st-sheet h2 { font-size: 21px; font-weight: 800; letter-spacing: -0.02em; }
.st-sheet-b { font-size: 13px; color: var(--ink-dim); margin-top: 9px; line-height: 1.5; }
.st-sheet-p { font-size: 14px; color: var(--ink); margin-top: 12px; }
.st-sheet-both { font-size: 11.5px; color: var(--ink-faint); margin-top: 10px; }
.st-buy { background: #4D9FFF; border-color: #4D9FFF; color: #0E1210; font-weight: 700; }

/* Long copy is left-aligned even though the sheet is centred. Four
   centred lines of prose is a poster, not something anyone reads. */
.st-details {
  font-size: 13px; color: var(--ink-dim); margin-top: 12px;
  line-height: 1.6; text-align: left; white-space: pre-line;
  padding: 13px 15px; border-radius: 14px; background: var(--bg);
}

/* Out of stock. Amber, not red — nothing is broken and nobody did
   anything wrong; it's just not on the shelf this week. */
.st-out-tag {
  display: inline-block; margin-top: 9px; padding: 4px 11px;
  border-radius: 100px; font-family: 'JetBrains Mono', monospace;
  font-size: 9.5px; letter-spacing: 0.12em; text-transform: uppercase;
  color: #E5B345; background: rgba(229,179,69,0.13);
  border: 1px solid rgba(229,179,69,0.35);
}
.st-note { font-size: 11.5px; color: var(--ink-dim); margin-top: 8px; }
.st-marked {
  margin-top: 14px; padding: 13px; border-radius: 13px;
  border: 1px solid rgba(198,255,61,0.3); color: #C6FF3D;
  font-size: 14px; font-weight: 600;
}
.st-fine { font-size: 11px; color: var(--ink-faint); margin-top: 12px; line-height: 1.5; }

/* The featured card's tag sits inline with the price and CTA, so it
   needs its own spacing rather than the block margin a list-card tag has. */
.st-featured .st-tag { margin-bottom: 0; margin-right: 2px; }
.st-featured .st-row { margin-top: 14px; }

/* ============================================================
   REFER
   ============================================================ */
.rf-intro { color: var(--ink-dim); font-size: 13px; margin-top: 8px; line-height: 1.45; max-width: 36ch; }

.rf-qr { margin: 6px 18px 0; padding: 22px 18px; background: var(--bg-2);
  border: 1px solid var(--line); border-radius: 22px; text-align: center; }
.rf-qr-box { width: 178px; height: 178px; margin: 0 auto; background: #F0F3EE;
  border-radius: 14px; padding: 8px; display: flex; align-items: center; justify-content: center; }
.rf-qr-box svg { display: block; width: 100%; height: 100%; }
.rf-qr-fail { font-size: 12.5px; color: #0E1210; line-height: 1.5; padding: 12px; }
.rf-qr-fail .dim { color: #6b746b; margin-top: 5px; }
.rf-code { font-family: 'JetBrains Mono', monospace; font-size: 13px; letter-spacing: 0.06em;
  color: var(--accent); margin-top: 15px; word-break: break-all; }
.rf-hint { font-size: 11.5px; color: var(--ink-faint); margin-top: 7px; line-height: 1.45; }

.rf-share { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; padding: 14px 18px 0; }
.rf-sbtn { background: var(--bg-2); border: 1px solid var(--line); border-radius: 14px;
  padding: 14px 10px; display: flex; flex-direction: column; align-items: center; gap: 7px;
  font-family: inherit; font-size: 12px; font-weight: 600; color: var(--ink); cursor: pointer; }
.rf-sbtn span { font-size: 19px; }
.rf-sbtn.wide { grid-column: 1 / -1; flex-direction: row; justify-content: center; gap: 9px; }
.rf-sbtn.wide span { font-size: 16px; }
.rf-sbtn:active { border-color: var(--line-2); }

.rf-add { margin: 0 18px; padding: 16px; background: var(--bg-2);
  border: 1px solid var(--line); border-radius: 18px; }
.rf-add-l { font-size: 12.5px; color: var(--ink-dim); line-height: 1.5; margin-bottom: 13px; }
.rf-add input { width: 100%; padding: 13px 14px; margin-bottom: 9px; border-radius: 12px;
  background: var(--bg); border: 1px solid var(--line-2); color: var(--ink);
  font-family: inherit; font-size: 15px; }
.rf-add input::placeholder { color: var(--ink-faint); }
.rf-add input:focus { outline: none; border-color: var(--accent); }
.rf-add .btn { margin-top: 4px; }

.rf-tally { display: flex; gap: 9px; padding: 16px 18px 0; }
.rf-cell { flex: 1; background: var(--bg-2); border: 1px solid var(--line);
  border-radius: 14px; padding: 14px 10px; text-align: center; }
.rf-cell .v { font-size: 25px; font-weight: 900; letter-spacing: -0.02em; }
.rf-cell .v.teal { color: #2DE1C2; }
.rf-cell .v.lime { color: #C6FF3D; }
.rf-cell .l { font-size: 10px; color: var(--ink-faint); margin-top: 3px; }

.rf-reward { margin: 12px 18px 0; padding: 13px 15px; border-radius: 14px;
  background: rgba(198,255,61,0.1); border: 1px solid rgba(198,255,61,0.28);
  color: #C6FF3D; font-size: 13px; line-height: 1.45; }

.rf-list { padding: 0 18px; display: flex; flex-direction: column; gap: 7px; }
.rf-row { background: var(--bg-2); border: 1px solid var(--line); border-radius: 13px;
  padding: 12px 14px; display: flex; align-items: center; gap: 10px; }
.rf-rt { flex: 1; min-width: 0; }
.rf-rn { font-size: 13.5px; font-weight: 600; }
.rf-rd { font-size: 10.5px; color: var(--ink-faint); margin-top: 2px; }
.rf-pill { font-family: 'JetBrains Mono', monospace; font-size: 9px; letter-spacing: 0.08em;
  text-transform: uppercase; padding: 4px 8px; border-radius: 20px; flex: 0 0 auto; }
.rf-pill.wait { background: rgba(255,255,255,0.05); color: var(--ink-faint); }
.rf-pill.booked { background: rgba(45,225,194,0.14); color: #2DE1C2; }
.rf-pill.joined { background: rgba(198,255,61,0.14); color: #C6FF3D; }
.rf-pill.closed { background: rgba(255,255,255,0.04); color: var(--ink-faint); }

.rf-copy-url { font-family: 'JetBrains Mono', monospace; font-size: 13px; color: var(--accent);
  word-break: break-all; margin-top: 12px; user-select: all; -webkit-user-select: all; }
.rf-fine { font-size: 11.5px; color: var(--ink-faint); margin-top: 8px; }

/* Home entry */
.rf-card { display: flex; align-items: center; gap: 12px; width: calc(100% - 36px);
  margin: 4px 18px 8px; padding: 15px 16px; background: var(--bg-2);
  border: 1px solid var(--line); border-radius: 18px;
  font-family: inherit; color: var(--ink); text-align: left; cursor: pointer; }
.rf-card-ic { font-size: 22px; flex: 0 0 auto; }
.rf-card-t { flex: 1; min-width: 0; }
.rf-card-n { font-size: 14.5px; font-weight: 700; letter-spacing: -0.01em; }
.rf-card-s { font-size: 11.5px; color: var(--ink-dim); margin-top: 3px; line-height: 1.4; }
.rf-card-go { color: var(--accent); font-size: 16px; flex: 0 0 auto; }


/* ============================================================
   PROGRESS · session cards, history fold, station detail
   v26.64. Numerals are deliberately large: a lot of members are
   seniors reading a phone at arm's length, and the block numbers
   are the whole point of the screen.
   ============================================================ */

.section-head em.sh-note { font-family: 'JetBrains Mono', monospace; font-style: normal;
  font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-faint); }

/* Side margins to match .section-head (0 22px). Without them these
   ran to the physical edge of the screen while every heading above
   them sat inset - the numbers on the right were touching the glass. */
.session-cards { margin: 4px 22px 0; }

.scard { background: var(--bg-2); border: 1px solid var(--line); border-radius: 14px;
  padding: 12px; margin-bottom: 9px; }
.scard-d { display: flex; justify-content: space-between; align-items: baseline;
  font-family: 'Archivo', sans-serif; font-weight: 700; font-size: 13px;
  color: var(--ink); margin-bottom: 9px; }
.scard-d em { font-family: 'JetBrains Mono', monospace; font-style: normal;
  font-weight: 500; font-size: 10px; color: var(--ink-faint); }

.s4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.s4 .sb { background: var(--bg-3); border: 0; border-radius: 10px; padding: 8px 4px;
  text-align: center; display: block; width: 100%; font: inherit; color: inherit;
  cursor: pointer; -webkit-appearance: none; appearance: none; }
.s4 .sb:active { background: var(--line); }
.s4 .sb.empty { opacity: .35; cursor: default; }
.s4 .sb i { display: block; font-family: 'JetBrains Mono', monospace; font-style: normal;
  font-weight: 700; font-size: 9px; letter-spacing: .08em; color: var(--ink-faint);
  margin-bottom: 5px; }
.s4 .sb b { display: block; font-family: 'Archivo', sans-serif; font-weight: 800;
  font-size: 24px; line-height: 1; letter-spacing: -.02em; color: var(--ink); }
.s4 .sb b s { text-decoration: none; font-size: 12px; font-weight: 600; color: var(--ink-dim); }
.s4 .sb u { display: block; text-decoration: none; font-family: 'JetBrains Mono', monospace;
  font-weight: 600; font-size: 11px; color: var(--ink-dim); margin-top: 5px; }

/* ---- the fold ---- */
details.hy { border-bottom: 1px solid var(--line); }
details.hy > summary, details.hm > summary { list-style: none; cursor: pointer;
  display: flex; justify-content: space-between; align-items: center; }
details.hy > summary::-webkit-details-marker,
details.hm > summary::-webkit-details-marker { display: none; }
details.hy > summary { padding: 15px 2px; }
.hy-n { font-family: 'Archivo', sans-serif; font-weight: 800; font-size: 24px; line-height: 1; }
.hy-c { font-family: 'JetBrains Mono', monospace; font-weight: 600; font-size: 12px;
  letter-spacing: .05em; color: var(--ink-dim); }
.hy-c::after { content: ' \2304'; color: var(--ink-faint); }
details.hy[open] > summary .hy-c::after { content: ' \2303'; }

details.hm > summary { padding: 11px 2px 11px 10px; border-left: 2px solid var(--line); }
.hm-n { font-family: 'Archivo', sans-serif; font-weight: 700; font-size: 14px; }
.hm-c { font-family: 'JetBrains Mono', monospace; font-weight: 600; font-size: 11px;
  color: var(--ink-faint); }
.hm-b { color: var(--accent); }
.hm-body { padding-left: 10px; border-left: 2px solid var(--line); }

/* ---- station detail sheet ---- */
.sd { text-align: left; }
.sd-top {
  display: flex; justify-content: space-between; align-items: center;
  position: sticky; top: -28px; z-index: 2;
  margin: -28px -24px 14px; padding: 28px 24px 10px;
  background: var(--bg-2);
}
.sd-back { font-family: 'JetBrains Mono', monospace; font-weight: 600; font-size: 12px;
  color: var(--accent); cursor: pointer; }
/* The ✕ is the emergency exit. It was a bare 22px glyph — well under
   a thumb's worth of target on a phone, which made a reachable close
   still feel like a miss. */
.sd-x { font-size: 22px; color: var(--ink-dim); cursor: pointer; line-height: 1;
        min-width: 44px; min-height: 44px; display: flex;
        align-items: center; justify-content: flex-end; }
.sd-st { font-family: 'JetBrains Mono', monospace; font-weight: 600; font-size: 11px;
  letter-spacing: .18em; text-transform: uppercase; color: var(--accent); }
.sd-h { font-family: 'Archivo', sans-serif; font-weight: 800; font-size: 34px;
  letter-spacing: -.02em; margin: 6px 0 2px; }
.sd-d { font-family: 'JetBrains Mono', monospace; font-weight: 500; font-size: 12px;
  color: var(--ink-dim); margin-bottom: 16px; }

.sd-hero { background: var(--bg); border: 1px solid var(--line); border-radius: 16px;
  padding: 16px; margin-bottom: 10px; }
.sd-hero .n { font-family: 'Archivo', sans-serif; font-weight: 800; font-size: 52px;
  line-height: 1; letter-spacing: -.03em; }
.sd-hero .n s { text-decoration: none; font-size: 24px; color: var(--ink-dim); }
.sd-hero .f { font-family: 'JetBrains Mono', monospace; font-weight: 600; font-size: 15px;
  color: var(--ink-dim); margin-top: 8px; }

.sd-jrny { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px;
  background: var(--bg); border: 1px solid var(--line); border-radius: 16px;
  padding: 14px; margin-bottom: 10px; }
.sd-jrny .c { text-align: center; }
.sd-jrny .c i { display: block; font-family: 'JetBrains Mono', monospace; font-style: normal;
  font-weight: 600; font-size: 9px; letter-spacing: .1em; color: var(--ink-faint); margin-bottom: 6px; }
.sd-jrny .c b { display: block; font-family: 'Archivo', sans-serif; font-weight: 800;
  font-size: 27px; line-height: 1; }
.sd-jrny .c b s { text-decoration: none; font-size: 13px; color: var(--ink-dim); }
.sd-jrny .c u { display: block; text-decoration: none; font-family: 'JetBrains Mono', monospace;
  font-weight: 500; font-size: 10px; color: var(--ink-faint); margin-top: 5px; }
.sd-jrny .a { font-family: 'Archivo', sans-serif; font-weight: 700; font-size: 22px; color: var(--accent); }

.sd-gain { background: var(--accent-dim); border: 1px solid var(--accent-glow);
  border-radius: 12px; padding: 11px; text-align: center; margin-bottom: 12px; }
.sd-gain b { font-family: 'Archivo', sans-serif; font-weight: 800; font-size: 21px; color: var(--accent); }
.sd-gain span { display: block; font-family: 'JetBrains Mono', monospace; font-weight: 500;
  font-size: 10.5px; line-height: 1.4; color: var(--ink-dim); margin-top: 5px; }

.sd-rng { display: flex; gap: 5px; margin-bottom: 10px; }
.sd-rng button { flex: 1; background: var(--bg-3); border: 1px solid var(--line);
  color: var(--ink-dim); border-radius: 9px; padding: 10px 0;
  font-family: 'JetBrains Mono', monospace; font-weight: 600; font-size: 11px;
  letter-spacing: .05em; cursor: pointer; }
.sd-rng button.on { background: var(--accent); color: var(--bg); border-color: var(--accent); }

.sd-chart { background: var(--bg); border: 1px solid var(--line); border-radius: 16px;
  padding: 12px 8px 4px; }
.sd-svg { width: 100%; height: auto; display: block; }
.sd-svg .ax { fill: var(--ink-faint); font-family: 'JetBrains Mono', monospace; font-size: 9px; }

.sd-pb { margin-top: 12px; }
.sd-pb .pb { display: flex; justify-content: space-between; align-items: center;
  padding: 11px 0; border-bottom: 1px solid var(--line); }
.sd-pb .pb:last-child { border-bottom: 0; }
.sd-pb .dt { font-family: 'JetBrains Mono', monospace; font-weight: 500; font-size: 11.5px;
  color: var(--ink-dim); }
.sd-pb .vv { font-family: 'Archivo', sans-serif; font-weight: 700; font-size: 17px; }
.sd-pb .vv s { text-decoration: none; font-size: 10px; color: var(--ink-dim); }
.sd-pb .lb { font-family: 'JetBrains Mono', monospace; font-weight: 500; font-size: 10px;
  color: var(--ink-faint); }
.sd-pb .on { color: var(--accent); }

.sd-cnote { font-family: 'JetBrains Mono', monospace; font-size: 9.5px; font-weight: 500;
  letter-spacing: .1em; text-transform: uppercase; color: var(--ink-faint);
  text-align: center; padding: 2px 0 6px; }

/* ============================================================
   REMS SCAN SHEET (v26.77)

   Two states, and the dates decide which. Everything accent-
   coloured uses var(--accent) rather than the lime literal,
   because the member's theme choice sets that at runtime — a
   hardcoded #C6FF3D would be the one gold-themed member's app
   showing one lime block.

   .rems-sheet inherits .sheet-content's text-align:center, so
   the blocks that read as prose or as a schedule opt back out
   to left. Centred times in a two-column row don't line up
   down the page and it reads as a mistake.
   ============================================================ */

.rems-event {
  background: var(--accent-dim);
  border: 1px solid var(--accent);
  border-radius: 14px;
  padding: 14px;
  text-align: left;
  margin-bottom: 14px;
}
.rems-event-tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 9px;
}
.rems-days { display: flex; flex-direction: column; gap: 6px; }
.rems-day {
  display: flex; justify-content: space-between; align-items: baseline; gap: 10px;
  font-family: 'JetBrains Mono', monospace; font-size: 12.5px;
}
.rems-day-date { color: var(--ink); }
.rems-day-time { color: var(--ink-dim); white-space: nowrap; }
.rems-price {
  margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line-2);
  font-size: 13px; color: var(--ink);
}
.rems-note { font-size: 12.5px; color: var(--ink-dim); margin-top: 8px; }
.rems-book { margin-top: 12px; display: block; text-decoration: none; text-align: center; }
/* The booking page belongs to the scanning team and looks nothing
   like this app. Saying so before the tap is cheaper than a member
   deciding the link is a scam and calling the front desk. */
.rems-away {
  font-size: 11px; color: var(--ink-faint); line-height: 1.45; margin-top: 8px;
}

.rems-none {
  background: var(--bg-3); border: 1px solid var(--line);
  border-radius: 14px; padding: 13px; text-align: left; margin-top: 4px;
}
.rems-none-tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--ink-faint); margin-bottom: 5px;
}
.rems-none-body { font-size: 13px; color: var(--ink-dim); line-height: 1.5; }

/* The live tile. Twice a year this is an announcement on the home
   screen; the rest of the time these two rules simply don't apply. */
.quick-tile.qt-live { border-color: var(--accent); }
.qt-sub.qt-sub-live { color: var(--accent); }

/* REMS interest + learn (v26.78)
   .rems-interest is an outline button, not a filled one. It sits
   directly under the filled Book button, and two filled buttons in
   a row make neither of them the obvious thing to press. */
.rems-interest {
  margin-top: 10px; width: 100%;
  background: transparent; border: 1px solid var(--accent); color: var(--accent);
}
.rems-onlist {
  margin-top: 12px; display: flex; align-items: center; justify-content: space-between;
  gap: 10px; padding: 10px 12px; border-radius: 10px;
  background: var(--bg-3); border: 1px solid var(--line-2);
}
.rems-onlist-t { font-size: 12.5px; color: var(--ink); text-align: left; }
.rems-onlist-x {
  background: none; border: none; color: var(--ink-faint);
  font-family: inherit; font-size: 12px; padding: 4px 2px; cursor: pointer;
  flex: 0 0 auto; text-decoration: underline;
}
/* Quiet by design. It's the third thing to do on this sheet, behind
   booking and saying you're interested. */
.rems-learn {
  display: block; margin-top: 6px; text-decoration: none; text-align: center;
  background: transparent; border: 1px solid var(--line-2); color: var(--ink-dim);
}

/* HISTORY FOLD WIDTH (v26.80)
   Same fix as .session-cards. The details blocks had no horizontal
   margin at all, so "best 20.4x LOW" sat flush against the edge.

   The nowrap/min-width pair matters as much as the margin: in a
   flex row with space-between, the right-hand value is the part
   that must stay whole. A long month name should ellipsis rather
   than squeeze the number that is the reason to open the row. */
.hist { margin: 0 22px; }
details.hy > summary, details.hm > summary { gap: 12px; }
.hy-n, .hm-n { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hy-c, .hm-c { flex: 0 0 auto; white-space: nowrap; }

/* ============================================================
   INSTALL TO PHONE (v26.82)

   Margins match .settings-block rather than the section headings,
   so the card lines up with the rows above and below it.

   The steps list is 15px, not the 12-13px used elsewhere in
   Settings. Somebody is reading these WHILE tapping, on a phone,
   probably without their glasses, and following instructions is
   harder than reading a label.
   ============================================================ */

.install-card {
  display: flex; align-items: center; gap: 13px;
  background: var(--bg-2); border: 1px solid var(--line);
  border-radius: 16px; padding: 14px; margin: 0 22px;
}
.install-card.done { border-color: var(--accent); }
.ic-logo { width: 46px; height: 46px; border-radius: 12px; flex: 0 0 auto; }
.ic-ico {
  width: 46px; height: 46px; border-radius: 12px; flex: 0 0 auto;
  background: var(--accent-dim); color: var(--accent);
  display: flex; align-items: center; justify-content: center; font-size: 22px;
}
.ic-body { min-width: 0; }
.ic-t { font-family: 'Archivo', sans-serif; font-weight: 700; font-size: 15px; color: var(--ink); }
.ic-d { font-size: 12.5px; color: var(--ink-dim); line-height: 1.45; margin-top: 3px; }

.install-btn { margin: 12px 22px 0; width: calc(100% - 44px); }

.install-steps {
  margin: 12px 22px 0; padding-left: 26px;
  font-size: 15px; line-height: 1.65; color: var(--ink-dim);
}
.install-steps li { margin-bottom: 9px; }
.install-steps strong { color: var(--ink); font-weight: 700; }

.install-note {
  margin: 8px 22px 0; font-size: 12px; line-height: 1.5; color: var(--ink-faint);
}
