:root {
  /* Ultra-Clean Modern Light Palette (Inspired by Reference Design) */
  --bg-app: #f8fafc;
  --bg-card: #ffffff;
  --bg-card-hover: #ffffff;
  --bg-subtle: #f1f5f9;
  --bg-input: #ffffff;
  
  --border-subtle: rgba(0, 0, 0, 0.05);
  --border-light: #e2e8f0;
  --border-active: #0f172a;

  --text-main: #0f172a;
  --text-body: #334155;
  --text-muted: #64748b;
  --text-dim: #94a3b8;

  /* Vibrant Illustration Accents (Violet & Mint from Reference) */
  --accent-purple: #7c3aed;
  --accent-purple-light: #8b5cf6;
  --accent-purple-bg: #f5f3ff;
  --accent-purple-border: #ddd6fe;

  --accent-mint: #10b981;
  --accent-mint-bg: #ecfdf5;
  --accent-mint-border: #a7f3d0;

  --accent-rose: #f43f5e;
  --accent-rose-bg: #fff1f2;
  --accent-rose-border: #fecdd3;

  --accent-indigo: #4f46e5;
  --accent-indigo-bg: #eef2ff;

  --btn-dark: #000000;
  --btn-dark-hover: #1e293b;

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-heading: 'Outfit', sans-serif;
  --font-display: 'Outfit', sans-serif;

  /* Lush Soft Shadows */
  --shadow-card: 0 16px 36px -4px rgba(15, 23, 42, 0.05), 0 4px 12px -2px rgba(15, 23, 42, 0.02);
  --shadow-elevated: 0 24px 48px -6px rgba(15, 23, 42, 0.08), 0 8px 16px -4px rgba(15, 23, 42, 0.03);
  --shadow-pill: 0 4px 16px rgba(0, 0, 0, 0.12);
  --shadow-subtle: 0 2px 8px rgba(0, 0, 0, 0.04);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-app);
  color: var(--text-body);
  font-family: var(--font-sans);
  min-height: 100vh;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* APP CONTAINER */
.app-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: max(1.5rem, env(safe-area-inset-top)) max(1.25rem, env(safe-area-inset-right)) max(4rem, env(safe-area-inset-bottom)) max(1.25rem, env(safe-area-inset-left));
}

/* FLOATING PILL HEADER */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1.5rem;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-subtle);
  border-radius: 9999px;
  margin-bottom: 2rem;
  box-shadow: var(--shadow-card);
}

.header-left .logo-badge {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.logo-icon {
  font-size: 1.4rem;
  background: var(--accent-purple-bg);
  padding: 0.35rem 0.55rem;
  border-radius: 12px;
  border: 1px solid var(--accent-purple-border);
}

.logo-text h1 {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: var(--text-main);
}

.logo-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 500;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

/* CAPSULE NAVIGATION TABS */
.nav-tabs {
  display: flex;
  gap: 0.35rem;
  background: var(--bg-subtle);
  padding: 0.3rem;
  border-radius: 9999px;
  border: 1px solid var(--border-light);
}

.nav-tab {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 1.15rem;
  background: transparent;
  border: none;
  border-radius: 9999px;
  color: var(--text-muted);
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
}

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

.nav-tab.active {
  color: var(--text-main);
  background: #ffffff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.stat-pill {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.85rem;
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: 9999px;
  font-family: var(--font-heading);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-main);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

.streak-pill {
  background: var(--accent-mint-bg);
  border-color: var(--accent-mint-border);
  color: #065f46;
}

.rep-pill {
  background: var(--accent-purple-bg);
  border-color: var(--accent-purple-border);
  color: var(--accent-purple);
}

/* MAIN CONTENT PANE */
.tab-pane {
  display: none;
  animation: fadeIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.tab-pane.active {
  display: block;
}

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

.pane-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.75rem;
}

.pane-title-group h2 {
  font-family: var(--font-heading);
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.5px;
}

.pane-subtitle {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-top: 0.25rem;
}

/* BUTTONS (Sleek Modern Pills) */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.6rem;
  border-radius: 9999px;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.92rem;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  border: none;
  text-decoration: none;
}

/* Signature Solid Black Pill Button ("Enter") */
.btn-primary {
  background: var(--btn-dark);
  color: #ffffff;
  box-shadow: var(--shadow-pill);
}

.btn-primary:hover {
  background: var(--btn-dark-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.22);
}

/* Violet Accent Button */
.btn-gold {
  background: var(--accent-purple);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(124, 58, 237, 0.25);
}

.btn-gold:hover {
  background: #6d28d9;
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(124, 58, 237, 0.35);
}

/* Fresh Mint Button ("I want this") */
.btn-success {
  background: var(--accent-mint);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.25);
}

.btn-success:hover {
  background: #059669;
  transform: translateY(-1px);
}

.btn-outline {
  background: #ffffff;
  border: 1px solid var(--border-light);
  color: var(--text-body);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.btn-outline:hover {
  border-color: var(--text-main);
  color: var(--text-main);
  background: #f8fafc;
  transform: translateY(-1px);
}

.custom-select {
  background: #ffffff;
  color: var(--text-main);
  border: 1px solid var(--border-light);
  padding: 0.65rem 1.25rem;
  border-radius: 9999px;
  font-family: var(--font-heading);
  font-weight: 500;
  outline: none;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

/* WORKOUT STEPPER */
.workout-stepper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #ffffff;
  padding: 1.15rem 1.75rem;
  border-radius: 24px;
  border: 1px solid var(--border-subtle);
  margin-bottom: 2rem;
  box-shadow: var(--shadow-card);
}

.step-node {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  opacity: 0.45;
  transition: all 0.3s ease;
}

.step-node.active {
  opacity: 1;
}

.step-num {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--bg-subtle);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.85rem;
  transition: all 0.2s ease;
}

.step-node.active .step-num {
  background: var(--btn-dark);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
}

.step-node.completed .step-num {
  background: var(--accent-mint);
  color: #ffffff;
}

.step-label {
  font-family: var(--font-heading);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-main);
}

.step-line {
  flex: 1;
  height: 2px;
  background: var(--border-light);
  margin: 0 1rem;
}

/* WORKOUT STAGE CARD */
.workout-stage-card {
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: 28px;
  padding: 2.5rem;
  box-shadow: var(--shadow-card);
  min-height: 480px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.phase-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.85rem;
  background: var(--accent-purple-bg);
  border: 1px solid var(--accent-purple-border);
  color: var(--accent-purple);
  border-radius: 9999px;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 1rem;
}

.phase-title {
  font-family: var(--font-heading);
  font-size: 1.85rem;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.5px;
  margin-bottom: 0.5rem;
}

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

.phase-instruction {
  font-size: 1.05rem;
  color: var(--text-body);
  margin: 1.25rem 0;
  line-height: 1.7;
}

.spine-box {
  background: var(--accent-mint-bg);
  border: 1px solid var(--accent-mint-border);
  border-left: 4px solid var(--accent-mint);
  padding: 1.25rem 1.5rem;
  border-radius: 18px;
  font-family: var(--font-sans);
  color: #065f46;
  font-size: 0.98rem;
  margin: 1.25rem 0;
  line-height: 1.7;
}

.full-story-box {
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: 20px;
  padding: 1.5rem 1.75rem;
  margin: 1.25rem 0;
  font-size: 1.05rem;
  line-height: 1.8;
  color: var(--text-main);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.02);
}

.readiness-prompt-card {
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: 24px;
  padding: 1.5rem 1.75rem;
  margin-top: 2rem;
  box-shadow: var(--shadow-card);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.readiness-question {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.readiness-icon {
  font-size: 2rem;
  background: var(--accent-purple-bg);
  padding: 0.5rem 0.65rem;
  border-radius: 16px;
  border: 1px solid var(--accent-purple-border);
}

.readiness-question h4 {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-main);
}

.readiness-question p {
  font-size: 0.92rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

.readiness-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.guardrail-box, .guardrail-banner {
  background: var(--accent-rose-bg);
  border: 1px solid var(--accent-rose-border);
  border-left: 4px solid var(--accent-rose);
  padding: 1rem 1.25rem;
  border-radius: 18px;
  color: #9f1239;
  font-size: 0.95rem;
  margin: 1rem 0;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.timer-display {
  font-family: var(--font-heading);
  font-size: 2.8rem;
  font-weight: 800;
  color: var(--text-main);
  text-align: center;
  margin: 1.5rem 0;
  letter-spacing: -1px;
}

.stage-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-light);
}

/* 4D SLIDERS */
.rating-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
  margin: 1.5rem 0;
}

.rating-item {
  background: var(--bg-subtle);
  padding: 1.25rem;
  border-radius: 18px;
  border: 1px solid var(--border-light);
}

.rating-header {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-heading);
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 0.6rem;
}

.slider-val {
  color: var(--accent-purple);
  font-weight: 700;
}

.custom-range {
  width: 100%;
  accent-color: var(--accent-purple);
  cursor: pointer;
}

/* ASSOCIATION QUIZ 3D FLIP */
.quiz-container {
  display: flex;
  justify-content: center;
  margin-top: 1.5rem;
}

.quiz-card {
  width: 100%;
  max-width: 800px;
  min-height: 460px;
  perspective: 1200px;
  -webkit-perspective: 1200px;
}

.quiz-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 460px;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  transform-style: preserve-3d;
  -webkit-transform-style: preserve-3d;
}

.quiz-card.flipped .quiz-card-inner {
  transform: rotateY(180deg);
  -webkit-transform: rotateY(180deg);
}

.quiz-front, .quiz-back {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  min-height: 100%;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: 28px;
  padding: 2.5rem;
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow-y: auto;
}

.quiz-back {
  transform: rotateY(180deg);
  -webkit-transform: rotateY(180deg);
}

.quiz-badge {
  display: inline-block;
  align-self: flex-start;
  padding: 0.35rem 0.85rem;
  background: var(--accent-purple-bg);
  border: 1px solid var(--accent-purple-border);
  color: var(--accent-purple);
  border-radius: 9999px;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.72rem;
  letter-spacing: 0.5px;
}

.quiz-badge.badge-solution {
  background: var(--accent-mint-bg);
  border-color: var(--accent-mint-border);
  color: var(--accent-mint);
}

.quiz-scenario-text {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-main);
  line-height: 1.5;
  margin: 2rem 0;
  text-align: center;
  letter-spacing: -0.3px;
}

.quiz-instruction {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.glow-dot {
  width: 8px;
  height: 8px;
  background: var(--accent-purple);
  border-radius: 50%;
  box-shadow: 0 0 8px rgba(124, 58, 237, 0.4);
}

.turn-highlight {
  color: #9f1239;
  background: var(--accent-rose-bg);
  padding: 0.85rem 1.2rem;
  border-radius: 16px;
  border-left: 3px solid var(--accent-rose);
  font-size: 0.98rem;
  line-height: 1.6;
}

.quiz-feedback-actions {
  display: flex;
  gap: 1rem;
  margin-top: 1.5rem;
}

/* SITUATION MATCHER SEARCH */
.search-input-box {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  background: #ffffff;
  border: 1px solid var(--border-light);
  padding: 0.65rem 1.25rem;
  border-radius: 9999px;
  margin-bottom: 1.25rem;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.03);
}

.search-icon {
  font-size: 1.2rem;
  color: var(--text-muted);
}

.search-input-box input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-main);
  font-size: 1.05rem;
  outline: none;
  font-family: var(--font-sans);
}

.quick-situation-tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 2rem;
}

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

.quick-chip {
  background: #ffffff;
  border: 1px solid var(--border-light);
  color: var(--text-muted);
  padding: 0.4rem 0.95rem;
  border-radius: 9999px;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.quick-chip:hover {
  border-color: var(--text-main);
  color: var(--text-main);
}

.search-results-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}

.match-card {
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: 22px;
  padding: 1.5rem;
  box-shadow: var(--shadow-card);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.match-card:hover {
  border-color: var(--accent-purple-border);
  transform: translateY(-3px);
  box-shadow: var(--shadow-elevated);
}

.match-card.is-active {
  border-left: 4px solid var(--accent-mint);
}

.match-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.match-title {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-main);
}

.rationale-badge {
  font-size: 0.78rem;
  padding: 0.25rem 0.75rem;
  background: var(--accent-purple-bg);
  color: var(--accent-purple);
  border-radius: 9999px;
  border: 1px solid var(--accent-purple-border);
  font-weight: 600;
}

.transition-phrase {
  margin-top: 1rem;
  padding: 0.75rem 1.15rem;
  background: var(--accent-indigo-bg);
  border-radius: 14px;
  color: #3730a3;
  font-size: 0.92rem;
  font-style: italic;
}

/* CATALOG GRID */
.filter-group {
  display: flex;
  gap: 0.5rem;
}

.filter-btn {
  background: #ffffff;
  border: 1px solid var(--border-light);
  color: var(--text-muted);
  padding: 0.45rem 1rem;
  border-radius: 9999px;
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.filter-btn.active {
  background: var(--btn-dark);
  color: #ffffff;
  border-color: var(--btn-dark);
  font-weight: 600;
}

.tradition-chips-bar {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 1rem;
  margin-bottom: 1.5rem;
}

.trad-chip {
  white-space: nowrap;
  background: #ffffff;
  border: 1px solid var(--border-light);
  color: var(--text-muted);
  padding: 0.35rem 0.85rem;
  border-radius: 9999px;
  font-size: 0.82rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.trad-chip:hover {
  border-color: var(--text-main);
  color: var(--text-main);
}

.trad-chip.active {
  border-color: var(--accent-purple);
  color: var(--accent-purple);
  background: var(--accent-purple-bg);
  font-weight: 600;
}

.catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.25rem;
}

.story-card-item {
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: 22px;
  padding: 1.5rem;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--shadow-card);
}

.story-card-item:hover {
  border-color: var(--accent-purple-border);
  transform: translateY(-3px);
  box-shadow: var(--shadow-elevated);
}

.card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.75rem;
}

.card-num {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--text-dim);
}

.card-title {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.5rem;
}

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

.card-breath {
  font-size: 0.92rem;
  color: var(--text-body);
  line-height: 1.6;
  margin: 0.85rem 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-light);
}

.badge-rep {
  font-size: 0.75rem;
  padding: 0.2rem 0.6rem;
  border-radius: 9999px;
  font-weight: 600;
}

.badge-rep.active {
  background: var(--accent-mint-bg);
  color: var(--accent-mint);
  border: 1px solid var(--accent-mint-border);
}

.badge-rep.candidate {
  background: var(--bg-subtle);
  color: var(--text-dim);
}

/* ANALYTICS */
.analytics-overview-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.metric-card {
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  padding: 1.5rem;
  border-radius: 22px;
  text-align: center;
  box-shadow: var(--shadow-card);
}

.metric-val {
  font-family: var(--font-heading);
  font-size: 2.4rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -1px;
}

.metric-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.3rem;
  font-weight: 500;
}

.weak-spots-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 0.75rem;
}

.weak-spot-chip {
  padding: 0.45rem 1rem;
  background: var(--accent-rose-bg);
  border: 1px solid var(--accent-rose-border);
  color: #9f1239;
  border-radius: 9999px;
  font-size: 0.85rem;
  font-weight: 500;
}

.srs-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
  background: #ffffff;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: var(--shadow-card);
  border: 1px solid var(--border-subtle);
}

.srs-table th, .srs-table td {
  padding: 0.95rem 1.25rem;
  text-align: left;
  border-bottom: 1px solid var(--border-light);
  font-size: 0.9rem;
}

.srs-table th {
  background: var(--bg-subtle);
  color: var(--text-muted);
  font-family: var(--font-heading);
  font-weight: 600;
}

/* MODAL SHEET */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.modal-overlay.active {
  display: flex;
}

.modal-card {
  position: relative;
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  width: 100%;
  max-width: 800px;
  max-height: 88vh;
  border-radius: 28px;
  overflow-y: auto;
  padding: 2.5rem;
  box-shadow: 0 25px 60px -10px rgba(15, 23, 42, 0.25);
}

.modal-close {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  background: var(--bg-subtle);
  border: none;
  color: var(--text-muted);
  font-size: 1.4rem;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.modal-close:hover {
  background: #e2e8f0;
  color: var(--text-main);
}

.card-section {
  margin: 1.25rem 0;
}

.section-label {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.75rem;
  color: var(--accent-purple);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 0.4rem;
}

/* LIVE DISK SYNC STATUS PILL */
.sync-pill {
  background: #ffffff;
  border: 1px solid var(--border-light);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.85rem;
  border-radius: 9999px;
  font-size: 0.8rem;
  font-weight: 500;
}

.sync-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-mint);
  box-shadow: 0 0 6px rgba(16, 185, 129, 0.5);
  display: inline-block;
  transition: all 0.3s ease;
}

.sync-dot.syncing {
  background: #f59e0b;
  box-shadow: 0 0 6px #f59e0b;
  animation: pulse-sync 1s infinite alternate;
}

.sync-dot.offline {
  background: #94a3b8;
  box-shadow: none;
}

@keyframes pulse-sync {
  0% { transform: scale(0.85); opacity: 0.6; }
  100% { transform: scale(1.2); opacity: 1; }
}

.btn-icon-ghost {
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 0.9rem;
  color: inherit;
  padding: 0;
  margin-left: 0.15rem;
  opacity: 0.75;
  transition: transform 0.2s ease;
}

.btn-icon-ghost:hover {
  opacity: 1;
  transform: rotate(45deg);
}

/* VOICE PRACTICE STUDIO */
.voice-studio-box {
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: 20px;
  padding: 1.15rem 1.35rem;
  margin: 1.25rem 0;
}

.voice-studio-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.85rem;
}

.voice-title {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text-main);
  letter-spacing: 0.3px;
}

.voice-timer {
  font-family: monospace;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--accent-rose);
  background: var(--accent-rose-bg);
  padding: 0.2rem 0.6rem;
  border-radius: 8px;
  border: 1px solid var(--accent-rose-border);
}

.voice-studio-controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.btn-voice-record {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: #ffffff;
  color: var(--text-main);
  border: 1px solid var(--border-light);
  padding: 0.55rem 1.1rem;
  border-radius: 9999px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.85rem;
  transition: all 0.2s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.btn-voice-record:hover {
  border-color: var(--accent-rose);
}

.btn-voice-record.recording {
  background: var(--accent-rose-bg);
  border-color: var(--accent-rose);
  color: #9f1239;
  animation: pulse-border 1.5s infinite;
}

@keyframes pulse-border {
  0% { box-shadow: 0 0 0 0 rgba(244, 63, 94, 0.3); }
  70% { box-shadow: 0 0 0 8px rgba(244, 63, 94, 0); }
  100% { box-shadow: 0 0 0 0 rgba(244, 63, 94, 0); }
}

.btn-voice-play {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: #ffffff;
  color: var(--text-main);
  border: 1px solid var(--border-light);
  padding: 0.55rem 1.1rem;
  border-radius: 9999px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.85rem;
  transition: all 0.2s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.btn-voice-play:not(:disabled):hover {
  background: var(--accent-mint);
  color: #ffffff;
  border-color: var(--accent-mint);
}

.btn-voice-play:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.voice-waveform-preview {
  display: flex;
  align-items: center;
  gap: 3px;
  height: 24px;
  margin-top: 0.85rem;
}

.waveform-bar {
  flex: 1;
  background: #cbd5e1;
  height: 4px;
  border-radius: 2px;
  transition: height 0.1s ease, background 0.1s ease;
}

.recording .waveform-bar {
  background: var(--accent-rose);
}

/* LOCAL DISK PERSISTENCE & BACKUP CARD */
.disk-sync-card {
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: 22px;
  padding: 1.5rem;
  margin: 1.75rem 0;
  box-shadow: var(--shadow-card);
}

.sync-card-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.sync-card-header .sync-icon {
  font-size: 1.6rem;
  background: var(--accent-purple-bg);
  padding: 0.4rem 0.6rem;
  border-radius: 12px;
  border: 1px solid var(--accent-purple-border);
}

.sync-card-header h4 {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
}

.sync-card-header .sync-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

.sync-card-header code {
  background: var(--bg-subtle);
  padding: 0.15rem 0.45rem;
  border-radius: 6px;
  color: var(--accent-purple);
  font-weight: 600;
}

.sync-actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

.file-input-label {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  margin-bottom: 0;
}

/* ==============================================================================
   MOBILE & IPHONE RESPONSIVE STYLES
   ============================================================================== */
@media (max-width: 860px) {
  /* Hide keyboard shortcuts bar on touch devices */
  .shortcuts-bar {
    display: none !important;
  }

  /* Header & Navigation */
  .app-header {
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
    padding: 1rem;
    border-radius: 24px;
  }

  .header-left {
    display: flex;
    justify-content: center;
  }

  .header-center {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 4px;
    width: 100%;
  }

  .header-center::-webkit-scrollbar {
    display: none;
  }

  .nav-tabs {
    display: flex;
    gap: 0.5rem;
    width: max-content;
  }

  .header-right {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
  }

  /* Pane Header & Controls */
  .pane-header {
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
    margin-bottom: 1.25rem;
  }

  .pane-title-group h2 {
    font-size: 1.4rem;
  }

  .workout-controls {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
  }

  .workout-controls button,
  .workout-controls select {
    width: 100%;
  }

  /* Workout Stepper (Compacts cleanly on 375px+ screens) */
  .workout-stepper {
    padding: 0.75rem 0.6rem;
    margin-bottom: 1.25rem;
    border-radius: 20px;
  }

  .step-label {
    display: none;
  }

  .step-node.active .step-label {
    display: inline;
    font-size: 0.8rem;
  }

  .step-line {
    min-width: 10px;
    margin: 0 0.35rem;
  }

  .step-num {
    width: 28px;
    height: 28px;
    font-size: 0.75rem;
  }

  /* Workout Stage Card */
  .workout-stage-card {
    padding: 1.5rem 1.15rem;
    min-height: auto;
    border-radius: 24px;
  }

  .stage-actions {
    flex-direction: column;
    gap: 0.6rem;
  }

  .stage-actions button {
    width: 100%;
  }

  /* Quiz Card */
  .quiz-card {
    min-height: 460px;
  }

  .quiz-front, .quiz-back {
    padding: 1.5rem 1.15rem;
    min-height: 460px;
    border-radius: 24px;
  }

  .quiz-scenario-text {
    font-size: 1.15rem;
    margin: 1.25rem 0;
  }

  .quiz-feedback-actions {
    flex-direction: column;
    gap: 0.6rem;
  }

  .quiz-feedback-actions button {
    width: 100%;
  }

  /* Catalog & Library Grids */
  .catalog-grid,
  .story-grid,
  .repertoire-grid {
    grid-template-columns: 1fr !important;
  }

  .quick-situation-tags {
    gap: 0.4rem;
  }

  .match-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
  }

  /* Analytics */
  .analytics-overview-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.75rem;
  }

  .metric-card {
    padding: 1rem;
    border-radius: 18px;
  }

  .metric-val {
    font-size: 1.8rem;
  }

  /* Modal Sheet on Mobile */
  .modal-overlay {
    padding: 0;
    align-items: flex-end;
  }

  .modal-card {
    padding: 1.75rem 1.25rem;
    max-height: 90vh;
    border-radius: 28px 28px 0 0;
  }

  /* Readiness Prompt Card on Mobile */
  .readiness-prompt-card {
    flex-direction: column;
    align-items: stretch;
    padding: 1.25rem;
  }

  .readiness-actions {
    flex-direction: column;
    width: 100%;
  }

  .readiness-actions button {
    width: 100%;
  }

  /* Touch Ergonomics & Elimination of tap delay */
  button, .nav-tab, .quick-chip, .trad-chip, .custom-select {
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
  }
}
