/* ============================================================
   Pelvic Floor Training — styles.css
   Modern, Calming, Fully Responsive Mobile & Desktop Design System
   ============================================================ */

/* ── Design Tokens & Themes ───────────────────────────────── */
:root {
  /* Core palette — Light Wellness Mode */
  --bg:                #f8fafc;
  --bg-surface:        #ffffff;
  --bg-surface-elev:   #ffffff;
  --bg-tertiary:       #f1f5f9;
  --bg-card:           #ffffff;
  --bg-translucent:    rgba(255, 255, 255, 0.88);

  --text:              #0f172a;
  --text-secondary:    #475569;
  --text-muted:        #64748b;
  --text-subtle:       #94a3b8;

  --accent:            #4f46e5;
  --accent-hover:      #4338ca;
  --accent-light:      #eef2ff;
  --accent-glow:       rgba(79, 70, 229, 0.25);

  --teal-accent:       #0d9488;
  --teal-light:        #ccfbf1;
  --rose-accent:       #e11d48;

  --success:           #10b981;
  --success-bg:        #ecfdf5;
  --success-border:    #a7f3d0;

  --warning:           #f59e0b;
  --warning-bg:        #fffbeb;

  --danger:            #ef4444;
  --danger-bg:         #fef2f2;

  --border:            #e2e8f0;
  --border-light:      #f1f5f9;

  /* Typography */
  --font-display:      'Outfit', system-ui, -apple-system, sans-serif;
  --font-body:         'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;

  /* Radii */
  --radius-xl:         24px;
  --radius-lg:         18px;
  --radius-md:         14px;
  --radius-sm:         10px;
  --radius-xs:         6px;
  --radius-full:       9999px;

  /* Shadows */
  --shadow-sm:         0 1px 3px rgba(15, 23, 42, 0.05), 0 1px 2px rgba(15, 23, 42, 0.03);
  --shadow-md:         0 4px 16px -2px rgba(15, 23, 42, 0.07), 0 2px 6px -2px rgba(15, 23, 42, 0.04);
  --shadow-lg:         0 12px 32px -4px rgba(15, 23, 42, 0.12), 0 4px 12px -2px rgba(15, 23, 42, 0.06);

  --header-h:          60px;
  --nav-h:             68px;
  --app-max-w:         1200px;
}

/* ── Dark Mode ────────────────────────────────────────────── */
@media (prefers-color-scheme: dark) {
  :root[data-theme="system"] {
    --bg:                #090d16;
    --bg-surface:        #131926;
    --bg-surface-elev:   #1a2234;
    --bg-tertiary:       #1e273d;
    --bg-card:           #131926;
    --bg-translucent:    rgba(19, 25, 38, 0.88);

    --text:              #f8fafc;
    --text-secondary:    #cbd5e1;
    --text-muted:        #94a3b8;
    --text-subtle:       #64748b;

    --accent:            #6366f1;
    --accent-hover:      #818cf8;
    --accent-light:      #1e1b4b;
    --accent-glow:       rgba(99, 102, 241, 0.35);

    --teal-accent:       #2dd4bf;
    --teal-light:        #042f2e;

    --success:           #34d399;
    --success-bg:        #064e3b;
    --success-border:    #065f46;

    --warning:           #fbbf24;
    --warning-bg:        #451a03;

    --danger:            #f87171;
    --danger-bg:         #450a0a;

    --border:            #243048;
    --border-light:      #1a2234;

    --shadow-sm:         0 1px 3px rgba(0, 0, 0, 0.4);
    --shadow-md:         0 4px 16px rgba(0, 0, 0, 0.5);
    --shadow-lg:         0 12px 32px rgba(0, 0, 0, 0.6);
  }
}

:root[data-theme="dark"] {
  --bg:                #090d16;
  --bg-surface:        #131926;
  --bg-surface-elev:   #1a2234;
  --bg-tertiary:       #1e273d;
  --bg-card:           #131926;
  --bg-translucent:    rgba(19, 25, 38, 0.88);

  --text:              #f8fafc;
  --text-secondary:    #cbd5e1;
  --text-muted:        #94a3b8;
  --text-subtle:       #64748b;

  --accent:            #6366f1;
  --accent-hover:      #818cf8;
  --accent-light:      #1e1b4b;
  --accent-glow:       rgba(99, 102, 241, 0.35);

  --teal-accent:       #2dd4bf;
  --teal-light:        #042f2e;

  --success:           #34d399;
  --success-bg:        #064e3b;
  --success-border:    #065f46;

  --warning:           #fbbf24;
  --warning-bg:        #451a03;

  --danger:            #f87171;
  --danger-bg:         #450a0a;

  --border:            #243048;
  --border-light:      #1a2234;

  --shadow-sm:         0 1px 3px rgba(0, 0, 0, 0.4);
  --shadow-md:         0 4px 16px rgba(0, 0, 0, 0.5);
  --shadow-lg:         0 12px 32px rgba(0, 0, 0, 0.6);
}

:root[data-theme="light"] {
  --bg:                #f8fafc;
  --bg-surface:        #ffffff;
  --bg-surface-elev:   #ffffff;
  --bg-tertiary:       #f1f5f9;
  --bg-card:           #ffffff;
  --bg-translucent:    rgba(255, 255, 255, 0.88);

  --text:              #0f172a;
  --text-secondary:    #475569;
  --text-muted:        #64748b;
  --text-subtle:       #94a3b8;

  --accent:            #4f46e5;
  --accent-hover:      #4338ca;
  --accent-light:      #eef2ff;
  --accent-glow:       rgba(79, 70, 229, 0.25);

  --border:            #e2e8f0;
  --border-light:      #f1f5f9;
}

/* ── Private Mode (Pitch-black discreet theme) ─────────────── */
:root[data-theme="private"] {
  --bg:                #000000;
  --bg-surface:        #0c0c0c;
  --bg-surface-elev:   #161616;
  --bg-tertiary:       #1a1a1a;
  --bg-card:           #0c0c0c;
  --bg-translucent:    rgba(12, 12, 12, 0.95);

  --text:              #d4d4d8;
  --text-secondary:    #a1a1aa;
  --text-muted:        #71717a;
  --text-subtle:       #52525b;

  --accent:            #71717a;
  --accent-hover:      #a1a1aa;
  --accent-light:      #18181b;
  --accent-glow:       rgba(113, 113, 122, 0.15);

  --teal-accent:       #71717a;
  --teal-light:        #18181b;

  --success:           #a1a1aa;
  --success-bg:        #18181b;
  --success-border:    #27272a;

  --warning:           #a1a1aa;
  --warning-bg:        #18181b;

  --danger:            #a1a1aa;
  --danger-bg:         #18181b;

  --border:            #27272a;
  --border-light:      #1c1c1f;

  --shadow-sm:         none;
  --shadow-md:         none;
  --shadow-lg:         none;
}

/* ── Reset & Global Setup ─────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg);
  color: var(--text);
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.5;
  overflow-x: hidden;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  touch-action: manipulation;
}

input, select, textarea {
  font-family: inherit;
  color: inherit;
}

a {
  color: var(--accent);
  text-decoration: none;
}

/* ── App Shell & Responsive Centering ─────────────────────── */
#app {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  width: 100%;
  max-width: var(--app-max-w);
  margin: 0 auto;
  position: relative;
  overflow-x: clip;
}

/* ── Header ───────────────────────────────────────────────── */
#app-header {
  position: sticky;
  top: 0;
  z-index: 40;
  min-height: var(--header-h);
  background: var(--bg-translucent);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: max(0.5rem, env(safe-area-inset-top, 0px)) max(1rem, env(safe-area-inset-right, 0px)) 0.5rem max(1rem, env(safe-area-inset-left, 0px));
  gap: 0.75rem;
  width: 100%;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: 1;
  min-width: 0;
}

.app-logo-badge {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: var(--accent-light);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.app-title-group {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.app-name {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.app-subtitle {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 500;
  line-height: 1;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.header-pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-full);
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 600;
  transition: all 0.15s ease;
  border: 1px solid var(--border);
  min-height: 38px;
}

.header-pill-btn:hover {
  background: var(--accent-light);
  color: var(--accent);
  border-color: var(--accent);
}

.icon-btn {
  width: 38px;
  height: 38px;
  min-width: 38px;
  min-height: 38px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  background: var(--bg-tertiary);
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.icon-btn:hover {
  color: var(--text);
  background: var(--border);
}

@media (max-width: 359px) {
  .app-name { font-size: 0.92rem; }
  .app-subtitle { display: none; }
  .header-pill-btn span { display: none; }
  .header-pill-btn { padding: 0.4rem 0.55rem; }
}

/* ── Sync Badge ───────────────────────────────────────────── */
.sync-badge {
  font-size: 0.68rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  white-space: nowrap;
  transition: opacity 0.2s ease;
}
.sync-badge.hidden { display: none; }
.sync-badge.syncing { background: var(--accent-light); color: var(--accent); }
.sync-badge.pending { background: var(--warning-bg); color: var(--warning); }
.sync-badge.error { background: var(--danger-bg); color: var(--danger); }

/* ── Main Content & Panels ────────────────────────────────── */
#main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom, 16px) + 24px);
  width: 100%;
}

.panel {
  display: none;
  flex-direction: column;
  padding: 1.25rem max(1rem, env(safe-area-inset-right, 0px)) calc(var(--nav-h) + env(safe-area-inset-bottom, 16px) + 2rem) max(1rem, env(safe-area-inset-left, 0px));
  gap: 1.25rem;
  outline: none;
  width: 100%;
  overflow-x: clip;
}

.panel.active {
  display: flex;
  animation: panelFadeIn 0.2s ease-out;
}

@keyframes panelFadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.panel-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 40vh;
  gap: 1rem;
  color: var(--text-muted);
}

.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ── Responsive Navigation (Mobile Bottom Bar & Desktop Floating Dock) ── */
#bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  height: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: var(--bg-translucent);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-around;
  z-index: 45;
  touch-action: manipulation;
}

.nav-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 6px 4px;
  color: var(--text-muted);
  transition: all 0.15s ease;
  user-select: none;
  -webkit-user-select: none;
  max-width: 110px;
  min-height: 48px;
  border-radius: var(--radius-sm);
}

.nav-btn:hover {
  color: var(--text);
}

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

.nav-btn.active .nav-icon svg {
  stroke: var(--accent);
  stroke-width: 2.3;
}

.nav-label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

/* Desktop Floating Pill Navigation Dock */
@media (min-width: 768px) {
  #bottom-nav {
    max-width: 580px;
    height: 60px;
    bottom: max(20px, env(safe-area-inset-bottom, 0px));
    border-radius: var(--radius-full);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    padding: 0 0.85rem;
  }
  
  .nav-btn {
    flex-direction: row;
    gap: 8px;
    padding: 8px 14px;
    border-radius: var(--radius-full);
    min-height: 42px;
  }
  
  .nav-btn:hover {
    background: var(--bg-tertiary);
  }

  .nav-btn.active {
    background: var(--accent-light);
  }

  .nav-btn.active:hover {
    background: var(--accent-light);
  }

  .nav-label {
    font-size: 0.84rem;
  }
}

/* ── Core Card Styles ─────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  position: relative;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.card-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
}

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

/* ── 1. Today Dashboard Grid Layout (Mobile & Desktop) ─────── */
.today-header-group {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.greeting-text {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}

.plan-level-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.8rem;
  border-radius: var(--radius-full);
  background: var(--accent-light);
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: capitalize;
}

.today-dashboard-grid {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.today-col-left, .today-col-right {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

@media (min-width: 768px) {
  .panel {
    padding: 1.75rem 1.5rem;
    gap: 1.5rem;
  }

  .today-dashboard-grid {
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    gap: 1.5rem;
    align-items: start;
  }
}

@media (min-width: 1024px) {
  .today-dashboard-grid {
    grid-template-columns: 1.15fr 1fr;
    gap: 1.75rem;
  }
}

/* Hero Daily Progress Card */
.progress-hero-card {
  background: linear-gradient(135deg, var(--bg-surface-elev) 0%, var(--bg-surface) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 1.5rem 1.25rem;
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  position: relative;
  overflow: hidden;
}

.progress-hero-card::before {
  content: '';
  position: absolute;
  top: -40px;
  right: -40px;
  width: 130px;
  height: 130px;
  border-radius: 50%;
  background: var(--accent-glow);
  filter: blur(35px);
  pointer-events: none;
}

.progress-metrics-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.session-counter {
  display: flex;
  flex-direction: column;
}

.counter-num-wrap {
  display: flex;
  align-items: baseline;
  gap: 0.3rem;
}

.count-done {
  font-family: var(--font-display);
  font-size: 2.75rem;
  font-weight: 800;
  line-height: 1;
  color: var(--text);
}

.count-divider {
  font-size: 1.5rem;
  color: var(--text-subtle);
  font-weight: 400;
}

.count-target {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-muted);
}

.counter-label {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: 0.2rem;
}

.streak-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.9rem;
  border-radius: var(--radius-full);
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text);
}

.streak-pill.has-streak {
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.3);
  color: #b45309;
}

@media (prefers-color-scheme: dark) {
  .streak-pill.has-streak {
    color: #fbbf24;
  }
}

.bar-track {
  height: 10px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-full);
  overflow: hidden;
  position: relative;
}

.bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent) 0%, #818cf8 100%);
  border-radius: var(--radius-full);
  transition: width 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.weekly-goal-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
}

.weekly-goal-strip strong {
  color: var(--text);
}

/* 7-Day Activity Strip */
.week-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border-light);
}

.week-day-cell {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
}

.week-dot {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-tertiary);
  color: var(--text-subtle);
  font-size: 0.75rem;
  font-weight: 600;
  border: 1px solid transparent;
  transition: all 0.2s ease;
}

.week-dot.is-today {
  border-color: var(--accent);
  background: var(--accent-light);
  color: var(--accent);
  font-weight: 700;
}

.week-dot.complete {
  background: var(--success);
  color: #ffffff;
  border-color: var(--success);
}

.week-dot.partial {
  background: rgba(16, 185, 129, 0.2);
  color: var(--success);
  border-color: var(--success);
}

.week-day-text {
  font-size: 0.7rem;
  color: var(--text-subtle);
  font-weight: 600;
}

/* ── Recommended Next Session Card ────────────────────────── */
.recommended-card {
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 1.35rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.rec-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.rec-badge {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent);
}

.rec-duration {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 600;
}

.rec-info-title {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
}

.rec-info-desc {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.45;
}

.rec-timing-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.timing-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-xs);
  background: var(--bg-tertiary);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
}

/* Primary Action Button */
.btn-start-hero {
  width: 100%;
  padding: 1.1rem 1.5rem;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, var(--accent) 0%, #6366f1 100%);
  color: #ffffff;
  font-family: var(--font-display);
  font-size: 1.12rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  box-shadow: 0 4px 18px var(--accent-glow);
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  letter-spacing: 0.01em;
  min-height: 52px;
}

.btn-start-hero:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px var(--accent-glow);
}

.btn-start-hero:active {
  transform: translateY(0);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-md);
  font-size: 0.92rem;
  font-weight: 600;
  transition: all 0.15s ease;
  min-height: 44px;
}

.btn-primary {
  background: var(--accent);
  color: #ffffff;
}
.btn-primary:hover {
  background: var(--accent-hover);
}

.btn-secondary {
  background: var(--bg-tertiary);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-secondary:hover {
  background: var(--border);
}

.btn-danger {
  background: var(--danger);
  color: #ffffff;
}

.btn-outline-danger {
  border: 1px solid var(--danger);
  color: var(--danger);
  background: transparent;
}
.btn-outline-danger:hover {
  background: var(--danger-bg);
}

/* ── Quick Action Strip ───────────────────────────────────── */
.quick-action-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.quick-card-btn {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
  text-align: left;
  transition: all 0.15s ease;
}

.quick-card-btn:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}

.quick-card-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: var(--bg-tertiary);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.25rem;
}

.quick-card-title {
  font-family: var(--font-display);
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text);
}

.quick-card-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ── Today Sessions List ──────────────────────────────────── */
.today-sessions-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.section-subtitle {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}

.session-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.session-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.session-item-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.session-badge-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent-light);
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.session-meta-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.session-meta-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.session-meta-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.session-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
}

.icon-btn-sm {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-xs);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  background: var(--bg-tertiary);
  transition: all 0.15s ease;
}

.icon-btn-sm:hover {
  color: var(--text);
  background: var(--border);
}

.icon-btn-sm.danger:hover {
  color: var(--danger);
  background: var(--danger-bg);
}

.empty-today-card {
  align-items: center;
  text-align: center;
  padding: 2rem 1.5rem;
}

/* ── Educational & Health Disclaimer ──────────────────────── */
.disclaimer-banner {
  background: var(--bg-surface-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.disclaimer-banner svg {
  flex-shrink: 0;
  color: var(--accent);
  margin-top: 1px;
}

/* ── 2. Training Plans & Library (Train Panel) ─────────────── */
.plans-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.85rem;
}

@media (min-width: 640px) {
  .plans-grid {
    grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
    gap: 1.1rem;
  }
}

.plan-card {
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transition: all 0.2s ease;
  position: relative;
}

.plan-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-sm);
}

.plan-card.active-plan {
  border-color: var(--accent);
  background: linear-gradient(135deg, var(--bg-card) 0%, var(--accent-light) 120%);
}

.plan-badge-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.plan-level-tag {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
  background: var(--bg-tertiary);
  color: var(--text-secondary);
}

.plan-card.active-plan .plan-level-tag {
  background: var(--accent);
  color: #ffffff;
}

.plan-name {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
}

.plan-desc {
  font-size: 0.84rem;
  color: var(--text-secondary);
  line-height: 1.45;
}

.plan-details-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding-top: 0.25rem;
  border-top: 1px solid var(--border-light);
}

.plan-card-btn-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.25rem;
}

/* Custom Workout Builder */
.custom-builder-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.builder-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

@media (min-width: 768px) {
  .builder-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.builder-row {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

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

.builder-input {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-tertiary);
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 600;
}

.builder-input:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--bg-card);
}

/* Exercise Library Grid */
.library-accordion {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.65rem;
}

@media (min-width: 640px) {
  .library-accordion {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 0.85rem;
  }
}

.lib-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.lib-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.lib-title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}

.lib-desc {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.45;
}

/* ── 3. History Panel ──────────────────────────────────────── */
.filter-tabs {
  display: flex;
  background: var(--bg-tertiary);
  padding: 4px;
  border-radius: var(--radius-md);
  gap: 4px;
}

.filter-tab {
  flex: 1;
  padding: 0.5rem 0.5rem;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  text-align: center;
  transition: all 0.15s ease;
}

.filter-tab.active {
  background: var(--bg-surface);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}

.history-day-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.history-day-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.history-day-title {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
}

.history-day-metrics {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.history-completion-tag {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-full);
  background: var(--bg-tertiary);
  color: var(--text-muted);
}

.history-completion-tag.complete {
  background: var(--success-bg);
  color: var(--success);
}

/* ── 4. Progress / Analytics Panel ─────────────────────────── */
.stats-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

@media (min-width: 768px) {
  .stats-grid-2 {
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
  }
}

.stat-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.stat-box-val {
  font-family: var(--font-display);
  font-size: 1.85rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1.1;
}

.stat-box-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 600;
}

.stat-box-sub {
  font-size: 0.72rem;
  color: var(--text-subtle);
}

.progress-charts-grid {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

@media (min-width: 768px) {
  .progress-charts-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
  }
}

/* Weekly Bars Chart */
.weekly-bars-container {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.5rem;
  height: 140px;
  padding: 0.75rem 0.5rem 0;
}

.bar-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  gap: 0.4rem;
}

.bar-slot {
  flex: 1;
  width: 100%;
  max-width: 36px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}

.bar-slot-fill {
  width: 100%;
  background: linear-gradient(180deg, var(--accent) 0%, #818cf8 100%);
  border-radius: var(--radius-sm);
  transition: height 0.6s ease;
}

.bar-col-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 600;
}

.bar-col-pct {
  font-size: 0.68rem;
  color: var(--text-subtle);
}

/* 30-Day Activity Heatmap */
.heatmap-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  padding: 0.5rem 0;
}

.heatmap-cell {
  aspect-ratio: 1;
  border-radius: 6px;
  background: var(--bg-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-subtle);
  transition: all 0.2s ease;
}

.heatmap-cell.level-0 { background: var(--bg-tertiary); }
.heatmap-cell.level-1 { background: rgba(79, 70, 229, 0.25); color: var(--accent); }
.heatmap-cell.level-2 { background: rgba(79, 70, 229, 0.5); color: #ffffff; }
.heatmap-cell.level-3 { background: rgba(79, 70, 229, 0.75); color: #ffffff; }
.heatmap-cell.level-4 { background: var(--accent); color: #ffffff; }

/* Exercise Mix Bar */
.mix-bar {
  display: flex;
  height: 14px;
  border-radius: var(--radius-full);
  overflow: hidden;
  gap: 2px;
  background: var(--bg-tertiary);
}

.mix-segment {
  height: 100%;
  transition: width 0.4s ease;
}
.mix-slow { background: #4f46e5; }
.mix-quick { background: #0d9488; }
.mix-endurance { background: #f59e0b; }
.mix-relax { background: #10b981; }

.mix-legend {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  font-size: 0.78rem;
  color: var(--text-secondary);
}

@media (min-width: 768px) {
  .mix-legend {
    grid-template-columns: repeat(4, 1fr);
  }
}

.mix-legend-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.mix-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

/* ── 5. Settings Panel Grid ────────────────────────────────── */
.settings-container-grid {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.settings-col {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

@media (min-width: 768px) {
  .settings-container-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    align-items: start;
  }
}

.settings-group {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.settings-group-title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 0.5rem;
}

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.setting-label-block {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.setting-title {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text);
}

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

/* Toggle Switch */
.toggle-switch {
  position: relative;
  width: 48px;
  height: 28px;
  flex-shrink: 0;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: var(--border);
  border-radius: var(--radius-full);
  transition: 0.25s;
}

.toggle-slider::before {
  position: absolute;
  content: "";
  height: 22px;
  width: 22px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  border-radius: 50%;
  transition: 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.toggle-switch input:checked + .toggle-slider {
  background-color: var(--accent);
}

.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(20px);
}

.setting-select {
  padding: 0.45rem 0.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-tertiary);
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 600;
  max-width: 170px;
}

/* ── Fullscreen Interactive Workout Screen (Responsive & Viewport-Contained) ── */
#session-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  height: 100dvh;
  max-height: 100dvh;
  user-select: none;
  -webkit-user-select: none;
  padding: max(8px, env(safe-area-inset-top, 0px)) max(12px, env(safe-area-inset-right, 0px)) max(8px, env(safe-area-inset-bottom, 0px)) max(12px, env(safe-area-inset-left, 0px));
}

#session-overlay.hidden {
  display: none;
}

.workout-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  max-height: 100%;
  max-width: 540px;
  margin: 0 auto;
  width: 100%;
  justify-content: space-between;
  overflow: hidden;
  gap: clamp(4px, 1.2vh, 12px);
}

/* Top bar during session */
.workout-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.2rem 0;
  flex-shrink: 0;
}

.workout-info-tag {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.workout-plan-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent);
}

.workout-set-label {
  font-family: var(--font-display);
  font-size: clamp(1rem, 2.2vh, 1.2rem);
  font-weight: 700;
  color: var(--text);
}

.workout-quick-cues {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.workout-timer-clock {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 600;
}

.cue-icon-btn {
  width: 36px;
  height: 36px;
  min-width: 36px;
  min-height: 36px;
  border-radius: 50%;
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
}

.cue-icon-btn.muted {
  opacity: 0.4;
}

/* Repetition Dot Matrix */
.workout-rep-matrix {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  flex-shrink: 0;
}

.rep-dots-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 5px;
  max-width: 280px;
}

.rep-matrix-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  transition: all 0.25s ease;
}

.rep-matrix-dot.done {
  background: var(--accent);
  border-color: var(--accent);
}

.rep-matrix-dot.current {
  background: #ffffff;
  border-color: var(--accent);
  box-shadow: 0 0 8px var(--accent);
  transform: scale(1.25);
}

.rep-matrix-text {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
}

/* Central Animated Contraction Orb / Visual Trainer (Fluid Scale & Scroll-Safe) */
.orb-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding: 4px 0;
  width: 100%;
}

.orb-stage::-webkit-scrollbar {
  display: none;
}

.orb-container {
  width: clamp(120px, 23vh, 210px);
  height: clamp(120px, 23vh, 210px);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin: 0 auto;
}

.orb-glow-layer {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
  filter: blur(20px);
  transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.6s ease;
  opacity: 0.3;
}

.orb-core-circle {
  width: clamp(95px, 17vh, 155px);
  height: clamp(95px, 17vh, 155px);
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, var(--bg-surface-elev) 0%, var(--bg-tertiary) 100%);
  border: 2px solid var(--border);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 2;
  transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1), border-color 0.4s ease, box-shadow 0.4s ease;
}

/* Dynamic Phase States */
.phase-squeeze .orb-glow-layer {
  transform: scale(1.32);
  opacity: 0.8;
  background: radial-gradient(circle, rgba(79, 70, 229, 0.55) 0%, transparent 75%);
}

.phase-squeeze .orb-core-circle {
  transform: scale(1.15);
  border-color: var(--accent);
  box-shadow: 0 0 32px var(--accent-glow);
}

.phase-hold .orb-glow-layer {
  transform: scale(1.2);
  opacity: 0.7;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.5) 0%, transparent 70%);
}

.phase-hold .orb-core-circle {
  transform: scale(1.12);
  border-color: #818cf8;
  box-shadow: 0 0 24px rgba(99, 102, 241, 0.4);
}

.phase-release .orb-glow-layer {
  transform: scale(0.9);
  opacity: 0.3;
}

.phase-release .orb-core-circle {
  transform: scale(0.92);
  border-color: var(--teal-accent);
}

.phase-rest .orb-glow-layer {
  transform: scale(1);
  opacity: 0.2;
}

.phase-rest .orb-core-circle {
  transform: scale(0.95);
  border-color: var(--border);
  animation: restBreathe 4s ease-in-out infinite;
}

@keyframes restBreathe {
  0%, 100% { transform: scale(0.95); opacity: 0.9; }
  50% { transform: scale(1.03); opacity: 1; }
}

.orb-timer-digits {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4.4vh, 3.2rem);
  font-weight: 800;
  line-height: 1;
  color: var(--text);
  letter-spacing: -0.03em;
}

.orb-phase-badge {
  font-size: clamp(0.68rem, 1.3vh, 0.82rem);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: 2px;
  color: var(--accent);
}

.phase-squeeze .orb-phase-badge { color: var(--accent); }
.phase-hold .orb-phase-badge    { color: #6366f1; }
.phase-release .orb-phase-badge { color: var(--teal-accent); }
.phase-rest .orb-phase-badge    { color: var(--text-muted); }

/* Action Guidance Banner */
.workout-cue-banner {
  text-align: center;
  margin-top: clamp(4px, 1.2vh, 10px);
  flex-shrink: 0;
  width: 100%;
}

.workout-main-cue {
  font-family: var(--font-display);
  font-size: clamp(1rem, 2.2vh, 1.3rem);
  font-weight: 700;
  color: var(--text);
}

.workout-sub-cue {
  font-size: clamp(0.74rem, 1.6vh, 0.85rem);
  color: var(--text-muted);
  margin-top: 2px;
}

/* Workout Controls */
.workout-controls {
  display: flex;
  flex-direction: column;
  gap: clamp(4px, 1.2vh, 8px);
  flex-shrink: 0;
  width: 100%;
}

.workout-primary-actions {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 0.65rem;
}

.btn-workout-pause {
  padding: clamp(0.65rem, 1.6vh, 1rem);
  border-radius: var(--radius-lg);
  background: var(--bg-surface-elev);
  border: 1.5px solid var(--border);
  color: var(--text);
  font-family: var(--font-display);
  font-size: clamp(0.9rem, 1.9vh, 1.05rem);
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  box-shadow: var(--shadow-sm);
  min-height: 46px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-workout-pause:hover {
  background: var(--bg-tertiary);
  border-color: var(--accent);
}

.btn-workout-skip, .btn-ready-early {
  padding: clamp(0.65rem, 1.6vh, 1rem);
  border-radius: var(--radius-lg);
  background: var(--bg-tertiary);
  border: 1.5px solid var(--border);
  color: var(--text-secondary);
  font-weight: 600;
  font-size: clamp(0.82rem, 1.7vh, 0.92rem);
  min-height: 46px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-ready-early {
  background: var(--accent-light);
  color: var(--accent);
  border-color: var(--accent);
  font-weight: 700;
}

.btn-workout-skip:hover {
  background: var(--border);
  color: var(--text);
}

.btn-workout-finish {
  padding: 0.4rem;
  font-size: 0.8rem;
  color: var(--danger);
  font-weight: 600;
  text-align: center;
  background: transparent;
  border: none;
  cursor: pointer;
  min-height: 32px;
}

.btn-workout-finish:hover {
  text-decoration: underline;
}

.desktop-shortcuts-hint {
  display: none;
  text-align: center;
  font-size: 0.72rem;
  color: var(--text-subtle);
}

@media (min-width: 768px) {
  .desktop-shortcuts-hint {
    display: block;
  }
}

/* Compact/Short Viewport & Landscape Ergonomics */
@media (max-height: 640px), (orientation: landscape) and (max-height: 520px) {
  .workout-container {
    gap: 4px;
  }
  .workout-topbar {
    padding: 0;
  }
  .workout-plan-label {
    font-size: 0.68rem;
  }
  .workout-set-label {
    font-size: 0.95rem;
  }
  .workout-rep-matrix {
    gap: 2px;
  }
  .rep-matrix-dot {
    width: 7px;
    height: 7px;
  }
  .orb-container {
    width: clamp(85px, 17vh, 125px);
    height: clamp(85px, 17vh, 125px);
  }
  .orb-core-circle {
    width: clamp(70px, 14vh, 100px);
    height: clamp(70px, 14vh, 100px);
  }
  .orb-timer-digits {
    font-size: clamp(1.3rem, 3.4vh, 1.8rem);
  }
  .orb-phase-badge {
    font-size: 0.65rem;
  }
  .workout-main-cue {
    font-size: 0.92rem;
  }
  .workout-sub-cue {
    font-size: 0.7rem;
  }
  .btn-workout-pause, .btn-workout-skip, .btn-ready-early {
    padding: 0.45rem 0.65rem;
    min-height: 40px;
    font-size: 0.85rem;
  }
  .btn-workout-finish {
    padding: 0.2rem;
    font-size: 0.74rem;
  }
  .desktop-shortcuts-hint {
    display: none !important;
  }
}

/* ── Workout Completion Screen ────────────────────────────── */
#completion-overlay {
  position: fixed;
  inset: 0;
  z-index: 110;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  overflow-y: auto;
}

#completion-overlay.hidden {
  display: none;
}

.completion-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 1.75rem 1.5rem;
  max-width: 440px;
  width: 100%;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 1.25rem;
  animation: popIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  max-height: 90dvh;
  overflow-y: auto;
}

@keyframes popIn {
  from { opacity: 0; transform: scale(0.92); }
  to { opacity: 1; transform: scale(1); }
}

.completion-icon-ring {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--success-bg);
  border: 2px solid var(--success-border);
  color: var(--success);
  display: flex;
  align-items: center;
  justify-content: center;
}

.completion-title {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.02em;
}

.completion-sub {
  font-size: 0.92rem;
  color: var(--text-muted);
}

.completion-stats-grid {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  padding: 0.85rem;
}

.comp-stat-col {
  display: flex;
  flex-direction: column;
}

.comp-stat-val {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
}

.comp-stat-lbl {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 600;
}

.wellness-rating-group {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  text-align: left;
}

.wellness-rating-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
}

.wellness-pills {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.35rem;
}

.wellness-pill-btn {
  padding: 0.45rem 0.2rem;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border);
  background: var(--bg-tertiary);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-align: center;
  transition: all 0.15s ease;
}

.wellness-pill-btn.selected {
  background: var(--accent-light);
  border-color: var(--accent);
  color: var(--accent);
}

/* ── Modals & Overlays ────────────────────────────────────── */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
}

.overlay.hidden {
  display: none;
}

.modal-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 1.5rem;
  max-width: min(440px, 94vw);
  width: 100%;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  max-height: 90dvh;
  overflow-y: auto;
}

.modal-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
}

.modal-message {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.modal-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.65rem;
  margin-top: 0.5rem;
  flex-wrap: wrap;
}

/* ── Learn Modal ──────────────────────────────────────────── */
.learn-modal-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  max-width: min(580px, 94vw);
  width: 100%;
  max-height: 88dvh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.learn-modal-header {
  padding: 1.1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.learn-modal-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
}

.icon-btn-close {
  width: 36px;
  height: 36px;
  min-width: 36px;
  min-height: 36px;
  border-radius: 50%;
  background: var(--bg-tertiary);
  color: var(--text-muted);
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: none;
  transition: all 0.15s ease;
}

.icon-btn-close:hover {
  background: var(--border);
  color: var(--text);
}

.learn-modal-content {
  padding: 1.25rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.55;
}

.learn-section-title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.35rem;
}

.learn-mistakes-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.learn-mistake-item {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  color: var(--danger);
}

.learn-mistake-item svg {
  flex-shrink: 0;
  margin-top: 3px;
}

.learn-positions-grid {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.position-card {
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
}

.position-title {
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.2rem;
}

/* ── Onboarding Modal ─────────────────────────────────────── */
.onboarding-modal-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 1.75rem 1.5rem;
  max-width: min(480px, 94vw);
  width: 100%;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  max-height: 90dvh;
  overflow-y: auto;
}

.onboarding-progress-dots {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.onboard-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border);
  transition: all 0.2s ease;
}

.onboard-dot.active {
  width: 22px;
  border-radius: var(--radius-full);
  background: var(--accent);
}

.onboarding-title {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.02em;
  text-align: center;
}

.onboarding-desc {
  font-size: 0.88rem;
  color: var(--text-secondary);
  text-align: center;
  line-height: 1.5;
}

.onboarding-options-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.onboard-option-btn {
  padding: 0.95rem 1.1rem;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border);
  background: var(--bg-surface);
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-align: left;
  transition: all 0.15s ease;
  min-height: 48px;
  cursor: pointer;
}

.onboard-option-btn:hover, .onboard-option-btn.selected {
  border-color: var(--accent);
  background: var(--accent-light);
}

.onboard-option-title {
  font-weight: 700;
  color: var(--text);
  font-size: 0.92rem;
}

.onboard-option-sub {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* ── Daily Session Timeline & Recovery Modal ─────────────────── */
.timeline-modal-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  max-width: min(640px, 94vw);
  width: 100%;
  max-height: 88dvh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: popIn 0.25s ease-out;
}

.timeline-modal-header {
  padding: 1.1rem 1.35rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.timeline-header-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.timeline-modal-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
}

.timeline-modal-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
}

.timeline-modal-content {
  padding: 1.25rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.timeline-summary-bar {
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  border: 1px solid var(--border);
}

.timeline-summary-metric {
  display: flex;
  flex-direction: column;
}

.timeline-summary-val {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
}

.timeline-summary-lbl {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 600;
}

/* Timeline vertical feed */
.daily-timeline-wrap {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  position: relative;
}

.timeline-step-item {
  display: flex;
  gap: 0.85rem;
  position: relative;
}

.timeline-axis {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
  width: 32px;
}

.timeline-bullet {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  background: var(--bg-tertiary);
  border: 2px solid var(--border);
  z-index: 2;
  color: var(--text-secondary);
}

.timeline-bullet.bullet-completed {
  background: var(--success-bg);
  border-color: var(--success);
  color: var(--success);
}

.timeline-bullet.bullet-partial {
  background: var(--warning-bg);
  border-color: var(--warning);
  color: #b45309;
}

.timeline-bullet.bullet-interrupted {
  background: rgba(147, 51, 234, 0.15);
  border-color: #9333ea;
  color: #9333ea;
}

.timeline-bullet.bullet-needs_retry {
  background: var(--danger-bg);
  border-color: var(--danger);
  color: var(--danger);
}

.timeline-bullet.bullet-skipped {
  background: var(--bg-tertiary);
  border-color: var(--border);
  color: var(--text-muted);
}

.timeline-line {
  width: 2px;
  flex: 1;
  background: var(--border);
  margin: 4px 0;
}

/* ── Timeline Modal Entry Components (openDayTimelineModal) ── */
.timeline-section {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.timeline-section-title {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--border);
}

.timeline-entry {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  padding: 0.7rem 0.9rem;
  border-left: 3px solid var(--border);
  transition: border-color 0.15s ease;
}

.timeline-entry.entry-complete { border-left-color: var(--success); }
.timeline-entry.entry-partial  { border-left-color: var(--warning); }
.timeline-entry.entry-skipped  { border-left-color: var(--text-muted); }

.timeline-entry-badge {
  min-width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(var(--accent-rgb, 99, 102, 241), 0.12);
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.timeline-entry-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
  min-width: 0;
}

.timeline-entry-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
}

.timeline-entry-meta {
  font-size: 0.76rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.timeline-entry-note {
  font-size: 0.76rem;
  color: var(--text-secondary);
  font-style: italic;
  margin-top: 2px;
}

.entry-status-pill {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 99px;
  padding: 1px 7px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: capitalize;
  color: var(--text-secondary);
}



.timeline-content-card {
  flex: 1;
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.05rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  box-shadow: var(--shadow-sm);
  transition: all 0.15s ease;
}

.timeline-content-card:hover {
  border-color: var(--accent);
}

.timeline-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
}

.timeline-plan-title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
}

.timeline-time-info {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

/* Status Badges */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.22rem 0.65rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
  border: 1px solid transparent;
}

.status-badge.status-completed {
  background: var(--success-bg);
  color: var(--success);
  border-color: var(--success-border);
}

.status-badge.status-partial {
  background: var(--warning-bg);
  color: #b45309;
  border-color: #fde68a;
}

.status-badge.status-interrupted {
  background: rgba(147, 51, 234, 0.12);
  color: #9333ea;
  border-color: rgba(147, 51, 234, 0.3);
}

.status-badge.status-needs_retry {
  background: var(--danger-bg);
  color: var(--danger);
  border-color: #fecaca;
}

.status-badge.status-skipped {
  background: var(--bg-tertiary);
  color: var(--text-muted);
  border-color: var(--border);
}

.status-badge.status-superseded {
  background: var(--bg-tertiary);
  color: var(--text-subtle);
  border-color: var(--border);
  font-style: italic;
}

/* Set Breakdown Matrix */
.set-breakdown-box {
  background: var(--bg-tertiary);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.8rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.set-breakdown-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.set-breakdown-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(115px, 1fr));
  gap: 0.4rem;
}

.set-pill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.3rem 0.55rem;
  border-radius: var(--radius-xs);
  background: var(--bg-card);
  border: 1px solid var(--border);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text);
}

.set-pill.done {
  border-color: var(--success);
  color: var(--success);
}

.set-pill.partial {
  border-color: var(--warning);
  color: #b45309;
}

.set-pill.pending {
  color: var(--text-subtle);
}

/* Actions in Timeline Card */
.timeline-actions-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding-top: 0.35rem;
  border-top: 1px solid var(--border-light);
}

.btn-recovery-action {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 700;
  transition: all 0.15s ease;
}

.btn-recovery-primary {
  background: var(--accent-light);
  color: var(--accent);
  border: 1px solid var(--accent);
}

.btn-recovery-primary:hover {
  background: var(--accent);
  color: #ffffff;
}

.btn-recovery-secondary {
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.btn-recovery-secondary:hover {
  background: var(--border);
  color: var(--text);
}

/* Recovery Alert Banner on Today Dashboard */
.recovery-banner {
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.12) 0%, rgba(99, 102, 241, 0.05) 100%);
  border: 1.5px solid var(--accent);
  border-radius: var(--radius-lg);
  padding: 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  position: relative;
  box-shadow: 0 4px 16px var(--accent-glow);
}

.recovery-banner-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.recovery-banner-title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.recovery-banner-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.45;
}

.recovery-banner-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* ── Toast Notifications ──────────────────────────────────── */
#toast-container {
  position: fixed;
  bottom: calc(var(--nav-h) + 16px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 120;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  pointer-events: none;
  max-width: 90vw;
}

@media (min-width: 768px) {
  #toast-container {
    bottom: 84px;
  }
}

.toast {
  padding: 0.65rem 1.1rem;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  pointer-events: auto;
}

.toast.visible {
  opacity: 1;
  transform: translateY(0);
}

.toast-success { background: #064e3b; color: #a7f3d0; }
.toast-warning { background: #451a03; color: #fde68a; }
.toast-error   { background: #450a0a; color: #fecaca; }
.toast-info    { background: #1e1b4b; color: #c7d2fe; }

/* ── Adaptive Recovery & Last-Rep Telemetry System ─────────── */
.recovery-telemetry-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.4rem 0.85rem;
  background: var(--bg-surface-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  margin-top: 0.35rem;
  box-shadow: var(--shadow-sm);
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.telemetry-item {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.telemetry-label {
  color: var(--text-muted);
  font-weight: 500;
}

.telemetry-val {
  font-weight: 700;
  color: var(--text);
  font-family: var(--font-display);
}

.telemetry-val.highlight {
  color: var(--teal-accent);
}

.telemetry-divider {
  width: 1px;
  height: 12px;
  background: var(--border);
}

/* 1-Tap Difficulty Rating Bar */
.rep-difficulty-wrap {
  width: 100%;
  max-width: 420px;
  margin: 0.5rem auto 0 auto;
  padding: 0.6rem 0.8rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  animation: fadeIn 0.25s ease-out;
}

.difficulty-prompt {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.difficulty-pills {
  display: flex;
  gap: 0.35rem;
  width: 100%;
  justify-content: center;
  flex-wrap: wrap;
}

.diff-btn {
  padding: 0.35rem 0.65rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  border: 1px solid var(--border);
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.diff-btn:hover {
  background: var(--bg-hover);
  border-color: var(--border-hover);
  color: var(--text);
  transform: translateY(-1px);
}

.diff-btn.selected {
  border-color: var(--accent);
  background: var(--accent-light);
  color: var(--accent);
  font-weight: 700;
  box-shadow: 0 0 8px rgba(99, 102, 241, 0.25);
}

.diff-btn.diff-1.selected { border-color: #10b981; background: rgba(16, 185, 129, 0.15); color: #10b981; }
.diff-btn.diff-2.selected { border-color: #3b82f6; background: rgba(59, 130, 246, 0.15); color: #3b82f6; }
.diff-btn.diff-3.selected { border-color: #8b5cf6; background: rgba(139, 92, 246, 0.15); color: #8b5cf6; }
.diff-btn.diff-4.selected { border-color: #f59e0b; background: rgba(245, 158, 11, 0.15); color: #f59e0b; }
.diff-btn.diff-5.selected { border-color: #ef4444; background: rgba(239, 68, 68, 0.15); color: #ef4444; }

/* Fatigue Guidance Banner */
.recovery-fatigue-notice {
  width: 100%;
  max-width: 420px;
  margin: 0.4rem auto;
  padding: 0.65rem 0.85rem;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: var(--radius-lg);
  font-size: 0.78rem;
  color: var(--text);
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  text-align: left;
  animation: fadeIn 0.3s ease-out;
}

.fatigue-notice-header {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 700;
  color: #f59e0b;
}

.fatigue-notice-actions {
  display: flex;
  gap: 0.4rem;
  margin-top: 0.2rem;
}

.btn-fatigue-action {
  padding: 0.3rem 0.6rem;
  border-radius: var(--radius-md);
  font-size: 0.72rem;
  font-weight: 600;
  border: 1px solid rgba(245, 158, 11, 0.4);
  background: var(--bg-surface-elev);
  color: var(--text);
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-fatigue-action:hover {
  background: rgba(245, 158, 11, 0.2);
}

/* Relaxation Check-in Prompt */
.relaxation-checkin-wrap {
  width: 100%;
  max-width: 420px;
  margin: 0.4rem auto;
  padding: 0.65rem 0.85rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.45rem;
  animation: fadeIn 0.3s ease-out;
}

.relaxation-prompt-text {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text);
}

.relaxation-options {
  display: flex;
  gap: 0.4rem;
  width: 100%;
  justify-content: center;
}

.btn-relax-opt {
  padding: 0.35rem 0.7rem;
  border-radius: var(--radius-full);
  font-size: 0.74rem;
  font-weight: 600;
  border: 1px solid var(--border);
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-relax-opt:hover {
  background: var(--bg-hover);
  color: var(--text);
}

.btn-relax-opt.selected {
  border-color: var(--teal-accent);
  background: rgba(20, 184, 166, 0.15);
  color: var(--teal-accent);
}

.relaxation-guidance-note {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.35;
  margin-top: 0.2rem;
}

/* Ready Early Button */
.btn-ready-early {
  padding: clamp(0.75rem, 1.8vh, 1.1rem);
  border-radius: var(--radius-lg);
  background: rgba(20, 184, 166, 0.12);
  border: 1.5px solid rgba(20, 184, 166, 0.4);
  color: var(--teal-accent);
  font-weight: 700;
  font-size: clamp(0.85rem, 1.8vh, 0.95rem);
  min-height: 48px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-ready-early:hover {
  background: rgba(20, 184, 166, 0.22);
  transform: translateY(-1px);
}

/* Recovery Summary Card in Completion Screen */
.recovery-summary-card {
  width: 100%;
  background: var(--bg-surface-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 0.9rem;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.recovery-card-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.recovery-stat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
}

.recovery-stat-box {
  background: var(--bg-tertiary);
  padding: 0.5rem 0.65rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.rec-stat-label {
  font-size: 0.68rem;
  color: var(--text-muted);
  font-weight: 500;
}

.rec-stat-value {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text);
}

.recovery-tip-box {
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.35;
  background: var(--bg-card);
  padding: 0.45rem 0.6rem;
  border-radius: var(--radius-sm);
  border-left: 2px solid var(--teal-accent);
}

/* Last Session Status Card on Today Dashboard */
.last-session-status-pill {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.8rem;
  background: var(--bg-surface-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  font-size: 0.76rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.last-session-status-pill.recent {
  background: rgba(99, 102, 241, 0.08);
  border-color: rgba(99, 102, 241, 0.25);
  color: var(--accent);
}

/* Recovery Settings Options */
.recovery-mode-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 0.5rem;
  margin-top: 0.35rem;
}

.recovery-mode-card {
  padding: 0.6rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-tertiary);
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.recovery-mode-card:hover {
  border-color: var(--border-hover);
  background: var(--bg-hover);
}

.recovery-mode-card.selected {
  border-color: var(--accent);
  background: var(--accent-light);
}

.recovery-mode-name {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text);
}

.recovery-mode-desc {
  font-size: 0.68rem;
  color: var(--text-muted);
  line-height: 1.3;
}

/* ── Train Sub-Tabs Navigation ─────────────────────────────── */
.train-subtabs-wrap {
  display: flex;
  background: var(--bg-tertiary);
  padding: 4px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  gap: 4px;
  margin-bottom: 1.25rem;
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  touch-action: pan-x;
}

.train-subtabs-wrap::-webkit-scrollbar {
  display: none;
}

.train-tab-btn {
  flex: 1;
  min-width: 105px;
  min-height: 44px;
  padding: 0.55rem 0.85rem;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  text-align: center;
  white-space: nowrap;
}

.train-tab-btn:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}

.train-tab-btn.active {
  background: var(--bg-surface-elev);
  color: var(--accent);
  font-weight: 700;
  box-shadow: var(--shadow-sm);
}

/* ── Complementary Routine Cards ──────────────────────────── */
.comp-routine-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transition: all 0.25s ease;
  box-shadow: var(--shadow-sm);
  position: relative;
}

.comp-routine-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.comp-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.comp-category-tag {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-full);
  background: rgba(99, 102, 241, 0.1);
  color: var(--accent);
}

.comp-category-tag.mobility {
  background: rgba(20, 184, 166, 0.1);
  color: var(--teal-accent);
}

.comp-category-tag.glute {
  background: rgba(245, 158, 11, 0.1);
  color: #f59e0b;
}

.comp-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
}

.comp-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.comp-exercise-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0.2rem 0;
}

.comp-exercise-chip {
  font-size: 0.74rem;
  font-weight: 600;
  padding: 0.25rem 0.55rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
}

.comp-safety-banner {
  font-size: 0.75rem;
  color: var(--text-muted);
  background: var(--bg-tertiary);
  border-left: 3px solid var(--teal-accent);
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  margin-top: 0.5rem;
}

/* ── Daily Hint Card on Home ──────────────────────────────── */
.daily-hint-card {
  background: var(--bg-surface-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 1.1rem 1.25rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-bottom: 1rem;
  position: relative;
  overflow: hidden;
}

.daily-hint-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: linear-gradient(to bottom, var(--accent), var(--teal-accent));
}

.hint-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.hint-badge {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.hint-text {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text);
  line-height: 1.45;
}

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

/* ── Daily Extra Card on Home ─────────────────────────────── */
.daily-extra-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 1.15rem 1.25rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-bottom: 1rem;
}

.extra-badge-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.extra-tag {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--teal-accent);
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.extra-title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
}

.extra-exercise-pills {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.extra-pill {
  font-size: 0.74rem;
  padding: 0.2rem 0.5rem;
  background: var(--bg-tertiary);
  border-radius: var(--radius-full);
  color: var(--text-secondary);
}

.extra-actions-row {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.25rem;
}

.btn-extra-try {
  flex: 2;
  padding: 0.55rem;
  font-size: 0.82rem;
  font-weight: 700;
  border-radius: var(--radius-md);
  background: var(--accent);
  color: #ffffff;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  min-height: 42px;
}

.btn-extra-try:hover {
  background: var(--accent-hover);
}

.btn-extra-skip {
  flex: 1;
  padding: 0.55rem;
  font-size: 0.82rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  background: var(--bg-tertiary);
  color: var(--text-muted);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.2s ease;
  min-height: 42px;
}

.btn-extra-skip:hover {
  background: var(--bg-hover);
  color: var(--text);
}

/* ── Theme Switcher Grid in Settings ──────────────────────── */
.theme-selector-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  margin-top: 0.4rem;
}

.theme-card {
  padding: 0.75rem 0.5rem;
  border-radius: var(--radius-lg);
  border: 1.5px solid var(--border);
  background: var(--bg-tertiary);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
  min-height: 72px;
  justify-content: center;
}

.theme-card:hover {
  border-color: var(--border-hover);
  background: var(--bg-hover);
}

.theme-card.selected {
  border-color: var(--accent);
  background: var(--accent-light);
  color: var(--accent);
  font-weight: 700;
}

.theme-icon {
  font-size: 1.2rem;
}

.theme-name {
  font-size: 0.78rem;
  font-weight: 600;
}

/* ── Complementary Progress Breakdown ─────────────────────── */
.category-progress-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.6rem;
  margin-top: 0.5rem;
}

.category-progress-grid > :nth-child(5):last-child {
  grid-column: 1 / -1;
}

@media (min-width: 540px) {
  .category-progress-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .category-progress-grid > :nth-child(5):last-child {
    grid-column: auto;
  }
}

@media (min-width: 1024px) {
  .category-progress-grid {
    grid-template-columns: repeat(5, 1fr);
    gap: 0.85rem;
  }
}

.category-stat-card {
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.65rem 0.8rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.category-stat-num {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--text);
}

.category-stat-lbl {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 600;
}

/* ── Expandable How-To Accordion ──────────────────────────── */
.how-to-toggle {
  font-size: 0.75rem;
  color: var(--accent);
  font-weight: 600;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 0;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  min-height: 32px;
}

.how-to-content {
  font-size: 0.76rem;
  color: var(--text-secondary);
  line-height: 1.4;
  background: var(--bg-tertiary);
  padding: 0.5rem 0.65rem;
  border-radius: var(--radius-sm);
  margin-top: 0.35rem;
}

.how-to-content.hidden {
  display: none;
}

/* ── Control & Recovery Mode System ───────────────────────── */

/* Today Dashboard Card */
.control-today-card {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.08) 0%, rgba(20, 184, 166, 0.06) 100%);
  border: 1.5px solid var(--border-hover);
  border-radius: var(--radius-lg);
  padding: 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-top: 0.85rem;
  transition: all 0.2s ease;
}

.control-today-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-sm);
}

.control-today-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.control-today-badge {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.control-today-hint {
  font-size: 0.72rem;
  color: var(--teal-accent);
  font-weight: 600;
  background: rgba(20, 184, 166, 0.1);
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.control-today-text {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.4;
  margin: 0;
}

.control-today-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.btn-start-control-quick {
  flex: 1;
  min-width: 140px;
  min-height: 42px;
  font-size: 0.84rem;
  padding: 0.5rem 0.9rem;
}

.btn-control-learn-quick {
  min-height: 42px;
  font-size: 0.84rem;
  padding: 0.5rem 0.85rem;
}

/* Control Hero Start Card */
.control-hero-card {
  background: var(--bg-surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 1.35rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  box-shadow: var(--shadow-sm);
}

.control-mode-pill-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--bg-tertiary);
  border-radius: var(--radius-full);
  padding: 4px;
  gap: 4px;
}

.mode-toggle-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.55rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  min-height: 40px;
}

.mode-toggle-btn.active {
  background: var(--bg-surface-elev);
  color: var(--text);
  font-weight: 700;
  box-shadow: var(--shadow-sm);
}

.mode-toggle-btn.active.moment {
  color: var(--accent);
}

.btn-start-control-dominant {
  width: 100%;
  padding: 0.95rem 1.25rem;
  font-size: 1.05rem;
  font-weight: 800;
  font-family: var(--font-display);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  box-shadow: 0 4px 18px var(--accent-glow);
  min-height: 52px;
}

/* Training Levels Grid */
.control-levels-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
  margin-top: 0.75rem;
}

@media (min-width: 640px) {
  .control-levels-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.control-level-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  transition: all 0.2s ease;
}

.control-level-card:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-sm);
}

.control-level-badge-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.control-level-tag {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-light);
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.control-level-title {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
  margin: 0;
}

.control-level-desc {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.4;
  margin: 0;
}

/* Educational Accordion */
.control-edu-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 0.85rem 1rem;
  margin-bottom: 0.5rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.control-edu-card:hover {
  border-color: var(--border-hover);
}

.control-edu-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.control-edu-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text);
  margin: 0;
}

.control-edu-summary {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin: 4px 0 0;
  line-height: 1.35;
}

.control-edu-body {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-top: 0.65rem;
  padding-top: 0.65rem;
  border-top: 1px solid var(--border-light);
}

.control-edu-body.hidden {
  display: none;
}

/* Medical Disclaimer Box */
.medical-boundary-box {
  background: rgba(239, 68, 68, 0.06);
  border: 1px solid rgba(239, 68, 68, 0.25);
  border-radius: var(--radius-lg);
  padding: 1rem;
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.45;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.medical-boundary-title {
  font-weight: 700;
  color: #ef4444;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

/* ── Interactive Fullscreen Control Overlay ───────────────── */
#control-overlay {
  background: var(--bg);
  height: 100dvh;
  max-height: 100dvh;
  width: 100vw;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: max(0.75rem, env(safe-area-inset-top, 0px)) max(0.85rem, env(safe-area-inset-right, 0px)) max(0.85rem, env(safe-area-inset-bottom, 0px)) max(0.85rem, env(safe-area-inset-left, 0px));
}

#control-overlay.hidden {
  display: none !important;
}

.control-screen-container {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
  width: 100%;
  max-width: 680px;
  margin: 0 auto;
}

.control-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-light);
  flex-shrink: 0;
}

.control-topbar-title {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.control-stage {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0.75rem 0;
  gap: 1rem;
}

.control-stage::-webkit-scrollbar {
  display: none;
}

/* Active Screen Elements */
.control-arousal-display {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}

.control-arousal-number {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 7vh, 4.2rem);
  font-weight: 800;
  line-height: 1;
  color: var(--text);
}

.control-arousal-number.high {
  color: #ef4444;
}

.control-arousal-number.moderate {
  color: #f59e0b;
}

.control-arousal-number.low {
  color: var(--teal-accent);
}

.control-arousal-tag {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

/* Dominant Pause Button */
.btn-dominant-pause {
  width: clamp(200px, 48vw, 300px);
  height: clamp(80px, 14vh, 120px);
  border-radius: var(--radius-xl);
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: #ffffff;
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 3.2vh, 1.85rem);
  font-weight: 800;
  letter-spacing: 0.04em;
  border: none;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  box-shadow: 0 8px 32px rgba(239, 68, 68, 0.4);
  transition: all 0.15s ease;
  user-select: none;
  touch-action: manipulation;
}

.btn-dominant-pause:active {
  transform: scale(0.96);
  box-shadow: 0 4px 16px rgba(239, 68, 68, 0.3);
}

.btn-dominant-pause span.pause-sub {
  font-size: 0.72rem;
  font-weight: 600;
  opacity: 0.9;
  letter-spacing: normal;
}

/* Arousal Selector Pills (1-10) */
.control-arousal-selector-wrap {
  width: 100%;
  max-width: 480px;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 0.65rem 0.85rem;
}

.arousal-selector-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
}

.arousal-scale-row {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 3px;
}

.arousal-scale-btn {
  padding: 0.4rem 0;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border);
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  min-height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.arousal-scale-btn:hover {
  background: var(--bg-hover);
}

.arousal-scale-btn.selected {
  background: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
}

.arousal-scale-btn.high-scale.selected {
  background: #ef4444;
  border-color: #ef4444;
}

/* Recovery Calm Visual State */
.control-recovery-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.85rem;
  width: 100%;
}

.control-recovery-timer {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5.5vh, 3.2rem);
  font-weight: 800;
  color: var(--teal-accent);
  line-height: 1;
}

.control-recovery-message {
  font-family: var(--font-display);
  font-size: clamp(1rem, 2.4vh, 1.3rem);
  font-weight: 700;
  color: var(--text);
  max-width: 380px;
  margin: 0;
}

.control-recovery-sub {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin: 0;
  max-width: 360px;
}

/* Breathing Guidance Ring */
.control-breathing-ring-wrap {
  width: clamp(110px, 20vh, 160px);
  height: clamp(110px, 20vh, 160px);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0.25rem 0;
}

.breathing-outer-ring {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(20, 184, 166, 0.22) 0%, rgba(20, 184, 166, 0.02) 70%);
  animation: breathExpand 10s infinite ease-in-out;
}

.breathing-inner-orb {
  position: absolute;
  width: 60%;
  height: 60%;
  border-radius: 50%;
  background: var(--teal-accent);
  opacity: 0.85;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  box-shadow: 0 0 24px rgba(20, 184, 166, 0.5);
  animation: breathCore 10s infinite ease-in-out;
}

@keyframes breathExpand {
  0%, 100% { transform: scale(0.75); opacity: 0.4; }
  40%      { transform: scale(1.15); opacity: 0.9; }
}

@keyframes breathCore {
  0%, 100% { transform: scale(0.85); }
  40%      { transform: scale(1.1); }
}

/* Tension Down-Training Meter */
.control-tension-meter {
  width: 100%;
  max-width: 320px;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  padding: 0.65rem 0.85rem;
  text-align: left;
}

.tension-meter-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.tension-track {
  width: 100%;
  height: 6px;
  background: var(--border);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.tension-fill {
  height: 100%;
  background: linear-gradient(90deg, #ef4444 0%, #f59e0b 50%, var(--teal-accent) 100%);
  border-radius: var(--radius-full);
  animation: tensionReleaseAnim 8s infinite ease-in-out;
}

@keyframes tensionReleaseAnim {
  0%   { width: 90%; background: #ef4444; }
  40%  { width: 50%; background: #f59e0b; }
  80%, 100% { width: 15%; background: var(--teal-accent); }
}

/* Anti-Pushing Safeguard Banner */
.control-safeguard-banner {
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: var(--radius-lg);
  padding: 0.75rem 0.95rem;
  font-size: 0.78rem;
  color: var(--text);
  line-height: 1.4;
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
  text-align: left;
  max-width: 420px;
}

/* Bottom Control Actions in Overlay */
.control-bottom-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  width: 100%;
  flex-shrink: 0;
  padding-top: 0.5rem;
}

.control-primary-actions {
  display: flex;
  gap: 0.5rem;
  width: 100%;
}

.btn-control-ready {
  flex: 1.5;
  padding: 0.85rem;
  font-size: 0.95rem;
  font-weight: 800;
  background: var(--teal-accent);
  color: #ffffff;
  border-radius: var(--radius-lg);
  border: none;
  cursor: pointer;
  min-height: 48px;
  box-shadow: 0 4px 16px rgba(20, 184, 166, 0.3);
  transition: all 0.15s ease;
}

.btn-control-ready:hover {
  background: #0d9488;
}

.btn-control-still-recovering {
  flex: 1;
  padding: 0.85rem;
  font-size: 0.85rem;
  font-weight: 600;
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  cursor: pointer;
  min-height: 48px;
  transition: all 0.15s ease;
}

.btn-control-still-recovering:hover {
  background: var(--border);
  color: var(--text);
}

.btn-control-exit {
  background: transparent;
  color: var(--text-muted);
  border: none;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.4rem;
  cursor: pointer;
  min-height: 36px;
}

.btn-control-exit:hover {
  color: var(--text);
}

/* Control Session Summary Screen */
.control-summary-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
  width: 100%;
  max-width: 520px;
  margin: auto;
  box-shadow: var(--shadow-lg);
  text-align: center;
}

.control-summary-stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.65rem;
}

@media (min-width: 480px) {
  .control-summary-stats-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.control-stat-box {
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  padding: 0.65rem 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.control-stat-val {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text);
}

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

.control-insight-box {
  background: rgba(99, 102, 241, 0.08);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 0.75rem 0.85rem;
  text-align: left;
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.45;
}

/* Control Subtabs Navigation */
.control-subtabs-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.35rem;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.control-subtabs-wrap::-webkit-scrollbar {
  display: none;
}

.control-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 1.1rem;
  border-radius: var(--radius-full);
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
  min-height: 42px;
}

.control-tab-btn:hover {
  background: var(--accent-light);
  color: var(--accent);
  border-color: var(--accent);
}

.control-tab-btn.active {
  background: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
  box-shadow: 0 2px 10px rgba(99, 102, 241, 0.3);
}

/* Practice Mode Cards & Short Routines */
.control-practice-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

@media (min-width: 640px) {
  .control-practice-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.control-practice-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.control-practice-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--accent);
}

.short-practice-pill-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
  margin-top: 0.25rem;
}

@media (min-width: 600px) {
  .short-practice-pill-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.short-practice-btn {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.65rem 0.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: center;
}

.short-practice-btn:hover {
  border-color: var(--accent);
  background: var(--accent-light);
}

.short-practice-time {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 800;
  color: var(--accent);
}

.short-practice-title {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-secondary);
}

/* Pelvic Floor Awareness Experiment Card */
.experiment-card {
  background: linear-gradient(135deg, rgba(20, 184, 166, 0.08) 0%, var(--bg-card) 100%);
  border: 1.5px solid var(--teal-accent);
  border-radius: var(--radius-xl);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.experiment-badge-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.experiment-tag {
  background: rgba(20, 184, 166, 0.15);
  color: var(--teal-accent);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Real-Time Minimal Screen */
.realtime-minimal-container {
  min-height: 55vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 1.5rem;
  padding: 1rem;
}

.btn-realtime-giant-pause {
  width: 100%;
  max-width: 320px;
  min-height: 140px;
  border-radius: var(--radius-2xl);
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: #ffffff;
  border: none;
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 900;
  letter-spacing: 0.03em;
  box-shadow: 0 10px 30px rgba(239, 68, 68, 0.35);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
  user-select: none;
  -webkit-user-select: none;
}

.btn-realtime-giant-pause:active {
  transform: scale(0.96);
  box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
}

/* Whole-Body Relaxation Cue Cards */
.body-cue-carousel {
  background: var(--bg-tertiary);
  border-radius: var(--radius-lg);
  padding: 0.85rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-align: left;
  border-left: 3px solid var(--teal-accent);
}

.body-cue-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
}

.body-cue-text {
  font-size: 0.82rem;
  color: var(--text);
  line-height: 1.4;
}

/* Personal Reflection Section */
.reflection-box {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  text-align: left;
}

.reflection-pills-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.reflection-pill-btn {
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  padding: 0.4rem 0.85rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
}

.reflection-pill-btn:hover {
  border-color: var(--accent);
  color: var(--text);
}

.reflection-pill-btn.selected {
  background: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
}

/* Adaptive Recommendation Banner */
.adaptive-rec-card {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.09) 0%, var(--bg-card) 100%);
  border: 1.5px solid var(--accent);
  border-radius: var(--radius-xl);
  padding: 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  text-align: left;
}

.adaptive-rec-header {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* History Control Badge */
.filter-btn[data-filter="control"].active {
  background: var(--accent);
  color: #ffffff;
}

/* ── Audio Guidance System Styles ─────────────────────────── */
.audio-mode-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin-top: 0.6rem;
  margin-bottom: 0.85rem;
}

@media (max-width: 600px) {
  .audio-mode-grid {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }
}

.audio-mode-card {
  background: var(--bg-tertiary);
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 0.9rem 0.8rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.4rem;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
  position: relative;
  text-align: left;
}

.audio-mode-card:hover {
  border-color: var(--accent);
  background: var(--bg-surface-elev);
  transform: translateY(-1px);
}

.audio-mode-card.selected {
  border-color: var(--accent);
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.08) 0%, var(--bg-card) 100%);
  box-shadow: 0 0 0 1px var(--accent), var(--shadow-md);
}

.audio-mode-icon-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
}

.audio-mode-icon {
  font-size: 1.25rem;
  line-height: 1;
}

.audio-mode-name {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
}

.audio-mode-desc {
  font-size: 0.76rem;
  color: var(--text-secondary);
  line-height: 1.35;
}

.audio-mode-badge {
  position: absolute;
  top: 0.65rem;
  right: 0.65rem;
  width: 14px;
  height: 14px;
  border-radius: var(--radius-full);
  border: 2px solid var(--border);
  background: transparent;
  transition: all 0.15s ease;
}

.audio-mode-card.selected .audio-mode-badge {
  border-color: var(--accent);
  background: var(--accent);
  box-shadow: inset 0 0 0 2.5px var(--bg-card);
}

/* Audio Sub-settings area */
.audio-sub-settings {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transition: opacity 0.2s ease;
}

.audio-sub-settings.dimmed {
  opacity: 0.4;
  pointer-events: none;
}

.audio-slider-wrap {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  width: 100%;
}

.audio-range-input {
  flex: 1;
  height: 6px;
  border-radius: var(--radius-full);
  background: var(--border);
  outline: none;
  accent-color: var(--accent);
  cursor: pointer;
}

.audio-slider-val {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-secondary);
  min-width: 38px;
  text-align: right;
}

.audio-test-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
  margin-top: 0.35rem;
}

.btn-test-audio {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.6rem 0.9rem;
  font-size: 0.82rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg-tertiary);
  color: var(--text);
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-test-audio:hover {
  background: var(--bg-surface-elev);
  border-color: var(--accent);
  color: var(--accent);
}

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

/* In-Workout Quick Audio Switcher Popover */
.workout-audio-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-full);
  padding: 0.35rem 0.75rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: inherit;
  cursor: pointer;
  transition: all 0.15s ease;
  backdrop-filter: blur(8px);
}

.workout-audio-btn:hover {
  background: rgba(255, 255, 255, 0.22);
  border-color: rgba(255, 255, 255, 0.35);
}

.audio-quick-popover {
  position: absolute;
  top: 55px;
  right: 15px;
  z-index: 1000;
  background: var(--bg-surface-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 0.85rem;
  width: 250px;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  animation: popoverFadeIn 0.15s ease-out;
}

@keyframes popoverFadeIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.audio-quick-title {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.audio-quick-modes {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.audio-quick-opt {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.65rem;
  border-radius: var(--radius-sm);
  background: var(--bg-tertiary);
  border: 1px solid transparent;
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.12s ease;
}

.audio-quick-opt:hover {
  border-color: var(--accent);
  background: var(--bg-surface);
}

.audio-quick-opt.selected {
  background: var(--accent);
  color: #ffffff;
}

.audio-quick-opt .check {
  font-size: 0.85rem;
}

/* ── Accessibility & Reduced Motion ───────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ============================================================
   REDESIGNED PRODUCT COMPONENTS & UX STYLES
   ============================================================ */

/* ── 1. Today Screen: Personal Focus & Action Grid ─────────── */
.focus-hero-card {
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.12) 0%, rgba(13, 148, 136, 0.08) 100%), var(--bg-card);
  border: 1.5px solid var(--accent);
  border-radius: var(--radius-xl);
  padding: 1.25rem 1.15rem;
  margin-bottom: 1.1rem;
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}

.focus-hero-card::before {
  content: '';
  position: absolute;
  top: -40px;
  right: -40px;
  width: 120px;
  height: 120px;
  border-radius: var(--radius-full);
  background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
  pointer-events: none;
}

.focus-badge-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.45rem;
}

.focus-kicker {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
}

.focus-duration-tag {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background: var(--accent-light);
  color: var(--accent);
}

.focus-title {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text);
  margin: 0 0 0.35rem;
  line-height: 1.25;
}

.focus-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.45;
  margin: 0 0 0.95rem;
}

.focus-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.btn-focus-start {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: var(--accent);
  color: #ffffff;
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 14px var(--accent-glow);
  transition: all 0.2s ease;
}

.btn-focus-start:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
}

/* Primary Action Grid on Today */
.today-actions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 0.85rem;
  margin-bottom: 1.1rem;
}

.action-tile {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.1rem 1rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.75rem;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}

.action-tile:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.action-tile-header {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.action-tile-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  background: var(--bg-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.action-tile-prep .action-tile-icon {
  background: rgba(13, 148, 136, 0.12);
  color: var(--teal-accent);
}

.action-tile-control .action-tile-icon {
  background: rgba(79, 70, 229, 0.12);
  color: var(--accent);
}

.action-tile-content {
  flex: 1;
}

.action-tile-kicker {
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  display: block;
  margin-bottom: 2px;
}

.action-tile-title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 3px;
}

.action-tile-desc {
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.35;
  margin: 0;
}

.action-tile-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.6rem 0.9rem;
  border-radius: var(--radius-md);
  font-size: 0.82rem;
  font-weight: 700;
  border: 1px solid var(--border);
  background: var(--bg-tertiary);
  color: var(--text);
  cursor: pointer;
  transition: all 0.15s ease;
}

.action-tile-btn:hover {
  background: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
}

/* Today Progress Snapshot */
.progress-snapshot-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1rem;
  margin-bottom: 1.1rem;
  box-shadow: var(--shadow-sm);
}

.snapshot-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.65rem;
  margin-top: 0.6rem;
}

.snapshot-pill {
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  padding: 0.6rem 0.5rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.snapshot-metric-label {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
}

.snapshot-metric-val {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text);
}

.snapshot-trend-up {
  color: var(--success);
}

.snapshot-trend-stable {
  color: var(--accent);
}

/* ── 2. Train Tab: Build Skill & Training Balance ──────────── */
.training-balance-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.1rem 1rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow-sm);
}

.balance-bar-container {
  display: flex;
  height: 12px;
  border-radius: var(--radius-full);
  overflow: hidden;
  background: var(--bg-tertiary);
  margin: 0.75rem 0 0.65rem;
}

.balance-seg {
  height: 100%;
  transition: width 0.3s ease;
}

.seg-strength { background: #6366f1; }
.seg-control  { background: #0d9488; }
.seg-relax    { background: #10b981; }
.seg-breath   { background: #f59e0b; }

.balance-legend-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1rem;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.balance-legend-item {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.balance-dot {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
}

.balance-nudge-box {
  background: var(--accent-light);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 0.65rem 0.85rem;
  margin-top: 0.75rem;
  font-size: 0.78rem;
  color: var(--text);
  line-height: 1.4;
}

/* Timing Breakdown Pill in Workout Cards */
.timing-breakdown-row {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0.4rem 0 0.6rem;
  flex-wrap: wrap;
}

.timing-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--radius-xs);
}

.timing-contract { background: rgba(99, 102, 241, 0.12); color: var(--accent); }
.timing-release  { background: rgba(13, 148, 136, 0.12); color: var(--teal-accent); }
.timing-relax    { background: rgba(16, 185, 129, 0.12); color: var(--success); }

/* ── 3. Control Lab: Structured Levels & Real Life ──────────── */
.control-levels-grid {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin-top: 0.75rem;
}

.control-level-card {
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.1rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
  position: relative;
}

.control-level-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-md);
}

.control-level-card.active-level {
  border-color: var(--accent);
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.04) 0%, var(--bg-card) 100%);
  box-shadow: 0 0 0 1px var(--accent), var(--shadow-md);
}

.level-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.level-num-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-light);
  padding: 3px 8px;
  border-radius: var(--radius-full);
}

.level-name-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  margin: 0.2rem 0 0;
}

.level-desc-text {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.4;
  margin: 0;
}

.level-actions-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  margin-top: 0.35rem;
  padding-top: 0.55rem;
  border-top: 1px solid var(--border-light);
}

/* Arousal Scale 1-8 Checkpoint Pills */
.arousal-scale-container {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  width: 100%;
  margin: 0.85rem 0;
}

.arousal-buttons-row {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 0.35rem;
}

.arousal-scale-btn {
  background: var(--bg-tertiary);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.65rem 0.2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  cursor: pointer;
  transition: all 0.15s ease;
  color: var(--text);
}

.arousal-scale-btn .num {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 800;
}

.arousal-scale-btn .tag {
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
}

.arousal-scale-btn:hover {
  border-color: var(--accent);
  background: var(--bg-surface-elev);
}

.arousal-scale-btn.selected {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}

.arousal-scale-btn.selected .tag {
  color: rgba(255, 255, 255, 0.85);
}

/* ── 4. My Progress: Baseline, Indicators & Insights ───────── */
.baseline-summary-card {
  background: linear-gradient(135deg, rgba(13, 148, 136, 0.08) 0%, var(--bg-card) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 1.15rem 1rem;
  margin-bottom: 1.15rem;
  box-shadow: var(--shadow-sm);
}

.before-now-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.1rem 1rem;
  margin-bottom: 1.15rem;
  box-shadow: var(--shadow-sm);
}

.before-now-grid {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.before-now-row {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  align-items: center;
  padding: 0.55rem 0.65rem;
  background: var(--bg-tertiary);
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
}

.before-now-header {
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  font-size: 0.7rem;
  background: transparent;
  padding: 0.2rem 0.65rem;
}

.trend-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 800;
}

.trend-badge.up {
  background: rgba(16, 185, 129, 0.15);
  color: var(--success);
}

.trend-badge.stable {
  background: rgba(99, 102, 241, 0.15);
  color: var(--accent);
}

/* Personal Training Indicators Grid */
.indicators-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.65rem;
  margin-top: 0.75rem;
}

.indicator-box {
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  padding: 0.75rem 0.65rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.indicator-title {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
}

.indicator-score {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text);
}

/* Personal Insight Bubble */
.insight-card {
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.06) 0%, rgba(13, 148, 136, 0.04) 100%), var(--bg-card);
  border: 1px solid var(--accent);
  border-radius: var(--radius-lg);
  padding: 0.95rem 1rem;
  margin-bottom: 0.85rem;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.insight-icon {
  font-size: 1.25rem;
  flex-shrink: 0;
  line-height: 1;
}

.insight-text {
  font-size: 0.83rem;
  color: var(--text);
  line-height: 1.45;
  margin: 0;
}

/* ── 5. Before Sex & After Sex Modals / Screens ────────────── */
.before-sex-overlay-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  max-width: 600px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem;
  justify-content: space-between;
  text-align: center;
}

.prep-guide-stage {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
}

.prep-breath-orb {
  width: 140px;
  height: 140px;
  border-radius: var(--radius-full);
  background: radial-gradient(circle, rgba(13, 148, 136, 0.35) 0%, rgba(13, 148, 136, 0.05) 70%);
  border: 2px solid var(--teal-accent);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  animation: gentlePulse 6s infinite ease-in-out;
}

@keyframes gentlePulse {
  0%, 100% { transform: scale(0.92); opacity: 0.8; }
  50%      { transform: scale(1.08); opacity: 1; }
}

.prep-cue-title {
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--text);
  margin: 0;
}

.prep-cue-sub {
  font-size: 0.92rem;
  color: var(--text-secondary);
  max-width: 380px;
  line-height: 1.5;
  margin: 0 auto;
}

/* ── 6. Professional Support & Clinician Summary ────────────── */
.clinical-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.15rem 1rem;
  margin-top: 1.25rem;
}

.clinical-disclaimer-box {
  background: var(--bg-tertiary);
  border-left: 3px solid var(--teal-accent);
  padding: 0.75rem 0.85rem;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.45;
  margin: 0.65rem 0 1rem;
}

.btn-export-summary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text);
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-export-summary:hover {
  border-color: var(--accent);
  background: var(--accent-light);
  color: var(--accent);
}

/* ── 7. Cloud Sync Status Indicator & Modal ─────────────────── */
.sync-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.28rem 0.65rem;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  border: 1px solid transparent;
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  transition: all 0.2s ease;
  user-select: none;
  line-height: 1;
  white-space: nowrap;
}

.sync-badge.synced {
  background: rgba(16, 185, 129, 0.12);
  color: #10b981;
  border-color: rgba(16, 185, 129, 0.25);
}

.sync-badge.syncing {
  background: rgba(99, 102, 241, 0.12);
  color: var(--accent);
  border-color: rgba(99, 102, 241, 0.25);
  animation: pulseSync 1.5s infinite ease-in-out;
}

.sync-badge.local_only {
  background: rgba(245, 158, 11, 0.12);
  color: #f59e0b;
  border-color: rgba(245, 158, 11, 0.25);
}

.sync-badge.error {
  background: rgba(239, 68, 68, 0.12);
  color: var(--danger);
  border-color: rgba(239, 68, 68, 0.25);
}

.sync-badge:hover {
  transform: translateY(-1px);
  filter: brightness(1.08);
}

@keyframes pulseSync {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

.sync-details-card {
  text-align: left;
}

.sync-status-header {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 0.85rem;
}

.sync-status-icon-lg {
  font-size: 1.8rem;
}

.sync-metrics-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
  margin: 0.85rem 0;
}

.sync-metric-box {
  background: var(--bg-tertiary);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.75rem;
}

.sync-metric-label {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  display: block;
}

.sync-metric-val {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text);
  margin-top: 2px;
  display: block;
}
