/* ==========================================================================
   OmniEnglish AI V9.0 — 4-Skin Apple Editorial & Mobile-First Design System
   Skins: editorial-light (Default) | dark-aurora | warm-paper | exam-contrast
   ========================================================================== */

:root,
html.skin-editorial-light {
  --font-serif: 'Newsreader', 'Georgia', 'Times New Roman', serif;
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  /* 1. Apple Editorial Light (Default) */
  --bg-canvas: #FFFFFF;
  --bg-elevated: rgba(247, 248, 250, 0.94);
  --bg-elevated-solid: #FFFFFF;
  --bg-subtle: #F7F8FA;
  --bg-hover: rgba(15, 17, 21, 0.045);
  --bg-sidebar: rgba(250, 251, 252, 0.96);
  --bg-topbar: rgba(255, 255, 255, 0.88);
  --bg-input: #FFFFFF;

  --border-glass: #E5E7EB;
  --border-strong: #D1D5DB;
  --border-accent: rgba(79, 70, 229, 0.42);

  --text-primary: #0F1115;
  --text-secondary: #374151;
  --text-muted: #6B7280;

  --accent-indigo: #4F46E5;
  --accent-violet: #7C3AED;
  --accent-cyan: #0284C7;
  --accent-emerald: #059669;
  --accent-amber: #D97706;
  --accent-rose: #E11D48;

  --shadow-card: 0 1px 3px rgba(15, 17, 21, 0.04), 0 10px 28px -10px rgba(15, 17, 21, 0.06);
  --shadow-modal: 0 24px 64px -12px rgba(15, 17, 21, 0.18);

  --heat-0: #EBEDF0;
  --heat-1: #A7F3D0;
  --heat-2: #34D399;
  --heat-3: #10B981;
  --heat-4: #047857;
}

/* 2. Deep Obsidian Aurora */
html.skin-dark-aurora {
  --bg-canvas: #070B14;
  --bg-elevated: rgba(17, 24, 39, 0.76);
  --bg-elevated-solid: #111827;
  --bg-subtle: rgba(30, 41, 59, 0.56);
  --bg-hover: rgba(99, 102, 241, 0.13);
  --bg-sidebar: rgba(10, 15, 28, 0.88);
  --bg-topbar: rgba(7, 11, 20, 0.82);
  --bg-input: rgba(15, 23, 42, 0.85);

  --border-glass: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.18);
  --border-accent: rgba(99, 102, 241, 0.5);

  --text-primary: #F8FAFC;
  --text-secondary: #CBD5E1;
  --text-muted: #94A3B8;

  --accent-indigo: #6366F1;
  --accent-violet: #8B5CF6;
  --accent-cyan: #06B6D4;
  --accent-emerald: #10B981;
  --accent-amber: #F59E0B;
  --accent-rose: #F43F5E;

  --shadow-card: 0 12px 36px -8px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  --shadow-modal: 0 24px 64px -12px rgba(0, 0, 0, 0.78);

  --heat-0: rgba(30, 41, 59, 0.65);
  --heat-1: rgba(16, 185, 129, 0.25);
  --heat-2: rgba(16, 185, 129, 0.48);
  --heat-3: rgba(16, 185, 129, 0.74);
  --heat-4: #10B981;
}

/* 3. Kindle Warm Paper */
html.skin-warm-paper {
  --bg-canvas: #FBF7EE;
  --bg-elevated: rgba(244, 236, 220, 0.94);
  --bg-elevated-solid: #FFFDF8;
  --bg-subtle: #F2E8D5;
  --bg-hover: rgba(120, 82, 48, 0.08);
  --bg-sidebar: rgba(247, 240, 226, 0.97);
  --bg-topbar: rgba(251, 247, 238, 0.92);
  --bg-input: #FFFDF9;

  --border-glass: #E4D6BC;
  --border-strong: #CEBC9D;
  --border-accent: rgba(180, 83, 9, 0.45);

  --text-primary: #2B2118;
  --text-secondary: #4E3E2E;
  --text-muted: #7C6855;

  --accent-indigo: #9A3412;
  --accent-violet: #7C2D12;
  --accent-cyan: #0E7490;
  --accent-emerald: #15803D;
  --accent-amber: #B45309;
  --accent-rose: #BE123C;

  --shadow-card: 0 2px 8px rgba(43, 33, 24, 0.05), 0 8px 24px -10px rgba(43, 33, 24, 0.08);
  --shadow-modal: 0 24px 60px rgba(43, 33, 24, 0.22);

  --heat-0: #EAE0CD;
  --heat-1: #BBF7D0;
  --heat-2: #4ADE80;
  --heat-3: #16A34A;
  --heat-4: #166534;
}

/* 4. Official IDP / BC Exam High-Contrast */
html.skin-exam-contrast {
  --bg-canvas: #FFFFFF;
  --bg-elevated: #F8FAFC;
  --bg-elevated-solid: #FFFFFF;
  --bg-subtle: #EFF3F8;
  --bg-hover: rgba(11, 61, 145, 0.08);
  --bg-sidebar: #F1F5F9;
  --bg-topbar: #FFFFFF;
  --bg-input: #FFFFFF;

  --border-glass: #94A3B8;
  --border-strong: #475569;
  --border-accent: #0B3D91;

  --text-primary: #000000;
  --text-secondary: #1E293B;
  --text-muted: #475569;

  --accent-indigo: #0B3D91;
  --accent-violet: #1D4ED8;
  --accent-cyan: #0369A1;
  --accent-emerald: #047857;
  --accent-amber: #B45309;
  --accent-rose: #B91C1C;

  --shadow-card: 0 1px 0 #CBD5E1;
  --shadow-modal: 0 18px 48px rgba(0, 0, 0, 0.28);

  --heat-0: #E2E8F0;
  --heat-1: #93C5FD;
  --heat-2: #3B82F6;
  --heat-3: #1D4ED8;
  --heat-4: #0B3D91;
}

/* WCAG AA Contrast Boosts for ALL 3 Light Skins */
html:not(.skin-dark-aurora) .text-amber-400 { color: #B45309 !important; }
html:not(.skin-dark-aurora) .text-emerald-400 { color: #047857 !important; }
html:not(.skin-dark-aurora) .text-emerald-300 { color: #065F46 !important; }
html:not(.skin-dark-aurora) .text-indigo-400 { color: #4338CA !important; }
html:not(.skin-dark-aurora) .text-indigo-300 { color: #3730A3 !important; }
html:not(.skin-dark-aurora) .text-cyan-400 { color: #0369A1 !important; }
html:not(.skin-dark-aurora) .text-rose-400 { color: #BE123C !important; }
html:not(.skin-dark-aurora) .text-violet-400 { color: #6D28D9 !important; }

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

html, body {
  margin: 0;
  padding: 0;
  min-height: 100dvh;
  font-family: var(--font-sans);
  background-color: var(--bg-canvas);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

.font-serif-editorial {
  font-family: var(--font-serif);
}

.font-mono {
  font-family: var(--font-mono);
}

/* Ambient Aurora & Editorial Light Backdrop */
.aurora-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
  transition: opacity 0.35s ease;
}

html.skin-editorial-light .aurora-bg { opacity: 0.14; }
html.skin-warm-paper .aurora-bg { opacity: 0.10; }
html.skin-exam-contrast .aurora-bg { opacity: 0; }
html.skin-dark-aurora .aurora-bg { opacity: 0.95; }

.aurora-blob {
  position: absolute;
  border-radius: 9999px;
  filter: blur(110px);
  opacity: 0.4;
}

.aurora-blob-1 {
  width: 520px;
  height: 520px;
  top: -160px;
  left: -120px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.42), transparent 70%);
}

.aurora-blob-2 {
  width: 480px;
  height: 480px;
  top: 10%;
  right: -140px;
  background: radial-gradient(circle, rgba(6, 182, 212, 0.28), transparent 70%);
}

.aurora-blob-3 {
  width: 560px;
  height: 560px;
  bottom: -220px;
  left: 35%;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.22), transparent 70%);
}

/* Hero Floating Particles Layer */
#hero-particles {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  opacity: 0.65;
}

/* Editorial Interactive Vocabulary Pills */
.editorial-word {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 1px 8px;
  margin: 0 1px;
  border-radius: 999px;
  font-weight: 700;
  font-style: normal;
  background: rgba(79, 70, 229, 0.09);
  color: var(--accent-indigo);
  border: 1px solid rgba(79, 70, 229, 0.24);
  cursor: pointer;
  transition: transform 0.14s ease, background-color 0.14s ease, box-shadow 0.14s ease;
  white-space: nowrap;
}

.editorial-word:hover {
  transform: translateY(-1px);
  background: rgba(79, 70, 229, 0.18);
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.16);
}

html.skin-dark-aurora .editorial-word {
  background: rgba(99, 102, 241, 0.2);
  color: #C7D2FE;
  border-color: rgba(129, 140, 248, 0.4);
}

/* Glass & Editorial Cards */
.glass-card {
  background: var(--bg-elevated);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-glass);
  box-shadow: var(--shadow-card);
  border-radius: 18px;
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

html.skin-editorial-light .glass-card {
  background: #FFFFFF;
}

html.skin-exam-contrast .glass-card {
  border-radius: 10px;
  backdrop-filter: none;
}

.glass-card-interactive:hover {
  border-color: var(--border-accent);
  transform: translateY(-2px);
}

.surface-subtle {
  background: var(--bg-subtle);
  border: 1px solid var(--border-glass);
}

.studio-input {
  background: var(--bg-input);
  border: 1px solid var(--border-strong);
  color: var(--text-primary);
  border-radius: 12px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.studio-input:focus {
  outline: none;
  border-color: var(--accent-indigo);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.16);
}

.studio-input::placeholder {
  color: var(--text-muted);
}

.text-theme-primary { color: var(--text-primary); }
.text-theme-secondary { color: var(--text-secondary); }
.text-theme-muted { color: var(--text-muted); }

/* Sidebar Layout */
.studio-sidebar {
  width: 248px;
  left: 0;
  padding-left: 14px;
  padding-right: 12px;
  overflow-x: hidden;
  box-sizing: border-box;
  background: var(--bg-sidebar);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-right: 1px solid var(--border-glass);
  transition: width 0.25s cubic-bezier(0.16, 1, 0.3, 1), transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 40;
}

.studio-sidebar.collapsed {
  width: 74px;
}

.studio-sidebar.collapsed .sidebar-label,
.studio-sidebar.collapsed .sidebar-brand-text,
.studio-sidebar.collapsed .sidebar-section-title,
.studio-sidebar.collapsed .sidebar-footer-card {
  display: none;
}

.studio-sidebar.collapsed .nav-item {
  justify-content: center;
  padding-left: 0;
  padding-right: 0;
}

.sidebar-active-pill {
  position: absolute;
  left: 8px;
  right: 8px;
  top: 0;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.13), rgba(59, 130, 246, 0.08));
  border: 1px solid rgba(79, 70, 229, 0.28);
  box-shadow: 0 6px 18px -8px rgba(79, 70, 229, 0.28);
  pointer-events: none;
  z-index: 0;
  transition: transform 0.36s cubic-bezier(0.22, 1, 0.36, 1), height 0.24s ease, opacity 0.2s ease;
  opacity: 0;
}

html.skin-dark-aurora .sidebar-active-pill {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.26), rgba(6, 182, 212, 0.14));
  border-color: rgba(129, 140, 248, 0.45);
}

.studio-sidebar.collapsed .sidebar-active-pill {
  left: 6px;
  right: 6px;
}

.nav-item {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 12px;
  border-radius: 12px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-secondary);
  border: 1px solid transparent;
  transition: transform 0.22s cubic-bezier(0.22, 1, 0.36, 1), color 0.18s ease, background 0.18s ease;
  cursor: pointer;
  white-space: nowrap;
  overflow: visible;
  width: 100%;
  text-align: left;
  background: transparent;
}

.nav-item svg {
  transition: transform 0.24s cubic-bezier(0.22, 1, 0.36, 1), filter 0.24s ease;
}

.nav-item:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  transform: translateX(4px);
}

.nav-item:hover svg {
  transform: scale(1.16) translateY(-1px);
  filter: drop-shadow(0 0 6px rgba(99, 102, 241, 0.35));
}

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

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 3px;
  border-radius: 9999px;
  background: linear-gradient(180deg, #4F46E5, #0EA5E9);
}

html.skin-dark-aurora .nav-item.active {
  color: #FFFFFF;
}

/* Topbar */
.studio-topbar {
  background: var(--bg-topbar);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-glass);
  z-index: 30;
}

/* Mobile 5-Tab Bottom Navigation Bar */
.mobile-bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 42;
  background: var(--bg-topbar);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  border-top: 1px solid var(--border-glass);
  padding-bottom: max(6px, env(safe-area-inset-bottom));
  padding-top: 6px;
  box-shadow: 0 -8px 28px rgba(15, 17, 21, 0.08);
}

body.keyboard-open .mobile-bottom-nav {
  display: none !important;
}

.mobile-tab-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  padding: 4px 2px;
  border-radius: 12px;
  transition: color 0.16s ease, transform 0.14s ease;
  white-space: nowrap;
}

.mobile-tab-btn.active {
  color: var(--accent-indigo);
}

.mobile-tab-btn:active {
  transform: scale(0.94);
}

@media (max-width: 767px) {
  #main-content {
    padding-bottom: calc(82px + env(safe-area-inset-bottom));
  }
  #toast-container {
    bottom: calc(76px + env(safe-area-inset-bottom));
  }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.34);
  border-radius: 999px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(148, 163, 184, 0.54);
}

/* Clickable English Words (.word-clickable) */
.word-clickable {
  cursor: pointer;
  border-radius: 4px;
  padding: 0 1px;
  transition: background-color 0.14s ease, color 0.14s ease;
  display: inline;
}

.word-clickable:hover {
  background-color: rgba(79, 70, 229, 0.14);
  color: #3730A3;
  text-decoration: underline;
  text-decoration-style: dotted;
  text-underline-offset: 3px;
}

html.skin-dark-aurora .word-clickable:hover {
  background-color: rgba(99, 102, 241, 0.24);
  color: #A5B4FC;
}

/* CEFR & Status Badges */
.badge-cefr {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  line-height: 1.4;
  white-space: nowrap;
}

.cefr-A1, .cefr-A2 {
  background: #ECFDF5;
  color: #047857;
  border: 1px solid #A7F3D0;
}
html.skin-dark-aurora .cefr-A1, html.skin-dark-aurora .cefr-A2 {
  background: rgba(16, 185, 129, 0.16);
  color: #34D399;
  border-color: rgba(16, 185, 129, 0.32);
}

.cefr-B1, .cefr-B2 {
  background: #EEF2FF;
  color: #3730A3;
  border: 1px solid #C7D2FE;
}
html.skin-dark-aurora .cefr-B1, html.skin-dark-aurora .cefr-B2 {
  background: rgba(99, 102, 241, 0.18);
  color: #A5B4FC;
  border-color: rgba(99, 102, 241, 0.35);
}

.cefr-C1, .cefr-C2 {
  background: #FFFBEB;
  color: #B45309;
  border: 1px solid #FDE68A;
}
html.skin-dark-aurora .cefr-C1, html.skin-dark-aurora .cefr-C2 {
  background: rgba(245, 158, 11, 0.18);
  color: #FBBF24;
  border-color: rgba(245, 158, 11, 0.35);
}

/* 3D Flashcard + Tinder Swipe Mechanics */
.flashcard-scene {
  perspective: 1400px;
  touch-action: pan-y;
  user-select: none;
}

.flashcard-inner {
  position: relative;
  width: 100%;
  min-height: 310px;
  transform-style: preserve-3d;
  transition: transform 0.56s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform;
}

.flashcard-inner.is-dragging {
  transition: none !important;
}

.flashcard-inner.is-flipped {
  transform: rotateY(180deg);
}

.flashcard-face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: 20px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 28px;
}

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

.swipe-stamp {
  position: absolute;
  top: 18px;
  padding: 5px 12px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-width: 2px;
  opacity: 0;
  pointer-events: none;
  z-index: 5;
  white-space: nowrap;
}

.swipe-stamp-like {
  left: 18px;
  color: #059669;
  border-color: #10B981;
  background: rgba(16, 185, 129, 0.14);
  transform: rotate(-10deg);
}

.swipe-stamp-nope {
  right: 18px;
  color: #E11D48;
  border-color: #F43F5E;
  background: rgba(244, 63, 94, 0.14);
  transform: rotate(10deg);
}

/* Reading Passage Highlights */
.hl-yellow {
  background-color: #FEF08A;
  color: #1E293B;
  border-bottom: 2px solid #EAB308;
  border-radius: 3px;
  padding: 0 2px;
}
html.skin-dark-aurora .hl-yellow {
  background-color: rgba(250, 204, 21, 0.35);
  color: inherit;
}

.hl-green {
  background-color: #BBF7D0;
  color: #064E3B;
  border-bottom: 2px solid #10B981;
  border-radius: 3px;
  padding: 0 2px;
}
html.skin-dark-aurora .hl-green {
  background-color: rgba(16, 185, 129, 0.28);
  color: inherit;
}

.hl-pink {
  background-color: #FECDD3;
  color: #881337;
  border-bottom: 2px solid #F43F5E;
  border-radius: 3px;
  padding: 0 2px;
}
html.skin-dark-aurora .hl-pink {
  background-color: rgba(244, 63, 94, 0.26);
  color: inherit;
}

/* Red-pen Error Underline */
.red-pen-error {
  text-decoration: underline wavy #F43F5E;
  text-underline-offset: 4px;
  background: rgba(244, 63, 94, 0.14);
  border-radius: 4px;
  padding: 0 2px;
  cursor: help;
}

/* Heatmap Grid */
.heatmap-cell {
  width: 13px;
  height: 13px;
  border-radius: 3px;
  transition: transform 0.15s ease;
}
.heatmap-cell:hover {
  transform: scale(1.3);
  outline: 1.5px solid var(--text-primary);
}
.heat-0 { background: var(--heat-0); }
.heat-1 { background: var(--heat-1); }
.heat-2 { background: var(--heat-2); }
.heat-3 { background: var(--heat-3); }
.heat-4 { background: var(--heat-4); }

/* Karaoke Shadowing Word States */
.shadow-word {
  display: inline-block;
  padding: 2px 6px;
  margin: 2px;
  border-radius: 8px;
  font-weight: 600;
  transition: all 0.2s ease;
}
.shadow-match {
  background: #D1FAE5;
  color: #065F46;
  border: 1px solid #6EE7B7;
}
html.skin-dark-aurora .shadow-match {
  background: rgba(16, 185, 129, 0.22);
  color: #34D399;
  border-color: rgba(16, 185, 129, 0.45);
}
.shadow-close {
  background: #FEF3C7;
  color: #92400E;
  border: 1px solid #FCD34D;
}
html.skin-dark-aurora .shadow-close {
  background: rgba(245, 158, 11, 0.22);
  color: #FBBF24;
  border-color: rgba(245, 158, 11, 0.45);
}
.shadow-miss {
  background: #FFE4E6;
  color: #9F1239;
  border: 1px solid #FDA4AF;
}
html.skin-dark-aurora .shadow-miss {
  background: rgba(244, 63, 94, 0.22);
  color: #FB7185;
  border-color: rgba(244, 63, 94, 0.45);
}

/* Primary Gradient Button */
.btn-primary-gradient {
  background: linear-gradient(135deg, #4F46E5 0%, #6366F1 55%, #0284C7 100%);
  color: #FFFFFF;
  font-weight: 600;
  border-radius: 12px;
  box-shadow: 0 8px 20px -6px rgba(79, 70, 229, 0.42);
  transition: transform 0.15s ease, filter 0.15s ease, box-shadow 0.15s ease;
}
html.skin-exam-contrast .btn-primary-gradient {
  background: #0B3D91;
  box-shadow: none;
}
html.skin-warm-paper .btn-primary-gradient {
  background: linear-gradient(135deg, #9A3412 0%, #B45309 100%);
  box-shadow: 0 8px 18px -6px rgba(154, 52, 18, 0.38);
}
.btn-primary-gradient:hover {
  filter: brightness(1.06);
  transform: translateY(-1px);
}
.btn-primary-gradient:active {
  transform: translateY(0);
}

/* Split Screen Resizer */
.cbt-split-pane {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

@media (max-width: 1023px) {
  .cbt-split-pane {
    grid-template-columns: 1fr;
  }
  .studio-sidebar {
    position: fixed !important;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 50 !important;
    transform: translateX(-100%);
    pointer-events: none;
  }
  .studio-sidebar.mobile-open {
    transform: translateX(0);
    pointer-events: auto;
  }
}

/* Pill Tabs */
.pill-tab {
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  border: 1px solid var(--border-glass);
  background: var(--bg-subtle);
  color: var(--text-secondary);
  transition: all 0.16s ease;
  cursor: pointer;
}
.pill-tab:hover {
  border-color: var(--border-accent);
  color: var(--text-primary);
}
.pill-tab.active {
  background: var(--accent-indigo);
  color: #FFFFFF;
  border-color: var(--accent-indigo);
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.25);
}

/* Modal Backdrop */
.modal-backdrop {
  background: rgba(15, 17, 21, 0.45);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
html.skin-dark-aurora .modal-backdrop {
  background: rgba(3, 7, 18, 0.76);
}

/* Live WS Pulse Dot */
.ws-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  display: inline-block;
  background: #94A3B8;
}
.ws-dot.online {
  background: #10B981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.22);
}

@keyframes pulseRing {
  0%, 100% { box-shadow: 0 0 0 0 rgba(79, 70, 229, 0.4); }
  50% { box-shadow: 0 0 0 8px rgba(79, 70, 229, 0); }
}
.pulse-active {
  animation: pulseRing 2.2s infinite;
}

/* IPA Chart, Syllables, Cloze & Spelling Arena */
.ipa-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 10px 6px;
  border-radius: 14px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-glass);
  cursor: pointer;
  transition: transform 0.14s ease, border-color 0.14s ease, background 0.14s ease;
  user-select: none;
}
.ipa-tile:hover {
  transform: translateY(-2px);
  border-color: var(--border-accent);
  background: var(--bg-hover);
}
.ipa-tile.active {
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.14), rgba(2, 132, 199, 0.14));
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 2px rgba(2, 132, 199, 0.22);
}
html.skin-dark-aurora .ipa-tile.active {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.28), rgba(6, 182, 212, 0.22));
}

.ipa-svg-wrap svg {
  width: 100%;
  max-width: 260px;
  height: auto;
  display: block;
  margin: 0 auto;
}

.syl-chip {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  border-radius: 10px;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 16px;
  border: 1px solid var(--border-strong);
  transition: transform 0.15s ease;
}
.syl-stressed {
  transform: scale(1.06);
  box-shadow: 0 4px 14px rgba(79, 70, 229, 0.22);
}

.cloze-blank-input {
  display: inline-block;
  min-width: 110px;
  max-width: 185px;
  padding: 2px 8px;
  margin: 2px 3px;
  border-radius: 8px;
  border: 1.5px dashed var(--accent-indigo);
  background: var(--bg-input);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  text-align: center;
}
.cloze-blank-input:focus {
  outline: none;
  border-style: solid;
  border-color: var(--accent-cyan);
}
.cloze-blank-input.correct {
  border-style: solid;
  border-color: #10B981;
  background: rgba(16, 185, 129, 0.16);
}
.cloze-blank-input.wrong {
  border-style: solid;
  border-color: #F43F5E;
  background: rgba(244, 63, 94, 0.16);
}

.spelling-slot {
  width: 34px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 18px;
  border: 1.5px solid var(--border-strong);
  background: var(--bg-subtle);
  color: var(--text-primary);
}

/* ==========================================================================
   V10 Apple Editorial & Antigravity Visual System
   ========================================================================== */
.hairline-border {
  border: 1px solid rgba(0, 0, 0, 0.075);
}
html.skin-dark-aurora .hairline-border {
  border: 1px solid rgba(255, 255, 255, 0.09);
}

.apple-shadow {
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.03),
    0 8px 24px -6px rgba(15, 17, 21, 0.06),
    0 20px 48px -16px rgba(15, 17, 21, 0.05);
}
html.skin-dark-aurora .apple-shadow {
  box-shadow: 0 20px 50px -16px rgba(0, 0, 0, 0.55);
}

.orb-shadow {
  box-shadow:
    0 2px 6px rgba(15, 17, 21, 0.04),
    0 10px 24px -8px rgba(15, 17, 21, 0.08);
}

.atmospheric-frame {
  position: relative;
  background-color: #F7F8FA;
  background-image:
    radial-gradient(circle at 12% 14%, rgba(147, 197, 253, 0.42) 0%, transparent 48%),
    radial-gradient(circle at 88% 18%, rgba(196, 181, 253, 0.36) 0%, transparent 46%),
    radial-gradient(circle at 82% 88%, rgba(253, 186, 116, 0.32) 0%, transparent 48%),
    radial-gradient(circle at 18% 85%, rgba(186, 230, 253, 0.34) 0%, transparent 45%);
  border: 1px solid rgba(0, 0, 0, 0.06);
}
html.skin-dark-aurora .atmospheric-frame {
  background-color: #0E1424;
  background-image:
    radial-gradient(circle at 12% 14%, rgba(79, 70, 229, 0.28) 0%, transparent 50%),
    radial-gradient(circle at 88% 18%, rgba(6, 182, 212, 0.22) 0%, transparent 48%),
    radial-gradient(circle at 82% 88%, rgba(217, 119, 6, 0.16) 0%, transparent 48%);
  border-color: rgba(255, 255, 255, 0.08);
}
html.skin-warm-paper .atmospheric-frame {
  background-color: #F3EAD6;
  border-color: rgba(120, 90, 40, 0.14);
}

.cinema-card {
  transition: transform 0.65s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.65s ease;
  will-change: transform;
}

#editorial-statement .editorial-word {
  color: #D1D5DB;
  background: transparent;
  border: none;
  padding: 0;
  margin: 0 0.24em 0 0;
  border-radius: 0;
  font-weight: inherit;
  transition: color 0.28s cubic-bezier(0.22, 1, 0.36, 1);
  display: inline-block;
  cursor: default;
  box-shadow: none;
  transform: none;
}
#editorial-statement .editorial-word:hover {
  transform: none;
  background: transparent;
  box-shadow: none;
}
#editorial-statement .editorial-word.active {
  color: var(--text-primary);
}
html.skin-dark-aurora #editorial-statement .editorial-word {
  color: #334155;
}
html.skin-dark-aurora #editorial-statement .editorial-word.active {
  color: #F8FAFC;
}

@keyframes orbBob {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-5px); }
}

@keyframes orbRipple {
  0% { transform: scale(0.8); opacity: 0.65; }
  100% { transform: scale(1.65); opacity: 0; }
}

.ag-orb-wrap {
  will-change: transform;
  animation: orbBob 3.6s ease-in-out infinite;
  animation-delay: calc(var(--orb-idx, 0) * 0.22s);
  transition: transform 0.24s cubic-bezier(0.22, 1, 0.36, 1);
}

#antigravity-strip:hover .ag-orb-wrap {
  animation-play-state: paused;
}

.ag-orb-btn {
  position: relative;
  overflow: visible;
  transition: transform 0.24s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.24s ease, border-color 0.2s ease;
  will-change: transform;
}

.ag-orb-btn.orb-hovered {
  box-shadow:
    0 12px 26px -6px rgba(99, 102, 241, 0.34),
    0 0 18px rgba(56, 189, 248, 0.28);
  border-color: rgba(79, 70, 229, 0.45);
}

.ag-orb-ripple {
  position: absolute;
  inset: 0;
  border-radius: 9999px;
  border: 2px solid rgba(79, 70, 229, 0.5);
  pointer-events: none;
  animation: orbRipple 0.55s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.ag-tooltip {
  opacity: 0;
  transform: translateY(6px) scale(0.94);
  transition: opacity 0.2s ease, transform 0.22s cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: none;
  z-index: 30;
}

.ag-orb-wrap:hover .ag-tooltip {
  opacity: 1;
  transform: translateY(-2px) scale(1);
}

#ws-indicator {
  transition: transform 0.32s cubic-bezier(0.22, 1, 0.36, 1), width 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}

@media (max-width: 767px) {
  body {
    padding-bottom: calc(68px + env(safe-area-inset-bottom));
  }
}

/* ==========================================================================
   V14 LUMIX — Stationary Bottom-Right Liquid-Light Prism Orb (Zero Popup)
   ========================================================================== */
.lumix-orb-host {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 128px;
  height: 128px;
  z-index: 65;
  pointer-events: none;
  will-change: transform;
  user-select: none;
  -webkit-user-select: none;
}

@media (max-width: 767px) {
  .lumix-orb-host {
    right: 14px;
    bottom: 82px;
  }
}

.lumix-orb-core {
  position: absolute;
  left: 30px;
  top: 30px;
  width: 68px;
  height: 68px;
  border-radius: 9999px;
  pointer-events: auto;
  cursor: pointer;
  touch-action: manipulation;
  outline: none;
  transition: transform 0.2s cubic-bezier(0.22, 1, 0.36, 1);
}

.lumix-orb-core:hover {
  transform: scale(1.06);
}

.lumix-orb-core:active {
  transform: scale(0.95);
}

.lumix-whisper {
  position: absolute;
  right: 8px;
  bottom: calc(100% - 8px);
  transform: translateY(4px);
  max-width: 260px;
  padding: 7px 13px;
  border-radius: 9999px;
  background: rgba(15, 17, 21, 0.9);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  color: #FFFFFF;
  font-size: 11.5px;
  font-weight: 500;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  box-shadow: 0 12px 30px -8px rgba(0, 0, 0, 0.38);
  border: 1px solid rgba(255, 255, 255, 0.14);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease, transform 0.22s ease;
}

.lumix-whisper.visible {
  opacity: 1;
  transform: translateY(0px);
}

.lumix-srs-pill {
  position: absolute;
  right: 8px;
  bottom: calc(100% + 28px);
  pointer-events: auto;
  padding: 6px 13px;
  border-radius: 9999px;
  background: linear-gradient(135deg, #4F46E5, #0EA5E9);
  color: #FFFFFF;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  box-shadow: 0 10px 26px -6px rgba(79, 70, 229, 0.48);
  border: 1px solid rgba(255, 255, 255, 0.25);
  animation: wsFadeSpring 220ms cubic-bezier(0.22, 1, 0.36, 1);
}

/* ==========================================================================
   V14 Strict 14-Route Isolation & Luxury Editorial Sub-View Parity
   ========================================================================== */
.ws-panel {
  display: none !important;
}

.ws-panel.ws-active {
  display: block !important;
  animation: wsFadeSpring 200ms cubic-bezier(0.22, 1, 0.36, 1);
}

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

.luxury-card {
  background: var(--bg-elevated, rgba(255, 255, 255, 0.92));
  border: 1px solid var(--border-glass, rgba(0, 0, 0, 0.08));
  border-radius: 24px;
  box-shadow: 0 12px 34px -16px rgba(15, 17, 21, 0.12);
  transition: transform 0.2s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.2s ease, border-color 0.2s ease;
}

.luxury-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 40px -16px rgba(15, 17, 21, 0.18);
}

.luxury-card:hover .mag-icon {
  transform: scale(1.1) rotate(-3deg);
  transition: transform 0.2s cubic-bezier(0.22, 1, 0.36, 1);
}

.omni-skeleton {
  background: linear-gradient(90deg, rgba(148,163,184,0.12) 25%, rgba(148,163,184,0.24) 50%, rgba(148,163,184,0.12) 75%);
  background-size: 200% 100%;
  animation: omniShimmer 1.35s infinite linear;
  border-radius: 14px;
}

@keyframes omniShimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
