:root {
  --bg-primary: #0b1120;
  --bg-card: #162033;
  --bg-card-elevated: #1e293b;
  --bg-glass: rgba(15, 23, 42, 0.88);
  --border-subtle: rgba(148, 163, 184, 0.14);
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --accent-coral: #fb7185;
  --accent-rose: #f43f5e;
  --accent-sky: #38bdf8;
  --accent-emerald: #10b981;
  --accent-amber: #f59e0b;
  --radius-lg: 18px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

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

html, body {
  background-color: var(--bg-primary);
  color: var(--text-main);
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.45;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea {
  font-family: inherit;
  color: inherit;
  touch-action: manipulation;
}

.app-shell {
  max-width: 520px;
  margin: 0 auto;
  padding-top: calc(var(--safe-top) + 12px);
  padding-bottom: calc(var(--safe-bottom) + 150px);
  padding-left: 16px;
  padding-right: 16px;
}

/* Top Header */
.top-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 4px 10px;
}

/* Top Bar Row: User Profile + Language Switcher */
.top-controls-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
}

.user-greeting-banner {
  background: linear-gradient(135deg, rgba(244, 63, 94, 0.2), rgba(56, 189, 248, 0.14));
  border: 1px solid rgba(251, 113, 133, 0.35);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.greeting-title {
  font-size: 1.38rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  background: linear-gradient(90deg, #fff, #fda4af);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.greeting-sub {
  font-size: 0.8rem;
  color: #e2e8f0;
  margin-top: 2px;
}

.user-switcher {
  display: inline-flex;
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 3px;
  flex-shrink: 0;
}

.user-btn {
  background: transparent;
  border: none;
  border-radius: 7px;
  padding: 6px 10px;
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
}

.user-btn.active {
  background: var(--accent-coral);
  color: #fff;
}

/* Language Switcher Bar */
.lang-switcher {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 4px;
}

.lang-btn {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 7px 6px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: center;
}

.lang-btn.active {
  background: rgba(251, 113, 133, 0.16);
  border-color: rgba(251, 113, 133, 0.45);
  color: var(--text-main);
}

.brand-group {
  display: flex;
  align-items: center;
  gap: 11px;
}

.brand-logo {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  box-shadow: 0 4px 14px rgba(244, 63, 94, 0.25);
}

.brand-title {
  font-size: 1.18rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.brand-subtitle {
  font-size: 0.76rem;
  color: var(--text-muted);
}

.header-actions {
  display: flex;
  gap: 8px;
}

.icon-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  border-radius: 10px;
  padding: 8px 11px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: transform 0.12s ease, background 0.15s ease;
}

.icon-btn:active {
  transform: scale(0.95);
}

.icon-btn.wake-active {
  border-color: rgba(16, 185, 129, 0.5);
  color: var(--accent-emerald);
}

/* Cards & Sections */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 16px;
  margin-bottom: 14px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22);
}

.card-highlight {
  background: linear-gradient(145deg, rgba(30, 41, 59, 0.95), rgba(22, 32, 51, 0.98));
  border-color: rgba(251, 113, 133, 0.32);
}

.section-label {
  font-size: 0.73rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--accent-coral);
  font-weight: 700;
  margin-bottom: 6px;
}

/* Segmented Controls (Tag A / Tag B, 1h / 2h) */
.segment-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 8px;
}

.segment-card {
  background: var(--bg-card-elevated);
  border: 2px solid transparent;
  border-radius: var(--radius-md);
  padding: 12px;
  text-align: left;
  cursor: pointer;
  transition: all 0.16s ease;
  position: relative;
}

.segment-card.active {
  border-color: var(--accent-coral);
  background: rgba(244, 63, 94, 0.12);
}

.segment-card .seg-title {
  font-weight: 700;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.segment-card .seg-desc {
  font-size: 0.76rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.rec-pill {
  display: inline-block;
  background: rgba(16, 185, 129, 0.18);
  color: #34d399;
  font-size: 0.66rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 99px;
  margin-bottom: 5px;
}

/* Toggle Switch Row (z.B. Padel morgen) */
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 13px;
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.22);
  border-radius: var(--radius-md);
  margin-top: 12px;
}

.toggle-text strong {
  display: block;
  font-size: 0.86rem;
  color: #e0f2fe;
}

.toggle-text span {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.switch-btn {
  min-width: 52px;
  height: 30px;
  border-radius: 99px;
  border: none;
  background: #334155;
  position: relative;
  cursor: pointer;
  transition: background 0.2s ease;
}

.switch-btn::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.2s ease;
}

.switch-btn.on {
  background: var(--accent-emerald);
}

.switch-btn.on::after {
  transform: translateX(22px);
}

/* Garmin Info Banner */
.garmin-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  background: rgba(16, 185, 129, 0.09);
  border: 1px solid rgba(16, 185, 129, 0.25);
  font-size: 0.78rem;
  color: #d1fae5;
  margin-bottom: 14px;
}

/* Progress Bar Header */
.workout-progress-wrap {
  margin-bottom: 14px;
}

.workout-progress-top {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.progress-track {
  height: 8px;
  background: #1e293b;
  border-radius: 99px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-coral), var(--accent-emerald));
  border-radius: 99px;
  transition: width 0.3s ease;
}

/* Exercise Accordion / Card */
.ex-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  margin-bottom: 12px;
  overflow: hidden;
  transition: border-color 0.2s ease;
}

.ex-card.completed {
  border-color: rgba(16, 185, 129, 0.45);
}

.ex-header {
  width: 100%;
  background: none;
  border: none;
  padding: 15px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  text-align: left;
  cursor: pointer;
}

.ex-num-badge {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--bg-card-elevated);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.9rem;
  flex-shrink: 0;
  color: var(--accent-coral);
}

.ex-card.completed .ex-num-badge {
  background: rgba(16, 185, 129, 0.2);
  border-color: var(--accent-emerald);
  color: var(--accent-emerald);
}

.ex-title-wrap {
  flex: 1;
}

.ex-title {
  font-size: 0.98rem;
  font-weight: 700;
}

.ex-meta {
  font-size: 0.77rem;
  color: var(--text-muted);
  margin-top: 2px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ex-meta-pill {
  color: var(--accent-sky);
  font-weight: 600;
}

.ex-body {
  padding: 0 16px 16px;
  border-top: 1px solid var(--border-subtle);
}

/* Visual SVG Box + Tempo Visualizer */
.visual-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-top: 12px;
}

.svg-stage {
  background: #0f172a;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.ex-svg {
  width: 100%;
  max-width: 260px;
  height: 145px;
}

/* Smooth SVG Animations */
@keyframes animPress {
  0%, 100% { transform: translateX(0px); }
  35% { transform: translateX(14px); }
}
@keyframes animPullDown {
  0%, 100% { transform: translateY(0px); }
  35% { transform: translateY(24px); }
}
@keyframes animPushRight {
  0%, 100% { transform: translateX(-18px); }
  35% { transform: translateX(8px); }
}
@keyframes animCurl {
  0%, 100% { transform: rotate(-18deg); }
  40% { transform: rotate(28deg); }
}
@keyframes animExtend {
  0%, 100% { transform: rotate(32deg); }
  38% { transform: rotate(-6deg); }
}
@keyframes animWings {
  0%, 100% { transform: translateY(10px); }
  35% { transform: translateY(-6px); }
}
@keyframes animSquat {
  0%, 100% { transform: translateY(0px); }
  45% { transform: translateY(12px); }
}
@keyframes animToeUp {
  0%, 100% { transform: rotate(10deg); }
  35% { transform: rotate(-22deg); }
}
@keyframes animSwayRight {
  0%, 100% { transform: translateX(-6px); }
  45% { transform: translateX(10px); }
}

.svg-anim-press { animation: animPress 3.5s ease-in-out infinite; }
.svg-anim-pull-down { animation: animPullDown 3.5s ease-in-out infinite; }
.svg-anim-push-right { animation: animPushRight 3.5s ease-in-out infinite; }
.svg-anim-curl { animation: animCurl 3.5s ease-in-out infinite; }
.svg-anim-extend { animation: animExtend 3.5s ease-in-out infinite; }
.svg-anim-wings { animation: animWings 3.2s ease-in-out infinite; }
.svg-anim-squat { animation: animSquat 3.6s ease-in-out infinite; }
.svg-anim-pull-left { animation: animPushRight 3.5s ease-in-out infinite reverse; }
.svg-anim-push-up { animation: animPullDown 3.5s ease-in-out infinite reverse; }
.svg-anim-hinge { animation: animCurl 3.8s ease-in-out infinite; }
.svg-anim-deadbug { animation: animPress 4s ease-in-out infinite; }
.svg-anim-bridge { animation: animWings 3.5s ease-in-out infinite; }
.svg-anim-toe-up { animation: animToeUp 2.8s ease-in-out infinite; }
.svg-anim-sway-right { animation: animSwayRight 3.2s ease-in-out infinite; }
.svg-anim-walk { animation: animSwayRight 1.8s ease-in-out infinite; }

/* Live Tempo Guide Bar */
.tempo-bar-box {
  width: 100%;
  background: rgba(30, 41, 59, 0.7);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  margin-top: 6px;
}

.tempo-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.74rem;
  color: var(--text-muted);
  margin-bottom: 5px;
}

.tempo-track {
  height: 7px;
  background: #1e293b;
  border-radius: 99px;
  overflow: hidden;
  position: relative;
}

@keyframes tempoPulse {
  0% { width: 8%; background: var(--accent-coral); }
  28% { width: 100%; background: var(--accent-emerald); }
  35% { width: 100%; background: var(--accent-emerald); }
  100% { width: 8%; background: var(--accent-sky); }
}

.tempo-fill-anim {
  height: 100%;
  border-radius: 99px;
  animation: tempoPulse 3.6s ease-in-out infinite;
}

/* Machine Setup Memory Row */
.setup-memory-box {
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.22);
  border-radius: var(--radius-md);
  padding: 11px 12px;
  margin-top: 12px;
}

.setup-tip-text {
  font-size: 0.8rem;
  color: #e0f2fe;
  margin-bottom: 9px;
}

.setup-inputs-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1.3fr;
  gap: 8px;
}

.setup-field label {
  display: block;
  font-size: 0.68rem;
  color: var(--text-muted);
  margin-bottom: 3px;
}

.setup-field input {
  width: 100%;
  background: var(--bg-primary);
  border: 1px solid var(--border-subtle);
  border-radius: 7px;
  padding: 6px 8px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent-sky);
}

/* Do's & Don'ts Checklists */
.cues-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin-top: 12px;
}

.cue-box {
  border-radius: var(--radius-md);
  padding: 10px 12px;
  font-size: 0.81rem;
}

.cue-box.positive {
  background: rgba(16, 185, 129, 0.09);
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.cue-box.negative {
  background: rgba(244, 63, 94, 0.09);
  border: 1px solid rgba(244, 63, 94, 0.25);
}

.cue-box-title {
  font-weight: 700;
  font-size: 0.78rem;
  margin-bottom: 5px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.cue-box.positive .cue-box-title { color: #34d399; }
.cue-box.negative .cue-box-title { color: #fda4af; }

.cue-list {
  padding-left: 16px;
}

.cue-list li {
  margin-bottom: 4px;
}

.video-link-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: 100%;
  margin-top: 10px;
  padding: 9px 12px;
  background: var(--bg-card-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  text-decoration: none;
  font-size: 0.81rem;
  font-weight: 600;
}

/* Smart Recommendation Banner */
.smart-rec-box {
  margin-top: 14px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  background: linear-gradient(90deg, rgba(251, 113, 133, 0.14), rgba(56, 189, 248, 0.1));
  border: 1px solid rgba(251, 113, 133, 0.28);
  font-size: 0.81rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

/* Anatomical Muscle Map & "Where to feel it" Box */
.feel-effort-box {
  margin-top: 12px;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: var(--radius-md);
  padding: 12px;
}

.feel-effort-grid {
  display: grid;
  grid-template-columns: 138px 1fr;
  gap: 12px;
  align-items: center;
  margin-top: 8px;
}

@media (max-width: 390px) {
  .feel-effort-grid {
    grid-template-columns: 1fr;
  }
}

.muscle-map-svg {
  width: 100%;
  max-width: 150px;
  height: auto;
  background: #0b1120;
  border-radius: 10px;
  border: 1px solid var(--border-subtle);
  padding: 4px;
  margin: 0 auto;
  display: block;
}

@keyframes muscleGlow {
  0%, 100% { fill-opacity: 0.92; }
  50% { fill-opacity: 0.48; }
}

.muscle-pulse {
  animation: muscleGlow 2s ease-in-out infinite;
}

/* Video-Game Loading Screen / Rest Fact Card */
.loading-fact-card {
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.95), rgba(15, 23, 42, 0.98));
  border: 1px solid rgba(250, 204, 21, 0.28);
  border-radius: var(--radius-lg);
  padding: 12px 14px;
  margin-bottom: 14px;
  position: relative;
}

.loading-fact-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 5px;
}

.loading-fact-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #facc15;
  background: rgba(250, 204, 21, 0.12);
  padding: 2px 8px;
  border-radius: 99px;
}

.loading-fact-next-btn {
  background: var(--bg-card-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 4px 9px;
  font-size: 0.72rem;
  font-weight: 700;
  color: #f8fafc;
  cursor: pointer;
}

.loading-fact-next-btn:active {
  transform: scale(0.95);
}

.loading-fact-title {
  font-size: 0.86rem;
  font-weight: 800;
  color: #f8fafc;
  margin-bottom: 2px;
}

.loading-fact-text {
  font-size: 0.79rem;
  color: #cbd5e1;
}

/* Set Tracker Rows */
.sets-container {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.set-row {
  display: grid;
  grid-template-columns: 54px 1fr 1fr 48px;
  align-items: center;
  gap: 8px;
  background: var(--bg-primary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 8px 10px;
  transition: all 0.15s ease;
}

.set-row.done {
  background: rgba(16, 185, 129, 0.11);
  border-color: rgba(16, 185, 129, 0.4);
}

.set-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
}

.set-row.done .set-label {
  color: var(--accent-emerald);
}

.stepper-control {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-card-elevated);
  border-radius: 8px;
  padding: 3px;
}

.step-btn {
  width: 28px;
  height: 30px;
  border: none;
  background: var(--bg-card);
  color: var(--text-main);
  border-radius: 6px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
}

.step-btn:active {
  background: var(--accent-coral);
}

.step-val-wrap {
  text-align: center;
  flex: 1;
}

.step-input {
  width: 100%;
  background: transparent;
  border: none;
  text-align: center;
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--text-main);
}

.step-unit {
  display: block;
  font-size: 0.62rem;
  color: var(--text-muted);
  margin-top: -2px;
}

.check-set-btn {
  width: 44px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-card-elevated);
  color: var(--text-muted);
  font-size: 1.05rem;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.set-row.done .check-set-btn {
  background: var(--accent-emerald);
  border-color: var(--accent-emerald);
  color: #052e16;
}

/* RPE 3-Button Feedback after sets */
.rpe-feedback-box {
  margin-top: 12px;
  padding: 11px 12px;
  background: var(--bg-primary);
  border-radius: var(--radius-md);
  border: 1px dashed rgba(148, 163, 184, 0.25);
}

.rpe-title {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 8px;
  font-weight: 600;
}

.rpe-btns {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
}

.rpe-btn {
  padding: 8px 6px;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-card-elevated);
  font-size: 0.74rem;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
}

.rpe-btn.selected-easy {
  background: rgba(16, 185, 129, 0.22);
  border-color: var(--accent-emerald);
  color: #6ee7b7;
}
.rpe-btn.selected-good {
  background: rgba(56, 189, 248, 0.22);
  border-color: var(--accent-sky);
  color: #7dd3fc;
}
.rpe-btn.selected-hard {
  background: rgba(244, 63, 94, 0.22);
  border-color: var(--accent-coral);
  color: #fda4af;
}

/* Primary Action Button */
.btn-primary {
  width: 100%;
  padding: 14px 18px;
  border-radius: var(--radius-md);
  border: none;
  background: linear-gradient(135deg, var(--accent-coral), var(--accent-rose));
  color: #fff;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(244, 63, 94, 0.3);
  transition: transform 0.12s ease;
}

.btn-primary:active {
  transform: scale(0.98);
}

.btn-secondary {
  width: 100%;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: var(--bg-card-elevated);
  color: var(--text-main);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
}

/* Interactive Treadmill Coach Screen */
.treadmill-stage {
  background: linear-gradient(160deg, #0f172a, #1e293b);
  border: 2px solid var(--accent-sky);
  border-radius: var(--radius-lg);
  padding: 18px;
  text-align: center;
  margin-bottom: 14px;
}

.treadmill-stage.phase-jog {
  border-color: var(--accent-coral);
}

.treadmill-phase-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 99px;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.phase-walk .treadmill-phase-badge {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
}

.phase-jog .treadmill-phase-badge {
  background: rgba(251, 113, 133, 0.22);
  color: #fda4af;
}

.treadmill-timer-big {
  font-size: 3.3rem;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
  margin: 4px 0;
}

.treadmill-speed-box {
  display: inline-flex;
  gap: 14px;
  background: rgba(15, 23, 42, 0.75);
  padding: 8px 16px;
  border-radius: 10px;
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--accent-sky);
  margin: 8px 0 12px;
}

.treadmill-cue-box {
  background: rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-md);
  padding: 12px;
  font-size: 0.88rem;
  color: #f1f5f9;
  margin-bottom: 14px;
}

.treadmill-controls {
  display: flex;
  gap: 8px;
  justify-content: center;
}

/* Floating Rest Timer Bar */
.rest-timer-bar {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(var(--safe-bottom) + 74px);
  max-width: 496px;
  margin: 0 auto;
  background: rgba(15, 23, 42, 0.96);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--accent-sky);
  border-radius: 16px;
  padding: 11px 14px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.55);
  z-index: 90;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.rest-timer-bar.hidden {
  display: none;
}

.rest-timer-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.rest-countdown {
  font-size: 1.35rem;
  font-weight: 900;
  color: var(--accent-sky);
  font-variant-numeric: tabular-nums;
}

.rest-actions {
  display: flex;
  gap: 6px;
}

.rest-mini-btn {
  padding: 5px 10px;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-card-elevated);
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
}

.rest-tip-line {
  font-size: 0.76rem;
  color: var(--text-muted);
}

/* Bottom Tab Navigation */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg-glass);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-top: 1px solid var(--border-subtle);
  padding-top: 6px;
  padding-bottom: calc(var(--safe-bottom) + 6px);
  z-index: 100;
}

.bottom-nav-inner {
  max-width: 520px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
}

.nav-tab {
  background: none;
  border: none;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 6px 4px;
  font-size: 0.7rem;
  font-weight: 600;
  cursor: pointer;
}

.nav-tab.active {
  color: var(--accent-coral);
}

.nav-tab-icon {
  font-size: 1.2rem;
}

/* Toast Notification */
.toast {
  position: fixed;
  top: calc(var(--safe-top) + 16px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent-emerald);
  color: #052e16;
  font-weight: 700;
  font-size: 0.84rem;
  padding: 10px 18px;
  border-radius: 99px;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
  z-index: 200;
  transition: opacity 0.25s ease;
}

.toast.hidden {
  opacity: 0;
  pointer-events: none;
}

/* History & Stats */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}

.stat-box {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 10px;
  text-align: center;
}

.stat-val {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--accent-coral);
}

.stat-lbl {
  font-size: 0.7rem;
  color: var(--text-muted);
}

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  z-index: 150;
}

.modal-backdrop.hidden {
  display: none;
}

.modal-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px;
  max-width: 440px;
  width: 100%;
  max-height: 85dvh;
  overflow-y: auto;
}

