:root {
  --bg: #07110f;
  --card: #101e1a;
  --ink: #f2f7ee;
  --muted: #aab8af;
  --faint: #7f948a;
  --line: #2a3934;
  --lime: #d7ff58;
  --mint: #63e7bd;
  --orange: #ff9563;

  /* Type scale — the single source for every font size. QA "make it bigger/
     smaller" moves an element one step on this scale, never a one-off px. */
  --fs-2xs: 12px;   /* micro labels, chart ticks, chips */
  --fs-xs:  13px;   /* captions, meta, supporting text */
  --fs-sm:  14px;   /* secondary body, most buttons, pills */
  --fs-md:  16px;   /* body, lede, summary */
  --fs-lg:  18px;   /* h3, card subtitles, primary button */
  --fs-xl:  22px;   /* brand, duration, now-playing title */
  --fs-2xl: 24px;   /* section headings, big stat numbers */
  --fs-3xl: 28px;   /* page title */
  --fs-timer: 32px; /* run timer */
  --fs-display: clamp(30px, 7.5vw, 40px); /* hero h1 */

  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--bg);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-width: 320px;
  background: radial-gradient(circle at 85% 6%, #1f4237 0, transparent 24rem), var(--bg);
}

button, input { font: inherit; }
button { cursor: pointer; }
b { font-weight: inherit; }

.app-shell {
  width: min(100%, 540px);
  min-height: 100dvh;
  margin: auto;
  padding: 22px 20px calc(42px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
}

/* ---- Zone colors: one class drives HTML backgrounds and SVG fills --------- */
.zone-fill-1 { background: #5cbfa0; fill: #5cbfa0; color: #08150f; }
.zone-fill-2 { background: var(--mint); fill: var(--mint); color: #08150f; }
.zone-fill-3 { background: #c8ed61; fill: #c8ed61; color: #101a05; }
.zone-fill-4 { background: #ffbd6a; fill: #ffbd6a; color: #1c1103; }
.zone-fill-5 { background: var(--orange); fill: var(--orange); color: #1c0d06; }
/* text colored to match a zone swatch (legend labels, phase chips) */
.zone-text-1 { color: #5cbfa0; }
.zone-text-2 { color: var(--mint); }
.zone-text-3 { color: #c8ed61; }
.zone-text-4 { color: #ffbd6a; }
.zone-text-5 { color: var(--orange); }

/* ---- Buttons: one ghost base, variants only change color/size ------------- */
/* ghost buttons (Edit / Exit / 30s preview / ← back) share one base */
.text-button, .back-button, .inline-button { background: transparent; border: 1px solid #34473f; border-radius: 9px; padding: 6px 13px; color: var(--muted); font-size: var(--fs-sm); }
.text-button:active, .back-button:active, .inline-button:active { background: #17332a; }
.text-button { font-weight: 650; }
.inline-button { color: var(--lime); font-size: var(--fs-2xs); font-weight: 700; }

.primary-button, .secondary-button { min-height: 56px; border-radius: 13px; font-weight: 800; font-size: var(--fs-lg); }
.primary-button { background: var(--lime); color: #132015; border: 0; width: 100%; box-shadow: 0 8px 32px #b5e64028; }
.primary-button span { margin-left: 8px; }
.secondary-button { min-height: 48px; padding: 0 14px; background: #1b302a; color: var(--ink); border: 0; font-size: var(--fs-sm); font-weight: 600; }
.secondary-button:active { background: #234037; }

/* ---- Top bar & headings -------------------------------------------------- */
.topbar { display: flex; align-items: center; justify-content: center; margin-bottom: 44px; }
.brand { color: var(--ink); font-weight: 700; letter-spacing: -0.4px; font-size: var(--fs-xl); text-decoration: none; background: none; border: 0; padding: 0; }
.brand span, .duration, .eyebrow { color: var(--lime); }

.view { animation: appear .4s ease both; }
.hidden { display: none !important; }

.eyebrow, .label { margin: 0 0 9px; font-weight: 600; letter-spacing: 1.4px; font-size: var(--fs-xs); }
.label { color: var(--muted); letter-spacing: 1.1px; }
h1 { font-size: var(--fs-display); letter-spacing: -1.5px; line-height: 1.04; margin: 0; }
h1 em { color: var(--lime); font-style: normal; }
.lede { color: var(--muted); line-height: 1.6; font-size: var(--fs-md); margin: 18px 0 30px; }

/* ---- Landing ------------------------------------------------------------- */
.hero-curve-card {
  background: linear-gradient(145deg, #163027, #0e1b18);
  border-radius: 20px; padding: 18px 16px 14px; margin: 24px 0;
}
.hero-curve-meta { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-weight: 600; font-size: var(--fs-sm); letter-spacing: .8px; margin-bottom: 12px; }
.proof-row { list-style: none; padding: 0; margin: 0 0 26px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.proof-row li { display: flex; flex-direction: column; gap: 3px; }
.proof-row b { font-size: var(--fs-md); font-weight: 750; letter-spacing: -.2px; }
.proof-row span { color: var(--faint); font-size: var(--fs-sm); line-height: 1.35; }

/* ---- App header ---------------------------------------------------------- */
.app-head { display: flex; align-items: start; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
.app-head h2 { font-size: var(--fs-3xl); letter-spacing: -1px; margin: 8px 0 0; }
.app-head .duration { margin-top: 6px; }

/* ---- Cards --------------------------------------------------------------- */
.workout-card, .energy-card, .genre-picker, .track-section {
  background: linear-gradient(145deg, #163027, #0e1b18);
  border: 1px solid #2e463c;
  border-radius: 20px;
  padding: 20px;
}
.workout-card, .energy-card, .track-section { border: 0; }
.card-header, .section-heading, .energy-meta, .run-topline {
  display: flex; justify-content: space-between; gap: 12px; align-items: start;
}
.card-header h2, .section-heading h2 { font-size: var(--fs-2xl); letter-spacing: -.8px; margin: 0; }
.section-heading h2 { font-size: var(--fs-3xl); }
.duration { font-weight: 500; font-size: var(--fs-xl); padding-right: 2px; font-variant-numeric: tabular-nums; }

/* ---- Energy curve (the signature) ---------------------------------------- */
.curve-frame { margin: 2px 0 4px; }
.curve { width: 100%; }
.curve svg { display: block; width: 100%; }
.curve-run { margin: 8px 0 4px; }
.run-view .run-curve-card { width: 100%; margin: 18px 0 4px; }
.run-curve-card .curve-run { margin: 6px 0 0; }
.chart { display: flex; gap: 8px; }
.chart-y { position: relative; width: 20px; flex: none; }
.chart-y span { position: absolute; right: 0; transform: translateY(-50%); font-size: var(--fs-2xs); color: var(--faint); font-variant-numeric: tabular-nums; line-height: 1; }
.chart-plot { flex: 1; min-width: 0; }
.chart-x { display: flex; justify-content: space-between; margin-top: 5px; padding-left: 28px; }
.chart-x span { font-size: var(--fs-2xs); color: var(--faint); font-variant-numeric: tabular-nums; letter-spacing: .3px; }
.curve-grid { stroke: rgba(255, 255, 255, .08); stroke-width: 1; vector-effect: non-scaling-stroke; }
.curve-tick { stroke: #0b1714; stroke-width: 1; stroke-dasharray: 2 3; opacity: .55; }
.curve-dot { stroke: #07110f; stroke-width: 1; }
.curve-head { stroke: var(--lime); stroke-width: 2; vector-effect: non-scaling-stroke; }
.curve-head-dot { fill: var(--lime); }

/* ---- Setup stats --------------------------------------------------------- */
.stat-row {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 10px; margin-top: 14px; padding-top: 15px; border-top: 1px solid var(--line);
}
.stat { display: flex; flex-direction: column; gap: 2px; }
.stat b { font-size: var(--fs-2xl); font-weight: 800; letter-spacing: -1px; font-variant-numeric: tabular-nums; }
.stat span { color: var(--faint); font-size: var(--fs-xs); letter-spacing: .3px; }

/* ---- Numbered build steps + interval editor ------------------------------ */
.step-head { display: flex; align-items: flex-start; gap: 10px; margin: 0 0 12px; }
.step-head.gap { margin-top: 26px; }
.step-num { flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--lime); color: #132015; font-weight: 800; font-size: var(--fs-sm); display: grid; place-items: center; }
.step-body { flex: 1; min-width: 0; }
.step-titlebar { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 28px; }
.step-titlebar h3 { font-size: var(--fs-lg); letter-spacing: -.3px; margin: 0; }
.step-desc { color: var(--faint); font-size: var(--fs-xs); line-height: 1.4; margin: 3px 0 0; }
.routine-editor { margin-top: 0; }
.editor-actions { display: flex; gap: 8px; flex: none; }
.routine-list { margin-top: 12px; max-height: 322px; overflow-y: auto; overscroll-behavior: contain; }

.routine-row {
  display: grid; grid-template-columns: 4px 1fr auto;
  grid-template-areas: "bar name actions" "bar controls controls";
  align-items: center; column-gap: 10px; row-gap: 8px;
  padding: 11px 2px; border-bottom: 1px solid #1e2f28;
}
.routine-row:last-child { border-bottom: 0; }
.zone-bar { grid-area: bar; width: 4px; align-self: stretch; min-height: 36px; border-radius: 3px; }

/* read-only rows (default; controls appear on Edit) */
.routine-row.read { grid-template-columns: 4px 1fr auto; grid-template-areas: none; column-gap: 12px; row-gap: 0; padding: 12px 2px; }
.routine-row.read .zone-bar { grid-area: auto; }
.read-main { min-width: 0; }
.read-main b { font-size: var(--fs-sm); font-weight: 650; }
.read-main span { display: block; color: var(--faint); font-size: var(--fs-2xs); margin-top: 2px; letter-spacing: .2px; }
.read-vals { display: flex; flex-direction: column; gap: 2px; text-align: right; color: var(--muted); font-size: var(--fs-2xs); font-variant-numeric: tabular-nums; white-space: nowrap; }
.segment-label {
  grid-area: name; min-width: 0; background: transparent; border: 0; border-bottom: 1px solid transparent;
  color: var(--ink); outline: none; padding: 2px 1px; font-size: var(--fs-sm); font-weight: 650;
}
.segment-label:focus { border-color: var(--lime); }

.row-move { grid-area: actions; display: flex; gap: 3px; }
.move, .remove-segment {
  width: 28px; height: 28px; border: 0; background: transparent; color: var(--faint);
  border-radius: 8px; font-size: var(--fs-lg); line-height: 1;
}
.remove-segment { color: #a3776a; }
.move:disabled, .remove-segment:disabled { opacity: .25; cursor: not-allowed; }
.move:active, .remove-segment:active { background: #17332a; }

.row-controls { grid-area: controls; display: flex; gap: 8px; }
.mini-stepper {
  flex: 1; display: grid; grid-template-columns: 32px 1fr 32px; align-items: center;
  height: 34px; background: #0d1c17; border: 1px solid #21362d; border-radius: 9px;
}
.mini-stepper b { text-align: center; font-size: var(--fs-sm); font-weight: 750; color: var(--ink); font-variant-numeric: tabular-nums; }
.mini-stepper b small { color: var(--faint); font-size: var(--fs-2xs); font-weight: 600; }
.step { height: 32px; border: 0; background: transparent; color: var(--mint); font-size: var(--fs-lg); line-height: 1; border-radius: 8px; }
.step:active { background: #17332a; }

.add-row { display: none; gap: 8px; margin-top: 14px; }
.routine-editor.editing .add-row { display: flex; }
.routine-editor:not(.editing) .routine-list { display: none; }
.add-chip { flex: 1; background: transparent; border: 1px dashed #456154; color: var(--mint); padding: 11px 8px; border-radius: 11px; font-size: var(--fs-2xs); font-weight: 750; }
.add-chip:active { background: #12261f; }
.add-chip-plain { color: var(--muted); border-color: #34473f; }

/* ---- Genre picker -------------------------------------------------------- */
.genre-picker { border: 0; margin: 0; }
#generate-button { margin-top: 22px; }
.pill-row { display: flex; gap: 8px; flex-wrap: wrap; }
.pill { border: 1px solid #2c3f38; color: var(--muted); background: #11211c; border-radius: 99px; padding: 9px 15px; font-size: var(--fs-sm); }
.pill.active { color: #152015; background: var(--lime); border-color: var(--lime); font-weight: 750; }
.genre-note { position: relative; margin: 12px 0 0; padding: 12px 14px; background: #0d1c17; border: 1px solid #22423a; border-radius: 12px; color: var(--muted); font-size: var(--fs-sm); line-height: 1.5; }
.genre-note::before {
  content: ""; position: absolute; top: -6px; left: var(--caret-x, 44px);
  width: 11px; height: 11px; background: #0d1c17; border-left: 1px solid #22423a; border-top: 1px solid #22423a;
  transform: translateX(-50%) rotate(45deg);
}
.genre-note b { color: var(--muted); font-weight: 650; }
/* theme vs playlist are an either/or — an "or" rule between them, and the
   genre pills dim once a playlist link is in the box */
.or-divider { display: flex; align-items: center; gap: 12px; margin: 16px 0 12px; color: var(--faint); font-size: var(--fs-2xs); font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; }
.or-divider::before, .or-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.genre-picker.has-playlist .pill-row, .genre-picker.has-playlist .genre-note { opacity: .38; transition: opacity .2s; }
.source-row input { width: 100%; height: 44px; background: #0a1613; border: 1px solid #253a32; border-radius: 10px; color: var(--ink); outline: none; font-size: var(--fs-sm); padding: 0 12px; }
.source-row input:focus { border-color: var(--lime); }
.source-row input::placeholder { color: #6f857a; }

.small-note { color: var(--faint); line-height: 1.45; text-align: center; font-size: var(--fs-sm); margin: 14px 14px 0; }

/* ---- Mix view ------------------------------------------------------------ */
.back-button { margin: -14px 0 26px; }
.mix-summary { color: var(--faint); margin: 14px 0 -6px; font-size: var(--fs-sm); }
.energy-card { margin: 26px 0 14px; padding: 20px 16px 16px; }
.energy-meta { color: var(--muted); font-weight: 700; font-size: var(--fs-2xs); letter-spacing: 1px; align-items: center; }
.genre-tag { color: var(--lime); font-size: var(--fs-sm); font-weight: 500; }

.zone-legend { display: flex; flex-wrap: wrap; gap: 6px 12px; margin-top: 12px; }
.legend-item { display: flex; align-items: center; gap: 5px; color: var(--faint); font-size: var(--fs-2xs); font-weight: 550; letter-spacing: .3px; }
.legend-item i { width: 10px; height: 10px; border-radius: 3px; }

.actions { display: flex; gap: 9px; margin-top: 16px; }
.actions .primary-button { flex: 1; }
.icon-button { flex: none; width: 56px; min-height: 56px; border-radius: 13px; border: 0; background: #1b302a; color: var(--ink); display: grid; place-items: center; }
.icon-button:active { background: #234037; }

/* ---- Track list ---------------------------------------------------------- */
.track-section { margin-top: 34px; }
#track-title { margin-bottom: 14px; color: var(--ink); font-size: var(--fs-lg); font-weight: 700; letter-spacing: -.2px; }
.playlist-note { color: var(--faint); font-size: var(--fs-xs); line-height: 1.5; margin: 13px 0 0; }
/* break the list out of the card's 20px padding so its dividers run edge-to-edge,
   then re-inset each row's content with matching horizontal padding */
.track-list { list-style: none; padding: 0; margin: 16px -20px 0; border-top: 1px solid var(--line); }
.track { display: grid; grid-template-columns: 28px 1fr auto; align-items: center; gap: 10px; padding: 11px 20px; border-bottom: 1px solid var(--line); }
.track:last-child { border-bottom: 0; }
.track-number { color: var(--faint); font-size: var(--fs-xs); font-variant-numeric: tabular-nums; align-self: center; }
.tw-time { color: var(--lime); font-size: var(--fs-2xs); font-weight: 600; letter-spacing: .2px; }
.track-id { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.track-title { font-weight: 720; font-size: var(--fs-lg); }
.track-artist { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; color: var(--muted); font-size: var(--fs-2xs); }
.track-len { color: var(--faint); font-variant-numeric: tabular-nums; }
.track-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.energy-chip { padding: 2px 7px; border-radius: 5px; font-weight: 800; font-size: var(--fs-2xs); letter-spacing: .2px; }
.bpm { color: var(--faint); font-size: var(--fs-2xs); font-variant-numeric: tabular-nums; }
.drift { color: var(--orange); font-weight: 650; }
.track-actions { display: flex; align-items: center; gap: 6px; }
.track-btn { min-width: 60px; text-align: center; border: 0; background: #1b302a; color: var(--muted); border-radius: 8px; font-size: var(--fs-2xs); font-weight: 600; padding: 7px 10px; white-space: nowrap; }
.play-btn { min-width: 40px; color: var(--lime); background: rgba(215, 255, 88, .13); }
.play-btn.playing { color: #132015; background: var(--lime); }
.play-btn:active, .change-btn:active { background: #17332a; }

/* ---- Bring-your-own-songs: range bar, player, swap sheet ------------------ */
.range-bar { display: flex; align-items: center; gap: 8px; margin: 4px 0 8px; }
.range-bar input { flex: 1; min-width: 0; height: 44px; background: #0a1613; border: 1px solid #253a32; border-radius: 10px; color: var(--ink); outline: none; font-size: var(--fs-sm); padding: 0 12px; }
.range-bar input:focus { border-color: var(--lime); }
.range-bar input::placeholder { color: #6f857a; }
.range-bar button { flex: none; height: 44px; padding: 0 18px; border: 0; border-radius: 10px; background: var(--lime); color: #132015; font-weight: 700; font-size: var(--fs-sm); }
.range-status { color: var(--faint); font-size: var(--fs-xs); line-height: 1.45; margin: 0 2px 10px; }

.yt-player {
  position: fixed; z-index: 5; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); left: auto; transform: none;
  width: min(320px, calc(100% - 24px)); background: #0b1714; border: 1px solid #294138; border-radius: 12px;
  box-shadow: 0 10px 34px #000a; padding: 6px;
}
/* During a run keep the mini player at its normal size, just lifted above the dock. */
body.is-running .yt-player { bottom: calc(84px + env(safe-area-inset-bottom)); }
.yt-head { display: flex; align-items: center; gap: 6px; padding: 3px 4px 6px; cursor: grab; touch-action: none; user-select: none; }
.yt-head:active { cursor: grabbing; }
.yt-head::after { content: "⠿"; margin-left: auto; color: var(--faint); font-size: var(--fs-sm); letter-spacing: -1px; }
.yt-live { color: var(--lime); font-size: 8px; }
#yt-title { color: var(--ink); font-size: var(--fs-2xs); font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.yt-frame-wrap { position: relative; width: 100%; aspect-ratio: 16 / 9; border-radius: 10px; overflow: hidden; background: #000; }
#yt-frame { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.sheet { position: fixed; z-index: 6; inset: 0; background: rgba(3, 12, 9, .72); display: flex; align-items: flex-end; justify-content: center; }
.sheet-card {
  width: min(100%, 540px); max-height: 82vh; overflow-y: auto; background: #0d1c17;
  border: 1px solid #294138; border-radius: 18px 18px 0 0;
  padding: 16px 16px calc(20px + env(safe-area-inset-bottom)); animation: sheetUp .25s ease;
}
@keyframes sheetUp { from { transform: translateY(24px); opacity: .5; } to { transform: none; opacity: 1; } }
.sheet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.sheet-head strong { font-size: var(--fs-md); letter-spacing: -.3px; }
.sheet-head button { background: none; border: 0; color: var(--muted); font-size: var(--fs-xl); line-height: 1; }
.swap-row { display: flex; gap: 8px; margin-bottom: 10px; }
.swap-row input { flex: 1; min-width: 0; background: #0a1613; border: 1px solid #294138; border-radius: 9px; color: var(--ink); outline: none; font-size: var(--fs-sm); padding: 10px 12px; }
.swap-row input:focus { border-color: var(--lime); }
.swap-row button { flex: none; height: 40px; padding: 0 14px; border: 0; border-radius: 9px; background: #21453a; color: var(--mint); font-weight: 750; font-size: var(--fs-sm); }
.swap-results { display: flex; flex-direction: column; gap: 9px; margin-top: 6px; }
.swap-hint { color: var(--faint); font-size: var(--fs-2xs); line-height: 1.5; margin: 4px 0; }
.swap-hint code { color: var(--mint); font-size: var(--fs-2xs); }
.swap-result { display: grid; grid-template-columns: 48px 1fr auto; gap: 10px; align-items: center; }
.swap-result img { width: 48px; height: 36px; object-fit: cover; border-radius: 6px; background: #000; }
.swap-meta { min-width: 0; }
.swap-meta b { display: block; font-size: var(--fs-sm); font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.swap-meta span { color: var(--faint); font-size: var(--fs-2xs); }
.swap-acts { display: flex; gap: 6px; }
.swap-play, .swap-use { border: 1px solid #3a5340; background: transparent; border-radius: 8px; font-size: var(--fs-2xs); font-weight: 750; padding: 7px 11px; }
.swap-play { color: var(--lime); }
.swap-use { color: #132015; background: var(--lime); border-color: var(--lime); }
.swap-alt { text-align: left; background: #0a1613; border: 1px solid #223a31; color: var(--ink); border-radius: 9px; padding: 10px 12px; font-size: var(--fs-sm); }
.swap-alt:active { background: #12261f; }
.swap-out { display: inline-block; margin-top: 6px; color: var(--lime); text-decoration: none; font-size: var(--fs-2xs); font-weight: 700; }

/* ---- Run view ------------------------------------------------------------ */
.run-view { flex: 1 0 auto; display: flex; flex-direction: column; text-align: center; align-items: center; padding-bottom: 84px; }
.run-topline { width: 100%; align-items: center; color: var(--muted); font-size: var(--fs-sm); letter-spacing: .5px; }
/* orb + status side by side (not stacked) so the top stays short */
.run-head { width: 100%; display: flex; align-items: center; gap: 14px; margin-top: 14px; }
.run-orb {
  flex: none; width: 72px; height: 72px; border: 0; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; color: var(--lime);
  background: radial-gradient(circle, #1d5442, #0b1f18 74%);
  box-shadow: 0 0 24px #63e7bd1c;
  transition: color .3s, background .3s, box-shadow .3s;
}
.run-orb.peak { color: var(--orange); background: radial-gradient(circle, #6b3320, #24100a 74%); box-shadow: 0 0 24px #ff956320; }
#phase-icon { font-size: 38px; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.run-status { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 3px; text-align: left; }
.run-line { display: flex; align-items: baseline; gap: 10px; }
#run-speed { font-size: var(--fs-lg); font-weight: 700; letter-spacing: -.3px; margin: 0; }
.run-message { color: var(--muted); line-height: 1.4; font-size: var(--fs-sm); margin: 0; }
.timer-wrap { display: flex; align-items: baseline; gap: 4px; }
.timer-wrap #run-timer { font-size: var(--fs-2xl); font-weight: 800; letter-spacing: -.5px; font-variant-numeric: tabular-nums; color: var(--lime); }
.timer-wrap span:last-child { color: var(--muted); font-size: var(--fs-2xs); }
.dock-now { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; gap: 2px; text-align: left; }
.dock-now strong { color: var(--ink); font-size: var(--fs-sm); font-weight: 700; letter-spacing: -.1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dock-now em { display: flex; align-items: center; gap: 6px; margin-top: 2px; font-style: normal; }
/* up next: a card, like the other panels */
.up-next { width: 100%; margin-top: 14px; padding: 14px 16px; border-radius: 14px; background: #0d1c17; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; text-align: left; }
.up-next > span { color: var(--faint); font-size: var(--fs-2xs); font-weight: 700; letter-spacing: 1px; text-transform: uppercase; }
.up-next .track-main { width: 100%; }
/* fixed bottom bar holding the pause/play control */
/* bottom player bar: current song + pause/play, pinned across the run */
.run-dock { position: fixed; z-index: 5; left: 50%; bottom: 0; transform: translateX(-50%); width: min(100%, 540px); display: flex; align-items: center; gap: 14px; padding: 10px 20px calc(12px + env(safe-area-inset-bottom)); background: #0b1714; border-top: 1px solid #223a31; }
.pause-button { flex: none; width: 52px; height: 52px; border-radius: 50%; border: 1px solid var(--lime); background: transparent; color: var(--lime); font-size: var(--fs-xl); }
.pause-button:active { background: #17332a; }

/* ---- Toast, a11y, motion ------------------------------------------------- */
.toast {
  position: fixed; z-index: 2; bottom: calc(24px + env(safe-area-inset-bottom)); left: 50%;
  transform: translate(-50%, 20px); background: var(--lime); color: #132015;
  padding: 11px 15px; border-radius: 99px; opacity: 0; pointer-events: none;
  transition: .25s; font-weight: 750; font-size: var(--fs-sm); white-space: nowrap;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.loading {
  position: fixed; inset: 0; z-index: 8; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 16px;
  background: rgba(7, 17, 15, .93); color: var(--muted); animation: appear .2s ease both;
}
.loading p { margin: 0; font-size: var(--fs-sm); letter-spacing: .3px; }
.spinner {
  width: 40px; height: 40px; border-radius: 50%;
  border: 3px solid #22423a; border-top-color: var(--lime); animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

:focus-visible { outline: 2px solid var(--lime); outline-offset: 2px; border-radius: 4px; }

@keyframes appear { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

@media (min-width: 600px) { .app-shell { padding-top: 28px; } }
@media (max-width: 360px) {
  .proof-row { gap: 7px; }
  .proof-row b { font-size: var(--fs-2xs); }
  .move, .remove-segment { width: 26px; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}
