/* ==========================================================================
   PIANO PRACTICE DESIGN SYSTEM
   Direction: Warm, Calm, Approachable, Polished, Educational, Focused.
   Typography: Plus Jakarta Sans (Headings/Brand) + Inter (Body/UI)
   ========================================================================== */

:root {
  color-scheme: dark;

  /* Ambient & Surfaces */
  --bg: #0c0e17;
  --surface: #141824;
  --surface-elevated: #1c2132;
  --surface-hover: #232a3f;
  --surface-subtle: #111420;

  /* Lines & Dividers */
  --line: rgba(255, 255, 255, 0.08);
  --line-subtle: rgba(255, 255, 255, 0.04);
  --line-focus: rgba(229, 169, 60, 0.45);

  /* Primary Brand & Accents: Warm Piano Gold */
  --accent: #e5a93c;
  --accent-hover: #f5b94e;
  --accent-active: #d97706;
  --accent-subtle: rgba(229, 169, 60, 0.12);
  --accent-ink: #141006;

  /* Semantic Feedback Tints */
  --success: #10b981;
  --success-subtle: rgba(16, 185, 129, 0.12);
  --warning: #f59e0b;
  --warning-subtle: rgba(245, 158, 11, 0.12);
  --error: #f43f5e;
  --error-subtle: rgba(244, 63, 94, 0.12);
  --violet: #818cf8;
  --violet-subtle: rgba(129, 140, 248, 0.12);

  /* Text & Foreground */
  --ink: #f8fafc;
  --ink-secondary: #94a3b8;
  --muted: #64748b;

  /* Radii */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius: 16px;

  /* Shadows */
  --shadow-card: 0 4px 20px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.05);
  --shadow-elevated: 0 12px 32px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.08);
}

/* Base & Browser Surfaces */
* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html, body {
  margin: 0;
  padding: 0;
  min-width: 320px;
  background-color: var(--bg);
  color: var(--ink);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection {
  background: rgba(229, 169, 60, 0.3);
  color: #ffffff;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg);
}
::-webkit-scrollbar-thumb {
  background: #252a3d;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #353c56;
}

/* Typography Defaults */
h1, h2, h3, h4, h5, h6 {
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  color: var(--ink);
  margin-top: 0;
  font-weight: 700;
  letter-spacing: -0.02em;
}

h1 {
  font-size: clamp(26px, 4vw, 36px);
  line-height: 1.2;
  margin-bottom: 12px;
}

h2 {
  font-size: clamp(20px, 3vw, 24px);
  line-height: 1.3;
  margin-bottom: 12px;
}

h3 {
  font-size: 18px;
  line-height: 1.4;
  margin-bottom: 8px;
}

p {
  margin-top: 0;
  margin-bottom: 12px;
  color: var(--ink-secondary);
}

small {
  display: block;
  font-size: 13px;
  color: var(--muted);
}

button, input, select {
  font: inherit;
}

button {
  cursor: pointer;
  user-select: none;
}

button:focus-visible, input:focus-visible, a:focus-visible, select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

/* ==========================================================================
   APP LAYOUT & NAVIGATION
   ========================================================================== */

.app-layout {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  min-height: 100vh;
}

.app-nav {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 28px 20px 24px;
  background-color: var(--surface-subtle);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  z-index: 20;
}

/* Brand */
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--ink);
  padding: 6px 4px;
}

.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, #e5a93c, #f59e0b);
  color: var(--accent-ink);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(229, 169, 60, 0.25);
}

.brand-text strong {
  display: block;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.brand-text small {
  font-size: 11px;
  color: var(--muted);
  font-weight: 500;
}

/* Nav Menu */
.app-nav nav {
  display: grid;
  gap: 6px;
  margin: 32px 0;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  color: var(--ink-secondary);
  text-decoration: none;
  border-radius: var(--radius-md);
  font-weight: 500;
  font-size: 14px;
  transition: all 0.15s ease;
}

.nav-item:hover {
  color: var(--ink);
  background-color: var(--surface-hover);
}

.nav-item[aria-current="page"] {
  color: var(--accent);
  background: var(--accent-subtle);
  font-weight: 600;
}

.nav-icon {
  flex-shrink: 0;
  transition: transform 0.15s ease;
}

.nav-item:hover .nav-icon {
  transform: translateX(1px);
}

/* Nav Footer & Volume Control */
.nav-footer {
  display: grid;
  gap: 14px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.sidebar-volume-widget {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 8px 12px;
  border-radius: var(--radius-md);
}

.vol-icon {
  display: grid;
  place-items: center;
  color: var(--muted);
}

.sidebar-volume-widget input[type="range"] {
  flex: 1;
  min-width: 0;
  accent-color: var(--accent);
  cursor: pointer;
  height: 4px;
}

.vol-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-secondary);
  font-variant-numeric: tabular-nums;
  width: 28px;
  text-align: right;
}

.nav-caption {
  font-size: 11px;
  line-height: 1.4;
  color: var(--muted);
}

/* Main Outlet Content */
.page-content {
  padding: 36px clamp(20px, 4vw, 48px);
  min-width: 0;
  max-width: 1280px;
  width: 100%;
  margin: 0 auto;
}

.page-heading {
  margin-bottom: 28px;
}

.page-heading h1 {
  font-size: clamp(26px, 3.5vw, 34px);
  margin-top: 6px;
  margin-bottom: 8px;
}

.page-heading p {
  color: var(--ink-secondary);
  max-width: 680px;
  margin: 0;
  font-size: 15px;
}

/* ==========================================================================
   BUTTONS & CONTROLS
   ========================================================================== */

.button {
  min-height: 44px;
  padding: 0 18px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  font-weight: 600;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  transition: all 0.15s cubic-bezier(0.16, 1, 0.3, 1);
}

.button:hover {
  transform: translateY(-1px);
}

.button:active {
  transform: translateY(1px);
}

.button.primary {
  background: var(--accent);
  color: var(--accent-ink);
  box-shadow: 0 2px 8px rgba(229, 169, 60, 0.25);
}

.button.primary:hover {
  background: var(--accent-hover);
  box-shadow: 0 4px 14px rgba(229, 169, 60, 0.35);
}

.button.secondary {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--line);
}

.button.secondary:hover {
  background: var(--surface-hover);
  border-color: rgba(255, 255, 255, 0.15);
}

.button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.badge-subtle {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 9999px;
  background: var(--accent-subtle);
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.eyebrow {
  display: inline-block;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 6px;
}

/* ==========================================================================
   HOME PAGE: SIMPIA-INSPIRED FOCUS
   ========================================================================== */

.learning-path-hero {
  background: linear-gradient(180deg, rgba(28, 33, 50, 0.95), rgba(20, 24, 36, 0.95));
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  padding: 32px clamp(20px, 4vw, 40px);
  margin-bottom: 28px;
  box-shadow: var(--shadow-card);
}

.hero-tag {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 9999px;
  background: var(--accent-subtle);
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.learning-path-hero h2 {
  font-size: clamp(22px, 3.5vw, 30px);
  margin: 0 0 10px;
  letter-spacing: -0.02em;
}

.learning-path-hero p {
  color: var(--ink-secondary);
  font-size: 15px;
  max-width: 620px;
  margin-bottom: 24px;
}

/* Milestone Track */
.milestone-track {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 6px 0 16px;
  margin-bottom: 24px;
  scrollbar-width: thin;
}

.milestone-node {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  width: 130px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 14px 10px;
  color: var(--ink);
  transition: all 0.15s ease;
}

.milestone-node:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
}

.milestone-dot {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--surface-elevated);
  border: 2px solid var(--accent);
  color: var(--accent);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 12px;
  margin-bottom: 8px;
}

.milestone-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
}

.milestone-time {
  font-size: 11px;
  color: var(--muted);
  margin-top: 3px;
}

/* Today's Practice (Simpia Daily Routine) */
.daily-practice-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  padding: 24px clamp(18px, 3vw, 28px);
  margin-bottom: 28px;
  box-shadow: var(--shadow-card);
}

.daily-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
  flex-wrap: wrap;
  gap: 10px;
}

.daily-title-group h2 {
  margin: 0;
  font-size: 19px;
}

.daily-steps-list {
  display: grid;
  gap: 10px;
}

.daily-step-item {
  display: grid;
  grid-template-columns: 40px 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  background: var(--surface-subtle);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  transition: all 0.15s ease;
}

.daily-step-item:hover {
  border-color: rgba(229, 169, 60, 0.4);
  background: var(--surface-elevated);
}

.step-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  color: var(--accent);
}

.step-info strong {
  display: block;
  font-size: 14px;
  color: var(--ink);
}

.step-info span {
  display: block;
  font-size: 12px;
  color: var(--ink-secondary);
  margin-top: 2px;
}

.step-action-btn {
  min-height: 38px;
  padding: 0 16px;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 600;
  font-size: 13px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

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

/* Diagnostic Banner */
.diagnostic-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  margin-bottom: 28px;
  gap: 16px;
  flex-wrap: wrap;
}

.diagnostic-banner strong {
  display: block;
  color: var(--ink);
  font-size: 14px;
  margin-bottom: 4px;
}

.diagnostic-banner p {
  margin: 0;
  font-size: 13px;
  color: var(--ink-secondary);
}

/* Skill Radar Grid */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
  margin: 18px 0 28px;
}

.skill-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: border-color 0.15s ease;
}

.skill-card:hover {
  border-color: rgba(255, 255, 255, 0.15);
}

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

.skill-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 8px;
}

.skill-stars {
  color: var(--accent);
  font-size: 13px;
  letter-spacing: 2px;
}

.skill-bar-bg {
  height: 5px;
  background: var(--surface-subtle);
  border-radius: 9999px;
  overflow: hidden;
}

.skill-bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 9999px;
  transition: width 0.3s ease;
}

.skill-meta {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--muted);
}

/* Dashboard Columns */
.dashboard-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-top: 24px;
}

.learning-link {
  display: grid;
  grid-template-columns: 1fr auto;
  padding: 16px 0;
  gap: 6px;
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--line);
  transition: color 0.15s ease;
}

.learning-link strong {
  font-size: 15px;
  color: var(--ink);
  transition: color 0.15s ease;
}

.learning-link span {
  grid-column: 1;
  color: var(--ink-secondary);
  font-size: 13px;
}

.learning-link b {
  grid-column: 2;
  grid-row: 1 / 3;
  align-self: center;
  color: var(--muted);
  font-weight: 600;
  transition: all 0.15s ease;
}

.learning-link:hover strong {
  color: var(--accent);
}

.learning-link:hover b {
  color: var(--accent);
  transform: translateX(2px);
}

/* ==========================================================================
   PRACTICE STUDIO (/practice)
   ========================================================================== */

.practice-studio, .practice-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 28px;
  align-items: start;
}

.studio-workspace, .practice-main {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.studio-header, .heading-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  margin-bottom: 6px;
}

.studio-title-block h1 {
  margin: 4px 0 6px;
  font-size: clamp(24px, 3.5vw, 32px);
}

.lede {
  color: var(--ink-secondary);
  font-size: 14px;
  margin: 0;
}

/* Score Display */
.score-display, .score-orb {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 10px 18px;
  text-align: center;
  flex-shrink: 0;
}

.score-label {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: block;
}

.score-val strong, .score-orb strong {
  font-size: 26px;
  font-weight: 700;
  color: var(--accent);
  font-family: 'Plus Jakarta Sans', sans-serif;
  line-height: 1.1;
}

.score-val small, .score-orb span {
  font-size: 12px;
  color: var(--muted);
  margin-left: 2px;
}

/* Falling Notes Lane Card */
.lane-card {
  position: relative;
  min-height: 380px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: linear-gradient(180deg, #161926 0%, #0e1019 100%);
  box-shadow: var(--shadow-card);
}

.lane-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  color: var(--muted);
}

.lane-tag {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-secondary);
}

.beat-badge {
  background: var(--surface-elevated);
  padding: 2px 10px;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.note-lane {
  position: absolute;
  inset: 48px 0 76px;
  overflow: hidden;
}

.falling-note {
  position: absolute;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border: 2px solid var(--accent);
  border-radius: 12px;
  background: rgba(229, 169, 60, 0.15);
  color: var(--accent);
  font-weight: 700;
  font-size: 13px;
  transform: translate(-50%, 0);
  transition: top 0.2s ease, opacity 0.2s;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.falling-note.current {
  box-shadow: 0 0 0 3px rgba(229, 169, 60, 0.3), 0 4px 16px rgba(229, 169, 60, 0.4);
  background: rgba(229, 169, 60, 0.25);
}

.falling-note.done {
  opacity: 0.3;
  border-color: var(--muted);
  color: var(--muted);
}

.hit-line {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 76px;
  border-top: 2px solid var(--accent);
  opacity: 0.8;
}

/* Tactical Virtual Mini-Keyboard */
.mini-keyboard {
  position: absolute;
  display: flex;
  bottom: 0;
  left: 0;
  right: 0;
  height: 76px;
  padding: 0 16px;
  gap: 2px;
  background: #090a12;
  border-top: 1px solid var(--line);
}

.mini-key {
  flex: 1;
  border: 1px solid #cbd5e1;
  border-top: 0;
  border-radius: 0 0 5px 5px;
  background: #f8fafc;
  color: #1e293b;
  position: relative;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3), inset 0 -2px 0 #94a3b8;
  transition: background 0.08s ease, transform 0.08s ease;
}

.mini-key.black {
  position: absolute;
  z-index: 2;
  width: 6.8%;
  height: 46px;
  background: #1e2230;
  border: 1px solid #0f1118;
  border-radius: 0 0 4px 4px;
  color: transparent;
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.5), inset 0 -2px 0 #000;
}

.mini-key.active, .mini-key.playing-active {
  background: var(--accent) !important;
  transform: translateY(2px);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Controls Toolbar */
.controls-toolbar, .controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  padding: 8px 0;
}

.main-actions {
  display: flex;
  gap: 10px;
}

.tempo-control {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--ink-secondary);
}

.tempo-control output {
  font-weight: 700;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.tempo-control input[type="range"] {
  width: 130px;
  accent-color: var(--accent);
}

/* Studio Sidebar */
.studio-sidebar, .sidebar {
  display: grid;
  gap: 14px;
}

.panel, .progress-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 18px;
}

.panel-title {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  padding: 3px;
  gap: 2px;
  border-radius: var(--radius-sm);
  background: var(--surface-subtle);
  border: 1px solid var(--line);
}

.segmented button {
  min-height: 36px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ink-secondary);
  font-size: 12px;
  font-weight: 600;
  transition: all 0.15s ease;
}

.segmented button.selected {
  background: var(--surface-elevated);
  color: var(--ink);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

.settings-list {
  display: grid;
  gap: 10px;
}

.setting {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 48px;
  gap: 14px;
  cursor: pointer;
}

.setting b {
  display: block;
  font-size: 13px;
  color: var(--ink);
}

.setting input[type="checkbox"] {
  width: 38px;
  height: 22px;
  appearance: none;
  border-radius: 20px;
  background: #252a3d;
  cursor: pointer;
  position: relative;
  transition: background 0.2s ease;
}

.setting input[type="checkbox"]:checked {
  background: var(--accent);
}

.setting input[type="checkbox"]::before {
  content: '';
  display: block;
  width: 16px;
  height: 16px;
  margin: 3px;
  border-radius: 50%;
  background: #ffffff;
  transition: transform 0.2s ease;
}

.setting input[type="checkbox"]:checked::before {
  transform: translateX(16px);
  background: var(--accent-ink);
}

.device-button {
  display: grid;
  grid-template-columns: 40px 1fr auto;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 52px;
  padding: 8px 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: none;
  color: var(--ink);
  text-align: left;
  transition: opacity 0.15s ease;
}

.device-button:hover {
  opacity: 0.85;
}

.device-icon {
  width: 38px;
  height: 30px;
  border-radius: 6px;
  background: #212638;
  color: var(--violet);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 10px;
}

.device-icon.mic {
  color: var(--accent);
}

.device-button b {
  display: block;
  font-size: 13px;
}

.device-arrow {
  color: var(--muted);
  font-size: 16px;
}

.import-link {
  margin-top: 10px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--accent);
  font-size: 12px;
  text-decoration: underline;
  cursor: pointer;
}

.progress-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  font-size: 13px;
}

.progress-track {
  height: 6px;
  border-radius: 9999px;
  background: var(--surface-subtle);
  overflow: hidden;
  margin-bottom: 8px;
}

.progress-track span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--accent);
  border-radius: inherit;
  transition: width 0.3s ease;
}

/* ==========================================================================
   PRACTICE HUB TABS & EXERCISE CARDS
   ========================================================================== */

.practice-hub-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 0 16px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--line);
  scrollbar-width: thin;
}

.practice-tab-btn {
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--ink-secondary);
  font-size: 13px;
  font-weight: 600;
  padding: 10px 18px;
  border-radius: var(--radius-md);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.practice-tab-btn:hover {
  border-color: rgba(255, 255, 255, 0.2);
  color: var(--ink);
}

.practice-tab-btn.active {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
  font-weight: 700;
}

.drill-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-card);
}

.drill-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
  flex-wrap: wrap;
  gap: 12px;
}

.drill-selector {
  background: var(--surface-elevated);
  border: 1px solid var(--line);
  color: var(--ink);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
}

/* Rhythm Tapper: Tactile Pad (No ugly dashed purple!) */
.rhythm-tap-target {
  width: 100%;
  min-height: 120px;
  background: linear-gradient(180deg, #181d2e 0%, #121522 100%);
  border: 2px solid rgba(229, 169, 60, 0.35);
  border-radius: var(--radius-xl);
  color: #ffffff;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 24px;
  transition: all 0.1s ease;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 8px 24px rgba(0, 0, 0, 0.4);
  user-select: none;
}

.rhythm-tap-target:active {
  transform: scale(0.99);
  border-color: var(--accent);
  background: linear-gradient(180deg, #20273d 0%, #171b2a 100%);
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.5);
}

.tap-feedback {
  font-size: 14px;
  font-weight: 600;
  padding: 8px 18px;
  border-radius: 9999px;
  margin-top: 14px;
  display: inline-block;
}

.tap-feedback.perfect {
  background: var(--success-subtle);
  color: var(--success);
  border: 1px solid var(--success);
}

.tap-feedback.early {
  background: var(--warning-subtle);
  color: var(--warning);
  border: 1px solid var(--warning);
}

.tap-feedback.late {
  background: rgba(249, 115, 22, 0.12);
  color: #f97316;
  border: 1px solid #f97316;
}

.tap-feedback.missed {
  background: var(--error-subtle);
  color: var(--error);
  border: 1px solid var(--error);
}

/* Repertoire Cards Grid */
.repertoire-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.repertoire-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all 0.15s ease;
  box-shadow: var(--shadow-card);
}

.repertoire-card:hover {
  transform: translateY(-2px);
  border-color: rgba(229, 169, 60, 0.4);
  box-shadow: var(--shadow-elevated);
}

.repertoire-card.selected {
  border-color: var(--accent) !important;
  background: rgba(229, 169, 60, 0.05) !important;
}

/* Virtual Instructor Stage */
.virtual-instructor-stage {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  padding: 28px;
  margin-bottom: 28px;
  box-shadow: var(--shadow-card);
}

/* Key Illumination (See + Hear + Play) */
.playing-active, rect[data-midi].playing-active {
  fill: #fde047 !important;
  stroke: #ffffff !important;
  transition: fill 0.05s ease-out !important;
}

/* Theory to Practice Bridge Card */
.practice-bridge-card {
  margin-top: 24px;
  background: var(--surface-elevated);
  border: 1px solid var(--accent);
  border-radius: var(--radius-lg);
  padding: 22px;
  text-align: left;
}

.practice-bridge-card .bridge-tag {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--accent);
  text-transform: uppercase;
  margin-bottom: 6px;
}

/* ==========================================================================
   LESSON PLAYER & STEP-BY-STEP PROGRESSION
   ========================================================================== */

.lesson-container {
  max-width: 820px;
  margin: 0 auto;
}

.lesson-nav-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  font-size: 14px;
}

.lesson-nav-bar a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
}

.lesson-stepper-header {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  margin-bottom: 24px;
}

.lesson-stepper-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 12px;
}

.lesson-stepper-meta strong {
  color: var(--ink);
  font-size: 15px;
}

.step-progress-bar {
  height: 6px;
  background: var(--surface-subtle);
  border-radius: 9999px;
  overflow: hidden;
  margin-bottom: 14px;
}

.step-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #e5a93c, #10b981);
  border-radius: 9999px;
  transition: width 0.3s ease;
}

.lesson-step-pills {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: thin;
}

.step-pill-btn {
  background: var(--surface-subtle);
  border: 1px solid var(--line);
  color: var(--ink-secondary);
  font-size: 12px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 9999px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.step-pill-btn:hover {
  border-color: var(--accent);
  color: var(--ink);
}

.step-pill-btn.active {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
  font-weight: 700;
}

.step-pill-btn.done {
  background: var(--surface-elevated);
  color: var(--ink);
  border-color: rgba(255, 255, 255, 0.12);
}

.step-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  padding: 28px;
  margin-bottom: 24px;
  min-height: 280px;
  box-shadow: var(--shadow-card);
}

.step-nav-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  flex-wrap: wrap;
}

/* Objective Box */
.objective-box {
  background: var(--surface-subtle);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  margin-bottom: 24px;
}

.objective-box strong {
  color: var(--accent);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  display: block;
  margin-bottom: 4px;
}

.objective-box p {
  margin: 0;
  font-size: 14px;
  color: var(--ink);
}

.prereq-tag {
  font-size: 12px;
  color: var(--muted);
  margin-top: 6px;
}

.prereq-tag a {
  color: var(--accent);
  text-decoration: underline;
}

.lesson-reading {
  font-size: 16px;
  line-height: 1.7;
  color: #e2e8f0;
  margin-bottom: 24px;
}

.theory-figure {
  margin: 20px 0;
  padding: 24px;
  background: #0d101b;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  display: flex;
  justify-content: center;
  align-items: center;
  overflow-x: auto;
}

.theory-figure svg {
  display: block;
  max-width: 100%;
  height: auto;
}

.interactive-key {
  cursor: pointer;
  transition: opacity 0.1s ease, transform 0.1s ease;
}

.interactive-key:hover rect {
  opacity: 0.88;
}

.interactive-key:active {
  transform: scaleY(0.98);
}

/* Audio Player Bar */
.audio-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 20px 0;
  padding: 14px 18px;
  background: var(--surface-subtle);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}

.audio-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 18px;
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.audio-button:hover {
  background: var(--accent-hover);
}

.audio-hint {
  font-size: 13px;
  color: var(--muted);
}

/* Try Box & Interactive Micro-Practice */
.try-box {
  margin: 24px 0;
  padding: 22px;
  background: var(--surface-subtle);
  border: 1px solid rgba(229, 169, 60, 0.35);
  border-radius: var(--radius-lg);
}

.try-box h3 {
  margin: 0 0 10px;
  font-size: 15px;
  color: var(--accent);
}

.try-feedback {
  min-height: 24px;
  margin-top: 14px;
  font-size: 14px;
  font-weight: 600;
  color: var(--success);
}

.try-feedback.error {
  color: var(--warning);
}

/* Recall Box */
.recall-box {
  margin: 20px 0;
  padding: 18px 20px;
  background: var(--surface-subtle);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}

.recall-box h4 {
  margin: 0 0 6px;
  font-size: 13px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.recall-box p {
  margin: 0 0 10px;
  font-size: 14px;
  color: var(--ink);
}

.recall-box details {
  font-size: 13px;
  color: var(--muted);
  cursor: pointer;
}

.recall-box summary {
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 4px;
}

/* Theory Choice Buttons (Quiz) */
.theory-choices {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin: 18px 0;
}

.theory-choice {
  min-height: 48px;
  padding: 12px 18px;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-subtle);
  color: var(--ink);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.theory-choice:hover:not(:disabled) {
  border-color: var(--accent);
  background: var(--surface-elevated);
}

.theory-choice:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.status-feedback {
  margin: 14px 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  background: var(--surface-subtle);
}

.status-feedback.correct {
  border: 1px solid var(--success);
  background: var(--success-subtle);
}

.status-feedback.incorrect {
  border: 1px solid var(--error);
  background: var(--error-subtle);
}

/* Posture Comparisons (Level 0) */
.posture-section {
  margin: 20px 0;
}

.posture-group {
  margin-bottom: 24px;
}

.posture-group-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 12px;
}

.posture-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.posture-card {
  border-radius: var(--radius-md);
  padding: 16px;
  font-size: 13px;
  line-height: 1.5;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.posture-card.bad {
  background: var(--error-subtle);
  border: 1px solid rgba(244, 63, 94, 0.4);
  color: #fecdd3;
}

.posture-card.good {
  background: var(--success-subtle);
  border: 1.5px solid var(--success);
  color: #d1fae5;
}

.posture-card strong {
  font-size: 13px;
  display: block;
}

.technique-box {
  background: var(--surface-subtle);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  margin: 20px 0;
}

.technique-box h4 {
  margin: 0 0 10px;
  color: var(--success);
  font-size: 14px;
}

.technique-list {
  margin: 0;
  padding-left: 20px;
  font-size: 14px;
  color: var(--ink-secondary);
  line-height: 1.6;
}

.technique-list li {
  margin-bottom: 6px;
}

.continue-panel {
  padding: 28px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  margin-bottom: 32px;
  box-shadow: var(--shadow-card);
}

/* ==========================================================================
   RESPONSIVE DESIGN (320px, 375px, 768px, 1024px, 1440px)
   ========================================================================== */

@media (max-width: 860px) {
  .app-layout {
    display: block;
  }

  /* Mobile Bottom Navigation Bar */
  .app-nav {
    height: auto;
    position: fixed;
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: rgba(12, 14, 23, 0.95);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    padding: 6px 12px calc(6px + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid var(--line);
    border-right: none;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.4);
  }

  .app-nav .brand, .app-nav .nav-footer {
    display: none;
  }

  .app-nav nav {
    display: flex;
    margin: 0;
    justify-content: space-around;
    gap: 4px;
  }

  .nav-item {
    flex-direction: column;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    min-height: 48px;
  }

  .nav-icon {
    width: 20px;
    height: 20px;
  }

  .page-content {
    padding: 24px 16px calc(80px + env(safe-area-inset-bottom, 0px));
  }

  .practice-studio, .practice-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .dashboard-columns {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .repertoire-cards-grid {
    grid-template-columns: 1fr !important;
  }

  .virtual-instructor-stage {
    padding: 16px !important;
  }
}

@media (max-width: 560px) {
  .heading-row, .studio-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .score-display, .score-orb {
    align-self: flex-start;
  }

  .controls-toolbar, .controls {
    flex-direction: column;
    align-items: stretch;
  }

  .main-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .tempo-control {
    justify-content: space-between;
  }

  .tempo-control input[type="range"] {
    flex: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}

/* ==========================================================================
   GLOBAL FLOATING MINI AUDIO PLAYER BAR
   ========================================================================== */
.global-mini-audio-bar {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  width: min(680px, calc(100vw - 32px));
  background: rgba(20, 24, 38, 0.94);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1.5px solid var(--accent);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.5), 0 0 20px rgba(200, 255, 98, 0.15);
  border-radius: 16px;
  padding: 12px 18px;
  z-index: 1000;
  animation: slideUpMini 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUpMini {
  from {
    transform: translate(-50%, 40px);
    opacity: 0;
  }
  to {
    transform: translate(-50%, 0);
    opacity: 1;
  }
}

.mini-bar-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.mini-bar-info {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 170px;
}

.mini-bar-icon {
  font-size: 20px;
  animation: pulseIcon 1.5s infinite ease-in-out;
}

@keyframes pulseIcon {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15); }
}

.mini-bar-text {
  display: flex;
  flex-direction: column;
}

.mini-bar-text strong {
  font-size: 13.5px;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 220px;
}

.mini-bar-text span {
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.mini-bar-progress {
  flex: 2;
  min-width: 120px;
}

.mini-bar-progress-track {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  overflow: hidden;
}

.mini-bar-progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 4px;
  transition: width 0.08s linear;
}

.mini-bar-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mini-ctrl-btn {
  padding: 6px 14px !important;
  font-size: 12.5px !important;
  white-space: nowrap;
}

/* Audio Player Box inside Lessons & Drills */
.lesson-audio-controls {
  margin-top: 14px;
  background: rgba(14, 16, 26, 0.7);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 18px;
}

.audio-btn-row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.audio-track-progress {
  margin-top: 12px;
}

.audio-track-progress-info {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  margin-bottom: 6px;
}

.audio-track-progress-bar {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  overflow: hidden;
}

.audio-track-progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 4px;
  transition: width 0.08s linear;
}
