/* ─────────────────────────────────────────────────────────────────────────
   HIT ZERO WEB — Desktop app tokens, layout, and primitives
   Inherits all brand tokens from hit_zero/styles/tokens.css but re-declares
   them here so this folder is self-contained (web app can ship independently).
   ───────────────────────────────────────────────────────────────────────── */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,300;0,9..144,400;0,9..144,500;0,9..144,600;0,9..144,700;0,9..144,800;0,9..144,900;1,9..144,400;1,9..144,700;1,9..144,900&family=Inter:wght@300;400;500;600;700;800;900&family=JetBrains+Mono:wght@400;500;700&display=swap');

:root {
  --hz-teal:        #27CFD7;
  --hz-teal-dim:    #1a8f94;
  --hz-teal-glow:   #81ffff;
  --hz-pink:        #F97FAC;
  --hz-pink-dim:    #b8567a;
  --hz-pink-glow:   #ffb0f9;
  --hz-black:       #000;
  --hz-ink:         #0A0A0B;
  --hz-ink-2:       #14141A;
  --hz-ink-3:       #1C1C24;
  --hz-ink-4:       #24242E;
  --hz-line:        rgba(255,255,255,0.08);
  --hz-line-2:      rgba(255,255,255,0.14);
  --hz-dim:         rgba(255,255,255,0.55);
  --hz-dimmer:      rgba(255,255,255,0.35);
  --hz-amber:       #FFB454;
  --hz-red:         #FF5E6C;
  --hz-green:       #3FE7A0;

  --hz-serif:       'Fraunces', 'Times New Roman', serif;
  --hz-sans:        'Inter', -apple-system, system-ui, sans-serif;
  --hz-mono:        'JetBrains Mono', ui-monospace, monospace;

  /* app chrome */
  --hz-sidebar-w:   240px;
  --hz-topbar-h:    64px;
  --hz-r-sm:        6px;
  --hz-r:           10px;
  --hz-r-lg:        18px;
  --hz-r-xl:        24px;

  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; font-family: var(--hz-sans); color: #fff; background: #050507; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
#root { min-height: 100vh; }

/* page bg — subtle, editorial */
body {
  background:
    radial-gradient(1400px 700px at 15% -10%, rgba(39,207,215,0.06), transparent 60%),
    radial-gradient(1400px 700px at 85% 110%, rgba(249,127,172,0.06), transparent 60%),
    #050507;
  min-height: 100vh;
}

/* ─── Type system ─── */
.hz-display {
  font-family: var(--hz-serif);
  font-weight: 500;
  font-variation-settings: "opsz" 144;
  letter-spacing: -0.04em;
  line-height: 0.92;
  font-style: italic;
}
.hz-display-strong { font-weight: 800; font-style: normal; letter-spacing: -0.05em; }
.hz-serif { font-family: var(--hz-serif); font-variation-settings: "opsz" 36; }
.hz-sans  { font-family: var(--hz-sans); }
.hz-mono  { font-family: var(--hz-mono); }
.hz-eyebrow { font-size: 10px; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; color: var(--hz-dim); }
.hz-label   { font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; }

/* ─── Wordmark ─── */
.hz-wordmark {
  font-family: var(--hz-serif);
  font-weight: 900;
  font-style: italic;
  letter-spacing: -0.055em;
  line-height: 0.82;
  font-variation-settings: "opsz" 144;
}
.hz-zero {
  background: linear-gradient(135deg, var(--hz-teal) 0%, var(--hz-pink) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  font-style: italic;
}

/* ─── Accent classes ─── */
.hz-teal { color: var(--hz-teal); }
.hz-pink { color: var(--hz-pink); }
.hz-amber { color: var(--hz-amber); }
.hz-green { color: var(--hz-green); }
.hz-red { color: var(--hz-red); }

/* ─── Panels ─── */
.hz-card {
  background: var(--hz-ink-2);
  border: 1px solid var(--hz-line);
  border-radius: var(--hz-r-lg);
  padding: 20px 22px;
}
.hz-card-dense { padding: 14px 16px; border-radius: var(--hz-r); }

/* ─── Pill / chip ─── */
.hz-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 999px;
  background: rgba(255,255,255,0.07);
  font-size: 10px; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: #fff;
}
.hz-pill-teal { background: rgba(39,207,215,0.15); color: var(--hz-teal); }
.hz-pill-pink { background: rgba(249,127,172,0.15); color: var(--hz-pink); }
.hz-pill-amber { background: rgba(255,180,84,0.15); color: var(--hz-amber); }
.hz-pill-green { background: rgba(63,231,160,0.15); color: var(--hz-green); }
.hz-pill-red { background: rgba(255,94,108,0.15); color: var(--hz-red); }

/* ─── Buttons ─── */
.hz-btn {
  appearance: none; border: 1px solid var(--hz-line-2); background: transparent; color: #fff;
  padding: 9px 14px; border-radius: 10px;
  font-family: var(--hz-sans); font-size: 13px; font-weight: 600; letter-spacing: 0.01em;
  cursor: pointer; display: inline-flex; align-items: center; gap: 8px;
  transition: background 120ms ease, border-color 120ms ease, transform 60ms ease;
}
.hz-btn:hover { background: rgba(255,255,255,0.06); border-color: rgba(255,255,255,0.25); }
.hz-btn:active { transform: translateY(1px); }
.hz-btn-primary {
  background: linear-gradient(135deg, var(--hz-teal) 0%, var(--hz-pink) 100%);
  border: none; color: #000; font-weight: 700;
}
.hz-btn-primary:hover { filter: brightness(1.08); background: linear-gradient(135deg, var(--hz-teal) 0%, var(--hz-pink) 100%); }
.hz-btn-ghost { border: none; }
.hz-btn-ghost:hover { background: rgba(255,255,255,0.06); }
.hz-btn-sm { padding: 6px 10px; font-size: 12px; }
.hz-btn-xs { padding: 4px 8px; font-size: 11px; border-radius: 6px; }
.hz-btn-danger { color: var(--hz-red); border-color: rgba(255,94,108,0.35); }
.hz-btn-danger:hover { background: rgba(255,94,108,0.08); }

/* ─── Inputs ─── */
.hz-input {
  appearance: none; background: rgba(255,255,255,0.04); border: 1px solid var(--hz-line);
  color: #fff; padding: 10px 14px; border-radius: 10px;
  font-family: var(--hz-sans); font-size: 13px; width: 100%;
  transition: border-color 120ms ease, background 120ms ease;
}
.hz-input:focus { outline: none; border-color: rgba(255,255,255,0.25); background: rgba(255,255,255,0.06); }
.hz-input::placeholder { color: var(--hz-dimmer); }

/* ─── Scrollbars ─── */
.hz-scroll::-webkit-scrollbar { width: 10px; height: 10px; }
.hz-scroll::-webkit-scrollbar-track { background: transparent; }
.hz-scroll::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 10px; border: 2px solid #050507; }
.hz-scroll::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.16); }

/* ─── Utilities ─── */
.hz-divider { height: 1px; background: var(--hz-line); }
.hz-nosel { user-select: none; -webkit-user-select: none; }

/* ─── Routine Builder ─── */
.routine-builder-setup {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(340px, 0.8fr);
  gap: 24px;
}
.routine-builder-music-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.routine-audio-empty {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px 14px;
  align-items: center;
  padding: 18px;
  border: 1px dashed rgba(255,255,255,0.18);
  border-radius: 14px;
  color: var(--hz-dim);
  margin-bottom: 16px;
}
.routine-audio-empty b {
  color: #fff;
  font-size: 14px;
}
.routine-audio-empty span {
  grid-column: 1 / 2;
  font-size: 13px;
  line-height: 1.35;
}
.routine-audio-empty .hz-btn {
  grid-column: 2 / 3;
  grid-row: 1 / 3;
}
.routine-jukebox {
  margin-bottom: 16px;
  border: 1px solid rgba(255,255,255,0.11);
  border-radius: 18px;
  padding: 14px;
  background:
    radial-gradient(circle at 12% 0%, rgba(39,207,215,0.12), transparent 35%),
    radial-gradient(circle at 88% 20%, rgba(249,127,172,0.10), transparent 34%),
    rgba(255,255,255,0.025);
}
.routine-jukebox-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
  margin-bottom: 12px;
}
.routine-jukebox-copy,
.routine-jukebox-note {
  color: var(--hz-dim);
  font-size: 12px;
  line-height: 1.35;
  margin-top: 4px;
}
.routine-jukebox-status {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 7px 10px;
  background: rgba(255,255,255,0.08);
  color: var(--hz-dim);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.routine-jukebox-status-restored {
  background: rgba(75,255,177,0.12);
  color: #80f4bc;
}
.routine-jukebox-status-loading,
.routine-jukebox-status-local {
  background: rgba(39,207,215,0.13);
  color: var(--hz-teal);
}
.routine-jukebox-status-error,
.routine-jukebox-status-local-expired,
.routine-jukebox-status-metadata {
  background: rgba(255,92,122,0.14);
  color: var(--hz-pink);
}
.routine-jukebox-list {
  display: grid;
  gap: 8px;
}
.routine-jukebox-track,
.routine-jukebox-empty {
  width: 100%;
  text-align: left;
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 14px;
  background: rgba(255,255,255,0.035);
  color: #fff;
  padding: 11px 12px;
  cursor: pointer;
}
.routine-jukebox-track {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}
.routine-jukebox-track.active {
  border-color: rgba(39,207,215,0.55);
  box-shadow: 0 0 0 1px rgba(39,207,215,0.20);
}
.routine-jukebox-track b,
.routine-jukebox-track small {
  display: block;
}
.routine-jukebox-track small,
.routine-jukebox-track em {
  color: var(--hz-dim);
  font-size: 11px;
  font-style: normal;
  margin-top: 3px;
}
.routine-jukebox-track em {
  flex: 0 0 auto;
  border-radius: 999px;
  background: rgba(255,255,255,0.07);
  padding: 6px 9px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 900;
}
.routine-jukebox-empty {
  color: var(--hz-dim);
  text-align: center;
}
.routine-builder-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 400px;
  gap: 24px;
}
.routine-builder-section-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.routine-builder-assignment-form {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr 1fr 1.3fr auto;
  gap: 10px;
  align-items: center;
}
.routine-section-editor-card {
  scroll-margin-top: calc(var(--hz-topbar-h) + 18px);
  outline: none;
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}
.routine-section-editor-card-active {
  border-color: rgba(39,207,215,0.8);
  box-shadow: 0 0 0 1px rgba(39,207,215,0.28), 0 0 36px rgba(39,207,215,0.12);
  transform: translateY(-2px);
}
.routine-choreo-guide {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: -4px 0 14px;
}
.routine-choreo-guide span {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 14px;
  background: rgba(255,255,255,0.035);
  color: var(--hz-dim);
  font-size: 12px;
  line-height: 1.35;
}
.routine-choreo-guide b {
  display: grid;
  place-items: center;
  flex: 0 0 22px;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  color: #030306;
  background: linear-gradient(135deg, var(--hz-teal), var(--hz-pink));
}
.routine-coach-helper {
  margin: 0 0 16px;
  border: 1px solid rgba(39,207,215,0.22);
  border-radius: 22px;
  padding: 16px;
  background:
    linear-gradient(135deg, rgba(39,207,215,0.12), transparent 38%),
    radial-gradient(circle at 88% 8%, rgba(249,127,172,0.18), transparent 34%),
    rgba(255,255,255,0.026);
}
.routine-coach-helper-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: start;
  margin-bottom: 12px;
}
.routine-coach-helper-title {
  font-size: 20px;
  font-weight: 950;
  letter-spacing: -0.035em;
  margin-top: 4px;
}
.routine-coach-helper-copy {
  color: var(--hz-dim);
  font-size: 12px;
  line-height: 1.4;
  margin-top: 4px;
}
.routine-coach-helper-head span {
  border-radius: 999px;
  padding: 7px 10px;
  background: rgba(39,207,215,0.13);
  color: var(--hz-teal);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.routine-coach-helper-log {
  display: grid;
  gap: 8px;
  max-height: 230px;
  overflow: auto;
  padding-right: 2px;
  margin-bottom: 12px;
}
.routine-coach-helper-msg {
  max-width: 88%;
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 16px;
  padding: 10px 12px;
  background: rgba(255,255,255,0.045);
}
.routine-coach-helper-msg-coach {
  justify-self: end;
  background: linear-gradient(135deg, rgba(39,207,215,0.26), rgba(249,127,172,0.18));
  color: #fff;
}
.routine-coach-helper-msg-assistant {
  justify-self: start;
}
.routine-coach-helper-msg b {
  display: block;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--hz-dim);
  margin-bottom: 4px;
}
.routine-coach-helper-msg p {
  margin: 0;
  color: #fff;
  font-size: 13px;
  line-height: 1.42;
}
.routine-coach-helper-msg small {
  display: block;
  margin-top: 6px;
  color: var(--hz-dim);
  font-size: 11px;
}
.routine-coach-helper-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}
.routine-coach-helper-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.routine-formation-board {
  position: relative;
  min-height: 360px;
  border: 1px solid rgba(39,207,215,0.24);
  border-radius: 24px;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(255,255,255,0.045) 1px, transparent 1px),
    linear-gradient(0deg, rgba(255,255,255,0.045) 1px, transparent 1px),
    radial-gradient(circle at 50% 12%, rgba(39,207,215,0.16), transparent 34%),
    rgba(255,255,255,0.025);
  background-size: 12.5% 12.5%, 12.5% 12.5%, auto, auto;
  touch-action: none;
}
.routine-formation-centerline {
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 1px;
  background: rgba(255,255,255,0.12);
}
.routine-formation-front {
  position: absolute;
  left: 50%;
  bottom: 12px;
  transform: translateX(-50%);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--hz-dimmer);
  font-family: var(--hz-mono);
}
.routine-athlete-dot {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 48px;
  height: 48px;
  border-radius: 999px;
  border: 1.5px solid rgba(255,255,255,0.22);
  background: linear-gradient(135deg, var(--hz-teal), var(--hz-pink));
  color: #030306;
  font-weight: 950;
  font-size: 12px;
  cursor: grab;
  box-shadow: 0 14px 30px rgba(0,0,0,0.35);
  touch-action: none;
}
.routine-athlete-dot.active {
  outline: 3px solid rgba(255,255,255,0.55);
  box-shadow: 0 0 0 8px rgba(39,207,215,0.18), 0 18px 36px rgba(0,0,0,0.45);
}
.routine-athlete-dot-live {
  left: 0;
  top: 0;
  width: 38px;
  height: 38px;
  font-size: 11px;
  cursor: grab;
  transform: translate3d(calc(var(--live-x, 0px) - 50%), calc(var(--live-y, 0px) - 50%), 0);
  transition: box-shadow 160ms ease, outline-color 160ms ease;
  will-change: transform;
  backface-visibility: hidden;
}
.routine-athlete-dot-live:hover {
  transform: translate3d(calc(var(--live-x, 0px) - 50%), calc(var(--live-y, 0px) - 50%), 0) scale(1.08);
}
.routine-athlete-dot-live.is-flowing {
  box-shadow: 0 0 0 5px rgba(39,207,215,0.09), 0 14px 30px rgba(0,0,0,0.35);
}
.routine-athlete-dot-live.is-routing {
  outline: 3px solid rgba(249,127,172,0.78);
  box-shadow: 0 0 0 8px rgba(249,127,172,0.18), 0 18px 42px rgba(0,0,0,0.5);
}
.routine-live-visualizer {
  margin-bottom: 16px;
  border: 1px solid rgba(39,207,215,0.22);
  border-radius: 20px;
  padding: 14px;
  background:
    radial-gradient(circle at 18% 12%, rgba(39,207,215,0.18), transparent 34%),
    radial-gradient(circle at 86% 22%, rgba(249,127,172,0.14), transparent 30%),
    rgba(255,255,255,0.026);
}
.routine-live-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: start;
  margin-bottom: 12px;
}
.routine-live-title {
  font-weight: 950;
  font-size: 18px;
  margin-top: 4px;
}
.routine-live-sub {
  color: var(--hz-dim);
  font-size: 12px;
  margin-top: 4px;
}
.routine-live-clock {
  text-align: right;
  font-family: var(--hz-mono);
  color: var(--hz-dim);
}
.routine-live-clock b {
  display: block;
  color: #fff;
  font-size: 16px;
}
.routine-live-progress {
  height: 6px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255,255,255,0.08);
  margin-bottom: 12px;
}
.routine-live-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--hz-teal), var(--hz-pink));
  transition: width 180ms linear;
}
.routine-live-controls {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(128px, 0.44fr) minmax(150px, 0.65fr) auto;
  gap: 10px;
  align-items: end;
  margin-bottom: 12px;
}
.routine-quick-counts {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.routine-live-build-btn {
  min-height: 41px;
  white-space: nowrap;
}
.routine-auto-motion-btn {
  width: 100%;
  min-height: 41px;
  white-space: nowrap;
}
.routine-live-action-stack {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.routine-live-stage {
  position: relative;
  min-height: 330px;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 18px;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(255,255,255,0.045) 1px, transparent 1px),
    linear-gradient(0deg, rgba(255,255,255,0.045) 1px, transparent 1px),
    linear-gradient(180deg, rgba(255,255,255,0.03), rgba(0,0,0,0.16));
  background-size: 12.5% 12.5%, 12.5% 12.5%, auto;
}
.routine-live-drag-hint {
  position: absolute;
  left: 14px;
  top: 12px;
  z-index: 1;
  max-width: calc(100% - 28px);
  padding: 7px 10px;
  border: 1px solid rgba(39,207,215,0.22);
  border-radius: 999px;
  background: rgba(0,0,0,0.32);
  color: rgba(255,255,255,0.72);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.02em;
  pointer-events: none;
}
.routine-board-drag-hint {
  border-color: rgba(255,255,255,0.14);
}
.routine-live-empty {
  position: absolute;
  inset: 24px;
  display: grid;
  place-items: center;
  text-align: center;
  color: var(--hz-dim);
  font-size: 13px;
  line-height: 1.45;
  border: 1px dashed rgba(255,255,255,0.16);
  border-radius: 16px;
  padding: 18px;
}
.routine-live-footer {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  margin-top: 12px;
  color: var(--hz-dim);
  font-size: 12px;
}
.routine-waveform-bar {
  width: 7px;
  align-self: end;
  padding: 0;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  background: linear-gradient(180deg, var(--hz-teal), var(--hz-pink));
  transition: transform 120ms ease, opacity 120ms ease, box-shadow 120ms ease;
}
.routine-waveform-bar:hover,
.routine-waveform-bar.active {
  opacity: 1 !important;
  transform: translateY(-3px) scaleX(1.18);
  box-shadow: 0 0 0 4px rgba(39,207,215,0.12);
}
.routine-section-block-hint {
  margin-top: 4px;
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.72);
  white-space: nowrap;
}
.routine-roster-tray {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}
.routine-roster-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--hz-line);
  border-radius: 999px;
  padding: 6px 10px 6px 6px;
  background: rgba(255,255,255,0.04);
  color: #fff;
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
}
.routine-roster-chip span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: rgba(39,207,215,0.24);
  color: var(--hz-teal);
  font-size: 10px;
}
.routine-position-inspector {
  display: grid;
  grid-template-columns: 1fr 170px auto;
  gap: 10px;
  align-items: center;
  margin-top: 14px;
  padding: 12px;
  border: 1px solid var(--hz-line);
  border-radius: 14px;
  background: rgba(255,255,255,0.035);
}
.routine-assignment-row {
  display: grid;
  grid-template-columns: minmax(150px, 0.7fr) 1fr;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--hz-line);
  border-radius: 12px;
  background: rgba(255,255,255,0.03);
}
.routine-ai-card {
  padding: 12px;
  border: 1px solid var(--hz-line);
  border-radius: 12px;
  background: rgba(255,255,255,0.03);
}
.routine-ai-card-accepted { border-color: rgba(63,231,160,0.35); background: rgba(63,231,160,0.06); }
.routine-ai-card-rejected { opacity: 0.62; }
.routine-music-console {
  display: grid;
  gap: 12px;
  margin-bottom: 18px;
  padding: 14px;
  border: 1px solid rgba(39,207,215,0.18);
  border-radius: 16px;
  background:
    radial-gradient(circle at 12% 20%, rgba(39,207,215,0.14), transparent 36%),
    radial-gradient(circle at 88% 24%, rgba(249,127,172,0.1), transparent 34%),
    rgba(255,255,255,0.032);
}
.routine-waveform-strip {
  display: grid;
  grid-template-columns: repeat(48, minmax(3px, 1fr));
  align-items: center;
  gap: 3px;
  min-height: 58px;
  padding: 8px 10px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  background: rgba(0,0,0,0.2);
}
.routine-waveform-strip span {
  display: block;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--hz-teal), var(--hz-pink));
}
.routine-upload-notice {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border: 1px solid var(--hz-line);
  border-radius: 14px;
  background: rgba(255,255,255,0.035);
  font-size: 12px;
}
.routine-upload-notice span {
  color: var(--hz-dim);
  line-height: 1.45;
}
.routine-upload-notice-success {
  border-color: rgba(63,231,160,0.34);
  background: rgba(63,231,160,0.06);
}
.routine-upload-notice-error {
  border-color: rgba(255,91,117,0.42);
  background: rgba(255,91,117,0.07);
}
.routine-ai-flavor-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}
.routine-validation-row {
  display: grid;
  gap: 3px;
  padding: 11px 12px;
  border: 1px solid var(--hz-line);
  border-radius: 12px;
  background: rgba(255,255,255,0.03);
  font-size: 12px;
}
.routine-validation-row span {
  color: var(--hz-dim);
  line-height: 1.4;
}
.routine-validation-red { border-color: rgba(255,91,117,0.34); background: rgba(255,91,117,0.07); }
.routine-validation-amber { border-color: rgba(255,185,82,0.34); background: rgba(255,185,82,0.06); }
.routine-validation-teal { border-color: rgba(39,207,215,0.34); background: rgba(39,207,215,0.06); }
.routine-validation-green { border-color: rgba(63,231,160,0.34); background: rgba(63,231,160,0.06); }
.routine-output-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0;
}
.routine-output-tabs button {
  appearance: none;
  border: 1px solid var(--hz-line);
  border-radius: 999px;
  background: rgba(255,255,255,0.035);
  color: var(--hz-dim);
  padding: 8px 11px;
  font-family: var(--hz-sans);
  font-size: 11px;
  font-weight: 900;
  cursor: pointer;
}
.routine-output-tabs button.active {
  color: #030306;
  border-color: transparent;
  background: linear-gradient(135deg, var(--hz-teal), var(--hz-pink));
}
.routine-output-preview {
  margin: 0 0 12px;
  min-height: 220px;
  max-height: 360px;
  overflow: auto;
  white-space: pre-wrap;
  border: 1px solid var(--hz-line);
  border-radius: 14px;
  background: rgba(0,0,0,0.25);
  color: var(--hz-dim);
  padding: 14px;
  font-size: 11px;
  line-height: 1.55;
}
.routine-review-row {
  display: grid;
  gap: 4px;
  padding: 10px 11px;
  border: 1px solid var(--hz-line);
  border-radius: 12px;
  background: rgba(255,255,255,0.03);
  font-size: 12px;
}
.routine-review-row span {
  color: var(--hz-dim);
  line-height: 1.4;
}
.routine-review-row.resolved {
  opacity: 0.58;
}
.routine-remix-console {
  display: grid;
  gap: 10px;
  margin-top: 16px;
  padding: 14px;
  border: 1px solid rgba(249,127,172,0.18);
  border-radius: 16px;
  background:
    linear-gradient(135deg, rgba(39,207,215,0.07), rgba(249,127,172,0.07)),
    rgba(255,255,255,0.025);
}
.routine-compliance-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

/* ─── Animations ─── */
@keyframes hz-rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.hz-rise { animation: hz-rise 0.45s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
@keyframes hz-fade { from { opacity: 0; } to { opacity: 1; } }
.hz-fade { animation: hz-fade 0.3s ease-out both; }
@keyframes hz-pulse-teal { 0%,100% { box-shadow: 0 0 0 0 rgba(39,207,215,0.55); } 50% { box-shadow: 0 0 0 10px rgba(39,207,215,0); } }
@keyframes hz-pulse-pink { 0%,100% { box-shadow: 0 0 0 0 rgba(249,127,172,0.55); } 50% { box-shadow: 0 0 0 10px rgba(249,127,172,0); } }

/* ─── App shell ─── */
.app-shell {
  display: grid;
  grid-template-columns: var(--hz-sidebar-w) 1fr;
  grid-template-rows: var(--hz-topbar-h) 1fr;
  min-height: 100vh;
}
.sidebar {
  grid-row: 1 / span 2;
  background: var(--hz-ink);
  border-right: 1px solid var(--hz-line);
  display: flex; flex-direction: column;
  padding: 20px 16px 16px;
  position: sticky; top: 0; height: 100vh;
}
.topbar {
  grid-column: 2; grid-row: 1;
  display: flex; align-items: center; justify-content: space-between;
  gap: 18px;
  padding: 0 24px;
  border-bottom: 1px solid var(--hz-line);
  background:
    linear-gradient(90deg, rgba(39,207,215,0.05), transparent 38%, rgba(249,127,172,0.04)),
    rgba(10,10,11,0.78);
  backdrop-filter: blur(14px);
  position: sticky; top: 0; z-index: 20;
}
.topbar-left {
  display: flex; align-items: center; gap: 12px;
  flex: 1 1 auto; min-width: 0;
}
.topbar-actions {
  display: flex; align-items: center; gap: 10px;
  flex: 0 1 auto; min-width: 0;
}
.topbar-search {
  appearance: none;
  display: flex; align-items: center; gap: 10px;
  width: min(520px, 100%);
  min-width: 220px;
  padding: 9px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,0.045);
  border: 1px solid var(--hz-line);
  color: var(--hz-dim);
  font-family: var(--hz-sans);
  font-size: 12.5px;
  cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease, color 120ms ease;
}
.topbar-search:hover {
  background: rgba(255,255,255,0.07);
  border-color: rgba(255,255,255,0.18);
  color: #fff;
}
.topbar-search-label {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.topbar-kbd {
  margin-left: auto;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--hz-line);
  font-family: var(--hz-mono);
  font-size: 10px;
  color: var(--hz-dimmer);
}
.topbar-account {
  appearance: none;
  display: inline-flex; align-items: center; gap: 9px;
  max-width: min(420px, 44vw);
  min-width: 0;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--hz-line-2);
  background: rgba(255,255,255,0.035);
  color: #fff;
  font-family: var(--hz-sans);
  font-size: 12px;
  cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease;
}
.topbar-account:hover {
  background: rgba(255,255,255,0.07);
  border-color: rgba(255,255,255,0.24);
}
.topbar-account-name {
  min-width: 0;
  max-width: 170px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-weight: 800;
}
.topbar-view-as {
  color: var(--hz-dimmer);
  font-size: 11px;
}
.topbar-account-role {
  color: var(--hz-teal);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.topbar-icon-btn {
  appearance: none;
  width: 36px; height: 36px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--hz-sans);
  font-size: 16px;
  font-weight: 900;
  cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease, color 120ms ease;
}
.topbar-icon-btn:hover {
  background: rgba(255,255,255,0.07);
  border-color: var(--hz-line);
  color: var(--hz-teal);
}
.main {
  grid-column: 2; grid-row: 2;
  padding: 32px 40px 80px;
  min-width: 0; /* allow horizontal scroll children */
}

/* ─── Sidebar nav ─── */
.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 12px; border-radius: 10px;
  color: var(--hz-dim); text-decoration: none;
  font-size: 13.5px; font-weight: 500;
  cursor: pointer; transition: background 120ms, color 120ms;
}
.nav-item:hover { background: rgba(255,255,255,0.04); color: #fff; }
.nav-item.active {
  background: rgba(255,255,255,0.08);
  color: #fff;
}
.nav-item.active .nav-accent {
  background: linear-gradient(135deg, var(--hz-teal), var(--hz-pink));
}
.nav-accent {
  width: 3px; height: 16px; border-radius: 2px; background: transparent;
  transition: background 120ms;
}
.nav-group-label {
  font-size: 10px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--hz-dimmer); padding: 16px 12px 8px;
}

/* ─── Avatar tile ─── */
.avatar {
  width: 32px; height: 32px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--hz-serif); font-weight: 700; font-style: italic;
  color: #000; font-size: 13px;
}

/* ─── Stat tile ─── */
.stat-tile {
  padding: 22px; border-radius: var(--hz-r-lg);
  border: 1px solid var(--hz-line); background: var(--hz-ink-2);
}
.stat-label { font-size: 10px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--hz-dim); margin-bottom: 10px; }
.stat-value { font-family: var(--hz-serif); font-style: italic; font-weight: 700; letter-spacing: -0.03em; }

/* ─── Data table ─── */
.hz-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
.hz-table th { text-align: left; font-weight: 700; font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--hz-dim); padding: 10px 12px; border-bottom: 1px solid var(--hz-line); }
.hz-table td { padding: 12px; border-bottom: 1px solid var(--hz-line); }
.hz-table tr:hover td { background: rgba(255,255,255,0.02); }

/* ─── Skill cell (used in matrix) ─── */
.skill-cell {
  width: 28px; height: 28px; border-radius: 6px;
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--hz-mono); font-size: 9.5px; font-weight: 700;
  cursor: pointer; transition: transform 80ms, box-shadow 120ms;
  user-select: none;
}
.skill-cell:hover { transform: scale(1.12); }
.skill-cell.status-none { background: rgba(255,255,255,0.04); color: rgba(255,255,255,0.25); }
.skill-cell.status-working { background: rgba(255,180,84,0.18); color: var(--hz-amber); }
.skill-cell.status-got_it { background: rgba(39,207,215,0.22); color: var(--hz-teal); }
.skill-cell.status-mastered { background: linear-gradient(135deg, rgba(39,207,215,0.35), rgba(249,127,172,0.35)); color: #fff; box-shadow: 0 0 0 1px rgba(249,127,172,0.3) inset; }

/* ─── 8-count timeline ─── */
.eight-count-grid {
  display: grid;
  gap: 2px;
  background: var(--hz-ink);
  border-radius: 10px; padding: 2px;
  overflow-x: auto;
}
.count-cell {
  height: 40px; min-width: 34px;
  background: var(--hz-ink-3);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--hz-mono); font-size: 10px; color: var(--hz-dimmer);
  position: relative;
}

/* ─── Celebration ticker ─── */
.celebration {
  padding: 14px 18px; border-radius: 12px;
  background: linear-gradient(90deg, rgba(39,207,215,0.08) 0%, rgba(249,127,172,0.08) 100%);
  border: 1px solid var(--hz-line);
  display: flex; align-items: center; gap: 14px;
}

/* ─── Readiness dial ─── */
.dial-ring {
  --val: 0.5;
  width: 140px; height: 140px; border-radius: 50%;
  background:
    conic-gradient(
      from -90deg,
      var(--hz-teal) 0%,
      var(--hz-pink) calc(var(--val) * 100%),
      rgba(255,255,255,0.05) calc(var(--val) * 100%)
    );
  display: flex; align-items: center; justify-content: center;
  position: relative;
}
.dial-ring::before {
  content: ''; position: absolute; inset: 10px; border-radius: 50%;
  background: var(--hz-ink);
}
.dial-value { position: relative; font-family: var(--hz-serif); font-style: italic; font-weight: 700; font-size: 36px; letter-spacing: -0.03em; }

/* ─── Full-height column scrollable ─── */
.col-scroll { max-height: calc(100vh - var(--hz-topbar-h) - 80px); overflow-y: auto; }

/* ─── Command-K palette ─── */
.cmdk-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,0.6); backdrop-filter: blur(6px);
  display: flex; align-items: flex-start; justify-content: center; padding-top: 12vh; z-index: 100;
}
.cmdk-panel {
  width: 640px; max-width: 92vw;
  background: var(--hz-ink-2); border: 1px solid var(--hz-line-2); border-radius: 14px;
  overflow: hidden; box-shadow: 0 30px 80px rgba(0,0,0,0.5);
}

/* ─── Toast ─── */
.toast-stack {
  position: fixed; bottom: 24px; right: 24px; z-index: 80;
  display: flex; flex-direction: column; gap: 10px; align-items: flex-end;
}
.toast {
  padding: 14px 18px;
  background: var(--hz-ink-2);
  border: 1px solid var(--hz-line-2);
  border-radius: 12px;
  min-width: 280px; max-width: 380px;
  display: flex; align-items: flex-start; gap: 12px;
  animation: hz-rise 0.4s cubic-bezier(0.2, 0.7, 0.2, 1) both;
  box-shadow: 0 20px 40px rgba(0,0,0,0.4);
}
.toast.mastered { border-color: rgba(249,127,172,0.35); background: linear-gradient(135deg, rgba(249,127,172,0.1), var(--hz-ink-2)); }
.toast.got_it { border-color: rgba(39,207,215,0.35); background: linear-gradient(135deg, rgba(39,207,215,0.1), var(--hz-ink-2)); }
.toast.error {
  border-color: rgba(255,91,117,0.45);
  background: linear-gradient(135deg, rgba(255,91,117,0.12), var(--hz-ink-2));
  max-width: min(520px, calc(100vw - 32px));
}

/* ─── Drawer ─── */
.drawer-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,0.55); z-index: 60;
  animation: hz-fade 0.2s both;
}
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: 560px; max-width: 90vw;
  background: var(--hz-ink); border-left: 1px solid var(--hz-line-2); z-index: 61;
  overflow-y: auto; padding: 28px;
  animation: hz-drawer-in 0.3s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
@keyframes hz-drawer-in { from { transform: translateX(40px); opacity: 0; } to { transform: none; opacity: 1; } }

/* Drawer tab strip */
.ad-tabs {
  display: flex; gap: 2px;
  padding: 4px; border-radius: 12px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--hz-line);
  overflow-x: auto; -webkit-overflow-scrolling: touch;
}
.ad-tab {
  flex: 1 1 auto; min-width: 78px;
  padding: 8px 10px; border-radius: 9px; border: 1px solid transparent;
  background: transparent; color: var(--hz-dim);
  font-family: var(--hz-sans); font-size: 12px; font-weight: 700;
  letter-spacing: 0.04em; text-transform: uppercase;
  cursor: pointer; transition: all 120ms;
  white-space: nowrap;
}
.ad-tab:hover { color: #fff; background: rgba(255,255,255,0.04); }
.ad-tab.active {
  background: #fff; color: #050507;
}

/* ─── ClassRow (offerings manager) — desktop = multi-column, mobile = stack ─── */
.class-row { display: flex; flex-direction: column; gap: 8px; }
.class-row__head {
  display: grid; grid-template-columns: 1.4fr 1.6fr; gap: 8px; align-items: center;
}
.class-row__name { font-size: 13px; padding: 6px 10px; }
.class-row__price { display: flex; align-items: center; gap: 6px; }
.class-row__price .hz-input { font-size: 13px; padding: 6px 8px; }
.class-row__price input[type="number"] { width: 70px; }
.class-row__meta { display: grid; grid-template-columns: 1.6fr 80px; gap: 8px; }
.class-row__schedule { font-size: 12px; padding: 6px 10px; }
.class-row__capacity { font-size: 12px; padding: 6px 10px; }
.class-row__actions { display: flex; align-items: center; gap: 6px; }
.class-row__actions .hz-btn { font-size: 11px; padding: 4px 10px; }
.class-row__public {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; color: var(--hz-dim); cursor: pointer;
}
@media (max-width: 768px) {
  .class-row__head { grid-template-columns: 1fr; gap: 8px; }
  .class-row__meta { grid-template-columns: 1fr; gap: 8px; }
  .class-row__price { gap: 4px; }
  .class-row__price input[type="number"] { width: 80px; flex: 1; }
  .class-row__price .hz-input { font-size: 14px; padding: 8px 10px; min-height: 38px; }
  .class-row__name { font-size: 14px; padding: 8px 12px; min-height: 38px; }
  .class-row__schedule, .class-row__capacity { font-size: 14px; padding: 8px 12px; min-height: 38px; }
  .class-row__actions .hz-btn { font-size: 13px; padding: 8px 14px; min-height: 38px; flex: 1; }
}

/* ─── Mobile shell: bottom tab bar + simplified top bar ─── */
@media (max-width: 768px) {
  :root { --hz-sidebar-w: 0px; --hz-tabbar-h: calc(60px + env(safe-area-inset-bottom)); --hz-mobile-topbar-h: calc(52px + env(safe-area-inset-top)); }

  /* Hide the desktop chrome — mobile shell takes over */
  .app-shell--mobile .sidebar,
  .app-shell--mobile .topbar { display: none !important; }

  .app-shell--mobile {
    grid-template-columns: 1fr;
    grid-template-rows: var(--hz-mobile-topbar-h) 1fr;
    min-height: 100vh; min-height: 100dvh;
  }

  .app-shell--mobile .main {
    grid-column: 1; grid-row: 2;
    padding: 16px 14px calc(var(--hz-tabbar-h) + 24px);
    overflow-y: auto;
  }

  /* Mobile top bar */
  .mobile-topbar {
    position: sticky; top: 0; z-index: 50;
    height: var(--hz-mobile-topbar-h);
    padding-top: env(safe-area-inset-top);
    background: rgba(5,5,7,0.92);
    backdrop-filter: saturate(140%) blur(14px);
    -webkit-backdrop-filter: saturate(140%) blur(14px);
    border-bottom: 1px solid var(--hz-line);
    display: flex; align-items: center; justify-content: space-between;
    padding-left: 18px; padding-right: 14px;
  }
  .mobile-topbar__title {
    font-family: var(--hz-serif, 'Fraunces', serif);
    font-style: italic; font-weight: 700;
    font-size: 22px; letter-spacing: -0.01em;
    color: #fff; text-transform: capitalize;
  }
  .mobile-topbar__account {
    width: 36px; height: 36px; border-radius: 999px;
    background: linear-gradient(135deg, var(--hz-teal), var(--hz-pink));
    color: #fff; font-weight: 700; font-size: 14px;
    border: none; cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
  }

  /* Bottom tab bar */
  .mobile-tabbar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
    height: var(--hz-tabbar-h);
    padding-bottom: env(safe-area-inset-bottom);
    background: rgba(5,5,7,0.94);
    backdrop-filter: saturate(140%) blur(20px);
    -webkit-backdrop-filter: saturate(140%) blur(20px);
    border-top: 1px solid var(--hz-line);
    display: grid; grid-template-columns: repeat(5, 1fr);
  }
  .mobile-tabbar__tab {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    background: none; border: none; color: var(--hz-dimmer);
    font-size: 10px; font-weight: 600; letter-spacing: 0.02em;
    padding: 6px 4px; cursor: pointer; min-height: 44px;
    transition: color 120ms ease;
    -webkit-tap-highlight-color: transparent;
  }
  .mobile-tabbar__tab.is-active { color: #fff; }
  .mobile-tabbar__tab.is-active .mobile-tabbar__icon {
    background: linear-gradient(135deg, rgba(39,207,215,0.18), rgba(249,127,172,0.18));
  }
  .mobile-tabbar__icon {
    width: 38px; height: 26px; border-radius: 999px;
    display: inline-flex; align-items: center; justify-content: center;
    transition: background 120ms ease;
  }

  /* Bottom sheet (More menu, Athlete drawer eventually) */
  .mobile-sheet-backdrop {
    position: fixed; inset: 0; z-index: 80;
    background: rgba(0,0,0,0.55);
    display: flex; align-items: flex-end;
    animation: hz-fade 160ms ease;
  }
  .mobile-sheet {
    width: 100%; max-height: 84vh; overflow-y: auto;
    background: var(--hz-ink-2);
    border-radius: 18px 18px 0 0;
    padding: 8px 16px calc(20px + env(safe-area-inset-bottom));
    box-shadow: 0 -10px 40px rgba(0,0,0,0.6);
    animation: hz-slide-up 220ms cubic-bezier(.22,.78,.16,1) both;
  }
  .mobile-sheet__handle {
    width: 36px; height: 4px; border-radius: 2px;
    background: rgba(255,255,255,0.18);
    margin: 6px auto 14px;
  }
  .mobile-sheet__title {
    font-family: var(--hz-serif, 'Fraunces', serif);
    font-style: italic; font-weight: 700; font-size: 22px;
    margin-bottom: 14px;
  }
  .mobile-sheet__list { display: flex; flex-direction: column; gap: 2px; }
  .mobile-sheet__item {
    display: flex; align-items: center; gap: 14px;
    padding: 14px 12px; min-height: 52px;
    background: none; border: none; color: #fff;
    font-size: 15px; font-weight: 500; text-align: left;
    border-radius: 12px; cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    width: 100%;
  }
  .mobile-sheet__item:active { background: rgba(255,255,255,0.06); }
  .mobile-sheet__item.is-active { background: rgba(39,207,215,0.10); color: var(--hz-teal); }
  .mobile-sheet__item-icon {
    width: 32px; height: 32px;
    display: inline-flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,0.05); border-radius: 8px;
  }
  .mobile-sheet__item-label { flex: 1; }
  .mobile-sheet__divider {
    height: 1px; background: var(--hz-line); margin: 14px 4px;
  }

  @keyframes hz-slide-up {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
  }

  /* Old desktop chrome remains hidden when in mobile shell */
  .sidebar-backdrop {
    position: fixed; inset: 0; background: rgba(0,0,0,0.55); z-index: 69;
    animation: hz-fade 0.2s both;
  }

  .drawer { width: 100vw; max-width: 100vw; padding: 20px 16px; }

  /* Mobile typography scale — display sizes were sized for desktop */
  .hz-display { font-size: 28px !important; line-height: 1.05 !important; letter-spacing: -0.025em !important; }
  h1.hz-display, [class*="display"]:first-of-type { font-size: 32px !important; }

  /* Larger touch targets across the board */
  .hz-btn { min-height: 40px; padding: 9px 16px; font-size: 14px; }
  .hz-btn-sm { min-height: 36px; padding: 7px 12px; font-size: 13px; }
  .hz-input { font-size: 16px !important; min-height: 44px; padding: 10px 14px; } /* 16px prevents iOS auto-zoom */
  select.hz-input { padding-right: 32px; }

  /* Cards: tighter padding on phone */
  .hz-card { padding: 16px; border-radius: 14px; }
  .hz-card-dense { padding: 12px; }

  /* Section headings: shrink */
  .hz-section-heading h1,
  .hz-section-heading [class*="display"] { font-size: 30px !important; }

  /* Generic responsive grids — anything inline-styled grid-template-columns multi-col → single col.
     React serializes object styles without quotes, so we match unquoted values. */
  .main [style*="grid-template-columns: repeat(4"] { grid-template-columns: repeat(2, 1fr) !important; gap: 10px !important; }
  .main [style*="grid-template-columns: repeat(3"] { grid-template-columns: repeat(2, 1fr) !important; gap: 10px !important; }
  .main [style*="grid-template-columns: repeat(2"] { grid-template-columns: 1fr !important; }
  /* Any explicit fr-based multi-col grid → 1col on phone */
  .main [style*="grid-template-columns: 1.35fr"],
  .main [style*="grid-template-columns: 1.4fr"],
  .main [style*="grid-template-columns: 1.5fr"],
  .main [style*="grid-template-columns: 1.6fr"],
  .main [style*="grid-template-columns: 2fr"],
  .main [style*="grid-template-columns: 1fr 1fr"] { grid-template-columns: 1fr !important; gap: 10px !important; }
  /* Form grids that mix px and fr (e.g. AddAthleteCard '2fr 100px 1fr auto auto', SessionForm) */
  .main form[class*="hz-card"][style*="grid-template-columns"] { grid-template-columns: 1fr !important; gap: 10px !important; }
  /* Roster card row inside grid (when editing) keeps its inner layout */
  .roster-grid { grid-template-columns: 1fr !important; }

  /* Tables → make the card horizontally scrollable so wide tables don't blow the layout */
  .hz-card .hz-table { font-size: 13px; min-width: 100%; }
  .hz-card:has(.hz-table) { overflow-x: auto !important; -webkit-overflow-scrolling: touch; }
  .hz-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

  /* Section heading "trailing" (right-side controls) wraps below title on mobile */
  .hz-section-heading { flex-direction: column; align-items: flex-start; gap: 12px; }
  .hz-section-heading > div:last-child { width: 100%; flex-wrap: wrap; }

  /* AddAthleteCard / ClassRow form-card inline grids → stack via the form rule above */

  /* Rich grids on the routine builder etc still get the older single-column treatment */
  .routine-builder-setup,
  .routine-builder-main,
  .routine-builder-music-grid,
  .routine-audio-empty,
  .routine-choreo-guide,
  .routine-builder-section-form,
  .routine-builder-assignment-form,
  .routine-position-inspector,
  .routine-assignment-row,
  .routine-live-head,
  .routine-live-controls,
  .routine-live-footer,
  .routine-coach-helper-head,
  .routine-coach-helper-form,
  .routine-ai-flavor-grid,
  .routine-compliance-grid {
    grid-template-columns: 1fr;
  }
  .routine-output-tabs button { flex: 1 1 44%; }
  .routine-live-head,
  .routine-live-footer { display: grid; }
  .routine-audio-empty .hz-btn {
    grid-column: 1;
    grid-row: auto;
    width: 100%;
  }
  .routine-jukebox-head,
  .routine-jukebox-track {
    display: grid;
  }
  .routine-jukebox-status,
  .routine-jukebox-track em {
    justify-self: start;
  }
  .routine-coach-helper-head { display: grid; }
  .routine-coach-helper-msg { max-width: 100%; }
  .routine-coach-helper-form .hz-btn { width: 100%; }
  .routine-live-clock { text-align: left; }
  .routine-live-stage { min-height: 280px; }
  .routine-formation-board { min-height: 300px; }
  .routine-athlete-dot { width: 42px; height: 42px; font-size: 11px; }
  .hamburger-btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 36px; height: 36px; border-radius: 8px;
    background: rgba(255,255,255,0.05); border: 1px solid var(--hz-line);
    color: #fff; cursor: pointer;
  }
}
@media (min-width: 769px) {
  .hamburger-btn { display: none; }
  .sidebar-backdrop { display: none; }
}

/* ─── Print ─── */
@media print {
  body { background: #fff; color: #000; }
  .sidebar, .topbar { display: none; }
  .main { padding: 0; }
  .hz-card { border-color: #ccc; background: #fff; color: #000; }
}
