/* Light the Lamp
   Built for iPad landscape (design canvas 1180 x 820) but fluid, so a phone or
   a laptop still works.

   The team theme arrives as four custom properties set on :root by the app:
   --dark, --accent, --ink, --soft. Everything team-colored reads those, so
   switching teams is four variable writes and no re-render of styles. */

:root {
  --dark:   #121212;
  --accent: #F26B1D;
  --ink:    #FFFFFF;
  --soft:   #FDECE2;

  --ink-900:  #141414;
  --gray:     #56616A;
  --label:    #6B757D;
  --app-bg:   #EEF1F3;
  --card:     #FFFFFF;
  --hairline: #E3E7EA;
  --locked:   #F7F8F9;

  --goal:        #E5262B;
  --goal-shadow: #9E1418;
  --goal-text:   #C41E23;
  --goal-ray:    #FF5A4E;
  --gold:        #E8A317;
  --pb:          #FFD23F;
  --rest-bg:     #DCE4EA;
  --rest-fg:     #3C4C58;
  --interval:    #24485C;
  --hit-bg:      #7A1012;
  --done-bg:     #FFF1F0;
  --done-border: #F7C9C5;

  --r-card: 24px;
  --r-btn:  22px;
  --r-row:  16px;
  --r-cell: 14px;
  --r-chip: 12px;
}

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

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  /* The surround only shows on a monitor bigger than the app's max size. */
  background: #0C0C0C;
  font-family: Saira, system-ui, -apple-system, 'Segoe UI', sans-serif;
  color: var(--ink-900);
  /* Kids drag and double-tap at random. None of that should zoom or select. */
  -webkit-user-select: none;
  user-select: none;
  -webkit-text-size-adjust: 100%;
  touch-action: manipulation;
}

body { display: flex; align-items: center; justify-content: center; }

/* #app -- the frame -- is sized and edged in frame.css. */

.display { font-family: 'Saira Condensed', Saira, sans-serif; font-weight: 800; }

button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; }
button:active { transform: scale(.97); }
.tabnum { font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------- scrollers */

.scroll { overflow-y: auto; -webkit-overflow-scrolling: touch; }
.scroll::-webkit-scrollbar { width: 8px; }
.scroll::-webkit-scrollbar-thumb { background: #CBD3D9; border-radius: 4px; }

/* -------------------------------------------------------------- wordmark */

/* The logo is inline SVG (public/js/wordmark.js, generated from the artwork by
   tools/build-wordmark.mjs) so its layers can take the team colors straight
   from the variables.

   Three layers, outermost first:

     .wm-outer    white          -- separates the logo from the background
     .wm-mid      the BACKGROUND -- reads as a gap, not as a color
     .wm-letters  the accent     -- the team's bright color

   The middle layer matching the background is what makes the mark sit in the
   page rather than on it. On the header that background is the team's own
   dark; on the picker it is the fixed #121212, so that one is set explicitly
   rather than left to --dark, which would be the WRONG dark whenever the kid's
   team is not Woburn. */
/* aspect-ratio is set inline from the generated constants -- see ui.js. */
.wordmark { flex: none; max-width: 100%; }
.wordmark svg { display: block; width: 100%; height: 100%; }
.wm-outer   { fill: #fff; }
.wm-mid     { fill: var(--dark); }
.wm-letters { fill: var(--accent); }

/* On a light background the white and the background color swap: the outer
   keyline becomes the dark one and the middle becomes white. Nothing uses this
   yet -- every surface the logo sits on is dark -- but the mark is designed
   for both, so the rule exists rather than being rediscovered later. */
.wordmark.on-light .wm-outer { fill: var(--dark); }
.wordmark.on-light .wm-mid   { fill: #fff; }
.monogram.on-light .wm-outer { fill: var(--dark); }
.monogram.on-light .wm-mid   { fill: #fff; }

/* The compressed "LL" mark shares the same three layers, so every colour rule
   above applies to it unchanged. */
.monogram { flex: none; max-width: 100%; }
.monogram svg { display: block; width: 100%; height: 100%; }


/* --------------------------------------------------------------- jersey */

.jersey { position: relative; flex: none; }
.jersey-dot {
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 999px; flex: none;
  font-family: 'Saira Condensed', sans-serif; font-weight: 800; line-height: 1;
}

/* ======================================================= 0. LOGIN === */

/* The sign-in and the kid picker come before anyone's team, so they wear the
   neon of the hero art instead of the house colors: black behind, its lime
   for the one button. */
.login, .picker {
  --neon-black: #000; --neon-lime: #C6FF2E; --neon-cyan: #3FD8FF; --neon-pink: #FF2E9A;
  --accent: var(--neon-lime); --ink: var(--neon-black);
}
.login {
  position: relative; height: 100%; background: var(--neon-black); color: #fff; overflow-y: auto;
  display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 20px;
}
/* Centered by auto margins, not justify-content: when a phone held sideways
   is too short for it all, that cuts off the top where no scroll reaches. */
.login-hero { margin-top: auto; }
.login-inner { margin-bottom: auto; }
/* The art is a rectangle with bright stripes in its corners; the mask fades
   its edges into the black so it reads as the room, not as a picture on it. */
.login-hero, .picker-hero {
  display: block; height: auto; max-width: 100%; flex: none;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 14%, #000 86%, transparent),
                      linear-gradient(180deg, transparent, #000 12%, #000 86%, transparent);
  -webkit-mask-composite: source-in;
          mask-image: linear-gradient(90deg, transparent, #000 14%, #000 86%, transparent),
                      linear-gradient(180deg, transparent, #000 12%, #000 86%, transparent);
          mask-composite: intersect;
  user-select: none; -webkit-user-select: none; pointer-events: none;
}
.login-hero { width: 640px; }
.login-inner {
  display: flex; flex-direction: column; align-items: center; gap: 22px;
  width: 100%; max-width: 420px;
}
.login-ask { font-size: 16px; color: rgba(255,255,255,.65); margin: 0; text-align: center; }
.login-form { width: 100%; display: flex; flex-direction: column; gap: 12px; }
.login-label { display: block; font-size: 13px; font-weight: 700; letter-spacing: .08em;
               color: rgba(255,255,255,.55); }
.login-label input {
  display: block; width: 100%; margin-top: 6px; height: 54px;
  border-radius: 12px; border: 2px solid rgba(255,255,255,.18);
  background: #141414; color: #fff; padding: 0 14px;
  /* 16px minimum or iOS Safari zooms in on focus and never zooms back. */
  font: inherit; font-size: 17px;
}
.login-label input:focus { outline: none; border-color: var(--accent); }
.login-err { color: #FF8A80; font-size: 14px; font-weight: 600; min-height: 18px; }
/* .login .login-go, not .login-go: .btn comes later in this file and would
   otherwise paint it black. */
.login .login-go { background: var(--accent); color: var(--ink); height: 56px; font-size: 19px; }

/* Signing out is deliberately quiet: a kid should never be drawn to it, but a
   parent handing the iPad on has to be able to find it. */
.sign-out {
  position: absolute; left: 14px; bottom: 12px; z-index: 2;
  font-size: 11px; font-weight: 600; letter-spacing: .04em;
  color: rgba(255,255,255,.22); padding: 6px 8px;
}
.sign-out:hover { color: rgba(255,255,255,.55); }

.preset-list { max-height: 50vh; display: flex; flex-direction: column; gap: 0; }
.preset-list .panel-title { margin: 10px 0 6px; }

/* ===================================================== 1. KID PICKER === */

.picker {
  position: relative; height: 100%;
  display: flex; align-items: center; justify-content: center;
  background: var(--neon-black); overflow: hidden;
}
/* The decor sits behind; the content is its own stacking context on top.
   Do NOT reintroduce a `.picker > *` rule -- it matches the absolutely
   positioned decor at the same specificity and knocks it back into the flow. */
.picker-inner {
  position: relative; z-index: 1;
  display: flex; flex-direction: column; align-items: center; gap: 30px;
}
/* Its height is what squeezes the kid cards, so it is sized per screen
   height below; this is for a tall screen -- an iPad held sideways is 820. */
.picker-hero { --hero-w: 700px; }
/* The question and the cards ride up over the bottom of the hero, across the
   lamp: the art becomes the backdrop rather than a picture stacked above, and
   the question starts at the top of the lamp, just under the name. The
   overlap is a share of the hero's own width (0.24 of the width is about
   0.43 of its height), so it scales with every --hero-w below. */
.picker .picker-hero {
  width: var(--hero-w); max-width: 100%;
  margin-bottom: calc(var(--hero-w) * -0.24);
}
/* The question sits above the cards too: their wide black glow reaches up
   over it, and painted on top it turned the white letters grey. */
.picker-ask, .picker-cards { position: relative; z-index: 1; }
.picker-ask { z-index: 2; }
/* Pure white type on a big soft pool of black. The pool is a pseudo-element,
   not a heavier text-shadow: stacked black shadows crowd the letters' edges
   and the white reads as grey. */
.picker-ask {
  color: #fff;
  text-shadow: 0 2px 6px rgba(0,0,0,.9);
}
.picker-ask::before {
  content: ""; position: absolute; z-index: -1; inset: -36px -130px;
  background: radial-gradient(closest-side, rgba(0,0,0,.95), rgba(0,0,0,.75) 50%, transparent);
  pointer-events: none;
}
.picker .kid-card {
  box-shadow: 0 0 0 1px rgba(0,0,0,.6), 0 30px 70px -6px #000, 0 0 90px 24px rgba(0,0,0,.9);
}
.picker-lamp { width: 170px; }
/* A heading, like every other in the app: condensed, in capitals. */
.picker-ask {
  font-family: 'Saira Condensed', Saira, sans-serif; font-size: 34px; font-weight: 800;
  text-transform: uppercase; letter-spacing: .03em; line-height: 1.1;
}
.picker-cards { display: flex; gap: 40px; }

.kid-card {
  width: 320px; height: 340px; border-radius: 30px;
  background: #141C33; border: 3px solid var(--accent);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px; color: #fff; padding: 18px;
}
.kid-card-name { font-size: 46px; line-height: 1; }
/* The two cards a family with no kids sees, the same size as a kid's. */
.start-card { text-align: center; }
.start-card .kid-card-name { font-size: 40px; text-transform: uppercase; }
.start-card .kid-card-meta { font-weight: 500; }
.start-card-icon { display: block; width: 96px; height: 96px; }
.start-card-icon svg { display: block; width: 100%; height: 100%; }
.start-tour { border-color: var(--neon-cyan); color: #fff; }
.start-tour .start-card-icon { color: var(--neon-cyan); }
.start-parent { border-color: var(--neon-lime); }
.start-parent .start-card-icon { color: var(--neon-lime); }
.kid-card-meta {
  display: flex; align-items: center; gap: 7px;
  font-size: 16px; font-weight: 600; color: rgba(255,255,255,.72);
}

.picker-parent {
  position: absolute; right: 22px; bottom: 22px;
  height: 44px; padding: 0 20px; border-radius: 999px;
  background: rgba(255,255,255,.1); color: #fff;
  display: flex; align-items: center; gap: 9px; font-size: 16px; font-weight: 600;
}

/* ======================================================== 2. HEADER === */

/* The top bar is all in frame.css: its size, its edges and what it drops as
   the screen narrows, in one place. */

/* ========================================================= 3. BOARD === */

.board {
  flex: 1; min-height: 0; padding: 18px;
  display: grid; grid-template-columns: minmax(0,1fr) 400px; gap: 18px;
}

.card { background: var(--card); border-radius: var(--r-card); }

/* --- calendar --- */
.cal { padding: 18px 20px; display: flex; flex-direction: column; min-height: 0; }
.cal-nav { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.cal-round {
  width: 48px; height: 48px; border-radius: 50%; background: #EEF1F3;
  display: flex; align-items: center; justify-content: center; flex: none;
}
.cal-month { font-size: 36px; text-transform: uppercase; line-height: 1; }
.cal-today-btn {
  height: 38px; padding: 0 16px; border-radius: 999px;
  background: var(--accent); color: var(--ink); font-size: 15px; font-weight: 700;
}

.cal-week {
  display: grid; grid-template-columns: repeat(7,1fr); gap: 6px; margin-bottom: 6px;
}
.cal-week span {
  text-align: center; font-size: 13px; font-weight: 700;
  letter-spacing: .12em; color: var(--label);
}
.cal-grid {
  flex: 1; min-height: 0;
  display: grid; grid-template-columns: repeat(7,1fr); gap: 6px;
  grid-auto-rows: 1fr;
}

.cal-cell {
  border-radius: var(--r-cell); border: 2.5px solid var(--hairline);
  padding: 5px 8px; display: flex; flex-direction: column; min-height: 0;
  background: #fff; text-align: left;
}
.cal-cell-num { font-size: 16px; font-weight: 700; }
.cal-cell.out    { opacity: .35; background: transparent; }
.cal-cell.future { opacity: .55; }
.cal-cell.today  { background: var(--soft); border-color: var(--accent); }
.cal-cell.picked { border-color: #141414; }
.cal-cell-top { display: flex; align-items: center; justify-content: space-between; gap: 4px; }
.cal-today-tag {
  background: var(--accent); color: var(--ink); border-radius: 6px;
  font-size: 10px; font-weight: 700; padding: 1px 5px; letter-spacing: .04em;
}
.cal-cell-body {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 3px;
  min-height: 0;
}
.cal-count { font-family: 'Saira Condensed', sans-serif; font-weight: 800; font-size: 22px; color: var(--goal-text); }
.cal-rest {
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--rest-bg); color: var(--rest-fg);
  border-radius: 999px; padding: 3px 9px; font-size: 11px; font-weight: 700;
}
.cal-legend {
  display: flex; gap: 18px; align-items: center; margin-top: 12px;
  font-size: 13px; font-weight: 600; color: var(--label);
}
.cal-legend span { display: inline-flex; align-items: center; gap: 6px; }

/* --- all drills --- */

/* Full width on purpose: no calendar, so the rows get the whole screen and a
   kid can skim them instead of reading a column. */
.drills-screen { flex: 1; min-height: 0; padding: 18px; display: flex; flex-direction: column; gap: 14px; }
.drills-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; flex: none; }
.drills-head-right { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.sort-pick { display: flex; align-items: center; gap: 6px; }
.sort-ask { font-size: 12px; font-weight: 700; letter-spacing: .1em; color: var(--label); }
.sort-opt {
  height: 32px; padding: 0 12px; border-radius: 16px; background: #fff;
  border: 2px solid var(--hairline); font-size: 14px; font-weight: 700; color: var(--gray);
}
.sort-opt.on { background: var(--dark); border-color: var(--dark); color: #fff; }
.drills-body { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 18px; }
.drills-group { display: flex; flex-direction: column; gap: 8px; }
.drills-cat {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 700; letter-spacing: .14em; color: var(--label);
}
.drills-cat-n {
  background: var(--hairline); color: var(--gray); border-radius: 999px;
  padding: 1px 8px; font-size: 12px; letter-spacing: 0;
}
/* Two columns of rows where there is room; one on a phone. */
.drills-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 8px; }
.drills-list .drill-row { background: #fff; }

/* --- right column --- */
.board-right { display: flex; flex-direction: column; gap: 18px; min-height: 0; }

.goal-card { background: var(--dark); color: #fff; border-radius: var(--r-card); padding: 16px 18px; flex: none; }
.goal-card-top { display: flex; align-items: baseline; justify-content: space-between; }
.goal-card-kicker { font-size: 13px; font-weight: 700; letter-spacing: .12em; opacity: .72; }
.goal-card-num { font-family: 'Saira Condensed', sans-serif; font-weight: 800; font-size: 26px; }
.bar { height: 14px; border-radius: 7px; background: rgba(255,255,255,.16); margin: 10px 0 8px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--accent); border-radius: 7px; transition: width .4s ease; }
.goal-card-msg { font-size: 14px; font-weight: 500; opacity: .85; }

.train { flex: 1; min-height: 0; display: flex; flex-direction: column; padding: 16px 16px 14px; }
.train-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; }
.train-kicker { font-size: 12px; font-weight: 700; letter-spacing: .14em; color: var(--label); }
.train-title { font-size: 30px; line-height: 1.05; }
/* Today's Training is a button: it opens the day full screen. */
.train-open { display: inline-flex; align-items: center; gap: 4px; text-align: left; color: inherit; }
.train-count { font-size: 15px; font-weight: 700; color: var(--gray); white-space: nowrap; }

.banner {
  margin-top: 10px; border-radius: var(--r-chip); padding: 9px 12px;
  font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 8px;
}
.banner.locked { background: var(--locked); color: var(--gray); }
.banner.rest   { background: var(--rest-bg); color: var(--rest-fg); }
.banner button { margin-left: auto; font-size: 14px; font-weight: 700; text-decoration: underline; }

.train-list { flex: 1; min-height: 0; margin-top: 10px; display: flex; flex-direction: column; gap: 8px; }

.drill-row {
  border-radius: var(--r-row); border: 2px solid var(--hairline);
  padding: 9px 12px 9px 9px; display: flex; align-items: center; gap: 10px;
  background: #fff; text-align: left; width: 100%;
}
.drill-row.done { background: var(--done-bg); border-color: var(--done-border); }
/* A past day's planned drill that never got done: still listed, so the day
   reads as what was asked AND what happened, but quieter than a lit lamp. */
.drill-row.missed { opacity: .55; }
.extra-tag {
  margin-left: 8px; font-size: 11px; font-weight: 800; letter-spacing: .06em;
  background: var(--soft); color: var(--gray); border-radius: 999px; padding: 2px 8px;
  vertical-align: middle;
}
.drill-tile {
  width: 48px; height: 48px; border-radius: 12px; background: var(--soft);
  display: flex; align-items: center; justify-content: center; flex: none;
}
.drill-main { flex: 1; min-width: 0; }
.drill-name { font-size: 18px; font-weight: 700; line-height: 1.2; }
.drill-sub { font-size: 14px; font-weight: 500; color: var(--gray); margin-top: 1px; }
.drill-needs { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 3px; }
.drill-need {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12px; font-weight: 600; color: var(--gray);
  background: #F2F5F7; border-radius: 999px; padding: 2px 9px 2px 7px;
}

.rest-btn {
  height: 46px; border-radius: var(--r-row); background: #EEF1F3;
  font-size: 16px; font-weight: 700; color: var(--gray); margin-top: 10px; flex: none;
}

/* ================================================== 4. DRILL DETAIL === */

.drill-screen { flex: 1; min-height: 0; padding: 14px 18px 18px; display: flex; flex-direction: column; }
.drill-top { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; flex: none; }
.back-pill {
  height: 44px; padding: 0 18px; border-radius: 999px; background: #fff;
  font-size: 16px; font-weight: 700; display: flex; align-items: center; gap: 6px;
}
.cat-label { font-size: 14px; font-weight: 700; letter-spacing: .16em; color: var(--gray); }

.drill-grid { flex: 1; min-height: 0; display: grid; grid-template-columns: 620px minmax(0,1fr); gap: 30px; }
.drill-left { display: flex; flex-direction: column; gap: 14px; min-height: 0; }

.video {
  position: relative; width: 100%; aspect-ratio: 620/349; border-radius: 22px;
  background: var(--dark); overflow: hidden; flex: none;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
  color: #fff;
}
.video::before {
  content: ''; position: absolute; inset: 0; opacity: .1;
  background: repeating-linear-gradient(135deg, #fff 0 2px, transparent 2px 14px);
}
.video > * { position: relative; }
.video iframe, .video video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video-play {
  width: 96px; height: 96px; border-radius: 50%; background: var(--accent);
  display: flex; align-items: center; justify-content: center;
}
.video-cap { font-size: 17px; font-weight: 600; opacity: .85; }
.video-none { font-size: 15px; font-weight: 500; opacity: .6; text-align: center; padding: 0 30px; }

.drill-cards { display: flex; gap: 14px; }
.mini { flex: 1; background: #fff; border-radius: 18px; padding: 12px 14px; min-width: 0; }
.mini-kicker { font-size: 11px; font-weight: 700; letter-spacing: .14em; color: var(--label); }
.mini-big { font-size: 32px; line-height: 1.1; margin-top: 2px; }
.mini-hint { font-size: 13px; font-weight: 500; color: var(--gray); margin-top: 2px; }

.partner-card { display: flex; align-items: center; gap: 11px; }
.partner-card.on { background: var(--soft); box-shadow: inset 0 0 0 2px var(--accent); }
.switch {
  width: 56px; height: 32px; border-radius: 999px; background: #D5DCE1;
  flex: none; position: relative; transition: background .18s ease;
}
.switch > i {
  position: absolute; top: 3px; left: 3px; width: 26px; height: 26px;
  border-radius: 50%; background: #fff; transition: transform .18s ease;
  box-shadow: 0 1px 3px rgba(0,0,0,.25);
}
.switch.on { background: var(--accent); }
.switch.on > i { transform: translateX(24px); }

.drill-right { display: flex; flex-direction: column; min-height: 0; }
.drill-title { font-size: 60px; line-height: .95; text-transform: uppercase; }
.drill-target { font-size: 110px; line-height: .9; color: var(--dark); margin-top: 6px; }
.drill-target-unit { font-size: 32px; color: var(--gray); font-weight: 700; letter-spacing: .02em; }
.drill-desc {
  background: #fff; border-radius: 18px; padding: 14px; margin-top: 14px;
  display: flex; gap: 12px; align-items: flex-start;
}
.replay {
  width: 48px; height: 48px; border-radius: 50%; background: var(--soft); flex: none;
  display: flex; align-items: center; justify-content: center; gap: 2px;
}
.drill-desc p { margin: 0; font-size: 21px; font-weight: 500; line-height: 1.4; }
.need-rows { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.need-row {
  display: inline-flex; align-items: center; gap: 7px;
  background: #fff; border-radius: 999px; padding: 8px 16px 8px 13px;
  font-size: 16px; font-weight: 600; color: var(--gray);
}

.big-btn {
  height: 92px; border-radius: var(--r-card); background: var(--accent); color: var(--ink);
  font-family: 'Saira Condensed', sans-serif; font-weight: 800; font-size: 38px;
  margin-top: auto; flex: none; width: 100%;
}
.big-btn:active { transform: translateY(3px); }

/* speaking bars */
.bars { display: flex; align-items: flex-end; gap: 3px; height: 20px; }
.bars i { width: 3px; background: var(--accent); border-radius: 2px; animation: bar .8s ease-in-out infinite; }
.bars i:nth-child(2) { animation-delay: .15s; }
.bars i:nth-child(3) { animation-delay: .3s; }
@keyframes bar { 0%,100% { height: 6px; } 50% { height: 19px; } }

/* ======================================================= 5. REP LOG === */

.rep { flex: 1; min-height: 0; display: flex; flex-direction: column; align-items: center; padding: 14px 18px 18px; }
.rep-top { width: 100%; display: flex; align-items: center; justify-content: space-between; flex: none; }
.rep-title { font-size: 52px; line-height: 1; text-transform: uppercase; margin-top: 6px; text-align: center; }
.rep-goal { font-size: 19px; font-weight: 600; color: var(--gray); margin-top: 2px; }
.rep-hint { font-size: 16px; font-weight: 500; color: var(--label); margin-top: 10px; }

.sets-row { display: flex; gap: 10px; margin-top: 8px; flex-wrap: wrap; justify-content: center; }
.set-chip {
  width: 130px; height: 72px; border-radius: var(--r-row); background: #fff;
  border: 2.5px solid var(--hairline);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.set-chip.on { background: var(--soft); border-color: var(--accent); }
.set-chip b { font-family: 'Saira Condensed', sans-serif; font-weight: 800; font-size: 22px; }
.set-chip span { font-size: 13px; font-weight: 600; color: var(--gray); }

.stepper { display: flex; align-items: center; gap: 30px; margin-top: auto; }
.step-btn {
  width: 110px; height: 110px; border-radius: 50%; flex: none;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 0 rgba(0,0,0,.14);
}
.step-minus { background: #fff; }
.step-plus  { background: var(--accent); }
.rep-count { font-size: 170px; line-height: .85; color: var(--dark); min-width: 240px; text-align: center; }
.rep-unit { font-size: 18px; font-weight: 700; letter-spacing: .14em; color: var(--label); text-align: center; }
/* Jump straight to the goal. Big enough to be the obvious thing to press. */
.quick-goal {
  height: 56px; padding: 0 30px; margin-top: 14px; border-radius: 999px; background: #fff;
  border: 3px solid var(--accent); font-size: 19px; font-weight: 700; color: var(--ink-900);
}
.quick-goal b { font-size: 24px; }

.stop-btn {
  width: 520px; max-width: 100%; height: 92px; border-radius: var(--r-card);
  background: #141414; color: #fff; margin-top: 16px; flex: none;
  display: flex; align-items: center; justify-content: center; gap: 12px;
  font-family: 'Saira Condensed', sans-serif; font-weight: 800; font-size: 34px;
}
/* During a rest there are two buttons side by side, so neither is full width. */
.rest-skip { background: var(--accent); color: var(--ink); }
.timer .stop-btn { width: auto; min-width: 260px; }

.complete-btn {
  background: var(--goal); color: #fff; box-shadow: 0 6px 0 var(--goal-shadow);
  animation: pulse 1.1s ease-in-out infinite;
}
.complete-btn:active { transform: translateY(4px); box-shadow: 0 2px 0 var(--goal-shadow); }
@keyframes pulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.035); } }

/* =================================================== 6. COUNTDOWN === */

.countdown {
  position: fixed; inset: 0; z-index: 40; background: var(--dark); color: #fff;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.cd-get-ready { position: absolute; top: 46px; font-size: 30px; font-weight: 700; letter-spacing: .2em; opacity: .75; }
.cd-num { font-size: 400px; line-height: .8; color: var(--accent); animation: cdPop 1s ease-out; }
@keyframes cdPop {
  0%   { transform: scale(1.7); opacity: 0; }
  18%  { transform: scale(1);   opacity: 1; }
  78%  { opacity: 1; }
  100% { opacity: .15; }
}
.cd-name { position: absolute; bottom: 54px; font-size: 32px; font-weight: 700; opacity: .8; }
/* Pause and Start now. Below the name so the big number stays the thing you
   look at, and far enough from the X that a six-year-old does not quit by
   accident reaching for Pause. */
/* FINISH is stopping short, so it is NOT the red celebration button -- but it
   is still the one a kid is reaching for, so it reads above EXIT and RESTART. */
.goal-btn-finish { background: #24485C; color: #fff; }


.cd-actions { position: absolute; bottom: 110px; display: flex; gap: 14px; }
.cd-btn {
  height: 56px; min-width: 150px; padding: 0 26px; border-radius: 28px;
  background: rgba(255,255,255,.14); color: #fff;
  font-size: 20px; font-weight: 700;
}
.cd-btn.cd-go { background: var(--accent); color: var(--ink); }
.countdown.paused .cd-num { opacity: .45; animation: none; }
.cd-x { position: absolute; top: 30px; right: 30px; width: 56px; height: 56px; border-radius: 50%;
        background: rgba(255,255,255,.12); display: flex; align-items: center; justify-content: center; }

/* ======================================================= 7. TIMER === */

.timer {
  position: fixed; inset: 0; z-index: 40; background: var(--dark); color: #fff;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  transition: background .4s ease;
}
.timer.hit  { background: var(--hit-bg); }
.timer.rest { background: var(--interval); }
.timer-restart {
  position: absolute; top: 26px; left: 26px; height: 52px; padding: 0 20px; border-radius: 26px;
  background: rgba(255,255,255,.12); display: flex; align-items: center; gap: 8px;
  font-size: 17px; font-weight: 700;
}
.timer-head { position: absolute; top: 30px; left: 0; right: 0; text-align: center; pointer-events: none; }
.timer-name { font-size: 36px; font-weight: 700; }
.timer-tap { font-size: 14px; font-weight: 600; letter-spacing: .16em; opacity: .5; margin-top: 3px; }

/* The ring is square, so it has to fit the SHORT side whichever way the phone
   is held. 58vh alone is 489px on a portrait phone -- a circle wider than the
   screen it is drawn on. */
.ring-wrap { position: relative; width: min(500px, 58vh, 84vw); aspect-ratio: 1; display: grid; place-items: center; }
.ring { position: absolute; inset: 0; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 16; stroke-linecap: round; }
.ring .track { stroke: rgba(255,255,255,.12); }
.ring-inner { text-align: center; }
.ring-label { font-size: 22px; font-weight: 700; letter-spacing: .18em; }
.ring-digits { font-size: min(190px, 22vh); line-height: .85; }
.ring-sub { font-size: 20px; font-weight: 600; opacity: .8; margin-top: 4px; min-height: 26px; }

.timer-bottom { position: absolute; bottom: 36px; }

/* ================================================= 8. CELEBRATION === */

.celebrate {
  position: fixed; inset: 0; z-index: 50; background: #0B0B0B; color: #fff; overflow: hidden;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
}
.sweep {
  position: absolute; width: 1800px; height: 1800px; left: 50%; top: 50%;
  margin: -900px 0 0 -900px; pointer-events: none; opacity: .5;
  background: conic-gradient(from 0deg, rgba(229,38,43,.55), transparent 22%, rgba(229,38,43,.55) 50%, transparent 72%, rgba(229,38,43,.55));
  animation: sweep 1.6s linear infinite;
}
@keyframes sweep { to { transform: rotate(360deg); } }

.confetti { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.confetti i {
  position: absolute; top: -30px; width: 11px; height: 16px; border-radius: 2px;
  animation: fall linear forwards;
}
.confetti i.puck { width: 16px; height: 8px; border-radius: 4px; background: #121212; }
@keyframes fall {
  to { transform: translate(var(--dx), 110vh) rotate(var(--spin)); opacity: .9; }
}

/* Same trap as the picker: the sweep and confetti are absolute and must stay
   that way, so the content gets its own wrapper rather than a `> *` rule. */
.celebrate-inner {
  position: relative; z-index: 1;
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  max-width: 100%; padding: 0 20px;
}
.celebrate-lamp { width: 300px; line-height: 0; animation: lampFlash .5s steps(1) infinite; filter: drop-shadow(0 0 60px rgba(229,38,43,.85)); }
@keyframes lampFlash { 0%,100% { opacity: 1; } 50% { opacity: .55; } }

.goal-word {
  font-size: 150px; line-height: .9; text-shadow: 0 6px 0 var(--goal-shadow), 0 0 50px rgba(229,38,43,.8);
  animation: goalIn .7s cubic-bezier(.2,1.5,.4,1);
}
@keyframes goalIn {
  0%   { transform: scale(.4); opacity: 0; }
  100% { transform: scale(1);  opacity: 1; }
}
.goal-sub { font-size: 34px; font-weight: 700; }
.goal-chips { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; max-width: 900px; }
.goal-chip {
  border-radius: 999px; padding: 9px 20px; font-size: 18px; font-weight: 700;
  background: var(--accent); color: var(--ink);
}
.goal-chip.pb    { background: var(--pb); color: #141414; }
.goal-chip.gold  { background: var(--gold); color: #141414; }
.goal-chip.plain { background: rgba(255,255,255,.16); color: #fff; }
.goal-btns { display: flex; gap: 14px; margin-top: 10px; }
.goal-btn {
  height: 76px; padding: 0 34px; border-radius: var(--r-btn);
  background: rgba(255,255,255,.14); color: #fff;
  font-family: 'Saira Condensed', sans-serif; font-weight: 800; font-size: 28px;
}
.goal-btn.primary { background: var(--accent); color: var(--ink); }
/* Deliberately quiet: there for a mistake, not a choice beside NEXT DRILL. */
.goal-undo {
  min-height: 44px; padding: 0 18px; margin-top: 4px;
  color: rgba(255,255,255,.7); font-size: 17px; font-weight: 600;
  text-decoration: underline; text-underline-offset: 3px;
}
.mini-undo {
  min-height: 36px; margin-top: 6px; padding: 0;
  color: var(--gray); font-size: 14px; font-weight: 600;
  text-decoration: underline; text-underline-offset: 3px;
}

/* ====================================================== 9. LOCKER === */

.locker { flex: 1; min-height: 0; padding: 18px; display: grid; grid-template-columns: minmax(0,1fr) 430px; gap: 18px; }
.locker-col { display: flex; flex-direction: column; gap: 18px; min-height: 0; }
.panel { background: #fff; border-radius: var(--r-card); padding: 16px 18px; }
.panel-title { font-size: 13px; font-weight: 700; letter-spacing: .14em; color: var(--label); margin-bottom: 12px; }

.badges { display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; }
.badge { text-align: center; }
.badge-name { font-size: 15px; font-weight: 700; margin-top: 4px; }
.badge-prog { font-size: 12px; font-weight: 600; color: var(--gray); }
.badge.locked { opacity: .55; }

.pbs { display: grid; grid-template-columns: repeat(2,1fr); gap: 6px 18px; }
.pb-row {
  display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
  padding: 5px 0; border-bottom: 1px solid var(--hairline); font-size: 15px;
}
.pb-row b { font-family: 'Saira Condensed', sans-serif; font-weight: 800; font-size: 19px; }

.theme-head { display: flex; align-items: center; gap: 16px; margin-bottom: 12px; }
.num-stepper { display: flex; align-items: center; gap: 8px; }
.num-stepper button {
  width: 40px; height: 40px; border-radius: 50%; background: #EEF1F3;
  display: flex; align-items: center; justify-content: center;
}
/* The number: typed straight in. Looks like the number it is, with a box
   that shows it can be tapped. 16px+ so iOS does not zoom on focus. */
.num-input {
  width: 64px; height: 48px; padding: 0; border-radius: 12px;
  border: 2px solid var(--hairline, #D5DBE1); background: #fff; color: var(--ink-900);
  font-family: 'Saira Condensed', sans-serif; font-weight: 800; font-size: 30px; text-align: center;
}
.num-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-faint, rgba(0,0,0,.1)); }

.theme-div { font-size: 11px; font-weight: 700; letter-spacing: .14em; color: var(--label); margin: 10px 0 6px; }
.swatches { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; }
.swatch {
  border-radius: var(--r-chip); padding: 9px 10px; color: #fff; text-align: left;
  display: flex; align-items: center; gap: 8px; border: 2.5px solid transparent;
  font-size: 13px; font-weight: 700; min-width: 0;
}
.swatch.on { border-color: #141414; }
.swatch i { width: 15px; height: 15px; border-radius: 50%; flex: none; }
.swatch span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.opt-row { display: grid; grid-template-columns: repeat(2,1fr); gap: 8px; }
.opt {
  height: 46px; border-radius: var(--r-chip); background: #EEF1F3;
  font-size: 15px; font-weight: 700; display: flex; align-items: center;
  justify-content: center; gap: 6px; padding: 0 10px;
}
.opt.on { background: var(--accent); color: var(--ink); }
.opt-real { font-size: 11px; opacity: .75; font-weight: 600; }

.reward-row { margin-bottom: 12px; }
.reward-top { display: flex; align-items: baseline; justify-content: space-between; font-size: 15px; font-weight: 700; }
.reward-top span { font-size: 13px; font-weight: 600; color: var(--gray); }
.bar.light { background: #E6EAED; height: 10px; border-radius: 5px; margin: 5px 0 0; }

/* ================================================ 10. REST MODAL === */

.modal-back {
  position: fixed; inset: 0; z-index: 60; background: rgba(0,0,0,.6);
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.sheet {
  width: 560px; max-width: 100%; max-height: 90vh; overflow-y: auto;
  background: #fff; border-radius: 28px; padding: 26px;
}
.sheet h2 { font-family: 'Saira Condensed', sans-serif; font-weight: 800; font-size: 34px; margin: 0; text-transform: uppercase; }
.sheet p { font-size: 17px; font-weight: 500; color: var(--gray); margin: 6px 0 18px; }
.reasons { display: grid; grid-template-columns: repeat(2,1fr); gap: 12px; }
.reason {
  height: 76px; border-radius: var(--r-row); background: #EEF1F3;
  font-size: 19px; font-weight: 700;
}
.sheet-cancel { width: 100%; height: 56px; margin-top: 14px; font-size: 17px; font-weight: 700; color: var(--gray); }

/* overlays on the timer / rep log */
.overlay {
  position: fixed; inset: 0; z-index: 45; background: rgba(0,0,0,.78); color: #fff;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
}
.overlay h2 { font-family: 'Saira Condensed', sans-serif; font-weight: 800; font-size: 72px; margin: 0; letter-spacing: .04em; }
.overlay .big { font-family: 'Saira Condensed', sans-serif; font-weight: 800; font-size: 90px; line-height: 1; }
.overlay p { font-size: 22px; font-weight: 600; margin: 0; text-align: center; padding: 0 20px; }
.overlay-btns { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; margin-top: 10px; }

/* ======================================================== PARENT === */

.parent { flex: 1; min-height: 0; display: flex; flex-direction: column; background: var(--app-bg); }
.parent-bar {
  height: 64px; flex: none; background: #141414; color: #fff;
  display: flex; align-items: center; gap: 12px; padding: 0 18px;
}
.parent-bar h1 { font-family: 'Saira Condensed', sans-serif; font-size: 26px; margin: 0; font-weight: 800; }
.tabs { display: flex; gap: 6px; margin-left: auto; }
.tab { height: 40px; padding: 0 16px; border-radius: 20px; background: rgba(255,255,255,.12); font-size: 15px; font-weight: 700; }
.tab.on { background: #fff; color: #141414; }
/* A second row of tabs that only applies to the one above it. */
.tab-sub { height: 32px; font-size: 13px; opacity: .9; }
.pill-tag {
  margin-left: 8px; padding: 1px 7px; border-radius: 6px;
  background: var(--hairline); color: var(--gray);
  font-size: 10px; font-weight: 800; letter-spacing: .08em; vertical-align: middle;
}

.parent-body { flex: 1; min-height: 0; padding: 18px; }
.parent-card { background: #fff; border-radius: var(--r-card); padding: 18px; max-width: 1000px; }

.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; font-weight: 700; letter-spacing: .08em; color: var(--label); margin-bottom: 5px; }
/* 16px minimum: below that iOS Safari zooms the page in on focus and never
   zooms back out, which reads to a parent as "the app is broken". */
.field input, .field select, .field textarea {
  width: 100%; height: 48px; border-radius: 12px; border: 2px solid var(--hairline);
  padding: 0 12px; font: inherit; font-size: 16px; background: #fff; color: var(--ink-900);
}
.field textarea { height: 92px; padding: 10px 12px; resize: vertical; line-height: 1.4; }
.field.row2 { display: grid; grid-template-columns: repeat(2,1fr); gap: 12px; }
.field.row3 { display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; }
.video-clip { display: grid; grid-template-columns: repeat(2,1fr); gap: 12px; margin-top: 10px; }
.pin-line { display: flex; gap: 8px; align-items: center; }
.pin-line select { flex: 1; min-width: 0; }
.pin-days-btn { flex: none; height: 48px; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.pin-days { margin-top: 10px; }
.pin-days .cat-filter { margin-bottom: 0; }
/* Drag to reorder (Parent mode: drills inside a category, and the categories).
   touch-action none on the grip ONLY, so a finger anywhere else on the row
   still scrolls the list. */
.drag-handle { width: 36px; height: 44px; flex: none; border-radius: 8px; background: transparent;
               display: flex; align-items: center; justify-content: center;
               cursor: grab; touch-action: none; -webkit-user-select: none; user-select: none; }
.drag-handle:hover, .drag-handle:focus-visible { background: #EEF1F3; }
.sorting { -webkit-user-select: none; user-select: none; }
.sorting [data-sort-id] { transition: transform .15s ease; }
.sorting [data-sort-id].dragging { transition: none; position: relative; z-index: 5; cursor: grabbing;
                                   box-shadow: 0 8px 22px rgba(0,0,0,.18); }
.parent-cat { margin: 14px 0 6px; }
.hint { font-size: 13px; font-weight: 500; color: var(--gray); margin-top: 4px; }

/* Venue checkboxes. Big enough to hit on a tablet, and the whole pill is the
   label so the tap target is the words, not just the little square. */
.checks { display: flex; flex-wrap: wrap; gap: 10px; }
.check {
  display: inline-flex; align-items: center; gap: 9px; cursor: pointer;
  height: 48px; padding: 0 18px 0 14px; border-radius: 999px;
  border: 2px solid var(--hairline); background: #fff;
  font-size: 16px; font-weight: 600; color: var(--ink-900);
}
.check.on { border-color: var(--accent); background: var(--soft); }
.check input { width: 20px; height: 20px; accent-color: var(--accent); margin: 0; }

/* How hard a drill is: Rookie / Prospect / All-Star / Legend. */
.lvl {
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 999px; padding: 2px 9px; margin-left: 8px;
  font-size: 11px; font-weight: 700; letter-spacing: .04em;
  color: #fff; vertical-align: middle; white-space: nowrap;
}
/* ---------------------------------------------------------------- lamp */

/* The artwork is traced, so it arrives as 29 near-identical fills. The build
   step clusters them into these four; everything that draws a lamp reads them
   from here, and a caller tints it by setting --lamp-dome. */
.lamp .lamp-dome { fill: var(--lamp-dome, #A8192A); }
.lamp .lamp-body { fill: var(--lamp-body, #6D6E70); }
.lamp .lamp-dark { fill: var(--lamp-dark, #0B0B0B); }
.lamp .lamp-glow { fill: var(--lamp-glow, #C78D96); }

.celebrate-lamp svg { width: 100%; height: auto; }

.lvl.big { font-size: 13px; padding: 5px 14px; margin-left: 0; }
.check .lvl { margin-left: 0; min-width: 24px; }

/* The level chooser on the drill screen. Only shown when a drill actually
   offers more than one, so most drills still show a single flat badge. */
/* Under the big target number, which is the thing it changes. Left-aligned
   with the rest of the column now that it is a control rather than a badge. */
.lvl-pick {
  display: flex; gap: 8px; flex-wrap: wrap; align-items: center;
  justify-content: flex-start; margin-top: 10px;
}
.lvl-pick-ask {
  font-size: 13px; font-weight: 700; letter-spacing: .1em; color: var(--label);
  margin-right: 2px;
}
.lvl-one { margin-top: 8px; }
.lvl-opt {
  border: 2px solid currentColor; background: transparent;
  min-height: 34px; padding: 4px 13px;
}
.lvl-opt.on { border-color: transparent; }

/* The escape hatch under a playing video. Deliberately quiet -- it is for the
   times the embed refuses, not something to pull a kid out of the app. */
.video-wrap { display: flex; flex-direction: column; gap: 6px; }
.video-out {
  align-self: center; font-size: 13px; font-weight: 600;
  color: var(--ink-500, #6B7680); text-decoration: underline; padding: 4px;
}

/* One row per level in the drill editor: the toggle, then that level's
   numbers. Stacks on a narrow screen so the number boxes stay tappable. */
.lvl-rows { display: flex; flex-direction: column; gap: 10px; }
.lvl-row {
  display: grid; grid-template-columns: 150px 1fr; gap: 12px; align-items: start;
  padding: 10px; border-radius: 12px; background: #F4F6F8;
}
.lvl-row.on { background: #E9EEF3; }
.lvl-row .field { margin: 0; }
@media (max-width: 720px) {
  .lvl-row { grid-template-columns: 1fr; }
}

.btn {
  height: 48px; padding: 0 20px; border-radius: 12px; background: #141414; color: #fff;
  font-size: 16px; font-weight: 700;
}
.btn.ghost { background: #EEF1F3; color: var(--ink-900); }
.btn.danger { background: #C41E23; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }

.list-row {
  display: flex; align-items: center; gap: 12px; padding: 10px;
  border: 2px solid var(--hairline); border-radius: var(--r-row); margin-bottom: 8px; background: #fff;
}
.list-row.off { opacity: .5; }
/* Reordering Today's Training. Stacked so the pair takes one column, not two. */
/* What kind of thing is in the list. Stickhandling and chores live together
   because they are the same to the app -- a thing a kid did today -- but they
   are not the same to a parent hunting for one of them. */
.cat-filter { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.cat-chip {
  display: inline-flex; align-items: center; gap: 6px;
  height: 34px; padding: 0 12px; border-radius: 17px;
  background: #fff; border: 2px solid var(--hairline);
  font-size: 13px; font-weight: 700; color: var(--gray);
}
.cat-chip.on { background: #141414; border-color: #141414; color: #fff; }
.cat-chip-n {
  background: var(--hairline); color: var(--gray);
  border-radius: 999px; padding: 0 6px; font-size: 11px; min-width: 18px; text-align: center;
}
.cat-chip.on .cat-chip-n { background: rgba(255,255,255,.22); color: #fff; }
/* The same category icon the kids see, so the two sides of the app agree. */
.tile-sm { width: 34px; height: 34px; border-radius: 10px; flex: none;
           display: flex; align-items: center; justify-content: center; }

.order-btns { display: flex; flex-direction: column; gap: 3px; }
.order-btn {
  height: 25px; min-width: 40px; padding: 0 10px; font-size: 11px; line-height: 1;
  border-radius: 7px;
}
.order-btn:disabled { opacity: .3; cursor: default; }

/* How a drill is counted -- reps, sets, hold, max time, intervals. Sits at the
   end of a drill row where the chevron was, on both the kids' and the parent's
   lists, so the two read the same. */
.type-badge {
  display: inline-flex; flex-direction: column; align-items: center; gap: 2px;
  flex: none; min-width: 54px; color: var(--gray);
}
.type-badge-label { font-size: 9px; font-weight: 800; letter-spacing: .08em; white-space: nowrap; }

/* A Custom day's list in the schedule editor: position, name, how it counts,
   then the controls. */
.sched-pick { margin-bottom: 6px; }
.sched-pos {
  width: 28px; height: 28px; border-radius: 50%; flex: none;
  display: flex; align-items: center; justify-content: center;
  background: #141414; color: #fff; font-weight: 800; font-size: 14px;
}
.list-row .grow { flex: 1; min-width: 0; }
.list-row small { color: var(--gray); font-size: 13px; font-weight: 500; }

table.slots { width: 100%; border-collapse: collapse; }
table.slots td, table.slots th { padding: 7px 8px; border-bottom: 1px solid var(--hairline); text-align: left; font-size: 14px; }
table.slots th { font-size: 12px; letter-spacing: .08em; color: var(--label); }
table.slots input { height: 42px; width: 100%; border-radius: 10px; border: 2px solid var(--hairline); padding: 0 10px; font: inherit; font-size: 16px; }
table.slots input.narrow { width: 86px; }

/* ========================================================= TOAST === */

.toast {
  position: fixed; left: 50%; bottom: 30px; transform: translate(-50%, 24px);
  background: #141414; color: #fff; border-radius: 18px; padding: 13px 24px;
  font-size: 18px; font-weight: 600; z-index: 70;
  opacity: 0; pointer-events: none; transition: opacity .2s ease, transform .2s ease;
  max-width: 90vw; text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ======================================================= LOADING === */

.boot {
  position: fixed; inset: 0; background: #121212; color: #fff; z-index: 80;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px;
}
.boot p { font-size: 19px; font-weight: 600; opacity: .7; margin: 0; }
.boot .btn { background: var(--accent); color: var(--ink); }
.spin { width: 54px; height: 54px; border-radius: 50%; border: 6px solid rgba(255,255,255,.15); border-top-color: #F26B1D; animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ================================================== SMALLER SCREENS === */

@media (max-width: 1100px) {
  .parent-bar { height: auto; min-height: 64px; flex-wrap: wrap; padding: 10px 18px; row-gap: 8px; }
  .parent-bar .tabs { margin-left: 0; width: 100%; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .parent-bar .tabs::-webkit-scrollbar { display: none; }
  .parent-bar .tab { flex: none; }
  .drill-grid { grid-template-columns: minmax(0,1fr); grid-auto-rows: min-content; overflow-y: auto; }
  .drill-title { font-size: 44px; }
  .drill-target { font-size: 76px; }
  .big-btn { margin-top: 18px; }
}

@media (max-width: 1100px) {
  .picker-hero { --hero-w: 680px; }
}

@media (max-width: 980px) {
  .board, .locker { grid-template-columns: minmax(0,1fr); overflow-y: auto; }
  .board-right { min-height: 420px; }
  .picker-cards { flex-wrap: wrap; justify-content: center; }
  .cal-month { font-size: 28px; }
}

@media (max-width: 760px) {
  .kid-card { width: 260px; height: 290px; }
  .kid-card-name { font-size: 38px; }
  .picker-lamp { width: 120px; }
  .rep-count { font-size: 120px; min-width: 160px; }
  .step-btn { width: 86px; height: 86px; }
  .goal-word { font-size: 86px; }
  .celebrate-lamp { width: 180px; }
  .cd-num { font-size: 220px; }
  .badges { grid-template-columns: repeat(2,1fr); }
  .pbs, .swatches { grid-template-columns: repeat(2,1fr); }
  .picker-hero { --hero-w: 500px; }
  .login-hero { width: 440px; }
}


/* A short window -- a laptop with browser chrome, or an iPad with the keyboard
   bar up -- must not push the kid cards off the bottom. They are the only
   thing on this screen you can actually tap. */
@media (max-height: 800px) {
  .picker-lamp { width: 112px; }
  .picker-inner { gap: 18px; }
  .kid-card { width: 280px; height: 272px; }
  .kid-card-name { font-size: 38px; }
  .picker-hero { --hero-w: 720px; }
  .login-hero { width: 520px; }
}

@media (max-height: 640px) {
  .picker-lamp { display: none; }
  .kid-card { height: 230px; }
  .picker-ask { font-size: 19px; }
  .picker-hero { --hero-w: 580px; }
  .login-hero { width: 380px; }
}

/* ---------------------------------------------------------- portrait */

/* --------------------------------------------------------- landscape */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ================================================== KID MENU & SETTINGS === */

/* The kid's name opens a menu. The wrapper is the positioning context so the
   panel hangs off the chip rather than the header. */
.kid-menu-wrap { position: relative; flex: none; }

.kid-menu {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 30;
  min-width: 220px; background: #fff; border-radius: var(--r-row);
  padding: 8px; box-shadow: 0 14px 40px rgba(0,0,0,.4);
}
/* Only shown where the chip is reduced to an initial -- see the portrait
   block. Everywhere else the name is already two inches to the right. */
.kid-menu-name { display: none; }

.kid-menu-item {
  display: flex; align-items: center; gap: 12px; width: 100%;
  height: 56px; padding: 0 14px; border-radius: 12px;
  font-size: 18px; font-weight: 700; color: var(--ink-900); text-align: left;
}
.kid-menu-item:hover { background: #F2F5F7; }
.kid-menu-item:active { transform: none; background: #E7ECEF; }

/* --- the settings screen --- */

.settings { flex: 1; min-height: 0; display: flex; flex-direction: column; padding: 14px 18px 18px; }
.settings-head { display: flex; align-items: center; gap: 16px; flex: none; margin-bottom: 14px; }
.settings-head h1 { font-size: 34px; margin: 0; text-transform: uppercase; }
.settings-body {
  flex: 1; min-height: 0;
  display: grid; grid-template-columns: 380px minmax(0,1fr); gap: 18px;
}
.settings-col { display: flex; flex-direction: column; gap: 18px; min-height: 0; }

/* --- goal sound list --- */

.sound-list { display: flex; flex-direction: column; gap: 8px; }
.sound {
  display: flex; align-items: center; gap: 10px; width: 100%;
  min-height: 60px; padding: 10px 14px; border-radius: var(--r-row);
  border: 2.5px solid var(--hairline); background: #fff; text-align: left;
}
.sound.on { border-color: var(--accent); background: var(--soft); }
.sound-name { font-size: 18px; font-weight: 700; flex: 1; min-width: 0; }
.sound-sub { font-size: 13px; font-weight: 500; color: var(--gray); }
.sound-play {
  width: 44px; height: 44px; border-radius: 50%; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  background: #F2F5F7;
}

@media (max-width: 980px) {
  .settings-body { grid-template-columns: minmax(0,1fr); overflow-y: auto; }
}

/* A reward that has been earned should look earned. */
.reward-row.won .reward-top span:last-child { color: #B07A0C; font-weight: 700; }

/* ========================================================= PARENT TOUR === */

/* The tour sits over the real Parent mode. The lit part is a hole cut by a
   huge shadow, so what is under it stays the real, readable screen; the dim
   is light enough that the rest still reads as "where you are". */
.tour { position: fixed; inset: 0; z-index: 70; opacity: 0; transition: opacity .2s; }
.tour.in { opacity: 1; }
.tour-hole {
  position: fixed; border-radius: 14px; pointer-events: none;
  box-shadow: 0 0 0 3px #C6FF2E, 0 0 0 9999px rgba(10,17,36,.62);
  transition: top .3s ease, left .3s ease, width .3s ease, height .3s ease;
}
/* Nothing to point at: the whole screen dims evenly. */
.tour.centered .tour-hole { inset: 50% auto auto 50%; width: 0; height: 0; box-shadow: 0 0 0 9999px rgba(10,17,36,.7); }
.tour-card {
  position: fixed; width: 440px; max-width: calc(100vw - 32px);
  background: #fff; color: var(--ink-900, #141414); border-radius: 22px; padding: 20px 22px 18px;
  box-shadow: 0 18px 50px -12px rgba(0,0,0,.55);
  transition: top .3s ease, left .3s ease;
}
.tour.centered .tour-card { top: 50%; left: 50%; transform: translate(-50%, -50%); width: 520px; }
.tour-step { font-size: 13px; font-weight: 700; color: var(--gray, #5E6670); }
.tour-card h2 {
  font-family: 'Saira Condensed', sans-serif; font-weight: 800; font-size: 30px; line-height: 1.05;
  margin: 2px 0 8px; text-transform: uppercase;
}
.tour-card p { font-size: 16px; line-height: 1.45; margin: 0 0 10px; color: #2B3238; }
.tour-dots { display: flex; gap: 6px; margin: 12px 0 14px; }
.tour-dots i { width: 8px; height: 8px; border-radius: 50%; background: #D5DBE1; }
.tour-dots i.on { background: #141414; width: 22px; border-radius: 4px; }
.tour-btns { display: flex; gap: 10px; align-items: center; justify-content: flex-end; flex-wrap: wrap; }
.tour-skip { margin-right: auto; font-size: 15px; font-weight: 600; color: var(--gray, #5E6670); padding: 10px 4px; min-height: 44px; }
.tour-btns .btn { min-width: 96px; }
.tour-card :focus-visible { outline: 3px solid #2F7DF6; outline-offset: 2px; }
/* Help: the last thing in the menu, a quiet circle -- not a button that
   competes with the tabs. */
.tab.help-btn { width: 40px; padding: 0; flex: none; background: transparent; box-shadow: inset 0 0 0 2px rgba(255,255,255,.35);
                font: 800 19px/1 'Saira Condensed', sans-serif; color: rgba(255,255,255,.8); }
.tab.help-btn:hover { color: #fff; box-shadow: inset 0 0 0 2px rgba(255,255,255,.7); }
.help-list { display: flex; flex-direction: column; gap: 8px; margin: 10px 0 16px; }
.help-item { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left;
             padding: 14px 16px; border-radius: 14px; background: #EEF1F3; min-height: 56px; }
.help-item b { font-size: 18px; }
.help-item span { font-size: 14px; color: var(--gray, #5E6670); }
.kid-id-line { display: block; color: var(--gray, #5E6670); }

/* A phone: the card is a sheet along the bottom and the hole stays above it.
   The room under the page lets the last thing on a tab scroll up clear of it. */
@media (max-width: 599px) {
  .touring .parent-body { padding-bottom: 60vh; }
  .tour-card, .tour.centered .tour-card {
    top: auto; left: 8px; right: 8px; bottom: max(8px, env(safe-area-inset-bottom));
    width: auto; max-width: none; transform: none; max-height: 62vh; overflow-y: auto;
  }
}
@media (prefers-reduced-motion: reduce) {
  .tour, .tour-hole, .tour-card { transition: none; }
}

/* ===================================================== PARENT ANALYTICS === */

.analytics { display: grid; grid-template-columns: 340px minmax(0,1fr); gap: 18px; height: 100%; min-height: 0; }
.analytics-left { min-width: 0; }
.analytics-right { display: flex; flex-direction: column; gap: 18px; min-height: 0; }

/* A compact month, just for picking a range. */
.mini-week { display: grid; grid-template-columns: repeat(7,1fr); gap: 3px; margin-bottom: 4px; }
.mini-week span { text-align: center; font-size: 11px; font-weight: 700; color: var(--label); }
.mini-grid { display: grid; grid-template-columns: repeat(7,1fr); gap: 3px; }
.mini-cell {
  aspect-ratio: 1; border-radius: 8px; background: #F2F5F7;
  font-size: 13px; font-weight: 600; color: var(--ink-900);
  display: flex; align-items: center; justify-content: center;
}
.mini-cell.out { opacity: .35; }
.mini-cell.future { opacity: .3; cursor: default; }
.mini-cell.in { background: var(--soft); }
/* The two ends of the range are the anchors, so they read strongest. */
.mini-cell.edge { background: var(--accent); color: var(--ink); font-weight: 700; }

.range-label {
  margin-top: 12px; font-size: 14px; font-weight: 600; color: var(--gray);
  text-align: center; min-height: 20px;
}

.kid-summary { max-width: none; }
.summary-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.summary-head .hint { margin-left: auto; }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.stat { background: #F7F9FA; border-radius: var(--r-chip); padding: 10px 12px; }
.stat-num { font-size: 30px; line-height: 1; }
.stat-label { font-size: 13px; font-weight: 700; margin-top: 2px; }
.stat-sub { font-size: 11px; font-weight: 500; color: var(--gray); margin-top: 1px; }

.summary-rows { margin-top: 14px; }
.summary-row {
  display: flex; align-items: baseline; justify-content: space-between; gap: 14px;
  padding: 6px 0; border-bottom: 1px solid var(--hairline); font-size: 14px;
}
.summary-row span { color: var(--gray); font-weight: 600; flex: none; }
.summary-row b { text-align: right; }

@media (max-width: 1100px) {
  .analytics { grid-template-columns: minmax(0,1fr); overflow-y: auto; }
  .stats { grid-template-columns: repeat(2, 1fr); }
}

/* ============================================================ PHONES ===

   This was drawn as an iPad app and the rules above assume it. A phone is two
   different shapes, and they fail in opposite directions:

     PORTRAIT   ~390 wide. Everything is already one column by here; what is
                left is type drawn for a 1180px screen.
     LANDSCAPE  ~390 TALL and 850 wide. The width rules above have helpfully
                stacked the two-column screens into one tall scrolling column,
                which is exactly backwards: when height is the scarce thing,
                side by side is what fits. Those get put back.

   Both blocks come last so they win over the width rules at equal specificity. */
/*  Last on purpose. Media queries do not raise specificity, so the winner at
    equal specificity is whichever comes LAST -- and .settings-body has a
    max-width:980 rule further down the file that was quietly undoing the
    landscape layout. Keep these at the bottom. */

/* ---------------------------------------------------------- portrait */
/* ------------------------------------------------- parent: schedule */

/* The override calendar. Monday first, like the plan. Each day says what it
   will be; a day set on its own carries a dot. */
.sched-cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-bottom: 8px; }
.sched-dow { font-size: 11px; font-weight: 700; letter-spacing: .1em; color: var(--label); text-align: center; }
.sched-cell {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  min-height: 64px; padding: 6px 2px; border-radius: 10px;
  border: 2px solid var(--hairline); background: #fff;
}
.sched-cell.out { opacity: .45; }
.sched-cell.past { opacity: .35; cursor: default; }
.sched-cell.today { border-color: #141414; }
.sched-cell.ovr { background: #FFF6E0; }
.sched-cell.sel { border-color: var(--accent); background: var(--soft); }
.sched-num { font-weight: 800; font-size: 16px; }
.sched-mode {
  font-size: 10px; font-weight: 800; letter-spacing: .05em;
  border-radius: 999px; padding: 1px 6px; background: #EEF1F3; color: var(--gray);
}
.sched-mode.m-random { background: #E3EEFB; color: #1F5FA8; }
.sched-mode.m-custom { background: #EDE6FA; color: #5B3BA6; }
.sched-mode.m-off    { background: var(--rest-bg); color: var(--rest-fg); }
.sched-dot { width: 7px; height: 7px; border-radius: 50%; background: #E8A317; }
.sched-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  border: 2px solid var(--hairline); margin-top: 12px;
}
.sched-mix { display: flex; flex-direction: column; gap: 6px; }
.sched-mix-row {
  display: flex; align-items: center; gap: 12px; padding: 6px 10px;
  border-radius: 10px; background: #F4F6F8; font-weight: 700;
}
.sched-mix-row input { width: 80px; height: 40px; }

/* The picker hero on a tall screen: as big as the height allows with the kid
   cards still whole below it (hero less the overlap, then question, cards
   and gaps, about 435px).
   After the width breakpoints so it wins over them; before the phone blocks,
   which never match a screen this tall anyway. */
@media (min-height: 880px) and (min-width: 1000px) {
  .picker-hero { --hero-w: 880px; }
}
@media (min-height: 1040px) and (min-width: 1200px) {
  .picker-hero { --hero-w: 1150px; }
}

@media (max-width: 560px) {
  /* the schedule calendar */
  .sched-cell { min-height: 52px; }
  .sched-mode { font-size: 8px; padding: 1px 4px; }


  .picker-inner { gap: 16px; }
  .picker-hero { --hero-w: 340px; }
  .picker-ask { font-size: 18px; }
  /* Two cards still fit side by side at 390px, and side by side is how a kid
     reads "me or my brother" -- stacked, the second one is below the fold. */
  .picker-cards { gap: 14px; flex-wrap: nowrap; }
  .kid-card { width: 172px; height: 236px; border-radius: 22px; padding: 12px; gap: 6px; }
  .kid-card-name { font-size: 30px; }
  .start-card-icon { width: 64px; height: 64px; }
  .start-card .kid-card-name { font-size: 26px; }
  .kid-card-meta { font-size: 13px; }
  /* The jersey is sized inline from JS so it can scale with whatever draws it.
     On a phone the card is far smaller, and an inline style yields to nothing
     but this. The svg carries width/height ATTRIBUTES, which any CSS beats. */
  .kid-card .jersey { width: 132px !important; height: 110px !important; }
  .kid-card .jersey svg { width: 100%; height: 100%; }
  .picker-parent { right: 14px; bottom: 14px; height: 40px; padding: 0 16px; }

  .board, .locker, .drill-screen, .settings { padding: 12px; }
  .settings-head h1 { font-size: 24px; }
  .settings-body { gap: 12px; }
  .board, .locker { gap: 12px; }
  .board-right { min-height: 0; gap: 12px; }

  .drill-title { font-size: 30px; }
  .drill-target { font-size: 46px; }
  .big-btn { height: 72px; font-size: 28px; }
  /* START is the one thing a kid opened this screen to press, so it must never
     be the thing that scrolled off. Pinned to the BOTTOM of the scroll rather
     than the top: a thumb reaches the bottom of a phone, and it keeps the same
     place it already has on an iPad. The shadow is the content fading under
     it, so it reads as a bar and not as a button floating in the text. */
  .big-btn { position: sticky; bottom: 0; z-index: 5; box-shadow: 0 -14px 16px -6px var(--app-bg); }
  .drill-right { padding-bottom: 0; }

  .rep-title { font-size: 28px; }
  .rep-count { font-size: 76px; min-width: 0; }
  .step-btn { width: 72px; height: 72px; }
  .stepper { gap: 16px; }
  .set-chip { width: 96px; height: 58px; }
  .stop-btn { height: 72px; font-size: 26px; }

  .cd-num { font-size: 150px; }
  .timer-name { font-size: 22px; }
  .timer-restart { top: 12px; left: 12px; height: 42px; padding: 0 14px; font-size: 15px; }
  .timer-bottom { bottom: 18px; }

  .goal-word { font-size: 52px; }
  .celebrate-lamp { width: 120px; }

  .overlay h2 { font-size: 34px; }
  .overlay .big { font-size: 46px; }

  .badges, .pbs, .swatches { grid-template-columns: repeat(2,1fr); }

  /* THE EMPTY-LIST BUG. .train, .train-list and .cal-grid are all
     "flex: 1; min-height: 0", which is right inside a fixed-height column: they
     share out the leftover space. On a phone the board scrolls instead, so the
     column has no fixed height, and flex-basis 0 with min-height 0 resolves to
     ZERO -- the card draws its "Today's Training" heading and then nothing at
     all. Content height plus a scrolling board is the right model here. */
  .train, .cal { flex: none; }
  .train-list { flex: none; min-height: 0; }
  .cal-grid { flex: none; }


  /* One week, so the cells can be a real tap target instead of 45px of a
     month grid shared between a date and a lamp. */
  .cal { padding: 12px 12px 14px; }
  .cal-grid { grid-auto-rows: 66px; gap: 4px; }
  .cal-week { gap: 4px; }
  .cal-week span { font-size: 11px; letter-spacing: .06em; }
  .cal-cell { padding: 4px 5px; border-width: 2px; }
  .cal-cell-num { font-size: 14px; }
  .cal-count { font-size: 18px; }
  .cal-month { font-size: 22px; }
  .cal-round { width: 40px; height: 40px; }
  .cal-nav { gap: 8px; margin-bottom: 10px; }
  .cal-today-btn { height: 34px; padding: 0 12px; font-size: 14px; }
  .cal-legend { gap: 10px; font-size: 11px; margin-top: 8px; flex-wrap: wrap; }
  .train-title { font-size: 24px; }
  /* Seven tabs, a title and an Exit button do not fit on one phone-width row.
     The bar wraps to two: controls on top, tabs underneath as a strip that
     scrolls sideways rather than squeezing every tab to an unreadable stub. */
  .parent-bar { height: auto; min-height: 52px; flex-wrap: wrap; padding: 7px 12px; gap: 8px; }
  .parent-bar h1 { font-size: 19px; }
  .tabs { margin-left: 0; width: 100%; flex-wrap: nowrap; overflow-x: auto; }
  .tabs::-webkit-scrollbar { display: none; }
  .tab { height: 34px; padding: 0 12px; font-size: 13px; flex: none; }
  .parent-body { padding: 12px; }
  .parent-card { padding: 12px; }
}

/* --------------------------------------------------------- landscape */
@media (max-height: 500px) {

  .picker-inner { gap: 8px; }
  .picker-hero { --hero-w: 340px; }
  .login-hero { width: 240px; }
  .picker-ask { font-size: 15px; }
  .picker-cards { gap: 14px; flex-wrap: nowrap; }
  .kid-card { width: 178px; height: 164px; border-radius: 18px; padding: 8px; gap: 3px; }
  .kid-card-name { font-size: 24px; }
  .start-card-icon { width: 52px; height: 52px; }
  .start-card .kid-card-name { font-size: 22px; }
  .kid-card-meta { font-size: 11px; }
  /* The jersey is sized inline from JS so it can scale with whatever draws it.
     On a phone the card is far smaller, and an inline style yields to nothing
     but this. The svg carries width/height ATTRIBUTES, which any CSS beats. */
  .kid-card .jersey { width: 108px !important; height: 90px !important; }
  .kid-card .jersey svg { width: 100%; height: 100%; }
  .picker-parent { right: 12px; bottom: 10px; height: 36px; padding: 0 14px; font-size: 14px; }

  /* Two columns again. There is width to spare and no height at all. */
  .board, .locker { grid-template-columns: minmax(0,1fr) 300px; overflow-y: auto; padding: 10px; gap: 10px; }
  .board-right, .locker-col { min-height: 0; gap: 10px; }
  .drill-grid { grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 14px; overflow-y: auto; }
  /* The video keeps its shape but must not eat the whole screen; the column
     scrolls rather than pushing the Start button off the bottom. */
  .drill-left { overflow-y: auto; }
  .drill-screen, .settings { padding: 8px 12px 12px; }
  /* Two columns here too -- the team list is 32 teams and a single column of
     them on a 390px-tall screen is nothing but scrolling. */
  .settings-body { grid-template-columns: minmax(0,240px) minmax(0,1fr); gap: 12px; }
  .settings-head { margin-bottom: 8px; }
  .settings-head h1 { font-size: 22px; }
  .drill-top { margin-bottom: 6px; }
  .back-pill { height: 36px; padding: 0 12px; font-size: 14px; }

  .drill-title { font-size: 26px; }
  .drill-target { font-size: 40px; }
  .big-btn { height: 54px; font-size: 22px; margin-top: 10px; }
  /* START is the one thing a kid opened this screen to press, so it must never
     be the thing that scrolled off. Pinned to the BOTTOM of the scroll rather
     than the top: a thumb reaches the bottom of a phone, and it keeps the same
     place it already has on an iPad. The shadow is the content fading under
     it, so it reads as a bar and not as a button floating in the text. */
  .big-btn { position: sticky; bottom: 0; z-index: 5; box-shadow: 0 -14px 16px -6px var(--app-bg); }
  .drill-right { padding-bottom: 0; }

  .rep-title { font-size: 22px; }
  .rep-count { font-size: 64px; min-width: 0; }
  .step-btn { width: 64px; height: 64px; }
  .stepper { gap: 14px; margin-top: 8px; }
  .set-chip { width: 88px; height: 50px; }
  .stop-btn { height: 56px; font-size: 22px; margin-top: 8px; }

  .cd-num { font-size: 150px; }
  .timer-name { font-size: 20px; }
  .timer-head { top: 10px; }
  .timer-restart { top: 8px; left: 8px; height: 38px; padding: 0 12px; font-size: 14px; }
  .timer-bottom { bottom: 12px; }

  .goal-word { font-size: 46px; }
  .celebrate-lamp { width: 90px; }
  .celebrate { gap: 6px; }

  .overlay h2 { font-size: 30px; }
  .overlay .big { font-size: 40px; }
  .sheet { max-height: 88vh; overflow-y: auto; }

  .badges, .pbs, .swatches { grid-template-columns: repeat(4,1fr); }

  /* THE EMPTY-LIST BUG. .train, .train-list and .cal-grid are all
     "flex: 1; min-height: 0", which is right inside a fixed-height column: they
     share out the leftover space. On a phone the board scrolls instead, so the
     column has no fixed height, and flex-basis 0 with min-height 0 resolves to
     ZERO -- the card draws its "Today's Training" heading and then nothing at
     all. Content height plus a scrolling board is the right model here. */
  .train, .cal { flex: none; }
  .train-list { flex: none; min-height: 0; }
  .cal-grid { flex: none; }

  .cal { padding: 10px; }
  .cal-grid { grid-auto-rows: 58px; gap: 4px; }
  .cal-week { gap: 4px; }
  .cal-week span { font-size: 10px; letter-spacing: .04em; }
  .cal-cell { padding: 3px 5px; border-width: 2px; }
  .cal-cell-num { font-size: 13px; }
  .cal-count { font-size: 16px; }
  .cal-month { font-size: 19px; }
  .cal-round { width: 36px; height: 36px; }
  .cal-nav { gap: 8px; margin-bottom: 8px; }
  .cal-today-btn { height: 32px; padding: 0 11px; font-size: 13px; }
  .cal-legend { display: none; }
  .train-title { font-size: 21px; }
  .train { padding: 10px; }
  /* Seven tabs, a title and an Exit button do not fit on one phone-width row.
     The bar wraps to two: controls on top, tabs underneath as a strip that
     scrolls sideways rather than squeezing every tab to an unreadable stub. */
  .parent-bar { height: auto; min-height: 52px; flex-wrap: wrap; padding: 7px 12px; gap: 8px; }
  .parent-bar h1 { font-size: 19px; }
  .tabs { margin-left: 0; width: 100%; flex-wrap: nowrap; overflow-x: auto; }
  .tabs::-webkit-scrollbar { display: none; }
  .tab { height: 34px; padding: 0 12px; font-size: 13px; flex: none; }
  .parent-body { padding: 12px; }
  .parent-card { padding: 12px; }
}


