﻿/* RedPrep Practice Lab — Crimson Red Prep-Inspired Design System */

:root {
  --red-950: #450A0A;
  --red-900: #7F1D1D;
  --red-800: #991B1B;
  --red-700: #B91C1C;
  --red-600: #DC2626;
  --red-500: #EF4444;
  --red-400: #F87171;
  --red-200: #FECACA;
  --red-100: #FEE2E2;
  --red-50: #FEF2F2;

  --bg-page: #FAF7F7;
  --surface: #FFFFFF;
  --surface-soft: #FDF8F8;
  --surface-muted: #F6F1F1;

  --border: #ECE3E3;
  --border-strong: #DECACA;

  --text-main: #18181B;
  --text-sub: #52525B;
  --text-muted: #71717A;

  --emerald-700: #047857;
  --emerald-600: #059669;
  --emerald-100: #D1FAE5;
  --emerald-50: #ECFDF5;

  --amber-700: #B45309;
  --amber-500: #F59E0B;
  --amber-100: #FEF3C7;
  --amber-50: #FFFBEB;

  --indigo-700: #4338CA;
  --indigo-50: #EEF2FF;
  --sky-700: #0369A1;
  --sky-50: #F0F9FF;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 22px;

  --shadow-xs: 0 1px 2px rgba(24, 24, 27, 0.04);
  --shadow-sm: 0 2px 8px rgba(127, 29, 29, 0.05), 0 1px 3px rgba(24, 24, 27, 0.04);
  --shadow-md: 0 10px 26px rgba(127, 29, 29, 0.08), 0 4px 10px rgba(24, 24, 27, 0.04);
  --shadow-lg: 0 20px 44px rgba(127, 29, 29, 0.14), 0 8px 18px rgba(24, 24, 27, 0.08);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: 'Be Vietnam Pro', 'Segoe UI', system-ui, -apple-system, sans-serif;
  background-color: var(--bg-page);
  color: var(--text-main);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

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

button {
  cursor: pointer;
}

.mono {
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Consolas, monospace;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* ==================== TOP NAVBAR ==================== */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  min-height: 72px;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 2px 14px rgba(15, 23, 42, 0.04);
}

.topbar-inner {
  max-width: 1360px;
  min-height: 72px;
  margin: 0 auto;
  padding: 8px 24px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 18px;
}

.brand-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border: none;
  background: transparent;
  padding: 4px 6px 4px 0;
  text-align: left;
  white-space: nowrap;
  flex-shrink: 0;
  transition: transform 0.2s cubic-bezier(0.22, 1, 0.36, 1);
}

.brand-btn:hover {
  transform: scale(1.04);
}

.brand-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: var(--red-700);
  color: #fff;
  font-weight: 800;
  font-size: 16px;
  letter-spacing: -0.02em;
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
}

.brand-text-wrap {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.brand-name {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-main);
}

.brand-name span {
  color: var(--red-600);
}

.brand-sub {
  font-size: 11px;
  font-weight: 600;
  color: var(--red-700);
  background: var(--red-50);
  border: 1px solid var(--red-200);
  border-radius: 999px;
  padding: 1px 8px;
  margin-top: 2px;
  width: fit-content;
}

.main-nav {
  justify-self: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 5px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 15px;
}

.nav-item {
  position: relative;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-sub);
  font-size: 13.5px;
  font-weight: 700;
  padding: 9px 13px;
  border-radius: 11px;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transform-origin: center;
  will-change: transform;
  transition: transform 0.2s cubic-bezier(0.22, 1, 0.36, 1), color 0.18s ease, background-color 0.18s ease, box-shadow 0.2s ease, border-color 0.18s ease;
}

.nav-item:hover {
  z-index: 2;
  background: #FFFFFF;
  color: var(--red-700);
  border-color: var(--red-200);
  transform: scale(1.07) translateY(-1px);
  box-shadow: 0 6px 16px rgba(220, 38, 38, 0.14);
}

.nav-item:active {
  transform: scale(0.98);
}

.nav-item.is-active {
  background: #FFFFFF;
  color: var(--red-700);
  border-color: var(--red-200);
  box-shadow: 0 2px 8px rgba(220, 38, 38, 0.1);
}

.nav-item.is-active::after {
  content: '';
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 2px;
  height: 2.5px;
  border-radius: 999px;
  background: var(--red-600);
}

.nav-badge {
  font-size: 11px;
  font-weight: 800;
  background: var(--red-100);
  color: var(--red-700);
  padding: 1px 7px;
  border-radius: 999px;
  transition: background-color 0.18s ease, color 0.18s ease;
}

.nav-item:hover .nav-badge,
.nav-item.is-active .nav-badge {
  background: var(--red-600);
  color: #FFFFFF;
}

.topbar-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  white-space: nowrap;
  flex-shrink: 0;
}

.meta-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12.5px;
  font-weight: 700;
  padding: 6px 11px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-main);
  transition: transform 0.2s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.2s ease;
}

.meta-pill:hover {
  transform: scale(1.06) translateY(-1px);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
}

.meta-pill.settings-pill {
  padding: 6px 10px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  color: var(--text-main);
}

.meta-pill.settings-pill:hover {
  border-color: var(--red-400);
  background: var(--red-50);
  color: var(--red-700);
}

.settings-option-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 8px;
}

.settings-opt-btn {
  text-align: left;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1.5px solid var(--border);
  background: #FFFFFF;
  color: var(--text-main);
  transition: all 0.16s ease;
}

.settings-opt-btn:hover {
  border-color: var(--red-300);
  background: #FFF9F9;
}

.settings-opt-btn.is-active {
  border-color: var(--red-600);
  background: var(--red-50);
  color: var(--red-800);
  box-shadow: 0 3px 10px rgba(220, 38, 38, 0.12);
}

.settings-opt-btn strong {
  display: block;
  font-size: 13px;
  font-weight: 800;
}

.settings-opt-btn span {
  display: block;
  font-size: 11.5px;
  color: var(--text-sub);
  margin-top: 2px;
}

.meta-pill.dict-pill {
  background: #FFFFFF;
  border: 1.5px solid var(--red-200);
  color: var(--red-700);
}

.meta-pill.dict-pill:hover {
  background: var(--red-600);
  border-color: var(--red-600);
  color: #FFFFFF;
  box-shadow: 0 6px 16px rgba(220, 38, 38, 0.25);
}

.quick-dict-dialog {
  max-width: 680px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
}

.quick-dict-results {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 14px;
}

.qd-result-card {
  background: var(--surface-soft);
  border: 1.5px solid var(--border);
  border-radius: 14px;
  padding: 14px 16px;
}

.qd-result-card:hover {
  border-color: var(--red-200);
  background: #FFFDFD;
}

.meta-pill.exam-pill {
  background: #FEF2F2;
  border: 1.5px solid var(--red-200);
  color: var(--red-800);
}

.meta-pill.exam-pill:hover {
  border-color: var(--red-500);
  box-shadow: 0 6px 16px rgba(220, 38, 38, 0.18);
}

.exam-countdown-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}

.exam-cd-box {
  background: var(--red-50);
  border: 1px solid var(--red-200);
  border-radius: 12px;
  padding: 10px 6px;
  text-align: center;
}

.exam-cd-val {
  font-size: 22px;
  font-weight: 800;
  color: var(--red-700);
  line-height: 1.1;
}

.exam-cd-lbl {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-sub);
  margin-top: 2px;
}

.meta-pill.streak {
  background: #FFF7ED;
  border: 1.5px solid #FCA5A5;
  color: #B91C1C;
  box-shadow: 0 2px 10px rgba(239, 68, 68, 0.14);
}

.meta-pill.streak:hover {
  background: #FFEDD5;
  border-color: var(--red-500);
  box-shadow: 0 6px 18px rgba(220, 38, 38, 0.25);
}

.streak-flame {
  display: inline-block;
  animation: flameFlicker 1.8s ease-in-out infinite;
  transform-origin: center bottom;
}

@keyframes flameFlicker {
  0%, 100% { transform: scale(1) rotate(0deg); }
  50% { transform: scale(1.14) rotate(-4deg); }
}

.streak-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.streak-popover {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  width: 332px;
  background: #FFFFFF;
  border: 1.5px solid var(--red-200);
  border-radius: 20px;
  box-shadow: 0 18px 44px rgba(153, 27, 27, 0.18), 0 4px 12px rgba(15, 23, 42, 0.06);
  z-index: 90;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px) scale(0.97);
  transition: opacity 0.2s ease, transform 0.22s cubic-bezier(0.22, 1, 0.36, 1), visibility 0.2s ease;
  pointer-events: none;
  overflow: hidden;
  white-space: normal;
}

.streak-wrap::after {
  content: '';
  position: absolute;
  top: 100%;
  left: -12px;
  right: -12px;
  height: 16px;
}

.streak-wrap:hover .streak-popover,
.streak-wrap.is-open .streak-popover {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.streak-pop-head {
  background: #991B1B;
  color: #FFFFFF;
  padding: 16px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.streak-big-num {
  font-size: 26px;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.streak-pop-meta {
  font-size: 12px;
  opacity: 0.92;
  margin-top: 3px;
  font-weight: 600;
}

.streak-pop-body {
  padding: 14px 16px 16px;
}

.streak-week-strip {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px dashed var(--border);
}

.streak-day-dot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
}

.streak-dot-circle {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-soft);
  border: 1.5px solid var(--border);
  font-size: 14px;
}

.streak-day-dot.is-lit .streak-dot-circle {
  background: #DC2626;
  border-color: #DC2626;
  color: #FFFFFF;
  box-shadow: 0 3px 10px rgba(220, 38, 38, 0.3);
}

.streak-day-dot.is-today {
  color: var(--red-700);
}

.streak-day-dot.is-today .streak-dot-circle {
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.22);
}

.streak-cal-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12.5px;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 8px;
}

.streak-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  text-align: center;
}

.streak-cal-dow {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--text-muted);
  padding-bottom: 4px;
}

.streak-cal-cell {
  height: 30px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-sub);
  background: var(--surface-soft);
}

.streak-cal-cell.is-empty {
  background: transparent;
}

.streak-cal-cell.has-streak {
  background: #DC2626;
  color: #FFFFFF;
  font-weight: 800;
  box-shadow: 0 2px 6px rgba(220, 38, 38, 0.25);
}

.streak-cal-cell.is-today {
  outline: 2px solid var(--red-700);
  outline-offset: 1px;
}

.streak-milestone {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-sub);
}

.meta-pill.mastery {
  background: var(--red-50);
  border-color: var(--red-200);
  color: var(--red-700);
}

@media (max-width: 1160px) {
  .topbar-inner {
    grid-template-columns: auto auto;
    row-gap: 8px;
    padding: 10px 16px;
  }
  .main-nav {
    grid-column: 1 / -1;
    order: 3;
    width: 100%;
    overflow-x: auto;
    justify-content: flex-start;
  }
}

/* ==================== MAIN CONTAINER & BUTTONS ==================== */
.app-main {
  max-width: 1260px;
  margin: 0 auto;
  padding: 24px 24px 90px;
}

.view-panel {
  display: none;
  animation: fadeSlideIn 0.22s ease;
}

.view-panel.is-active {
  display: block;
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 11px;
  font-weight: 700;
  font-size: 14px;
  padding: 10px 18px;
  border: 1px solid transparent;
  transition: transform 0.14s ease, box-shadow 0.18s ease, background-color 0.18s ease, border-color 0.18s ease;
  text-decoration: none;
}

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

.btn-primary {
  background: var(--red-600);
  color: #fff;
  box-shadow: 0 6px 16px rgba(185, 28, 28, 0.25);
}

.btn-primary:hover {
  background: var(--red-500);
  box-shadow: 0 8px 20px rgba(185, 28, 28, 0.34);
}

.btn-outline-red {
  background: #fff;
  color: var(--red-700);
  border-color: var(--red-200);
}

.btn-outline-red:hover {
  background: var(--red-50);
  border-color: var(--red-400);
}

.btn-soft {
  background: var(--surface-muted);
  color: var(--text-main);
  border-color: var(--border);
}

.btn-soft:hover {
  background: #EDE4E4;
}

.btn-emerald {
  background: var(--emerald-600);
  color: #fff;
}

.btn-emerald:hover {
  background: var(--emerald-700);
}

.btn-sm {
  font-size: 13px;
  padding: 7px 12px;
  border-radius: 9px;
}

/* ==================== BANK HERO BANNER ==================== */
.prep-hero {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-xl);
  padding: 34px 36px;
  background: #6E1414;
  color: #fff;
  box-shadow: var(--shadow-lg);
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(290px, 0.85fr);
  gap: 28px;
  align-items: center;
  margin-bottom: 26px;
}

.prep-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-color: rgba(255, 255, 255, 0.14);
  background-size: 22px 22px;
  opacity: 0.45;
  pointer-events: none;
}

.prep-hero::after {
  content: '';
  position: absolute;
  right: -70px;
  top: -70px;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  background: rgba(254, 202, 202, 0.25);
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 1;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.28);
  margin-bottom: 14px;
}

.hero-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #FCA5A5;
  box-shadow: 0 0 0 3px rgba(252, 165, 165, 0.35);
}

.hero-title {
  margin: 0 0 12px;
  font-size: clamp(24px, 3vw, 35px);
  line-height: 1.22;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.hero-desc {
  margin: 0 0 22px;
  font-size: 15px;
  color: rgba(255, 255, 255, 0.9);
  max-width: 620px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.btn-hero-white {
  background: #fff;
  color: var(--red-800);
  box-shadow: 0 8px 20px rgba(69, 10, 10, 0.28);
}

.btn-hero-white:hover {
  background: var(--red-50);
  transform: translateY(-1px);
}

.btn-hero-glass {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.34);
  backdrop-filter: blur(8px);
}

.btn-hero-glass:hover {
  background: rgba(255, 255, 255, 0.24);
}

.hero-stats-card {
  position: relative;
  z-index: 1;
  background: rgba(69, 10, 10, 0.36);
  border: 1px solid rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(12px);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
}

.hero-stats-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  font-size: 13px;
  font-weight: 700;
  color: var(--red-100);
}

.hero-progress-wrap {
  margin-bottom: 16px;
}

.hero-progress-label {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  margin-bottom: 6px;
  font-weight: 600;
}

.hero-progress-track {
  height: 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
  overflow: hidden;
}

.hero-progress-fill {
  height: 100%;
  border-radius: 999px;
  background: #FDE68A;
  transition: width 0.35s ease;
}

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

.hero-stat-box {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  padding: 10px;
  text-align: center;
}

.hero-stat-val {
  font-size: 19px;
  font-weight: 800;
  line-height: 1.2;
}

.hero-stat-lbl {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.82);
  margin-top: 2px;
}

/* ==================== FILTER TOOLBAR & BANK GRID ==================== */
.bank-toolbar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  box-shadow: var(--shadow-xs);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 22px;
}

.filter-groups {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.filter-chip {
  border: 1px solid var(--border);
  background: var(--surface-soft);
  color: var(--text-sub);
  font-size: 13px;
  font-weight: 600;
  padding: 6px 13px;
  border-radius: 999px;
  transition: all 0.16s ease;
}

.filter-chip:hover {
  border-color: var(--red-300, #FCA5A5);
  color: var(--red-700);
}

.filter-chip.is-active {
  background: var(--red-600);
  border-color: var(--red-600);
  color: #fff;
  box-shadow: 0 3px 10px rgba(220, 38, 38, 0.25);
}

.search-box {
  position: relative;
  min-width: 240px;
  flex: 0 1 300px;
}

.search-box input {
  width: 100%;
  padding: 9px 14px 9px 36px;
  border: 1px solid var(--border-strong);
  border-radius: 11px;
  background: var(--surface-soft);
  font-size: 13.5px;
  color: var(--text-main);
  outline: none;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.search-box input:focus {
  border-color: var(--red-500);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
}

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
  font-size: 14px;
}

.section-heading-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.section-heading {
  margin: 0;
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.section-count {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 600;
}

.bank-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.lab-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 18px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.lab-card:hover {
  transform: translateY(-3px);
  border-color: var(--red-200);
  box-shadow: var(--shadow-md);
}

.lab-card.is-featured {
  border-color: var(--red-400);
  background: #FFF9F9;
}

.card-badges {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.badge-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.03em;
  padding: 3px 9px;
  border-radius: 999px;
}

.pill-red {
  background: var(--red-100);
  color: var(--red-700);
}

.pill-solid-red {
  background: var(--red-600);
  color: #fff;
}

.pill-emerald {
  background: var(--emerald-50);
  color: var(--emerald-700);
  border: 1px solid var(--emerald-100);
}

.pill-amber {
  background: var(--amber-50);
  color: var(--amber-700);
  border: 1px solid var(--amber-100);
}

.pill-indigo {
  background: var(--indigo-50);
  color: var(--indigo-700);
}

.pill-sky {
  background: var(--sky-50);
  color: var(--sky-700);
}

.card-title {
  margin: 0 0 4px;
  font-size: 17px;
  font-weight: 800;
  line-height: 1.32;
  color: var(--text-main);
}

.card-subtitle {
  font-size: 13px;
  font-weight: 700;
  color: var(--red-700);
  margin-bottom: 8px;
}

.card-desc {
  margin: 0;
  font-size: 13.5px;
  color: var(--text-sub);
  line-height: 1.5;
}

.card-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12.5px;
  color: var(--text-muted);
  font-weight: 600;
}

.progress-track {
  height: 7px;
  border-radius: 999px;
  background: var(--surface-muted);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--red-500);
  transition: width 0.3s ease;
}

.card-actions {
  display: flex;
  gap: 8px;
  padding-top: 4px;
}

.card-actions .btn {
  flex: 1;
}

/* ==================== UNIT WORKSPACE ==================== */
.unit-header-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 20px 24px 0;
  box-shadow: var(--shadow-sm);
  margin-bottom: 22px;
}

.unit-header-top {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 16px;
}

.breadcrumb-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.link-btn {
  border: none;
  background: transparent;
  padding: 0;
  color: var(--red-700);
  font-weight: 700;
  font-size: 13px;
}

.link-btn:hover {
  text-decoration: underline;
}

.unit-title {
  margin: 0 0 4px;
  font-size: clamp(20px, 2.3vw, 26px);
  font-weight: 800;
  letter-spacing: -0.02em;
}

.unit-sub {
  margin: 0;
  font-size: 14px;
  color: var(--text-sub);
}

.unit-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.accent-switch {
  display: inline-flex;
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 3px;
}

.accent-btn {
  border: none;
  background: transparent;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-sub);
  padding: 5px 11px;
  border-radius: 7px;
  transition: all 0.15s ease;
}

.accent-btn.is-active {
  background: #fff;
  color: var(--red-700);
  box-shadow: var(--shadow-xs);
}

.unit-progress-bar-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 16px;
}

.unit-progress-bar-row .progress-track {
  flex: 1;
}

.unit-progress-text {
  font-size: 13px;
  font-weight: 700;
  color: var(--red-700);
  white-space: nowrap;
}

.unit-tabs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(185px, 1fr));
  gap: 6px;
  padding: 6px;
  margin-top: 14px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 15px;
  overflow: visible;
}

.unit-tab {
  position: relative;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-sub);
  font-size: 13.5px;
  font-weight: 700;
  padding: 11px 14px;
  border-radius: 11px;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: transform 0.18s ease, color 0.18s ease, background-color 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.unit-tab:hover {
  color: var(--red-700);
  background: rgba(255, 255, 255, 0.9);
  border-color: var(--red-100);
  transform: translateY(-1px);
}

.unit-tab.is-active {
  color: var(--red-700);
  background: #FFFFFF;
  border-color: var(--red-200);
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.12);
}

.unit-tab.is-active::after {
  content: '';
  position: absolute;
  left: 20px;
  right: 20px;
  bottom: 3px;
  height: 2.5px;
  background: var(--red-600);
  border-radius: 999px;
}

/* ==================== TAB 1: VOCABULARY CARDS ==================== */
.vocab-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.vocab-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.vocab-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-xs);
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.vocab-card:hover {
  border-color: var(--red-200);
  box-shadow: var(--shadow-sm);
}

.vocab-card.is-mastered {
  border-left: 4px solid var(--emerald-600);
}

.vocab-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.vocab-word-line {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
}

.vocab-word {
  margin: 0;
  font-size: 22px;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.02em;
}

.vocab-pos {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  font-style: italic;
}

.vocab-ipa {
  font-size: 13.5px;
  color: var(--red-700);
  margin-top: 2px;
}

.audio-controls {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.audio-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid var(--red-200);
  background: var(--red-50);
  color: var(--red-700);
  border-radius: 9px;
  padding: 6px 10px;
  font-size: 12.5px;
  font-weight: 700;
  transition: all 0.15s ease;
}

.audio-btn:hover {
  background: var(--red-600);
  color: #fff;
  border-color: var(--red-600);
}

.audio-btn.is-speaking {
  background: var(--red-600);
  color: #fff;
  animation: pulseSpeak 0.9s infinite;
}

@keyframes pulseSpeak {
  0%, 100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.35); }
  50% { box-shadow: 0 0 0 6px rgba(220, 38, 38, 0); }
}

.vocab-vi {
  font-size: 15.5px;
  font-weight: 700;
  color: var(--text-main);
}

.vocab-en-def {
  font-size: 13.5px;
  color: var(--text-sub);
}

.vocab-example-box {
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
}

.vocab-example-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 4px;
}

.vocab-example-en {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-main);
}

.target-hl {
  background: var(--red-100);
  color: var(--red-800);
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 5px;
}

.vocab-example-vi {
  font-size: 13px;
  color: var(--text-sub);
  margin-top: 5px;
}

.vocab-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.colloc-chip {
  font-size: 12px;
  font-weight: 600;
  background: #fff;
  border: 1px solid var(--border-strong);
  color: var(--text-sub);
  padding: 3px 9px;
  border-radius: 7px;
}

.vocab-tip {
  font-size: 12.5px;
  background: var(--amber-50);
  border: 1px solid #FDE68A;
  color: #92400E;
  border-radius: 10px;
  padding: 8px 11px;
}

.vocab-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 4px;
  border-top: 1px dashed var(--border);
}

.toggle-pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 9px;
  padding: 7px 12px;
  font-size: 13px;
  font-weight: 700;
  border: 1px solid var(--border-strong);
  background: #fff;
  color: var(--text-sub);
  transition: all 0.15s ease;
}

.toggle-pill-btn:hover {
  border-color: var(--red-400);
  color: var(--red-700);
}

.toggle-pill-btn.is-mastered {
  background: var(--emerald-50);
  border-color: var(--emerald-600);
  color: var(--emerald-700);
}

.toggle-pill-btn.is-saved {
  background: var(--amber-50);
  border-color: var(--amber-500);
  color: var(--amber-700);
}

/* ==================== TAB 2: 3D FLASHCARDS ==================== */
.flashcard-shell {
  max-width: 760px;
  margin: 0 auto;
}

.flashcard-topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.flashcard-stage {
  perspective: 1200px;
  margin-bottom: 18px;
}

.flashcard-inner {
  position: relative;
  width: 100%;
  min-height: 360px;
  transform-style: preserve-3d;
  transition: transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
  cursor: pointer;
}

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

.flashcard-face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 28px 32px;
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.flashcard-front {
  background: var(--red-50);
}

.flashcard-back {
  transform: rotateY(180deg);
  background: #FFF7F7;
  border-color: var(--red-200);
}

.fc-face-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.fc-center {
  text-align: center;
  padding: 12px 0;
}

.fc-word {
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.02em;
  margin: 0 0 6px;
}

.fc-ipa {
  font-size: 16px;
  color: var(--red-700);
  margin-bottom: 14px;
}

.fc-flip-hint {
  font-size: 12.5px;
  color: var(--text-muted);
  text-align: center;
}

.fc-back-meaning {
  font-size: 21px;
  font-weight: 800;
  color: var(--red-800);
  margin-bottom: 6px;
}

.flashcard-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 12px;
}

.shortcut-bar {
  text-align: center;
  font-size: 12.5px;
  color: var(--text-muted);
}

kbd {
  display: inline-block;
  padding: 2px 6px;
  font-size: 11px;
  font-family: 'JetBrains Mono', monospace;
  background: #fff;
  border: 1px solid var(--border-strong);
  border-radius: 5px;
  color: var(--text-main);
}

/* ==================== TAB 3: INTERACTIVE DRILLS ==================== */
.drill-mode-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}

.drill-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 24px 26px;
  box-shadow: var(--shadow-sm);
  max-width: 860px;
  margin: 0 auto;
}

.drill-sentence {
  font-size: 19px;
  line-height: 1.65;
  font-weight: 600;
  color: var(--text-main);
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  margin: 14px 0;
}

.blank-slot {
  display: inline-block;
  min-width: 120px;
  border-bottom: 2.5px solid var(--red-600);
  color: var(--red-700);
  font-weight: 800;
  text-align: center;
  padding: 0 8px;
}

.word-bank-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0;
}

.bank-chip {
  border: 1px solid var(--border-strong);
  background: #fff;
  color: var(--text-main);
  font-weight: 700;
  font-size: 13.5px;
  padding: 6px 12px;
  border-radius: 9px;
  transition: all 0.15s ease;
}

.bank-chip:hover {
  background: var(--red-50);
  border-color: var(--red-500);
  color: var(--red-700);
}

.drill-input-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 14px 0;
}

.text-input {
  flex: 1;
  min-width: 220px;
  padding: 11px 14px;
  border: 1.5px solid var(--border-strong);
  border-radius: 11px;
  font-size: 15px;
  font-weight: 600;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.text-input:focus {
  border-color: var(--red-600);
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.14);
}

.feedback-banner {
  border-radius: 12px;
  padding: 14px 16px;
  margin-top: 14px;
  font-size: 14px;
}

.feedback-banner.is-correct {
  background: var(--emerald-50);
  border: 1px solid var(--emerald-600);
  color: #065F46;
}

.feedback-banner.is-wrong {
  background: var(--red-50);
  border: 1px solid var(--red-500);
  color: var(--red-900);
}

/* Speed Matching */
.match-board {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 16px;
}

.match-col {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.match-tile {
  text-align: left;
  padding: 13px 15px;
  border-radius: 12px;
  border: 1.5px solid var(--border-strong);
  background: #fff;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-main);
  transition: all 0.15s ease;
}

.match-tile:hover:not(:disabled) {
  border-color: var(--red-400);
  background: var(--red-50);
}

.match-tile.is-selected {
  border-color: var(--red-600);
  background: var(--red-50);
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.16);
}

.match-tile.is-matched {
  border-color: var(--emerald-600);
  background: var(--emerald-50);
  color: var(--emerald-700);
  opacity: 0.72;
  cursor: default;
}

.match-tile.is-wrong {
  border-color: var(--red-600);
  background: var(--red-100);
  animation: shakeTile 0.32s ease;
}

@keyframes shakeTile {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

.char-diff {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 8px;
}

.char-box {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 28px;
  padding: 0 5px;
  border-radius: 6px;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  font-size: 14px;
}

.char-box.ok {
  background: var(--emerald-100);
  color: var(--emerald-700);
}

.char-box.err {
  background: var(--red-100);
  color: var(--red-800);
}

/* ==================== TAB 4: PRACTICE TEST ROOM ==================== */
.test-intro-card {
  max-width: 780px;
  margin: 0 auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 28px 30px;
  box-shadow: var(--shadow-md);
}

.test-specs-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 20px 0;
}

.spec-box {
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  text-align: center;
}

.spec-val {
  font-size: 18px;
  font-weight: 800;
  color: var(--red-700);
}

.spec-lbl {
  font-size: 12px;
  color: var(--text-sub);
  margin-top: 2px;
}

.test-room-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 290px;
  gap: 20px;
  align-items: start;
}

.test-question-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 26px;
  box-shadow: var(--shadow-sm);
}

.test-passage-box {
  background: var(--surface-soft);
  border-left: 4px solid var(--red-600);
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 18px;
  font-size: 14.5px;
  line-height: 1.7;
  color: var(--text-main);
}

.test-prompt {
  font-size: 17px;
  font-weight: 700;
  line-height: 1.55;
  margin-bottom: 18px;
}

.test-prompt mark {
  background: var(--red-100);
  color: var(--red-800);
  padding: 1px 6px;
  border-radius: 5px;
}

.mcq-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mcq-option {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
  padding: 13px 16px;
  border: 1.5px solid var(--border-strong);
  border-radius: 12px;
  background: #fff;
  font-size: 15px;
  font-weight: 600;
  transition: all 0.15s ease;
}

.mcq-option:hover {
  border-color: var(--red-400);
  background: var(--red-50);
}

.mcq-option.is-selected {
  border-color: var(--red-600);
  background: var(--red-50);
  color: var(--red-900);
}

.opt-letter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--surface-muted);
  font-size: 13px;
  font-weight: 800;
  flex-shrink: 0;
}

.mcq-option.is-selected .opt-letter {
  background: var(--red-600);
  color: #fff;
}

.test-nav-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.test-sidebar {
  position: sticky;
  top: 86px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}

.timer-box {
  background: var(--red-800);
  color: #fff;
  border-radius: 14px;
  padding: 14px;
  text-align: center;
  margin-bottom: 16px;
}

.timer-label {
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  opacity: 0.9;
}

.timer-clock {
  font-size: 28px;
  font-weight: 800;
  line-height: 1.2;
  margin-top: 2px;
}

.palette-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin: 14px 0 18px;
}

.palette-btn {
  position: relative;
  height: 38px;
  border-radius: 9px;
  border: 1.5px solid var(--border-strong);
  background: #fff;
  font-weight: 700;
  font-size: 13.5px;
  color: var(--text-main);
}

.palette-btn.is-answered {
  background: var(--red-50);
  border-color: var(--red-400);
  color: var(--red-800);
}

.palette-btn.is-current {
  background: var(--red-600);
  border-color: var(--red-600);
  color: #fff;
}

.palette-btn.is-flagged::after {
  content: '';
  position: absolute;
  top: 3px;
  right: 3px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--amber-500);
}

/* Results Dashboard */
.results-summary-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 26px;
  box-shadow: var(--shadow-md);
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 24px;
  align-items: center;
  margin-bottom: 22px;
}

.score-ring-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.score-ring-svg {
  width: 152px;
  height: 152px;
  transform: rotate(-90deg);
}

.score-ring-bg {
  fill: none;
  stroke: var(--red-100);
  stroke-width: 12;
}

.score-ring-fg {
  fill: none;
  stroke: var(--red-600);
  stroke-width: 12;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.6s ease;
}

.score-ring-center {
  position: relative;
  margin-top: -102px;
  margin-bottom: 42px;
}

.score-big {
  font-size: 28px;
  font-weight: 800;
  color: var(--red-700);
  line-height: 1.1;
}

.cat-bars {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 14px 0;
}

.cat-bar-row {
  display: grid;
  grid-template-columns: 185px 1fr 52px;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 600;
}

.review-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.review-item {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 14px;
  padding: 16px 18px;
}

.review-item.is-right {
  border-left: 4px solid var(--emerald-600);
}

.review-item.is-wrong {
  border-left: 4px solid var(--red-600);
}

/* ==================== TAB 5: AI VOCAB COACH ==================== */
.coach-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(300px, 0.85fr);
  gap: 20px;
  align-items: start;
}

.coach-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

.prompt-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.target-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0 16px;
}

.target-word-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1.5px solid var(--red-200);
  background: var(--red-50);
  color: var(--red-800);
  padding: 6px 11px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  transition: all 0.16s ease;
}

.target-word-chip.is-used {
  background: var(--emerald-50);
  border-color: var(--emerald-600);
  color: var(--emerald-700);
}

.coach-textarea {
  width: 100%;
  min-height: 148px;
  padding: 14px 16px;
  border: 1.5px solid var(--border-strong);
  border-radius: 14px;
  font-size: 15px;
  line-height: 1.65;
  resize: vertical;
  outline: none;
  background: var(--surface-soft);
}

.coach-textarea:focus {
  border-color: var(--red-600);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.14);
}

.coach-editor-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 12px;
}

.coach-report-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.band-banner {
  background: var(--red-800);
  color: #fff;
  border-radius: 14px;
  padding: 16px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.criterion-box {
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
}

.criterion-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13.5px;
  font-weight: 800;
  margin-bottom: 5px;
}

.model-box {
  background: var(--emerald-50);
  border: 1px solid #A7F3D0;
  border-radius: 12px;
  padding: 14px;
  font-size: 14px;
}

/* ==================== MODAL & REDBEE AI DRAWER ==================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(24, 24, 27, 0.56);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-backdrop.is-open {
  display: flex;
}

.modal-dialog {
  width: 100%;
  max-width: 560px;
  background: #fff;
  border-radius: var(--radius-xl);
  padding: 24px 26px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
}

.redbee-fab {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 50;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  border: none;
  border-radius: 999px;
  padding: 12px 18px;
  background: var(--red-600);
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  box-shadow: 0 12px 28px rgba(153, 27, 27, 0.36);
  transition: transform 0.16s ease;
}

.redbee-fab:hover {
  transform: translateY(-2px);
}

.redbee-drawer {
  position: fixed;
  right: 24px;
  bottom: 84px;
  z-index: 55;
  width: min(400px, calc(100vw - 32px));
  max-height: min(580px, calc(100vh - 120px));
  background: #fff;
  border: 1.5px solid var(--red-200);
  border-radius: 20px;
  box-shadow: var(--shadow-lg);
  display: none;
  flex-direction: column;
  overflow: hidden;
}

.redbee-drawer.is-open {
  display: flex;
  animation: fadeSlideIn 0.2s ease;
}

.redbee-head {
  background: var(--red-800);
  color: #fff;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.redbee-messages {
  padding: 14px 16px;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--surface-soft);
}

.bee-msg {
  max-width: 92%;
  padding: 10px 13px;
  border-radius: 13px;
  font-size: 13.5px;
  line-height: 1.55;
}

.bee-msg.bot {
  align-self: flex-start;
  background: #fff;
  border: 1px solid var(--border);
  color: var(--text-main);
}

.bee-msg.user {
  align-self: flex-end;
  background: var(--red-600);
  color: #fff;
}

.bee-quick-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 10px 14px;
  background: #fff;
  border-top: 1px solid var(--border);
}

.bee-input-row {
  display: flex;
  gap: 8px;
  padding: 10px 14px 14px;
  background: #fff;
}

.bee-input-row input {
  flex: 1;
  padding: 9px 12px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  font-size: 13.5px;
  outline: none;
}

.bee-input-row input:focus {
  border-color: var(--red-600);
}

/* ==================== TOAST & EMPTY STATES ==================== */
#toast-container {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  z-index: 80;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  background: #18181B;
  color: #fff;
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 600;
  box-shadow: var(--shadow-md);
  border-left: 4px solid var(--red-500);
}

.empty-state {
  background: var(--surface);
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 36px 24px;
  text-align: center;
  color: var(--text-sub);
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 1024px) {
  .prep-hero {
    grid-template-columns: 1fr;
  }

  .bank-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .test-room-layout,
  .coach-layout,
  .results-summary-card {
    grid-template-columns: 1fr;
  }

  .test-sidebar {
    position: static;
  }
}

@media (max-width: 720px) {
  .topbar {
    height: auto;
    padding: 10px 0;
  }

  .topbar-inner {
    flex-wrap: wrap;
    padding: 0 14px;
  }

  .main-nav {
    order: 3;
    width: 100%;
    overflow-x: auto;
    padding-top: 6px;
  }

  .app-main {
    padding: 16px 14px 90px;
  }

  .prep-hero {
    padding: 24px 20px;
  }

  .bank-grid,
  .vocab-grid,
  .match-board {
    grid-template-columns: 1fr;
  }

  .test-specs-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .cat-bar-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .redbee-fab {
    right: 14px;
    bottom: 14px;
  }

  .redbee-drawer {
    right: 14px;
    bottom: 72px;
  }
}

/* ==================== 1000-WORD LEXICON HUB ==================== */
.lexicon-stats-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.lex-stat-card {
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 13px;
  padding: 12px 14px;
}

.lex-stat-num {
  font-size: 20px;
  font-weight: 800;
  color: var(--red-700);
  line-height: 1.2;
}

.lex-stat-lbl {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-sub);
  margin-top: 2px;
}

.lexicon-topic-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 16px;
}

.topic-pill {
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text-sub);
  font-size: 12.5px;
  font-weight: 600;
  padding: 6px 11px;
  border-radius: 999px;
  transition: all 0.15s ease;
}

.topic-pill:hover {
  border-color: var(--red-400);
  color: var(--red-700);
  background: var(--red-50);
}

.topic-pill.is-active {
  background: var(--red-600);
  border-color: var(--red-600);
  color: #fff;
  box-shadow: 0 3px 10px rgba(220, 38, 38, 0.22);
}

.pagination-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 22px;
  padding: 14px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.page-buttons {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.page-btn {
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  border-radius: 9px;
  border: 1px solid var(--border-strong);
  background: #fff;
  color: var(--text-main);
  font-size: 13px;
  font-weight: 700;
  transition: all 0.15s ease;
}

.page-btn:hover:not(:disabled) {
  border-color: var(--red-400);
  color: var(--red-700);
  background: var(--red-50);
}

.page-btn.is-active {
  background: var(--red-600);
  border-color: var(--red-600);
  color: #fff;
}

.page-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.lex-quiz-panel {
  max-width: 780px;
  margin: 0 auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 24px 26px;
  box-shadow: var(--shadow-sm);
}

@media (max-width: 720px) {
  .lexicon-stats-row {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ==================== GRAMMAR PRACTICE LAB (47 LESSONS) ==================== */
.grammar-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.grammar-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 16px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  box-shadow: var(--shadow-xs);
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.grammar-card:hover {
  transform: translateY(-2px);
  border-color: var(--red-300, #FCA5A5);
  box-shadow: var(--shadow-sm);
}

.grammar-card.is-done {
  border-left: 4px solid var(--emerald-600);
}

.grammar-formula-mini {
  font-size: 12px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 7px 10px;
  color: var(--red-800);
  line-height: 1.45;
}

.grammar-theory-box {
  background: var(--surface);
  border: 1.5px solid var(--red-200);
  border-radius: var(--radius-xl);
  padding: 22px 24px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-xs);
}

.grammar-formula-bar {
  background: var(--red-50);
  border: 1px solid var(--red-200);
  border-radius: 11px;
  padding: 11px 14px;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--red-900);
  margin: 12px 0;
}

.grammar-q-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.grammar-q-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 16px;
  padding: 20px 22px;
  box-shadow: var(--shadow-xs);
}

.grammar-q-card.is-right {
  border-left: 4px solid var(--emerald-600);
}

.grammar-q-card.is-wrong {
  border-left: 4px solid var(--red-600);
}

.grammar-submit-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 20px;
  padding: 18px 22px;
  background: var(--surface);
  border: 1.5px solid var(--red-200);
  border-radius: 16px;
}

@media (max-width: 1024px) {
  .grammar-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .grammar-grid {
    grid-template-columns: 1fr;
  }
}

/* ==================== DEEP GRAMMAR 4-TAB LESSON ROOM ==================== */
.markers-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  background: var(--amber-50);
  border: 1px solid #FDE68A;
  border-radius: 11px;
  padding: 10px 14px;
  margin: 12px 0 18px;
  font-size: 13.5px;
  color: #92400E;
}

.markers-bar strong {
  color: #78350F;
}

.grammar-rules-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 14px 0 20px;
}

.rule-card {
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-top: 3px solid var(--red-600);
  border-radius: 14px;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.rule-title {
  font-size: 14.5px;
  font-weight: 800;
  color: var(--red-800);
}

.rule-desc {
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--text-main);
}

.rule-example {
  background: #fff;
  border-left: 3px solid var(--red-400);
  border-radius: 8px;
  padding: 8px 11px;
  font-size: 13.5px;
  font-style: italic;
  color: var(--text-main);
}

.mistakes-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 12px 0 18px;
}

.mistake-row {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 13px;
  padding: 13px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.mistake-pair {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  font-size: 14px;
}

.mistake-wrong {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--red-50);
  color: var(--red-800);
  border: 1px solid var(--red-200);
  border-radius: 8px;
  padding: 3px 9px;
  font-weight: 600;
  text-decoration: line-through;
}

.mistake-right {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--emerald-50);
  color: var(--emerald-700);
  border: 1px solid var(--emerald-600);
  border-radius: 8px;
  padding: 3px 9px;
  font-weight: 700;
}

.mistake-why {
  font-size: 13px;
  color: var(--text-sub);
  line-height: 1.5;
}

.passage-card {
  background: var(--surface);
  border: 1.5px solid var(--red-200);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-xs);
}

.passage-head {
  background: var(--red-50);
  border-bottom: 1px solid var(--red-200);
  padding: 16px 22px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.passage-title {
  margin: 6px 0 2px;
  font-size: 17px;
  font-weight: 800;
  color: var(--text-main);
}

.passage-instruction {
  margin: 0;
  font-size: 13.5px;
  color: var(--text-sub);
}

.passage-body {
  padding: 22px 24px;
  font-size: 15.5px;
  line-height: 2.35;
  color: var(--text-main);
  white-space: pre-line;
}

.inline-blank-wrap {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin: 0 3px;
  vertical-align: baseline;
}

.inline-blank-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  border-radius: 999px;
  background: var(--red-600);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
}

.inline-blank-input {
  width: 155px;
  padding: 4px 10px;
  border: 1.5px solid var(--border-strong);
  border-radius: 8px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13.5px;
  font-weight: 600;
  background: #fff;
  color: var(--text-main);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.inline-blank-input:focus {
  border-color: var(--red-600);
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.14);
}

.inline-blank-input.is-right {
  border-color: var(--emerald-600);
  background: var(--emerald-50);
  color: var(--emerald-700);
}

.inline-blank-input.is-wrong {
  border-color: var(--red-600);
  background: var(--red-50);
  color: var(--red-800);
}

.inline-blank-fix {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 6px;
  background: var(--emerald-50);
  border: 1px solid var(--emerald-600);
  color: var(--emerald-700);
  font-size: 12.5px;
  font-weight: 700;
}

.passage-exp-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.passage-exp-item {
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 13.5px;
  line-height: 1.5;
  border: 1px solid var(--border);
  background: var(--surface);
}

.passage-exp-item.is-right {
  border-left: 4px solid var(--emerald-600);
  background: var(--emerald-50);
}

.passage-exp-item.is-wrong {
  border-left: 4px solid var(--red-600);
  background: var(--red-50);
}

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

@media (max-width: 820px) {
  .grammar-rules-grid,
  .passage-exp-list {
    grid-template-columns: 1fr;
  }
  .inline-blank-input {
    width: 128px;
  }
}

/* ==================== GRAMMAR TEXTBOOK (145 UNITS, STUDY GUIDE, 7 APPENDICES) ==================== */
.units-chapter-block {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-xl);
  overflow: hidden;
  margin-bottom: 20px;
  box-shadow: var(--shadow-xs);
}

.units-chapter-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 15px 20px;
  background: var(--red-50);
  border-bottom: 1px solid var(--red-200);
}

.units-chapter-title {
  margin: 0;
  font-size: 16.5px;
  font-weight: 800;
  color: var(--red-800);
}

.units-chapter-sub {
  font-size: 13px;
  color: var(--text-sub);
  margin-top: 2px;
}

.unit-row-list {
  display: flex;
  flex-direction: column;
}

.unit-row-item {
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  transition: background 0.14s ease;
}

.unit-row-item:last-child {
  border-bottom: none;
}

.unit-row-item:hover {
  background: #FFFDFD;
}

.unit-row-item.is-studied {
  background: #F4FDF8;
  border-left: 4px solid var(--emerald-600);
  padding-left: 16px;
}

.unit-num-badge {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 6px 8px;
  border-radius: 11px;
  background: var(--red-50);
  border: 1px solid var(--red-200);
  color: var(--red-700);
  font-weight: 800;
  font-size: 13px;
  line-height: 1.2;
}

.unit-row-item.is-studied .unit-num-badge {
  background: var(--emerald-50);
  border-color: var(--emerald-600);
  color: var(--emerald-700);
}

.unit-row-main {
  min-width: 0;
}

.unit-row-en {
  font-size: 15px;
  font-weight: 800;
  color: var(--text-main);
}

.unit-row-vi {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--red-700);
  margin-top: 2px;
}

.unit-row-key {
  font-size: 13px;
  color: var(--text-sub);
  margin-top: 4px;
  line-height: 1.45;
}

.unit-row-example {
  margin-top: 5px;
  font-size: 13px;
  font-style: italic;
  color: var(--text-main);
  background: var(--surface-soft);
  border-left: 3px solid var(--red-300);
  padding: 4px 10px;
  border-radius: 6px;
  display: inline-block;
}

.unit-row-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  flex-shrink: 0;
}

/* Diagnostic Study Guide Report */
.diag-summary-card {
  background: #FFF5F5;
  border: 1.5px solid var(--red-200);
  border-radius: var(--radius-xl);
  padding: 22px 24px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}

.diag-report-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.diag-chapter-card {
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: 14px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.diag-chapter-card.is-weak {
  border-color: var(--red-300);
  background: #FFF9F9;
}

.diag-chapter-card.is-strong {
  border-color: var(--emerald-600);
  background: #F4FDF8;
}

.diag-bar-track {
  height: 7px;
  border-radius: 999px;
  background: var(--border);
  overflow: hidden;
}

.diag-bar-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--red-600);
  transition: width 0.3s ease;
}

.diag-chapter-card.is-strong .diag-bar-fill {
  background: var(--emerald-600);
}

/* Appendices & 100 Irregular Verbs Table */
.appendix-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 22px 24px;
  box-shadow: var(--shadow-xs);
}

.appendix-table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 14px;
  margin-top: 14px;
}

.appendix-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
  text-align: left;
}

.appendix-table thead th {
  background: var(--red-700);
  color: #fff;
  font-weight: 700;
  padding: 11px 14px;
  white-space: nowrap;
}

.appendix-table tbody td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text-main);
  vertical-align: top;
  line-height: 1.5;
}

.appendix-table tbody tr:nth-child(even) {
  background: var(--surface-soft);
}

.appendix-table tbody tr:hover {
  background: var(--red-50);
}

.appendix-table tbody tr:last-child td {
  border-bottom: none;
}

.irreg-verb-cell {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  color: var(--red-800);
  white-space: nowrap;
}

@media (max-width: 820px) {
  .unit-row-item {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .unit-row-actions {
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
  }
  .diag-report-grid {
    grid-template-columns: 1fr;
  }
}

/* ==================== 4-SKILL IELTS EXAM LAB ==================== */
.skill-topbar-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 16px;
  padding: 14px 18px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-xs);
}

.skill-timer-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.reading-split {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
  gap: 18px;
  align-items: start;
}

.reading-passage-pane {
  position: sticky;
  top: 86px;
  max-height: calc(100vh - 108px);
  overflow-y: auto;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 22px 24px;
  box-shadow: var(--shadow-xs);
}

.reading-para {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  margin-bottom: 10px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background-color 0.16s ease, border-color 0.16s ease;
}

.reading-para:hover {
  background: var(--surface-soft);
  border-color: var(--border);
}

.reading-para.is-highlighted {
  background: #FEF9C3;
  border-color: #FDE047;
}

.reading-para p {
  margin: 0;
  font-size: 14.8px;
  line-height: 1.72;
  color: var(--text-main);
}

.para-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--red-600);
  color: #fff;
  font-weight: 800;
  font-size: 13px;
  flex-shrink: 0;
  margin-top: 2px;
}

.reading-questions-pane {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.listening-player-card {
  background: #FFF5F5;
  border: 1.5px solid var(--red-200);
  border-radius: var(--radius-xl);
  padding: 20px 24px;
  margin-bottom: 18px;
  box-shadow: var(--shadow-xs);
}

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

.transcript-box {
  margin-top: 14px;
  padding: 14px 16px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  max-height: 280px;
  overflow-y: auto;
  font-size: 13.5px;
  line-height: 1.65;
}

.transcript-line {
  padding: 5px 0;
  border-bottom: 1px dashed var(--border);
}

.transcript-line:last-child {
  border-bottom: none;
}

.writing-studio-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  gap: 18px;
  align-items: start;
}

.writing-prompt-pane,
.writing-editor-pane {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 20px 22px;
  box-shadow: var(--shadow-xs);
}

.writing-chart-box {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 16px;
  margin-bottom: 12px;
}

.writing-help-box {
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 16px;
  max-height: 360px;
  overflow-y: auto;
}

.writing-textarea {
  width: 100%;
  min-height: 330px;
  padding: 14px 16px;
  border: 1.5px solid var(--border-strong);
  border-radius: 14px;
  font-size: 14.8px;
  line-height: 1.7;
  color: var(--text-main);
  background: #fff;
  resize: vertical;
  outline: none;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.writing-textarea:focus {
  border-color: var(--red-600);
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.14);
}

.writing-report-card {
  margin-top: 16px;
  padding: 16px 18px;
  background: #FFF9F9;
  border: 1.5px solid var(--red-200);
  border-radius: 14px;
}

.cue-card-box {
  background: #FFF7F7;
  border: 2px solid var(--red-200);
  border-radius: var(--radius-xl);
  padding: 24px 26px;
  box-shadow: var(--shadow-sm);
}

@media (max-width: 960px) {
  .reading-split,
  .writing-studio-grid {
    grid-template-columns: 1fr;
  }
  .reading-passage-pane {
    position: static;
    max-height: none;
  }
}

/* ==================== SWIPE SRS FLASHCARDS ==================== */
.swipe-fc-shell {
  max-width: 820px;
}

.swipe-fc-stats {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 14px;
}

.swipe-direction-guide {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
  padding: 0 6px;
  font-size: 13px;
}

.swipe-guide-left {
  color: var(--emerald-700);
  font-weight: 700;
}

.swipe-guide-right {
  color: var(--red-700);
  font-weight: 700;
}

.swipe-stage {
  position: relative;
  perspective: 1200px;
  margin-bottom: 18px;
  overflow: visible;
}

.swipe-card-wrap {
  position: relative;
  touch-action: pan-y;
  user-select: none;
  cursor: grab;
  will-change: transform;
}

.swipe-card-wrap:active {
  cursor: grabbing;
}

.swipe-stamp {
  position: absolute;
  top: 26px;
  z-index: 15;
  padding: 7px 16px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 0.04em;
  opacity: 0;
  pointer-events: none;
  border: 3px solid currentColor;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow-md);
}

.stamp-known {
  left: 24px;
  color: var(--emerald-700);
  transform: rotate(-10deg);
}

.stamp-review {
  right: 24px;
  color: var(--red-700);
  transform: rotate(10deg);
}

.srs-btn-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.srs-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 11px 10px;
  border-radius: 13px;
  border: 1.5px solid var(--border);
  background: #FFFFFF;
  color: var(--text-main);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.srs-btn strong {
  font-size: 13.5px;
  font-weight: 800;
}

.srs-btn span {
  font-size: 11.5px;
  color: var(--text-sub);
  font-weight: 600;
}

.srs-btn:hover {
  transform: translateY(-2px) scale(1.03);
  box-shadow: var(--shadow-sm);
}

.srs-btn.srs-easy {
  border-color: #6EE7B7;
  background: #ECFDF5;
  color: #047857;
}

.srs-btn.srs-good {
  border-color: var(--emerald-600);
  background: var(--emerald-50);
  color: var(--emerald-700);
}

.srs-btn.srs-hard {
  border-color: #FDBA74;
  background: #FFF7ED;
  color: #C2410C;
}

.srs-btn.srs-again {
  border-color: var(--red-300);
  background: var(--red-50);
  color: var(--red-800);
}

@media (max-width: 720px) {
  .srs-btn-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* ==================== PRO LEXICON STATS & 2-LEVEL BAND STAGES ==================== */
.pro-stats-row {
  gap: 14px;
}

.pro-stats-row .lex-stat-card {
  background: #FFFFFF;
  border: 1.5px solid var(--red-100);
  border-radius: 16px;
  padding: 15px 17px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 0 3px 10px rgba(220, 38, 38, 0.05);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.pro-stats-row .lex-stat-card:hover {
  transform: translateY(-2px);
  border-color: var(--red-300);
  box-shadow: 0 8px 20px rgba(220, 38, 38, 0.1);
}

.pro-stats-row .pro-stat-hero {
  background: #991B1B;
  border-color: #B91C1C;
  color: #FFFFFF;
}

.pro-stats-row .pro-stat-hero .lex-stat-num,
.pro-stats-row .pro-stat-hero .lex-stat-lbl {
  color: #FFFFFF;
}

.pro-stats-row .pro-stat-hero .lex-stat-lbl {
  opacity: 0.9;
}

.pro-stats-row .pro-stat-hero .pro-stat-tag {
  background: rgba(255, 255, 255, 0.2);
  color: #FFFFFF;
}

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

.pro-stat-icon {
  font-size: 18px;
  line-height: 1;
}

.pro-stat-tag {
  font-size: 11px;
  font-weight: 800;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--red-50);
  color: var(--red-700);
}

.band-mini-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.band-mini-pill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 8px;
}

.band-mini-pill.band-34 {
  background: #FFFBEB;
  color: #B45309;
  border: 1px solid #FDE68A;
}

.band-mini-pill.band-4565 {
  background: #ECFDF5;
  color: #047857;
  border: 1px solid #A7F3D0;
}

.band-mini-pill.band-70 {
  background: var(--red-50);
  color: var(--red-800);
  border: 1px solid var(--red-200);
}

.band-stage-bar {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.band-stage-card {
  text-align: left;
  background: #FFFFFF;
  border: 1.5px solid var(--border);
  border-radius: 15px;
  padding: 13px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: transform 0.2s cubic-bezier(0.22, 1, 0.36, 1), border-color 0.18s ease, box-shadow 0.2s ease, background-color 0.18s ease;
}

.band-stage-card:hover {
  transform: translateY(-2px) scale(1.02);
  border-color: var(--red-300);
  box-shadow: 0 8px 18px rgba(220, 38, 38, 0.1);
}

.band-stage-card.is-active {
  background: #991B1B;
  border-color: #B91C1C;
  color: #FFFFFF;
  box-shadow: 0 8px 22px rgba(220, 38, 38, 0.24);
}

.band-stage-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.band-stage-icon {
  font-size: 18px;
}

.band-stage-count {
  font-size: 11px;
  font-weight: 700;
  color: var(--red-700);
  background: var(--red-50);
  padding: 2px 7px;
  border-radius: 999px;
}

.band-stage-card.is-active .band-stage-count {
  background: rgba(255, 255, 255, 0.22);
  color: #FFFFFF;
}

.band-stage-title {
  font-size: 14.5px;
  font-weight: 800;
  margin-top: 2px;
}

.band-stage-sub {
  font-size: 12px;
  color: var(--text-sub);
}

.band-stage-card.is-active .band-stage-sub {
  color: rgba(255, 255, 255, 0.88);
}

.stage-topics-panel {
  background: #FFF7F7;
  border: 1.5px solid var(--red-200);
  border-radius: 16px;
  padding: 14px 16px;
  margin-bottom: 16px;
}

.stage-topics-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
  font-size: 13.5px;
  color: var(--red-800);
}

@media (max-width: 980px) {
  .band-stage-bar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* ==================== ROADMAP TRACKER & YOUTUBE LISTENING HUB ==================== */
.rm-select {
  padding: 6px 10px;
  border-radius: 9px;
  border: 1.5px solid var(--border-strong);
  background: #FFFFFF;
  color: var(--text-main);
  font-size: 13px;
  font-weight: 700;
  outline: none;
}

.rm-select:focus {
  border-color: var(--red-600);
}

.roadmap-daily-card {
  background: #FFF7F7;
  border: 1.5px solid var(--red-200);
  border-radius: var(--radius-xl);
  padding: 20px 22px;
  box-shadow: var(--shadow-xs);
}

.roadmap-charts-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 0.9fr);
  gap: 16px;
  margin-bottom: 18px;
}

.roadmap-chart-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 18px 20px;
  box-shadow: var(--shadow-xs);
}

.daily-task-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.daily-task-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: #FFFFFF;
  border: 1px solid var(--border);
  border-radius: 12px;
}

.daily-task-row.is-done {
  background: #F4FDF8;
  border-color: var(--emerald-600);
}

.daily-task-text {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-main);
}

.daily-task-row.is-done .daily-task-text {
  text-decoration: line-through;
  color: var(--text-sub);
}

.roadmap-stages-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.roadmap-stage-box {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-top: 4px solid var(--red-600);
  border-radius: var(--radius-xl);
  padding: 20px 22px;
  box-shadow: var(--shadow-xs);
}

.add-yt-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed var(--border);
}

.add-yt-bar .text-input {
  flex: 1;
  min-width: 220px;
}

.yt-player-stage {
  background: var(--surface);
  border: 1.5px solid var(--red-200);
  border-radius: var(--radius-xl);
  padding: 20px 22px;
  margin-bottom: 18px;
  box-shadow: var(--shadow-sm);
}

.yt-embed-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 0.85fr);
  gap: 16px;
  align-items: start;
}

.yt-iframe-wrap {
  position: relative;
  width: 100%;
  padding-top: 56.25%;
  border-radius: 14px;
  overflow: hidden;
  background: #0F172A;
}

.yt-iframe-wrap iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.yt-note-box {
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 16px;
}

.video-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.video-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  box-shadow: var(--shadow-xs);
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.video-card:hover {
  transform: translateY(-2px);
  border-color: var(--red-200);
  box-shadow: var(--shadow-sm);
}

.video-card.is-watched {
  border-left: 4px solid var(--emerald-600);
  background: #F9FEFB;
}

.video-card-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px dashed var(--border);
}

@media (max-width: 980px) {
  .roadmap-charts-grid,
  .roadmap-stages-grid,
  .yt-embed-grid,
  .video-grid {
    grid-template-columns: 1fr;
  }
  .daily-task-row {
    grid-template-columns: 1fr;
  }
}

/* ==================== INTERACTIVE CLICK-TO-TRANSLATE READER ==================== */
.reader-article-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 26px 28px;
  box-shadow: var(--shadow-xs);
}

.reader-hint-bar {
  background: #FFF7F7;
  border: 1px solid var(--red-200);
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 13px;
  color: var(--text-main);
  margin-bottom: 18px;
}

.reader-paragraphs {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.reader-para-block {
  padding-bottom: 14px;
  border-bottom: 1px dashed var(--border);
}

.reader-para-block:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.reader-en-text {
  margin: 0;
  font-size: 17px;
  line-height: 1.9;
  color: var(--text-main);
}

.reader-vi-text {
  margin: 10px 0 0;
  font-size: 14.5px;
  line-height: 1.65;
  color: var(--text-sub);
  background: var(--surface-soft);
  padding: 10px 14px;
  border-radius: 10px;
  border-left: 3px solid var(--red-400);
}

.tap-word {
  display: inline;
  padding: 1px 2px;
  border-radius: 5px;
  cursor: pointer;
  transition: background-color 0.12s ease, color 0.12s ease;
}

.tap-word:hover {
  background: var(--red-100);
  color: var(--red-800);
}

.tap-word.is-active {
  background: var(--red-600);
  color: #FFFFFF;
}

.word-lookup-popover {
  position: fixed;
  z-index: 120;
  width: 310px;
  background: #FFFFFF;
  border: 2px solid var(--red-300);
  border-radius: 16px;
  padding: 14px 16px;
  box-shadow: 0 18px 40px rgba(153, 27, 27, 0.22), 0 4px 12px rgba(15, 23, 42, 0.08);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px) scale(0.96);
  transition: opacity 0.16s ease, transform 0.18s cubic-bezier(0.22, 1, 0.36, 1), visibility 0.16s ease;
  pointer-events: none;
}

.word-lookup-popover.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.wpop-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.wpop-meaning {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.45;
}

/* ==================== REDBEE GEMINI AI SETTINGS ==================== */
.bee-mode-badge {
  font-size: 10.5px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
  color: #FFFFFF;
}

.bee-mode-badge.is-online {
  background: #10B981;
  color: #FFFFFF;
}

.redbee-key-panel {
  background: #FFF7F7;
  border-bottom: 1px solid var(--red-200);
  padding: 10px 14px;
}


/* ==================== POMODORO & EVOLVING STUDY FLAME ==================== */
.pomo-page {
  max-width: 1180px;
  margin: 0 auto;
  padding: 6px 0 36px;
}

.pomo-hero-grid {
  display: grid;
  grid-template-columns: 1.12fr 0.88fr;
  gap: 18px;
  align-items: stretch;
}

.pomo-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 20px;
  padding: 20px 22px;
  box-shadow: var(--shadow-sm);
}

.pomo-mode-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  background: var(--surface-soft);
  padding: 5px;
  border-radius: 14px;
  margin-bottom: 14px;
}

.pomo-mode-btn {
  flex: 1;
  min-width: 92px;
  border: none;
  background: transparent;
  color: var(--text-sub);
  font-weight: 700;
  font-size: 13px;
  padding: 8px 10px;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.pomo-mode-btn.is-active {
  background: #fff;
  color: var(--red-700);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
}

.pomo-presets {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 10px;
}

.pomo-preset-chip {
  border: 1px solid var(--border);
  background: var(--surface-soft);
  color: var(--text-main);
  font-weight: 700;
  font-size: 12.5px;
  padding: 5px 12px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.18s ease;
}

.pomo-preset-chip.is-active {
  background: var(--red-600);
  border-color: var(--red-600);
  color: #fff;
}

.pomo-custom-min {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12.5px;
  color: var(--text-sub);
  margin-left: 4px;
}

.pomo-custom-min input {
  width: 54px;
  padding: 4px 6px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 700;
  text-align: center;
  color: var(--text-main);
}

.pomo-ring-wrap {
  position: relative;
  width: 244px;
  height: 244px;
  margin: 10px auto 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pomo-ring-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  pointer-events: none;
}

.pomo-ring-status {
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.pomo-time-display {
  font-size: 46px;
  font-weight: 800;
  line-height: 1.1;
  color: var(--text-main);
  margin: 4px 0;
}

.pomo-ring-tag {
  font-size: 12px;
  font-weight: 700;
  color: var(--red-700);
  background: var(--red-50);
  padding: 3px 10px;
  border-radius: 999px;
}

.pomo-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 16px;
}

.pomo-main-btn {
  min-width: 158px;
  font-size: 14.5px;
  padding: 10px 20px;
  border-radius: 12px;
}

.pomo-tag-section {
  border-top: 1px dashed var(--border);
  padding-top: 12px;
}

.pomo-sub-lbl {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-sub);
  margin-bottom: 7px;
}

.pomo-tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.pomo-quick-add {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed var(--border);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

/* EVOLVING FLAME CARD */
.pomo-flame-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: background 0.45s ease, border-color 0.45s ease;
}

.pomo-flame-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.pomo-tier-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 800;
}

.pomo-goal-pill {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-sub);
  background: rgba(255, 255, 255, 0.78);
  padding: 4px 10px;
  border-radius: 999px;
}

.pomo-flame-stage {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 0 2px;
}

.pomo-flame-svg {
  overflow: visible;
  filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.08));
}

.pomo-flame-outer {
  transform-origin: 80px 150px;
  animation: pomoFlameSway 2.4s ease-in-out infinite;
}

.pomo-flame-inner {
  transform-origin: 80px 148px;
  animation: pomoFlameInner 1.7s ease-in-out infinite;
}

.pomo-flame-svg.is-burning .pomo-flame-outer {
  animation-duration: 1.25s;
}

.pomo-flame-svg.is-burning .pomo-flame-inner {
  animation-duration: 0.9s;
}

.pomo-flame-svg.is-aurora,
.pomo-tier-swatch.is-aurora,
.pomo-bar-fill.is-aurora {
  animation: pomoAuroraShift 4s linear infinite;
}

.pomo-ember {
  animation: pomoEmberRise 2.2s ease-out infinite;
}
.pomo-ember.e2 { animation-delay: 0.7s; }
.pomo-ember.e3 { animation-delay: 1.4s; }

@keyframes pomoFlameSway {
  0%, 100% { transform: scaleY(1) scaleX(1) rotate(0deg); }
  35% { transform: scaleY(1.04) scaleX(0.97) rotate(-1.5deg); }
  70% { transform: scaleY(0.97) scaleX(1.03) rotate(1.5deg); }
}

@keyframes pomoFlameInner {
  0%, 100% { transform: scaleY(1) scaleX(1); }
  50% { transform: scaleY(1.07) scaleX(0.94); }
}

@keyframes pomoEmberRise {
  0% { transform: translateY(10px) scale(0.7); opacity: 0; }
  35% { opacity: 0.95; }
  100% { transform: translateY(-28px) scale(0.2); opacity: 0; }
}

@keyframes pomoAuroraShift {
  0% { filter: hue-rotate(0deg); }
  100% { filter: hue-rotate(360deg); }
}

.pomo-flame-caption {
  text-align: center;
  margin-bottom: 12px;
}

.pomo-flame-caption h3 {
  margin: 0 0 4px;
  font-size: 18px;
  color: var(--text-main);
}

.pomo-flame-caption p {
  margin: 0;
  font-size: 13px;
  color: var(--text-sub);
}

.pomo-stats-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}

.pomo-stat-box {
  background: rgba(255, 255, 255, 0.84);
  border-radius: 12px;
  padding: 9px 10px;
  text-align: center;
}

.pomo-stat-lbl {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
}

.pomo-stat-val {
  font-size: 15.5px;
  font-weight: 800;
  color: var(--text-main);
  margin-top: 2px;
}

.pomo-progress-block {
  background: rgba(255, 255, 255, 0.84);
  border-radius: 12px;
  padding: 10px 12px;
}

.pomo-progress-label {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 12.5px;
  color: var(--text-main);
  margin-bottom: 6px;
}

.pomo-progress-track {
  height: 9px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.22);
  overflow: hidden;
}

.pomo-progress-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.45s ease;
}

/* 6 FLAME TIER CARDS */
.pomo-tier-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 10px;
}

.pomo-tier-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 12px 8px;
  border-radius: 14px;
  border: 1.5px solid var(--border);
  background: var(--surface-soft);
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.pomo-tier-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.pomo-tier-card.is-unlocked {
  background: #fff;
}

.pomo-tier-card.is-current {
  background: #fff;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.08);
}

.pomo-tier-swatch {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  margin-bottom: 8px;
}

.pomo-tier-name {
  font-size: 12px;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.25;
}

.pomo-tier-req {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-sub);
  margin-top: 3px;
}

.pomo-tier-state {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--text-muted);
  margin-top: 4px;
}

/* BOTTOM 7-DAY CHART & LOGS */
.pomo-bottom-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-top: 18px;
}

.pomo-bars-wrap {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
  align-items: end;
  height: 170px;
  padding-top: 10px;
}

.pomo-bar-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
}

.pomo-bar-val {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-sub);
  margin-bottom: 4px;
}

.pomo-bar-track {
  flex: 1;
  width: 100%;
  max-width: 34px;
  background: var(--surface-soft);
  border-radius: 10px;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  padding: 2px;
}

.pomo-bar-fill {
  width: 100%;
  border-radius: 8px;
  transition: height 0.4s ease;
}

.pomo-bar-lbl {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-sub);
  margin-top: 6px;
}

.pomo-bar-col.is-today .pomo-bar-lbl {
  color: var(--red-700);
}

.pomo-log-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 185px;
  overflow-y: auto;
}

.pomo-log-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 12px;
  border-radius: 12px;
  background: var(--surface-soft);
  font-size: 13px;
}

.pomo-log-empty {
  padding: 28px 14px;
  text-align: center;
  font-size: 13px;
  color: var(--text-sub);
  background: var(--surface-soft);
  border-radius: 12px;
}

@media (max-width: 960px) {
  .pomo-hero-grid,
  .pomo-bottom-grid {
    grid-template-columns: 1fr;
  }
  .pomo-tier-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 520px) {
  .pomo-tier-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}


/* ==================== STUDY GAME: REDBEE ISLAND, GACHA & ARENA ==================== */
.game-page {
  max-width: 1180px;
  margin: 0 auto;
  padding: 6px 0 36px;
}

.game-hero-banner {
  background: #fff5f5;
  border: 1.5px solid #fecaca;
  border-radius: 22px;
  padding: 22px 24px;
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 18px;
  align-items: center;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}

.game-hero-kicker {
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: var(--red-700);
}

.game-hero-title {
  margin: 6px 0 6px;
  font-size: 24px;
  color: var(--text-main);
}

.game-hero-sub {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--text-sub);
}

.game-wallet-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.game-wallet-box {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 14px;
}

.game-wallet-box.is-gold {
  background: #fffbeb;
  border-color: #fcd34d;
}

.game-w-lbl {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-sub);
}

.game-w-val {
  font-size: 19px;
  font-weight: 800;
  color: var(--text-main);
  margin-top: 3px;
}

.game-wallet-box.is-gold .game-w-val {
  color: #b45309;
}

.game-subtabs {
  display: flex;
  gap: 8px;
  background: var(--surface-soft);
  padding: 6px;
  border-radius: 14px;
  margin-bottom: 16px;
  border: 1px solid var(--border);
}

.game-island-skyline {
  background: #eff6ff;
  border: 1.5px solid #bbf7d0;
  border-radius: 18px;
  padding: 16px 20px;
  margin-bottom: 16px;
}

.game-skyline-lbl {
  font-size: 12.5px;
  font-weight: 800;
  color: #166534;
  margin-bottom: 10px;
}

.game-skyline-stage {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: center;
  gap: 14px;
  min-height: 76px;
}

.game-sky-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid #bbf7d0;
  border-radius: 14px;
  padding: 8px 12px;
  box-shadow: 0 4px 10px rgba(22, 101, 52, 0.08);
}

.game-sky-icon {
  font-size: 32px;
  line-height: 1.1;
}

.game-sky-lv {
  font-size: 11px;
  font-weight: 800;
  color: #15803d;
  margin-top: 3px;
}

.game-sky-pet {
  font-size: 36px;
  animation: gamePetBounce 2s ease-in-out infinite;
}

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

.game-bldg-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.game-bldg-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 16px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
}

.game-bldg-card.is-owned {
  border-color: #fca5a5;
  background: #fff;
}

.game-bldg-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.game-bldg-icon {
  font-size: 30px;
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: var(--surface-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.game-bldg-name {
  font-size: 14px;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 2px;
}

.game-bldg-desc {
  margin: 0;
  font-size: 12.5px;
  color: var(--text-sub);
  line-height: 1.4;
}

.game-bldg-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-top: 4px;
}

/* GACHA & PETS */
.game-roll-results {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 16px;
}

.game-roll-pill {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 14px;
  border-radius: 14px;
  border: 2px solid var(--border);
  background: #fff;
  min-width: 118px;
}

.game-pet-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.game-pet-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 16px;
  padding: 14px 12px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.game-pet-card.is-locked {
  opacity: 0.72;
  background: var(--surface-soft);
}

.game-pet-card.is-equipped {
  box-shadow: 0 6px 18px rgba(220, 38, 38, 0.14);
}

.game-pet-icon {
  font-size: 36px;
  line-height: 1.1;
}

.game-pet-name {
  font-size: 14px;
  font-weight: 800;
  color: var(--text-main);
}

.game-pet-perk {
  margin: 0;
  font-size: 12px;
  color: var(--text-sub);
  line-height: 1.35;
}

.game-rarity-tag {
  font-size: 11px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 999px;
}

.game-rarity-tag.rarity-common { background: #f1f5f9; color: #475569; }
.game-rarity-tag.rarity-rare { background: #e0f2fe; color: #0369a1; }
.game-rarity-tag.rarity-epic { background: #f3e8ff; color: #7e22ce; }
.game-rarity-tag.rarity-legendary { background: #fef3c7; color: #b45309; }

.game-pet-card.rarity-rare.is-owned, .game-roll-pill.rarity-rare { border-color: #7dd3fc; }
.game-pet-card.rarity-epic.is-owned, .game-roll-pill.rarity-epic { border-color: #d8b4fe; }
.game-pet-card.rarity-legendary.is-owned, .game-roll-pill.rarity-legendary { border-color: #f59e0b; background: #fffbeb; }

@media (max-width: 960px) {
  .game-hero-banner { grid-template-columns: 1fr; }
  .game-bldg-grid, .game-pet-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 520px) {
  .game-bldg-grid, .game-pet-grid { grid-template-columns: 1fr; }
}


/* ==================== PRO POLISH: 9-TAB TOPBAR, SMOOTH TRANSITIONS & DARK MODE ==================== */
.topbar-inner {
  max-width: 1460px;
  padding: 8px 18px;
  gap: 12px;
}

.main-nav {
  max-width: 100%;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  justify-content: flex-start;
  gap: 3px;
  padding: 4px;
}

.main-nav::-webkit-scrollbar {
  display: none;
}

.nav-item {
  font-size: 13px;
  padding: 8px 10.5px;
  gap: 5px;
}

.nav-item:hover {
  transform: scale(1.04) translateY(-1px);
}

.view-panel.is-active {
  animation: redprepViewFadeIn 0.24s cubic-bezier(0.22, 1, 0.36, 1);
}

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

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--red-500);
  outline-offset: 2px;
}

/* ==================== CRIMSON-OBSIDIAN PRO DARK MODE ==================== */
[data-theme="dark"] {
  --bg-page: #0b0f19;
  --surface: #131a2a;
  --surface-soft: #1a2338;
  --surface-muted: #1e2942;

  --border: #26324d;
  --border-strong: #37476b;

  --text-main: #f1f5f9;
  --text-sub: #cbd5e1;
  --text-muted: #94a3b8;

  --red-950: #fecaca;
  --red-900: #fca5a5;
  --red-800: #f87171;
  --red-700: #ef4444;
  --red-600: #dc2626;
  --red-500: #ef4444;
  --red-200: rgba(239, 68, 68, 0.35);
  --red-100: rgba(239, 68, 68, 0.2);
  --red-50: rgba(239, 68, 68, 0.12);

  --emerald-700: #34d399;
  --emerald-600: #10b981;
  --emerald-100: rgba(16, 185, 129, 0.2);
  --emerald-50: rgba(16, 185, 129, 0.12);

  --amber-700: #fbbf24;
  --amber-500: #f59e0b;
  --amber-100: rgba(245, 158, 11, 0.2);
  --amber-50: rgba(245, 158, 11, 0.12);

  --indigo-700: #818cf8;
  --indigo-50: rgba(129, 140, 248, 0.14);
  --sky-700: #38bdf8;
  --sky-50: rgba(56, 189, 248, 0.14);

  --shadow-xs: 0 1px 3px rgba(0, 0, 0, 0.35);
  --shadow-sm: 0 4px 14px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 12px 28px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 20px 48px rgba(0, 0, 0, 0.6);
  color-scheme: dark;
}

[data-theme="dark"] .topbar {
  background: rgba(11, 15, 25, 0.9);
  border-bottom-color: var(--border);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.38);
}

[data-theme="dark"] .nav-item:hover,
[data-theme="dark"] .nav-item.is-active,
[data-theme="dark"] .pomo-mode-btn.is-active {
  background: #232f4b;
  color: #fca5a5;
  border-color: rgba(239, 68, 68, 0.4);
}

[data-theme="dark"] .meta-pill,
[data-theme="dark"] .btn-soft,
[data-theme="dark"] .filter-chip,
[data-theme="dark"] .text-input,
[data-theme="dark"] select,
[data-theme="dark"] textarea,
[data-theme="dark"] input[type="text"],
[data-theme="dark"] input[type="search"],
[data-theme="dark"] input[type="password"],
[data-theme="dark"] input[type="number"],
[data-theme="dark"] input[type="date"] {
  background: var(--surface-soft);
  color: var(--text-main);
  border-color: var(--border);
}

[data-theme="dark"] .filter-chip.is-active {
  background: var(--red-600);
  color: #fff;
  border-color: var(--red-600);
}

[data-theme="dark"] .modal-dialog,
[data-theme="dark"] .streak-popover,
[data-theme="dark"] .redbee-drawer,
[data-theme="dark"] .word-popover,
[data-theme="dark"] .flashcard-face,
[data-theme="dark"] .vocab-card,
[data-theme="dark"] .pomo-card,
[data-theme="dark"] .qd-result-card,
[data-theme="dark"] .pomo-tier-card.is-unlocked,
[data-theme="dark"] .pomo-tier-card.is-current,
[data-theme="dark"] .game-bldg-card,
[data-theme="dark"] .game-pet-card,
[data-theme="dark"] .game-roll-pill {
  background: var(--surface);
  color: var(--text-main);
  border-color: var(--border);
}

[data-theme="dark"] .pomo-flame-card {
  background: #161d30 !important;
  border-color: rgba(239, 68, 68, 0.35) !important;
}

[data-theme="dark"] .pomo-stat-box,
[data-theme="dark"] .pomo-progress-block,
[data-theme="dark"] .pomo-goal-pill,
[data-theme="dark"] .game-wallet-box {
  background: rgba(15, 23, 42, 0.72);
  border-color: var(--border);
}

[data-theme="dark"] .game-wallet-box.is-gold {
  background: rgba(180, 83, 9, 0.28);
  border-color: rgba(251, 191, 36, 0.45);
}

[data-theme="dark"] .game-wallet-box.is-gold .game-w-val {
  color: #fde047;
}

[data-theme="dark"] .game-hero-banner {
  background: #171e31;
  border-color: rgba(239, 68, 68, 0.35);
}

[data-theme="dark"] .game-island-skyline {
  background: #0f1c32;
  border-color: rgba(52, 211, 153, 0.35);
}

[data-theme="dark"] .game-skyline-lbl {
  color: #6ee7b7;
}

[data-theme="dark"] .game-sky-item {
  background: rgba(15, 23, 42, 0.8);
  border-color: rgba(52, 211, 153, 0.35);
}

[data-theme="dark"] .game-bldg-card.is-owned {
  background: #172033;
  border-color: rgba(239, 68, 68, 0.42);
}

[data-theme="dark"] .game-pet-card.rarity-legendary.is-owned,
[data-theme="dark"] .game-roll-pill.rarity-legendary {
  background: rgba(180, 83, 9, 0.18);
  border-color: #f59e0b;
}

[data-theme="dark"] .settings-opt-btn {
  background: var(--surface-soft);
  border-color: var(--border);
  color: var(--text-main);
}

[data-theme="dark"] .settings-opt-btn.is-active {
  background: rgba(220, 38, 38, 0.18);
  border-color: var(--red-500);
}

[data-theme="dark"] .redbee-messages {
  background: #0e1424;
}

[data-theme="dark"] .bee-msg.bot {
  background: var(--surface-soft);
  color: var(--text-main);
  border-color: var(--border);
}

[data-theme="dark"] .redbee-key-panel {
  background: #161f33;
  border-bottom-color: var(--border);
}

[data-theme="dark"] .vocab-example-box,
[data-theme="dark"] .vocab-tip {
  background: var(--surface-soft);
  border-color: var(--border);
}

@media (max-width: 1220px) {
  .topbar-inner {
    grid-template-columns: auto 1fr;
    row-gap: 6px;
  }
  .main-nav {
    grid-column: 1 / -1;
    order: 3;
    width: 100%;
    justify-content: flex-start;
  }
  .topbar-meta {
    justify-self: end;
  }
}


/* ==================== COMPLETE DARK MODE OVERRIDES (ALL 9 TABS & SUBCOMPONENTS) ==================== */
[data-theme="dark"] .reader-hint-bar {
  background: rgba(245, 158, 11, 0.14);
  border-color: rgba(245, 158, 11, 0.38);
  color: #fde68a;
}

[data-theme="dark"] .reader-hint-bar strong {
  color: #fef3c7;
}

[data-theme="dark"] .audio-btn,
[data-theme="dark"] .btn-outline-red,
[data-theme="dark"] .btn-hero-white,
[data-theme="dark"] .toggle-pill-btn,
[data-theme="dark"] .topic-pill,
[data-theme="dark"] .bank-chip,
[data-theme="dark"] .page-btn,
[data-theme="dark"] .palette-btn,
[data-theme="dark"] .colloc-chip,
[data-theme="dark"] .srs-btn,
[data-theme="dark"] .accent-btn.is-active,
[data-theme="dark"] .unit-tab.is-active,
[data-theme="dark"] .rm-select,
[data-theme="dark"] kbd {
  background: var(--surface-soft);
  color: var(--text-main);
  border-color: var(--border-strong);
}

[data-theme="dark"] .audio-btn:hover,
[data-theme="dark"] .btn-outline-red:hover,
[data-theme="dark"] .toggle-pill-btn:hover,
[data-theme="dark"] .topic-pill:hover,
[data-theme="dark"] .bank-chip:hover {
  background: #232f4b;
  color: #fca5a5;
  border-color: rgba(239, 68, 68, 0.5);
}

[data-theme="dark"] .band-stage-card,
[data-theme="dark"] .stage-topics-panel,
[data-theme="dark"] .pro-stats-row .lex-stat-card,
[data-theme="dark"] .lab-card,
[data-theme="dark"] .lab-card.is-featured,
[data-theme="dark"] .roadmap-daily-card,
[data-theme="dark"] .daily-task-row,
[data-theme="dark"] .listening-player-card,
[data-theme="dark"] .writing-chart-box,
[data-theme="dark"] .writing-report-card,
[data-theme="dark"] .writing-textarea,
[data-theme="dark"] .cue-card-box,
[data-theme="dark"] .transcript-box,
[data-theme="dark"] .word-lookup-popover,
[data-theme="dark"] .mcq-option,
[data-theme="dark"] .match-tile,
[data-theme="dark"] .rule-example,
[data-theme="dark"] .mistake-row,
[data-theme="dark"] .diag-chapter-card,
[data-theme="dark"] .diag-summary-card,
[data-theme="dark"] .flashcard-back,
[data-theme="dark"] .bee-input-row,
[data-theme="dark"] .bee-quick-chips,
[data-theme="dark"] .inline-blank-input,
[data-theme="dark"] .reader-passage-card,
[data-theme="dark"] .reader-card,
[data-theme="dark"] .book-card,
[data-theme="dark"] .video-card {
  background: var(--surface);
  color: var(--text-main);
  border-color: var(--border);
}

[data-theme="dark"] .diag-chapter-card.is-weak {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.4);
}

[data-theme="dark"] .reading-para.is-highlighted {
  background: rgba(245, 158, 11, 0.18);
  color: var(--text-main);
}

[data-theme="dark"] .unit-row-item:hover,
[data-theme="dark"] .qd-result-card:hover {
  background: var(--surface-soft);
}

[data-theme="dark"] .meta-pill.dict-pill,
[data-theme="dark"] .meta-pill.exam-pill,
[data-theme="dark"] .meta-pill.streak {
  background: var(--surface-soft);
  border-color: var(--border-strong);
  color: var(--text-main);
}

[data-theme="dark"] .band-mini-pill.band-34,
[data-theme="dark"] .band-mini-pill.band-4565 {
  background: var(--surface-soft);
  color: var(--text-main);
  border-color: var(--border-strong);
}

[data-theme="dark"] .srs-btn.srs-easy {
  background: rgba(16, 185, 129, 0.16);
  color: #6ee7b7;
  border-color: rgba(16, 185, 129, 0.4);
}

[data-theme="dark"] .srs-btn.srs-hard {
  background: rgba(245, 158, 11, 0.16);
  color: #fcd34d;
  border-color: rgba(245, 158, 11, 0.4);
}

[data-theme="dark"] .coach-textarea:focus,
[data-theme="dark"] .search-box input:focus {
  background: var(--surface-muted);
}

/* ==================== DICTATION LAB (INSIDE VIDEO NGHE) ==================== */
.dict-lab-shell {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.dict-selector-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.dict-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 20px;
  padding: 20px 22px;
  box-shadow: var(--shadow-sm);
}

.dict-audio-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  margin: 12px 0;
}

.dict-input-area {
  width: 100%;
  min-height: 92px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1.5px solid var(--border-strong);
  background: var(--surface);
  color: var(--text-main);
  font-size: 15.5px;
  line-height: 1.55;
  resize: vertical;
  font-family: inherit;
}

.dict-diff-box {
  margin-top: 12px;
  padding: 14px 16px;
  border-radius: 14px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  line-height: 1.8;
  font-size: 15px;
}

.dict-w-ok {
  display: inline-block;
  padding: 1px 6px;
  margin: 2px;
  border-radius: 6px;
  background: var(--emerald-100);
  color: var(--emerald-700);
  font-weight: 700;
}

.dict-w-miss {
  display: inline-block;
  padding: 1px 6px;
  margin: 2px;
  border-radius: 6px;
  background: var(--red-100);
  color: var(--red-700);
  font-weight: 800;
}

.dict-w-wrong {
  text-decoration: line-through;
  opacity: 0.72;
  margin-right: 4px;
  font-weight: 600;
}

.pomo-strict-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  padding: 5px 11px;
  border-radius: 999px;
  background: var(--emerald-50);
  color: var(--emerald-700);
  border: 1px solid var(--emerald-100);
  margin: 0 auto 10px;
}

.pomo-strict-pill.is-paused {
  background: var(--amber-50);
  color: var(--amber-700);
  border-color: var(--amber-100);
}


/* ==================== DAILYDICTATION-INSPIRED STUDIO LAYOUT ==================== */
.dd-cat-bar {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
  margin-top: 14px;
}

.dd-cat-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 9px 12px;
  border-radius: 12px;
  border: 1.5px solid var(--border);
  background: var(--surface-soft);
  color: var(--text-main);
  font-size: 12.5px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.18s ease;
}

.dd-cat-btn small {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
}

.dd-cat-btn.is-active {
  background: var(--red-600);
  border-color: var(--red-600);
  color: #fff;
}

.dd-cat-btn.is-active small {
  color: rgba(255, 255, 255, 0.86);
}

.dd-workspace-grid {
  display: grid;
  grid-template-columns: 1.38fr 0.72fr;
  gap: 16px;
  align-items: start;
}

.dd-step-pills {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}

.dd-step-pill {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1.5px solid var(--border-strong);
  background: var(--surface-soft);
  color: var(--text-sub);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.dd-step-pill.is-current {
  border-color: var(--red-600);
  background: var(--red-600);
  color: #fff;
}

.dd-step-pill.is-done {
  border-color: var(--emerald-600);
  background: var(--emerald-50);
  color: var(--emerald-700);
}

.dd-step-pill.is-done.is-current {
  background: var(--emerald-600);
  color: #fff;
}

.dd-mask-blank {
  display: inline-block;
  padding: 1px 6px;
  margin: 2px;
  border-radius: 6px;
  background: var(--surface-muted);
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  letter-spacing: 0.08em;
}

.dd-transcript-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 440px;
  overflow-y: auto;
}

.dd-trans-item {
  padding: 9px 11px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface-soft);
  cursor: pointer;
  transition: border-color 0.16s ease;
}

.dd-trans-item.is-active {
  border-color: var(--red-500);
  background: var(--red-50);
}

@media (max-width: 960px) {
  .dd-cat-bar { grid-template-columns: repeat(3, 1fr); }
  .dd-workspace-grid { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
  .dd-cat-bar { grid-template-columns: repeat(2, 1fr); }
}


/* ==================== LUXURY DARK MODE HERO BANNER (.prep-hero) ==================== */
[data-theme="dark"] .prep-hero {
  background: #101524;
  border: 1px solid rgba(239, 68, 68, 0.36);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

[data-theme="dark"] .prep-hero::before {
  opacity: 0.2;
}

[data-theme="dark"] .prep-hero::after {
  background: rgba(239, 68, 68, 0.28);
}

[data-theme="dark"] .hero-eyebrow {
  background: rgba(239, 68, 68, 0.16);
  border-color: rgba(248, 113, 113, 0.42);
  color: #fecaca;
}

[data-theme="dark"] .hero-desc {
  color: #cbd5e1;
}

[data-theme="dark"] .btn-hero-white {
  background: #ef4444;
  color: #ffffff;
  border-color: transparent;
  box-shadow: 0 8px 24px rgba(220, 38, 38, 0.45);
}

[data-theme="dark"] .btn-hero-white:hover {
  background: #f87171;
  color: #ffffff;
  transform: translateY(-1px);
}

[data-theme="dark"] .btn-hero-glass {
  background: rgba(255, 255, 255, 0.07);
  color: #f1f5f9;
  border-color: rgba(255, 255, 255, 0.18);
}

[data-theme="dark"] .btn-hero-glass:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(248, 113, 113, 0.45);
  color: #ffffff;
}

[data-theme="dark"] .hero-stats-card {
  background: rgba(11, 15, 25, 0.66);
  border: 1px solid rgba(248, 113, 113, 0.26);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .hero-stats-head {
  color: #fca5a5;
  letter-spacing: 0.04em;
}

[data-theme="dark"] .hero-progress-label {
  color: #f1f5f9;
}

[data-theme="dark"] .hero-progress-track {
  background: rgba(255, 255, 255, 0.12);
}

[data-theme="dark"] .hero-progress-fill {
  background: #ef4444;
}

[data-theme="dark"] .hero-stat-box {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.11);
}

[data-theme="dark"] .hero-stat-val {
  color: #ffffff;
}

[data-theme="dark"] .hero-stat-lbl {
  color: #94a3b8;
}


/* ==================== MOTIVATION QUOTE STRIP (HOME & POMODORO) ==================== */
.moti-strip {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-left: 4px solid var(--red-600);
  border-radius: 16px;
  padding: 14px 18px;
  margin-bottom: 18px;
  box-shadow: var(--shadow-xs);
}

.moti-main-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.moti-quote-wrap {
  flex: 1;
  min-width: 240px;
}

.moti-badge {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: var(--red-700);
  background: var(--red-50);
  padding: 2px 8px;
  border-radius: 999px;
  margin-bottom: 5px;
}

.moti-quote-text {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.45;
}

.moti-quote-author {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

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

.moti-manager {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--border);
}

.moti-add-form {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.moti-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 220px;
  overflow-y: auto;
}

.moti-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
}

.moti-list-item.is-pinned {
  border-color: var(--red-500);
  background: var(--red-50);
}

.pomo-quote-pill {
  text-align: center;
  font-size: 12.5px;
  font-style: italic;
  color: var(--text-sub);
  background: var(--surface-soft);
  border: 1px dashed var(--border);
  border-radius: 12px;
  padding: 8px 12px;
  margin-bottom: 14px;
}


/* ==================== 3D FLIPBOOK EBOOK & PDF READER ==================== */
.fb-shell {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 20px;
  padding: 16px 18px;
  box-shadow: var(--shadow-sm);
}

.fb-shell:fullscreen {
  border-radius: 0;
  padding: 18px 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: var(--bg-page);
  overflow-y: auto;
}

.fb-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 12px;
}

.fb-tool-left,
.fb-tool-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.fb-doc-meta {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}

.fb-doc-meta strong {
  font-size: 14px;
  color: var(--text-main);
}

.fb-doc-meta span {
  font-size: 11.5px;
  color: var(--text-muted);
}

.fb-recent-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.fb-stage {
  position: relative;
  min-height: 520px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px 44px;
  border-radius: 16px;
  background: #334155;
  perspective: 1800px;
  overflow: auto;
}

.fb-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #f1f5f9;
  padding: 36px 24px;
  border: 2px dashed rgba(248, 113, 113, 0.45);
  border-radius: 18px;
  background: rgba(15, 23, 42, 0.55);
  transition: border-color 0.2s ease, background 0.2s ease;
}

.fb-empty-state p {
  color: #cbd5e1 !important;
}

.fb-empty-state.is-dragover {
  border-color: #ef4444;
  background: rgba(220, 38, 38, 0.16);
}

.fb-book-spread {
  display: flex;
  align-items: stretch;
  justify-content: center;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
  border-radius: 8px;
  transform-style: preserve-3d;
}

.fb-book-spread.fb-anim-next {
  animation: fbTurnNext 0.34s cubic-bezier(0.22, 1, 0.36, 1);
}

.fb-book-spread.fb-anim-prev {
  animation: fbTurnPrev 0.34s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes fbTurnNext {
  0% { transform: rotateY(-12deg) scale(0.985); opacity: 0.72; }
  100% { transform: rotateY(0deg) scale(1); opacity: 1; }
}

@keyframes fbTurnPrev {
  0% { transform: rotateY(12deg) scale(0.985); opacity: 0.72; }
  100% { transform: rotateY(0deg) scale(1); opacity: 1; }
}

.fb-leaf {
  position: relative;
  background: #fdfcf8;
  min-width: 340px;
  max-width: 540px;
  min-height: 490px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  overflow: hidden;
}

.fb-leaf-left {
  border-radius: 8px 0 0 8px;
  box-shadow: inset -14px 0 22px -12px rgba(15, 23, 42, 0.22);
}

.fb-leaf-right {
  border-radius: 0 8px 8px 0;
  box-shadow: inset 14px 0 22px -12px rgba(15, 23, 42, 0.22);
}

.fb-leaf-single {
  border-radius: 8px;
  cursor: default;
}

.fb-leaf.is-empty-leaf {
  background: transparent;
  box-shadow: none;
  cursor: default;
}

.fb-spine {
  width: 6px;
  background: rgba(15, 23, 42, 0.28);
}

.fb-pdf-canvas {
  display: block;
  max-width: 100%;
  height: auto;
}

.fb-canvas-num {
  position: absolute;
  bottom: 8px;
  right: 12px;
  font-size: 11px;
  font-weight: 800;
  color: #475569;
  background: rgba(255, 255, 255, 0.82);
  padding: 2px 7px;
  border-radius: 999px;
}

/* BUILT-IN BOOK PAPER PAGES */
.fb-paper {
  width: 440px;
  min-height: 520px;
  padding: 32px 30px 44px;
  color: #1e293b;
  display: flex;
  flex-direction: column;
  position: relative;
  background: #fffdf9;
}

.fb-cover-page {
  background: #7f1d1d;
  color: #ffffff;
  justify-content: center;
  align-items: center;
  text-align: center;
}

.fb-cover-badge {
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  margin-bottom: 18px;
}

.fb-cover-ornament {
  font-size: 56px;
  margin-bottom: 14px;
}

.fb-cover-title {
  margin: 0 0 10px;
  font-size: 24px;
  line-height: 1.28;
  font-weight: 800;
}

.fb-cover-author {
  font-size: 14.5px;
  font-weight: 700;
  color: #fecaca;
  margin-bottom: 24px;
}

.fb-cover-sub {
  font-size: 12px;
  opacity: 0.85;
  margin-top: auto;
}

.fb-back-page {
  justify-content: center;
  align-items: center;
  text-align: center;
}

.fb-page-header {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #b91c1c;
  border-bottom: 1px solid #e7dcc8;
  padding-bottom: 6px;
  margin-bottom: 14px;
}

.fb-page-heading {
  margin: 0 0 12px;
  font-size: 19px;
  color: #0f172a;
}

.fb-page-body p {
  margin: 0 0 11px;
  font-size: 14px;
  line-height: 1.65;
  color: #334155;
}

.fb-page-callout {
  margin-top: auto;
  padding: 10px 12px;
  border-radius: 10px;
  background: #fef2f2;
  border-left: 3px solid #dc2626;
  font-size: 12.8px;
  color: #7f1d1d;
  line-height: 1.45;
}

.fb-page-num {
  position: absolute;
  bottom: 12px;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  color: #64748b;
}

.fb-nav-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 38px;
  height: 54px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(15, 23, 42, 0.65);
  color: #ffffff;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.18s ease, transform 0.18s ease;
  z-index: 3;
}

.fb-nav-arrow:hover:not(:disabled) {
  background: var(--red-600);
}

.fb-nav-arrow:disabled {
  opacity: 0.25;
  cursor: not-allowed;
}

.fb-nav-prev { left: 10px; }
.fb-nav-next { right: 10px; }

.fb-bottom-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

@media (max-width: 960px) {
  .fb-stage { padding: 14px 10px; }
  .fb-leaf { min-width: 260px; }
  .fb-paper { width: 100%; min-height: 400px; padding: 20px 18px 36px; }
  .fb-nav-arrow { display: none; }
}


/* ==================== REAL 3D HINGED PAGE-TURN & MOUSE SWIPE ==================== */
.fb-book-spread {
  position: relative;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
  cursor: grab;
}

.fb-book-spread:active {
  cursor: grabbing;
}

.fb-3d-sheet {
  position: absolute;
  top: 0;
  bottom: 0;
  width: calc(50% - 3px);
  transform-style: preserve-3d;
  will-change: transform;
  z-index: 12;
  pointer-events: none;
}

.fb-3d-sheet.is-next {
  right: 0;
  transform-origin: left center;
}

.fb-3d-sheet.is-prev {
  left: 0;
  transform-origin: right center;
}

.fb-3d-face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  overflow: hidden;
  background: #fdfcf8;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.34);
}

.fb-3d-sheet.is-next .fb-3d-front {
  border-radius: 0 8px 8px 0;
}

.fb-3d-sheet.is-next .fb-3d-back {
  transform: rotateY(180deg);
  border-radius: 8px 0 0 8px;
}

.fb-3d-sheet.is-prev .fb-3d-front {
  border-radius: 8px 0 0 8px;
}

.fb-3d-sheet.is-prev .fb-3d-back {
  transform: rotateY(-180deg);
  border-radius: 0 8px 8px 0;
}

.fb-3d-shade {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  opacity: 0;
  pointer-events: none;
}

.fb-pdf-img-wrap {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
}

.fb-pdf-img-wrap img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  pointer-events: none;
}

.fb-pdf-loading {
  padding: 60px 24px;
  color: #64748b;
  font-size: 13px;
  font-weight: 700;
}

.fb-blank-paper {
  background: #f8f5ef;
}


/* ==================== FLIPBOOK FULLSCREEN OVERLAY & DELETE CHIPS ==================== */
.fb-shell.is-fs-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  border-radius: 0;
  border: none;
  padding: 16px 24px;
  display: flex;
  flex-direction: column;
  background: var(--bg-page);
  overflow-y: auto;
}

.fb-shell.is-fs-overlay .fb-stage {
  flex: 1;
  min-height: 72vh;
}

.fb-recent-chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-soft);
  overflow: hidden;
}

.fb-recent-chip.is-active {
  border-color: var(--red-600);
  background: var(--red-600);
}

.fb-recent-open,
.fb-recent-del {
  border: none;
  background: transparent;
  color: var(--text-main);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  padding: 5px 10px;
}

.fb-recent-del {
  padding: 5px 8px 5px 4px;
  color: var(--red-600);
}

.fb-recent-chip.is-active .fb-recent-open,
.fb-recent-chip.is-active .fb-recent-del {
  color: #ffffff;
}


/* ==================== PRO TINDER-STYLE SWIPE FLASHCARDS (GREEN RIGHT / RED LEFT) ==================== */
.swipe-stage-pro {
  position: relative;
  overflow: hidden;
  border-radius: 22px;
  padding: 18px 12px;
}

.swipe-aura-zone {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 42%;
  display: flex;
  align-items: center;
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 0.06em;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.08s linear;
  z-index: 0;
}

.swipe-aura-left {
  left: 0;
  justify-content: flex-start;
  padding-left: 22px;
  color: #dc2626;
  background: rgba(220, 38, 38, 0.32);
}

.swipe-aura-right {
  right: 0;
  justify-content: flex-end;
  padding-right: 22px;
  color: #059669;
  background: rgba(16, 185, 129, 0.34);
}

.swipe-deck-shadow {
  position: absolute;
  width: min(560px, 86%);
  height: 310px;
  border-radius: 22px;
  background: var(--surface-soft);
  border: 1.5px solid var(--border);
  transform: translateY(12px) scale(0.95);
  opacity: 0.7;
  pointer-events: none;
  z-index: 0;
}

.swipe-card-wrap {
  position: relative;
  z-index: 2;
  border-radius: 22px;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}

.swipe-card-wrap:active {
  cursor: grabbing;
}

.swipe-tint-overlay {
  position: absolute;
  inset: 0;
  border-radius: 22px;
  pointer-events: none;
  z-index: 6;
  opacity: 0;
}

[data-theme="dark"] .swipe-aura-left {
  color: #fca5a5;
  background: rgba(239, 68, 68, 0.42);
}

[data-theme="dark"] .swipe-aura-right {
  color: #6ee7b7;
  background: rgba(16, 185, 129, 0.42);
}


/* ==================== IELTS PRO TOOLS (BAND CALC, MISTAKE BANK, PARAPHRASE VAULT) ==================== */
.pro-panel-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 20px;
  padding: 20px 22px;
  box-shadow: var(--shadow-sm);
}

.bc-overall-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 8px 18px;
  border-radius: 16px;
  background: var(--red-700);
  color: #ffffff;
  min-width: 96px;
  box-shadow: 0 8px 20px rgba(220, 38, 38, 0.3);
}

.bc-overall-badge span {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  opacity: 0.9;
}

.bc-overall-badge strong {
  font-size: 26px;
  line-height: 1.1;
}

.bc-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.bc-box {
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 14px;
}

.bc-box-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  margin-bottom: 6px;
  color: var(--text-main);
}

.mk-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mk-item {
  padding: 14px 16px;
  border-radius: 14px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
}

.pv-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.pv-card {
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
}

@media (max-width: 720px) {
  .bc-grid,
  .pv-grid {
    grid-template-columns: 1fr;
  }
}


/* ==================== RPG LEVEL 1 -> 100 & EPIC RANK SYSTEM ==================== */
.meta-pill.lvl-pill {
  background: #fffbeb;
  border-color: #fcd34d;
  color: #92400e;
  font-weight: 800;
}

.meta-pill.lvl-pill:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.25);
}

[data-theme="dark"] .meta-pill.lvl-pill {
  background: rgba(180, 83, 9, 0.28);
  border-color: rgba(251, 191, 36, 0.45);
  color: #fde68a;
}

.lvl-hero-box {
  padding: 16px 18px;
  border-radius: 16px;
  border: 1.5px solid var(--border);
}

.lvl-crest {
  width: 58px;
  height: 58px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  color: #fff;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
  flex-shrink: 0;
}

.lvl-xp-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
}

.lvl-xp-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 10px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-sub);
}

.lvl-rank-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 235px;
  overflow-y: auto;
  padding-right: 4px;
}

.lvl-rank-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 12px;
  background: var(--surface-soft);
  border: 1.5px solid var(--border);
  opacity: 0.68;
}

.lvl-rank-row.is-unlocked {
  opacity: 1;
}

.lvl-rank-row.is-current {
  opacity: 1;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

@media (max-width: 600px) {
  .lvl-xp-grid {
    grid-template-columns: 1fr;
  }
}


/* ==================== INTERACTIVE 2.5D ISLAND MAP & PET SANCTUARY ==================== */
.game-island-shell {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 22px;
  overflow: hidden;
  box-shadow: 0 14px 36px rgba(15, 23, 42, 0.08);
  margin-bottom: 18px;
}

.game-island-shell.is-fullscreen {
  position: fixed;
  inset: 14px;
  z-index: 950;
  display: flex;
  flex-direction: column;
  margin: 0;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.45);
}

.game-island-shell.is-fullscreen .game-island-world {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

.game-island-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 16px;
  background: var(--surface-soft);
  border-bottom: 1px solid var(--border);
}

.game-island-tb-left,
.game-island-tb-right {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.game-island-badge {
  font-size: 13.5px;
  font-weight: 800;
  color: var(--text-main);
}

.game-island-stat {
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-sub);
}

.game-harvest-hint {
  font-size: 12px;
  font-weight: 700;
  color: #059669;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.25);
  padding: 4px 10px;
  border-radius: 999px;
}

.game-harvest-pulse {
  animation: islandPulse 1.8s ease-in-out infinite;
}

@keyframes islandPulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.45); }
  50% { transform: scale(1.03); box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
}

/* Living Ocean + Sky Stage */
.game-island-world {
  position: relative;
  padding: 24px 20px 20px;
  overflow: hidden;
  transition: background 0.45s ease;
}

.game-island-world.is-day {
  background: #e0f2fe;
}

.game-island-world.is-night {
  background: #312e81;
}

.game-sky-decor {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.game-celestial {
  position: absolute;
  top: 12px;
  right: 22px;
  font-size: 32px;
  filter: drop-shadow(0 0 14px rgba(253, 224, 71, 0.65));
  animation: islandFloat 4.5s ease-in-out infinite;
}

.game-cloud {
  position: absolute;
  font-size: 28px;
  opacity: 0.78;
  animation: cloudDrift 18s linear infinite;
}
.game-cloud.c1 { top: 14px; left: 8%; animation-duration: 22s; }
.game-cloud.c2 { top: 34px; left: 62%; font-size: 22px; animation-duration: 28s; }

@keyframes cloudDrift {
  0% { transform: translateX(-16px); }
  50% { transform: translateX(22px); }
  100% { transform: translateX(-16px); }
}

.game-star {
  position: absolute;
  color: #fde68a;
  font-size: 13px;
  animation: starTwinkle 2.6s ease-in-out infinite;
}
.game-star.s1 { top: 16px; left: 14%; animation-delay: 0s; }
.game-star.s2 { top: 28px; left: 36%; animation-delay: 0.7s; }
.game-star.s3 { top: 18px; left: 66%; animation-delay: 1.3s; }
.game-star.s4 { top: 44px; left: 88%; animation-delay: 1.9s; }

@keyframes starTwinkle {
  0%, 100% { opacity: 0.35; transform: scale(0.9); }
  50% { opacity: 1; transform: scale(1.25); }
}

.game-ocean-waves {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.game-wave {
  position: absolute;
  opacity: 0.55;
  font-size: 18px;
  animation: islandFloat 3.6s ease-in-out infinite;
}
.game-wave.w1 { top: 24%; left: 4%; }
.game-wave.w2 { top: 16%; right: 6%; font-size: 22px; opacity: 0.85; animation-duration: 4.8s; }
.game-wave.w3 { bottom: 32%; right: 4%; animation-delay: 1.2s; }

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

/* 2.5D Island Sandy Coastline + Lush Green Terrain */
.game-island-beach {
  position: relative;
  max-width: 860px;
  margin: 12px auto 18px;
  padding: 14px;
  border-radius: 46% 54% 48% 52% / 26% 30% 24% 28%;
  background: #fde68a;
  box-shadow:
    0 16px 0 rgba(12, 74, 110, 0.38),
    0 24px 44px rgba(2, 6, 23, 0.35),
    inset 0 4px 10px rgba(255, 255, 255, 0.55);
}

.game-island-world.is-night .game-island-beach {
  background: #d97706;
  box-shadow:
    0 16px 0 rgba(2, 6, 23, 0.65),
    0 24px 50px rgba(0, 0, 0, 0.55);
}

.game-island-land {
  position: relative;
  width: 100%;
  height: 360px;
  border-radius: 45% 55% 47% 53% / 24% 28% 22% 26%;
  background:
    #86efac;
  box-shadow:
    inset 0 -14px 26px rgba(20, 83, 45, 0.45),
    inset 0 8px 18px rgba(220, 252, 231, 0.45);
  overflow: visible;
}

.game-island-world.is-night .game-island-land {
  background:
    #166534;
  box-shadow:
    inset 0 -14px 28px rgba(0, 0, 0, 0.6),
    inset 0 6px 14px rgba(52, 211, 153, 0.16);
}

.game-scenery {
  position: absolute;
  font-size: 20px;
  pointer-events: none;
  opacity: 0.85;
  filter: drop-shadow(0 3px 3px rgba(0, 0, 0, 0.2));
}
.game-scenery.sc1 { top: 14%; left: 32%; }
.game-scenery.sc2 { top: 68%; left: 10%; font-size: 23px; }
.game-scenery.sc3 { top: 20%; right: 16%; }
.game-scenery.sc4 { top: 72%; left: 56%; font-size: 16px; }
.game-scenery.sc5 { top: 62%; right: 12%; font-size: 17px; }
.game-scenery.sc6 { top: 44%; left: 8%; font-size: 22px; }

/* Interactive Clickable Building Plots */
.game-island-plot {
  position: absolute;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 7px 10px;
  min-width: 78px;
  border-radius: 16px;
  cursor: pointer;
  border: 2px solid rgba(255, 255, 255, 0.72);
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(4px);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.22);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
  z-index: 3;
}

.game-island-plot:hover {
  transform: translate(-50%, -56%) scale(1.07);
  z-index: 8;
  box-shadow: 0 14px 26px rgba(15, 23, 42, 0.3);
}

.game-island-plot.tier-empty {
  background: rgba(255, 255, 255, 0.62);
  border: 2px dashed rgba(21, 128, 61, 0.65);
  opacity: 0.9;
}

.game-island-plot.tier-empty.can-build {
  border-color: #f59e0b;
  background: rgba(254, 243, 199, 0.9);
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.28), 0 8px 16px rgba(15, 23, 42, 0.18);
}

.game-island-plot.tier-high {
  border-color: #f59e0b;
  background: #fffbeb;
}

.game-island-plot.tier-max {
  border-color: #a855f7;
  background: #faf5ff;
  box-shadow: 0 0 18px rgba(168, 85, 247, 0.45), 0 8px 18px rgba(15, 23, 42, 0.25);
}

.game-island-plot.is-selected {
  border-color: #dc2626 !important;
  box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.32), 0 14px 28px rgba(15, 23, 42, 0.32) !important;
  transform: translate(-50%, -56%) scale(1.09);
  z-index: 10;
}

.game-plot-icon {
  font-size: 28px;
  line-height: 1.05;
  filter: drop-shadow(0 3px 4px rgba(0, 0, 0, 0.18));
}

.game-island-plot.tier-empty .game-plot-icon {
  font-size: 20px;
  opacity: 0.85;
}

.game-plot-tag {
  font-size: 10.5px;
  font-weight: 800;
  padding: 1px 7px;
  border-radius: 999px;
  background: #15803d;
  color: #ffffff;
  white-space: nowrap;
}

.game-island-plot.tier-empty .game-plot-tag {
  background: #475569;
}

.game-island-plot.tier-empty.can-build .game-plot-tag {
  background: #d97706;
}

.game-plot-name {
  font-size: 10px;
  font-weight: 700;
  color: #0f172a;
  max-width: 92px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.game-island-world.is-night .game-island-plot {
  background: rgba(15, 23, 42, 0.86);
  border-color: rgba(148, 163, 184, 0.45);
}
.game-island-world.is-night .game-plot-name {
  color: #f1f5f9;
}
.game-island-world.is-night .game-island-plot.tier-empty {
  background: rgba(15, 23, 42, 0.65);
  border-color: rgba(52, 211, 153, 0.5);
}

/* 🐾 FENCED PET SANCTUARY / ENCLOSURE */
.game-pet-enclosure {
  position: relative;
  max-width: 860px;
  margin: 0 auto;
  border-radius: 20px;
  background: rgba(254, 243, 199, 0.92);
  border: 3px solid #92400e;
  box-shadow: 0 12px 26px rgba(15, 23, 42, 0.28), inset 0 2px 8px rgba(255, 255, 255, 0.6);
  overflow: visible;
}

.game-island-world.is-night .game-pet-enclosure {
  background: rgba(30, 41, 59, 0.92);
  border-color: #b45309;
}

.game-pen-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 14px;
  background: #92400e;
  color: #fef3c7;
  border-radius: 16px 16px 0 0;
}

.game-pen-sign {
  font-size: 13px;
  font-weight: 700;
}

.game-pen-sign span {
  opacity: 0.85;
  font-weight: 600;
}

.game-pen-gacha-btn {
  background: #fef3c7;
  color: #78350f;
  border: none;
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 11.5px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.15s ease;
}
.game-pen-gacha-btn:hover {
  transform: translateY(-1px);
}

.game-pen-yard {
  position: relative;
  padding: 16px 14px 18px;
  min-height: 126px;
}

.game-pen-fence-top,
.game-pen-fence-bottom {
  position: absolute;
  left: 10px;
  right: 10px;
  height: 6px;
  background: #92400e;
  opacity: 0.45;
  pointer-events: none;
}
.game-pen-fence-top { top: 6px; }
.game-pen-fence-bottom { bottom: 6px; }

.game-pen-pets {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 6px 4px;
}

.game-pen-pet {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 10px 12px 8px;
  min-width: 86px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.86);
  border: 2px solid rgba(148, 163, 184, 0.45);
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.14);
}

.game-island-world.is-night .game-pen-pet {
  background: rgba(15, 23, 42, 0.84);
  color: #f8fafc;
}

.game-pen-pet:hover {
  transform: translateY(-5px) scale(1.06) !important;
  z-index: 6;
}

.game-pen-pet.is-selected {
  border-color: #dc2626 !important;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.3), 0 10px 22px rgba(15, 23, 42, 0.25);
  z-index: 8;
}

.game-pen-pet.rarity-rare {
  border-color: #38bdf8;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.32);
}

.game-pen-pet.rarity-epic {
  border-color: #a855f7;
  box-shadow: 0 0 14px rgba(168, 85, 247, 0.42);
}

.game-pen-pet.rarity-legendary {
  border-color: #f59e0b;
  background: #fffbeb;
  box-shadow: 0 0 18px rgba(245, 158, 11, 0.55);
}

.game-island-world.is-night .game-pen-pet.rarity-legendary {
  background: rgba(120, 53, 15, 0.85);
}

.game-pen-pet-emoji {
  font-size: 32px;
  line-height: 1;
}

.game-pen-pet-meta {
  font-size: 10.5px;
  font-weight: 700;
  color: #1e293b;
  white-space: nowrap;
}
.game-island-world.is-night .game-pen-pet-meta {
  color: #e2e8f0;
}
.game-pen-pet-meta b {
  color: #d97706;
}

.game-pet-crown {
  position: absolute;
  top: -10px;
  right: -6px;
  font-size: 16px;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.25));
}

.game-pet-bubble {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: #0f172a;
  color: #ffffff;
  font-size: 11px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 10px;
  white-space: nowrap;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.28);
  z-index: 20;
  pointer-events: none;
}

/* Gentle roaming animations for pets inside the enclosure */
.game-pen-pet.roam-1 { animation: petRoam1 3.4s ease-in-out infinite; }
.game-pen-pet.roam-2 { animation: petRoam2 4.1s ease-in-out infinite; }
.game-pen-pet.roam-3 { animation: petRoam3 3.7s ease-in-out infinite; }
.game-pen-pet.roam-4 { animation: petRoam4 4.5s ease-in-out infinite; }

@keyframes petRoam1 {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(4px, -4px); }
}
@keyframes petRoam2 {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(-5px, -3px); }
}
@keyframes petRoam3 {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(3px, 3px); }
}
@keyframes petRoam4 {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(-3px, -5px); }
}

.game-pen-empty {
  text-align: center;
  padding: 14px 10px;
  font-size: 13px;
  color: #365314;
  font-weight: 600;
}
.game-island-world.is-night .game-pen-empty {
  color: #d1fae5;
}

/* Dynamic Inspector Bar */
.game-inspector-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  background: var(--surface);
  border-top: 1px solid var(--border);
}

.game-insp-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1;
}

.game-insp-icon {
  font-size: 34px;
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  flex-shrink: 0;
}

.game-insp-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  font-size: 15px;
  font-weight: 800;
  color: var(--text-main);
}

.game-insp-zone {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-sub);
}

.game-insp-desc {
  font-size: 12.5px;
  color: var(--text-sub);
  margin-top: 3px;
}

.game-insp-speech {
  margin-top: 4px;
  font-size: 12px;
  font-weight: 700;
  color: #b91c1c;
}

[data-theme="dark"] .game-insp-speech {
  color: #fca5a5;
}

.game-insp-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

@media (max-width: 680px) {
  .game-island-land {
    height: 310px;
  }
  .game-island-plot {
    min-width: 62px;
    padding: 5px 6px;
  }
  .game-plot-icon {
    font-size: 22px;
  }
  .game-plot-name {
    display: none;
  }
}


/* ==================== ACHIEVEMENTS & TROPHY HALL ==================== */
.ach-pill {
  position: relative;
  gap: 5px;
  font-weight: 700;
  color: #b45309;
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.35);
}

.ach-pill:hover {
  background: rgba(245, 158, 11, 0.22);
}

.ach-topbar-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #dc2626;
  color: #ffffff;
  font-size: 10.5px;
  font-weight: 800;
  box-shadow: 0 2px 6px rgba(220, 38, 38, 0.45);
}

.ach-mini-dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 17px;
  height: 17px;
  padding: 0 5px;
  margin-left: 4px;
  border-radius: 999px;
  background: #dc2626;
  color: #ffffff;
  font-size: 10px;
  font-weight: 800;
}

.ach-modal-dialog {
  max-width: 920px !important;
  max-height: 88vh;
  overflow-y: auto;
}

.ach-shell {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.ach-hero {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 20px;
  border-radius: 18px;
  background: rgba(245, 158, 11, 0.14);
  border: 1.5px solid rgba(245, 158, 11, 0.35);
}

.ach-hero-left {
  flex: 1;
  min-width: 240px;
}

.ach-kicker {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: #b45309;
  margin-bottom: 4px;
}

.ach-title {
  margin: 0 0 8px;
  font-size: 19px;
  font-weight: 800;
  color: var(--text-main);
}

.ach-bar-track {
  height: 9px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.25);
  overflow: hidden;
  margin-bottom: 7px;
}

.ach-bar-fill {
  height: 100%;
  border-radius: 999px;
  background: #f59e0b;
  transition: width 0.35s ease;
}

.ach-sub {
  font-size: 12.5px;
  color: var(--text-sub);
}

.ach-done-pill {
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 700;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-sub);
}

.ach-cat-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.ach-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(255px, 1fr));
  gap: 12px;
}

.ach-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px;
  border-radius: 16px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.ach-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.08);
}

.ach-card.is-claimable {
  border-color: #10b981;
  background: rgba(16, 185, 129, 0.08);
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.22);
}

.ach-card.is-claimed {
  opacity: 0.88;
}

.ach-card.is-locked .ach-icon-wrap {
  filter: grayscale(0.45);
  opacity: 0.85;
}

.ach-card-top {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ach-icon-wrap {
  width: 44px;
  height: 44px;
  border-radius: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  flex-shrink: 0;
}

.ach-card-title {
  font-size: 14px;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.25;
}

.ach-tier-tag {
  display: inline-block;
  margin-top: 3px;
  font-size: 10.5px;
  font-weight: 800;
  padding: 1px 8px;
  border-radius: 999px;
}

.ach-tier-tag.tier-bronze { background: rgba(180, 83, 9, 0.14); color: #b45309; }
.ach-tier-tag.tier-silver { background: rgba(100, 116, 139, 0.16); color: #475569; }
.ach-tier-tag.tier-gold { background: rgba(234, 179, 8, 0.18); color: #a16207; }
.ach-tier-tag.tier-diamond { background: rgba(14, 165, 233, 0.18); color: #0369a1; }
.ach-tier-tag.tier-mythic { background: rgba(168, 85, 247, 0.2); color: #9333ea; }

.ach-card-desc {
  margin: 0;
  font-size: 12.5px;
  color: var(--text-sub);
  line-height: 1.4;
}

.ach-prog-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ach-prog-bar {
  flex: 1;
  height: 7px;
  border-radius: 999px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  overflow: hidden;
}

.ach-prog-fill {
  height: 100%;
  border-radius: 999px;
  background: #f59e0b;
}

.ach-prog-num {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-sub);
  white-space: nowrap;
}

.ach-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: auto;
  padding-top: 6px;
  border-top: 1px dashed var(--border);
}

.ach-rewards {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.ach-rew-pill {
  font-size: 11px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(245, 158, 11, 0.14);
  color: #b45309;
}

.ach-rew-pill.is-xp {
  background: rgba(124, 58, 237, 0.13);
  color: #7c3aed;
}

.ach-status-claimed {
  font-size: 11.5px;
  font-weight: 800;
  color: #059669;
}

.ach-status-lock {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-muted);
}

[data-theme="dark"] .ach-pill { color: #fcd34d; }
[data-theme="dark"] .ach-kicker { color: #fcd34d; }
[data-theme="dark"] .ach-rew-pill { color: #fcd34d; background: rgba(245, 158, 11, 0.2); }
[data-theme="dark"] .ach-rew-pill.is-xp { color: #c4b5fd; background: rgba(139, 92, 246, 0.22); }
[data-theme="dark"] .ach-tier-tag.tier-bronze { color: #fdba74; }
[data-theme="dark"] .ach-tier-tag.tier-silver { color: #cbd5e1; }
[data-theme="dark"] .ach-tier-tag.tier-gold { color: #fde047; }
[data-theme="dark"] .ach-tier-tag.tier-diamond { color: #7dd3fc; }
[data-theme="dark"] .ach-tier-tag.tier-mythic { color: #e879f9; }

@media (max-width: 960px) {
  .ach-pill-lbl {
    display: none;
  }
}


/* ==================== PRO HUB: ANALYTICS, SRS ANKI & FULL MOCK TEST ==================== */
.pro-pill {
  position: relative;
  gap: 5px;
  font-weight: 700;
  color: #0369a1;
  background: rgba(14, 165, 233, 0.12);
  border-color: rgba(14, 165, 233, 0.35);
}

.pro-pill:hover {
  background: rgba(14, 165, 233, 0.22);
}

.ach-topbar-badge.is-blue {
  background: #0284c7;
  box-shadow: 0 2px 6px rgba(2, 132, 199, 0.4);
}

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

.pro-card {
  padding: 18px;
  border-radius: 18px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
}

.pro-kicker {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: var(--red-700);
  margin-bottom: 6px;
}

.pro-band-row {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.pro-band-circle {
  width: 82px;
  height: 82px;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #dc2626;
  color: #ffffff;
  box-shadow: 0 10px 22px rgba(220, 38, 38, 0.32);
  flex-shrink: 0;
}

.pro-band-circle span {
  font-size: 26px;
  font-weight: 800;
  line-height: 1;
}

.pro-band-circle small {
  font-size: 9px;
  font-weight: 700;
  opacity: 0.9;
  letter-spacing: 0.06em;
  margin-top: 2px;
}

.pro-pillars {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pro-pillar-head {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-sub);
  margin-bottom: 3px;
}

.pro-pillar-bar {
  height: 7px;
  border-radius: 999px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  overflow: hidden;
}

.pro-pillar-fill {
  height: 100%;
  border-radius: 999px;
  background: #0ea5e9;
}

/* 7-Day Bar Chart */
.pro-chart-wrap {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
  align-items: end;
  height: 155px;
  padding: 12px 6px 6px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 14px;
  margin-bottom: 12px;
}

.pro-bar-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  gap: 4px;
}

.pro-bar-val {
  font-size: 10.5px;
  font-weight: 800;
  color: var(--text-sub);
}

.pro-bar-track {
  flex: 1;
  width: 100%;
  max-width: 28px;
  display: flex;
  align-items: flex-end;
  background: rgba(148, 163, 184, 0.16);
  border-radius: 8px;
  overflow: hidden;
}

.pro-bar-fill {
  width: 100%;
  border-radius: 8px;
  background: #f59e0b;
  transition: height 0.35s ease;
}

.pro-bar-fill.is-goal {
  background: #10b981;
}

.pro-bar-lbl {
  font-size: 11px;
  font-weight: 800;
  color: var(--text-main);
}

.pro-bar-date {
  font-size: 9.5px;
  color: var(--text-muted);
}

.pro-mini-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.pro-mstat {
  padding: 8px;
  border-radius: 11px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  text-align: center;
}

.pro-mstat span {
  display: block;
  font-size: 10.5px;
  color: var(--text-sub);
}

.pro-mstat strong {
  font-size: 15px;
  font-weight: 800;
  color: var(--text-main);
}

.pro-mock-hist {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.pro-mh-item {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 11px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
}

/* SRS Anki Card */
.srs-top-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}

.srs-card {
  max-width: 600px;
  margin: 0 auto;
  padding: 24px 22px;
  border-radius: 20px;
  background: var(--surface);
  border: 2px solid var(--border);
  text-align: center;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
}

.srs-card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.srs-word {
  font-size: 30px;
  font-weight: 800;
  color: var(--red-800);
}

.srs-ipa {
  font-size: 14px;
  color: var(--red-600);
  margin-top: 4px;
}

.srs-answer-box {
  margin: 18px 0 16px;
  padding: 14px 16px;
  border-radius: 14px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  text-align: left;
}

.srs-vi {
  font-size: 16px;
  font-weight: 800;
  color: var(--text-main);
}

.srs-en {
  font-size: 13px;
  color: var(--text-sub);
  margin-top: 4px;
}

.srs-ex {
  font-size: 13px;
  font-style: italic;
  color: var(--text-sub);
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed var(--border);
}

.srs-rate-prompt {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-sub);
  margin-bottom: 8px;
}

.srs-rate-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.srs-rate-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 10px 6px;
  border-radius: 12px;
  border: 1.5px solid var(--border);
  background: var(--surface-soft);
  cursor: pointer;
  transition: transform 0.14s ease, border-color 0.14s ease;
}

.srs-rate-btn:hover {
  transform: translateY(-2px);
}

.srs-rate-btn strong { font-size: 13px; color: var(--text-main); }
.srs-rate-btn span { font-size: 11px; color: var(--text-sub); }
.srs-rate-btn.is-again:hover { border-color: #ef4444; background: rgba(239, 68, 68, 0.1); }
.srs-rate-btn.is-hard:hover { border-color: #f59e0b; background: rgba(245, 158, 11, 0.1); }
.srs-rate-btn.is-good:hover { border-color: #10b981; background: rgba(16, 185, 129, 0.1); }
.srs-rate-btn.is-easy:hover { border-color: #0ea5e9; background: rgba(14, 165, 233, 0.1); }

/* Full Mock Test */
.mock-topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 12px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.mock-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.mock-step-pill {
  font-size: 12px;
  font-weight: 700;
  padding: 5px 11px;
  border-radius: 999px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  color: var(--text-sub);
}

.mock-step-pill.is-now {
  background: #dc2626;
  border-color: #dc2626;
  color: #ffffff;
}

.mock-step-pill.is-done {
  background: rgba(16, 185, 129, 0.14);
  border-color: #34d399;
  color: #059669;
}

.mock-clock {
  font-size: 14px;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(220, 38, 38, 0.1);
  color: #b91c1c;
}

.mock-reading-split {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 16px;
  max-height: 460px;
}

.mock-passage {
  overflow-y: auto;
  padding-right: 8px;
}

.mock-q-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 460px;
  overflow-y: auto;
}

.mock-q-card {
  padding: 11px 13px;
  border-radius: 12px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
}

.mock-q-prompt {
  font-size: 13px;
  margin-bottom: 7px;
  color: var(--text-main);
}

.mock-gap-input {
  width: 100%;
  padding: 7px 10px;
  font-size: 13px;
}

.mock-opt-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.mock-opt-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  padding: 6px 9px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
}

.mock-opt-item.is-picked {
  border-color: #dc2626;
  background: rgba(220, 38, 38, 0.08);
}

.mock-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

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

.mock-score-box {
  padding: 14px 10px;
  border-radius: 14px;
  background: var(--surface-soft);
  border: 1.5px solid var(--border);
  text-align: center;
}

.mock-score-box span { display: block; font-size: 12px; font-weight: 700; color: var(--text-sub); }
.mock-score-box strong { display: block; font-size: 26px; font-weight: 800; color: var(--red-700); margin: 2px 0; }
.mock-score-box small { font-size: 11.5px; color: var(--text-sub); }

[data-theme="dark"] .pro-pill { color: #7dd3fc; }
[data-theme="dark"] .mock-clock { color: #fca5a5; background: rgba(239, 68, 68, 0.18); }

@media (max-width: 720px) {
  .mock-reading-split { grid-template-columns: 1fr; max-height: none; }
  .srs-rate-grid { grid-template-columns: repeat(2, 1fr); }
  .pro-mini-stats { grid-template-columns: repeat(2, 1fr); }
}


/* ==================== GRAMMAR EXPLANATION LINE (RIGHT & WRONG) ==================== */
.gram-exp-details {
  margin-top: 7px;
  padding: 7px 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.55);
  border: 1px dashed rgba(148, 163, 184, 0.45);
}

.gram-exp-details summary {
  cursor: pointer;
  font-size: 12.5px;
  font-weight: 800;
  color: var(--text-main);
  user-select: none;
  list-style: none;
}

.gram-exp-details summary::-webkit-details-marker {
  display: none;
}

.gram-exp-details summary::after {
  content: ' ▾';
  opacity: 0.7;
}

.gram-exp-details[open] summary::after {
  content: ' ▴';
}

.gram-exp-body {
  margin-top: 5px;
  font-size: 13px;
  line-height: 1.55;
  color: var(--text-main);
}

[data-theme="dark"] .gram-exp-details {
  background: rgba(15, 23, 42, 0.48);
  border-color: rgba(148, 163, 184, 0.35);
}


/* ==================== GRAMMAR FORMULA TABLE & IELTS APPLICATION ==================== */
.gram-forms-table {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
}

.gram-form-row {
  display: grid;
  grid-template-columns: 185px 1fr;
  gap: 12px;
  padding: 11px 14px;
  border-radius: 13px;
  background: var(--surface-soft);
  border: 1.5px solid var(--border);
  align-items: start;
}

.gram-form-type {
  font-size: 12.5px;
  font-weight: 800;
  color: var(--red-700);
  padding-top: 2px;
}

.gram-form-code {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-main);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 5px 10px;
  border-radius: 8px;
  display: inline-block;
  margin-bottom: 5px;
}

.gram-form-note {
  font-size: 12.5px;
  color: var(--text-sub);
  line-height: 1.5;
}

.gram-ielts-box {
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: 14px;
  background: rgba(16, 185, 129, 0.1);
  border: 1.5px solid rgba(16, 185, 129, 0.35);
}

.gram-ielts-head {
  font-size: 13px;
  font-weight: 800;
  color: #047857;
  margin-bottom: 5px;
}

.gram-ielts-body {
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--text-main);
}

[data-theme="dark"] .gram-ielts-head {
  color: #6ee7b7;
}

[data-theme="dark"] .gram-form-type {
  color: #fca5a5;
}

@media (max-width: 680px) {
  .gram-form-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }
}


/* ==================== DARK MODE CONTRAST FIX: 145 UNITS & COMPLETED ROWS ==================== */
[data-theme="dark"] .units-chapter-head {
  background: rgba(127, 29, 29, 0.35) !important;
  border-bottom-color: rgba(248, 113, 113, 0.25) !important;
}

[data-theme="dark"] .units-chapter-title {
  color: #fecaca !important;
}

[data-theme="dark"] .unit-row-item {
  background: var(--surface) !important;
}

[data-theme="dark"] .unit-row-item:hover {
  background: rgba(30, 41, 59, 0.92) !important;
}

[data-theme="dark"] .unit-row-item.is-studied {
  background: rgba(6, 78, 59, 0.26) !important;
  border-left: 4px solid #34d399 !important;
}

[data-theme="dark"] .unit-row-item.is-studied:hover {
  background: rgba(6, 78, 59, 0.36) !important;
}

[data-theme="dark"] .unit-num-badge {
  background: rgba(127, 29, 29, 0.35) !important;
  border-color: rgba(248, 113, 113, 0.4) !important;
  color: #fca5a5 !important;
}

[data-theme="dark"] .unit-row-item.is-studied .unit-num-badge {
  background: rgba(16, 185, 129, 0.2) !important;
  border-color: #34d399 !important;
  color: #6ee7b7 !important;
}

[data-theme="dark"] .unit-row-en {
  color: #f8fafc !important;
}

[data-theme="dark"] .unit-row-vi {
  color: #fca5a5 !important;
}

[data-theme="dark"] .unit-row-key {
  color: #cbd5e1 !important;
}

[data-theme="dark"] .unit-row-example {
  background: rgba(15, 23, 42, 0.85) !important;
  color: #e2e8f0 !important;
  border-left-color: #f87171 !important;
}

[data-theme="dark"] .grammar-card.is-done,
[data-theme="dark"] .daily-task-row.is-done {
  background: rgba(6, 78, 59, 0.24) !important;
  border-color: rgba(52, 211, 153, 0.4) !important;
}


/* ==================== DAILY ROADMAP TASKS LAYOUT & QUOTA PILLS ==================== */
.daily-task-row {
  display: flex !important;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 14px;
  padding: 12px 14px;
}

.daily-toggle-btn {
  flex-shrink: 0;
  width: auto !important;
  white-space: nowrap;
}

.daily-task-main {
  flex: 1 1 280px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.daily-quota-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 800;
  background: rgba(220, 38, 38, 0.12);
  color: var(--red-700);
  border: 1px solid rgba(220, 38, 38, 0.25);
  white-space: nowrap;
}

.daily-task-row.is-done .daily-quota-pill {
  background: rgba(16, 185, 129, 0.16);
  color: #059669;
  border-color: rgba(16, 185, 129, 0.35);
}

.daily-go-btn {
  flex-shrink: 0;
  width: auto !important;
  white-space: nowrap;
}

[data-theme="dark"] .daily-quota-pill {
  background: rgba(248, 113, 113, 0.18);
  color: #fca5a5;
  border-color: rgba(248, 113, 113, 0.35);
}

[data-theme="dark"] .daily-task-row.is-done .daily-quota-pill {
  background: rgba(52, 211, 153, 0.18);
  color: #6ee7b7;
  border-color: rgba(52, 211, 153, 0.4);
}


/* ==================== UPGRADED ILLUSTRATED ISLAND & FREE-ROAMING PET SANCTUARY ==================== */
.game-island-canvas {
  position: relative;
  width: 100%;
  max-width: 900px;
  height: 430px;
  margin: 8px auto 18px;
}

.game-island-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 20px 34px rgba(2, 6, 23, 0.42));
  pointer-events: none;
}

.game-star.s5 { top: 68px; left: 22%; animation-delay: 2.3s; }

/* Glowing Fireflies at Night */
.game-firefly {
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #fde047;
  box-shadow: 0 0 10px 3px rgba(253, 224, 71, 0.75);
  pointer-events: none;
  animation: fireflyDrift 5s ease-in-out infinite;
}
.game-firefly.f1 { top: 42%; left: 42%; }
.game-firefly.f2 { top: 58%; left: 64%; animation-delay: 1.6s; }
.game-firefly.f3 { top: 34%; left: 28%; animation-delay: 3.1s; }

@keyframes fireflyDrift {
  0%, 100% { transform: translate(0, 0) scale(0.8); opacity: 0.3; }
  50% { transform: translate(14px, -16px) scale(1.25); opacity: 1; }
}

/* Isometric Circular Pedestal Building Plots (NO clunky rectangular cards!) */
.game-island-canvas .game-island-plot {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  padding: 0 !important;
  min-width: 0 !important;
  gap: 4px;
}

.game-island-canvas .game-island-plot:hover {
  transform: translate(-50%, -56%) scale(1.08);
}

.game-island-canvas .game-island-plot.is-selected {
  box-shadow: none !important;
  border: none !important;
}

.game-plot-pedestal {
  position: relative;
  width: 66px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.92);
  border: 2.5px solid rgba(255, 255, 255, 0.95);
  box-shadow:
    0 7px 0 rgba(15, 23, 42, 0.22),
    0 12px 18px rgba(15, 23, 42, 0.28);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.game-island-world.is-night .game-plot-pedestal {
  background: rgba(30, 41, 59, 0.95);
  border-color: rgba(148, 163, 184, 0.55);
}

.game-island-plot.tier-empty .game-plot-pedestal {
  background: rgba(254, 243, 199, 0.42);
  border: 2px dashed rgba(254, 243, 199, 0.85);
  box-shadow: 0 5px 12px rgba(2, 6, 23, 0.22);
}

.game-island-plot.tier-empty.can-build .game-plot-pedestal {
  border-color: #fbbf24;
  background: rgba(254, 243, 199, 0.78);
  box-shadow: 0 0 0 4px rgba(251, 191, 36, 0.3), 0 8px 18px rgba(2, 6, 23, 0.28);
}

.game-island-plot.tier-high .game-plot-pedestal {
  border-color: #f59e0b;
  box-shadow: 0 0 16px rgba(245, 158, 11, 0.55), 0 7px 0 rgba(180, 83, 9, 0.45);
}

.game-island-plot.tier-max .game-plot-pedestal {
  border-color: #c084fc;
  box-shadow: 0 0 22px rgba(192, 132, 252, 0.72), 0 7px 0 rgba(107, 33, 168, 0.5);
}

.game-island-plot.is-selected .game-plot-pedestal {
  border-color: #ef4444 !important;
  box-shadow: 0 0 0 5px rgba(239, 68, 68, 0.4), 0 10px 22px rgba(0, 0, 0, 0.38) !important;
}

.game-island-canvas .game-plot-icon {
  font-size: 32px;
  transform: translateY(-9px);
  filter: drop-shadow(0 5px 5px rgba(0, 0, 0, 0.28));
}

.game-island-plot.tier-empty .game-plot-icon {
  font-size: 22px;
  transform: translateY(-4px);
}

.game-plot-badge {
  position: absolute;
  bottom: -7px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10px;
  font-weight: 800;
  padding: 1px 7px;
  border-radius: 999px;
  background: #15803d;
  color: #ffffff;
  white-space: nowrap;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.28);
}

.game-island-plot.tier-empty .game-plot-badge {
  background: #334155;
}

.game-island-plot.tier-empty.can-build .game-plot-badge {
  background: #d97706;
}

.game-island-canvas .game-plot-name {
  margin-top: 5px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  max-width: none;
  background: rgba(15, 23, 42, 0.76);
  color: #f8fafc;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.25);
  white-space: nowrap;
}

/* Free-roaming Pet Sanctuary Meadow (NO clunky square card borders!) */
.game-pet-enclosure {
  max-width: 900px;
  border: 2.5px solid #b45309;
  border-radius: 22px;
  overflow: visible;
}

.game-pen-meadow {
  position: relative;
  padding: 26px 18px 22px;
  min-height: 152px;
  border-radius: 0 0 19px 19px;
  background:
    #a3e635;
  box-shadow: inset 0 10px 24px rgba(20, 83, 45, 0.28);
  overflow: visible;
}

.game-island-world.is-night .game-pen-meadow {
  background:
    #15803d;
  box-shadow: inset 0 12px 28px rgba(0, 0, 0, 0.45);
}

.game-fence-rail {
  position: absolute;
  left: 12px;
  right: 12px;
  height: 10px;
  background:
    #78350f;
  opacity: 0.85;
  pointer-events: none;
}
.game-fence-rail.is-top { top: 8px; }
.game-fence-rail.is-bottom { bottom: 7px; }

.game-pen-prop {
  position: absolute;
  pointer-events: none;
  opacity: 0.9;
  filter: drop-shadow(0 3px 4px rgba(0, 0, 0, 0.25));
}
.game-pen-prop.p-barn { left: 16px; top: 20px; font-size: 28px; }
.game-pen-prop.p-flower1 { left: 20%; bottom: 18px; font-size: 16px; }
.game-pen-prop.p-flower2 { right: 18%; top: 22px; font-size: 16px; }
.game-pen-prop.p-bowl { right: 20px; bottom: 18px; font-size: 20px; }

.game-pen-meadow .game-pen-pets {
  gap: 18px 22px;
  padding: 12px 28px 6px;
}

.game-pen-meadow .game-pen-pet {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 2px 4px !important;
  min-width: 82px;
  gap: 5px;
}

.game-pen-pet-sprite {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.game-pen-meadow .game-pen-pet-emoji {
  font-size: 40px;
  line-height: 1;
  filter: drop-shadow(0 5px 6px rgba(0, 0, 0, 0.28));
  z-index: 2;
}

.game-pen-pet-shadow {
  width: 44px;
  height: 12px;
  border-radius: 50%;
  margin-top: -5px;
  background: rgba(15, 23, 42, 0.34);
  z-index: 1;
}

.game-pen-pet.rarity-rare .game-pen-pet-shadow {
  background: rgba(56, 189, 248, 0.55);
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.65);
}
.game-pen-pet.rarity-epic .game-pen-pet-shadow {
  background: rgba(168, 85, 247, 0.58);
  box-shadow: 0 0 14px rgba(168, 85, 247, 0.72);
}
.game-pen-pet.rarity-legendary .game-pen-pet-shadow {
  background: rgba(251, 191, 36, 0.7);
  box-shadow: 0 0 18px rgba(251, 191, 36, 0.85);
}

.game-pen-pet.is-selected .game-pen-pet-emoji {
  filter: drop-shadow(0 0 12px rgba(254, 240, 138, 0.95));
  transform: scale(1.12);
}

.game-pen-pet-pill {
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  background: rgba(15, 23, 42, 0.82);
  color: #f8fafc;
  white-space: nowrap;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.25);
}
.game-pen-pet-pill b {
  color: #fbbf24;
  margin-left: 2px;
}

.game-pen-meadow .game-pet-bubble {
  max-width: 260px;
  white-space: normal;
  text-align: center;
  line-height: 1.35;
  padding: 6px 12px;
  background: #ffffff;
  color: #0f172a;
  border: 2px solid #f59e0b;
  bottom: calc(100% + 10px);
}

@media (max-width: 680px) {
  .game-island-canvas {
    height: 330px;
  }
  .game-plot-pedestal {
    width: 52px;
    height: 40px;
  }
  .game-island-canvas .game-plot-icon {
    font-size: 24px;
  }
  .game-island-canvas .game-plot-name {
    font-size: 9.5px;
    padding: 1px 5px;
  }
}


/* ==================== POLISHED LEXICON KPI STAT CARDS (LIGHT & DARK) ==================== */
.pro-stats-row {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 14px !important;
  align-items: stretch !important;
}

.pro-stats-row .lex-stat-card {
  position: relative;
  display: flex !important;
  flex-direction: column !important;
  justify-content: space-between !important;
  gap: 10px !important;
  padding: 16px 18px !important;
  border-radius: 18px !important;
  overflow: hidden;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.pro-stats-row .lex-stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: #dc2626;
  opacity: 0.85;
}

.pro-stats-row .lex-stat-card:nth-child(2)::before {
  background: #0ea5e9;
}

.pro-stats-row .lex-stat-card:nth-child(3)::before {
  background: #10b981;
}

.pro-stats-row .lex-stat-card:nth-child(4)::before {
  background: #f59e0b;
}

.pro-stats-row .pro-stat-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 0 !important;
}

.pro-stats-row .pro-stat-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
}

.pro-stats-row .lex-stat-num {
  font-size: 26px !important;
  font-weight: 800 !important;
  letter-spacing: -0.02em;
  line-height: 1.15 !important;
  margin: 2px 0 0 !important;
}

.pro-stats-row .lex-stat-lbl {
  font-size: 12.5px !important;
  color: var(--text-sub) !important;
  line-height: 1.4 !important;
}

.pro-stats-row .band-mini-list {
  display: grid !important;
  grid-template-columns: repeat(3, 1fr) !important;
  gap: 6px !important;
  margin-top: 2px;
}

.pro-stats-row .band-mini-pill {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 2px !important;
  padding: 7px 4px !important;
  border-radius: 11px !important;
  font-size: 10.5px !important;
  font-weight: 700 !important;
  text-align: center;
  line-height: 1.2;
}

.pro-stats-row .band-mini-pill strong {
  font-size: 15px !important;
  font-weight: 800 !important;
}

[data-theme="dark"] .pro-stats-row .lex-stat-card {
  background: rgba(30, 41, 59, 0.85) !important;
  border: 1px solid rgba(148, 163, 184, 0.2) !important;
  box-shadow: 0 10px 24px rgba(2, 6, 23, 0.35) !important;
}

[data-theme="dark"] .pro-stats-row .pro-stat-hero {
  background: rgba(185, 28, 28, 0.32) !important;
  border-color: rgba(248, 113, 113, 0.38) !important;
}

[data-theme="dark"] .pro-stats-row .pro-stat-icon {
  background: rgba(15, 23, 42, 0.72);
  border-color: rgba(148, 163, 184, 0.22);
}

[data-theme="dark"] .pro-stats-row .band-mini-pill.band-34 {
  background: rgba(16, 185, 129, 0.14) !important;
  border: 1px solid rgba(52, 211, 153, 0.32) !important;
  color: #6ee7b7 !important;
}

[data-theme="dark"] .pro-stats-row .band-mini-pill.band-4565 {
  background: rgba(56, 189, 248, 0.14) !important;
  border: 1px solid rgba(56, 189, 248, 0.32) !important;
  color: #7dd3fc !important;
}

[data-theme="dark"] .pro-stats-row .band-mini-pill.band-70 {
  background: rgba(244, 63, 94, 0.16) !important;
  border: 1px solid rgba(251, 113, 133, 0.35) !important;
  color: #fda4af !important;
}

@media (max-width: 980px) {
  .pro-stats-row {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 560px) {
  .pro-stats-row {
    grid-template-columns: 1fr !important;
  }
}


/* ==================== MYTHIC, 0.01% CELESTIAL SECRET & GOD-TIER BUILDINGS ==================== */
.game-gacha-rates {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin: 8px 0 4px;
}

.game-rarity-tag.rarity-mythic {
  background: #db2777;
  color: #ffffff;
  box-shadow: 0 2px 10px rgba(219, 39, 119, 0.45);
}

.game-rarity-tag.rarity-celestial {
  background: #06b6d4;
  background-size: 220% 100%;
  color: #ffffff;
  font-weight: 800;
  animation: celestialShimmer 2.6s linear infinite;
  box-shadow: 0 0 16px rgba(168, 85, 247, 0.65);
}

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

.game-pet-card.rarity-mythic,
.game-roll-pill.rarity-mythic {
  border-color: #ec4899 !important;
  box-shadow: 0 0 18px rgba(236, 72, 153, 0.35);
}

.game-pet-card.rarity-celestial,
.game-roll-pill.rarity-celestial {
  border: 2px solid #f59e0b !important;
  background: rgba(6, 182, 212, 0.14) !important;
  box-shadow: 0 0 26px rgba(168, 85, 247, 0.55), inset 0 0 14px rgba(251, 191, 36, 0.25);
}

.game-pen-pet.rarity-mythic .game-pen-pet-shadow {
  background: rgba(236, 72, 153, 0.72);
  box-shadow: 0 0 18px rgba(236, 72, 153, 0.85);
}

.game-pen-pet.rarity-celestial .game-pen-pet-shadow {
  background: #06b6d4;
  box-shadow: 0 0 24px rgba(251, 191, 36, 0.95), 0 0 14px rgba(6, 182, 212, 0.9);
  animation: celestialShimmer 2s linear infinite;
}

.game-pen-pet.rarity-celestial .game-pen-pet-emoji {
  filter: drop-shadow(0 0 14px rgba(251, 191, 36, 0.95));
}

/* Lv.8+ God-Tier Building Rainbow Halo */
.game-island-plot.tier-god .game-plot-pedestal {
  border-color: #fde047;
  box-shadow:
    0 0 22px rgba(251, 191, 36, 0.85),
    0 0 34px rgba(168, 85, 247, 0.65),
    0 7px 0 rgba(126, 34, 206, 0.55);
}

.game-island-plot.tier-god .game-plot-badge {
  background: #06b6d4;
}


/* ==================== VIRTUAL IELTS SPEAKING ROOM ==================== */
.sp-setup-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
}

.sp-lbl {
  display: block;
  font-size: 12.5px;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 8px;
}

.sp-ex-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sp-radio-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 13px;
  background: var(--surface-soft);
  border: 1.5px solid var(--border);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.sp-radio-card:hover {
  border-color: var(--red-500);
}

.sp-ex-emoji {
  font-size: 26px;
  line-height: 1;
}

.sp-live-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 12px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.sp-examiner-avatar {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  background: var(--surface-soft);
  border: 2.5px solid var(--border);
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.sp-examiner-avatar.is-speaking {
  border-color: #10b981;
  box-shadow: 0 0 0 6px rgba(16, 185, 129, 0.24);
  animation: islandPulse 1.4s ease-in-out infinite;
}

.sp-question-box {
  padding: 16px 18px;
  border-radius: 15px;
  background: var(--surface-soft);
  border: 1.5px solid var(--border);
  margin-bottom: 14px;
}

.sp-cue-card {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--surface);
  border: 1.5px dashed #f59e0b;
}

.sp-mic-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.sp-mic-pulse {
  animation: islandPulse 1.2s ease-in-out infinite;
}

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

.sp-crit-card {
  padding: 12px 14px;
  border-radius: 13px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
}

.sp-crit-card strong {
  display: block;
  font-size: 13.5px;
  color: var(--red-700);
  margin-bottom: 4px;
}

.sp-crit-card p {
  margin: 0;
  font-size: 12.5px;
  color: var(--text-sub);
  line-height: 1.5;
}


/* ==================== VOCABULARY CONTEXTUAL ILLUSTRATIONS & SUBTLE TOGGLE ==================== */
.villus-toggle-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-sub);
  background: var(--surface-soft);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

.villus-toggle-pill:hover {
  border-color: var(--text-muted);
  color: var(--text-main);
}

.villus-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #94a3b8;
  transition: background 0.18s ease, box-shadow 0.18s ease;
}

.villus-toggle-pill.is-on {
  color: var(--text-main);
  border-color: rgba(16, 185, 129, 0.45);
  background: rgba(16, 185, 129, 0.1);
}

.villus-toggle-pill.is-on .villus-dot {
  background: #10b981;
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.75);
}

.vocab-illus-frame {
  position: relative;
  width: 100%;
  height: 118px;
  border-radius: 13px;
  overflow: hidden;
  margin: 8px 0 10px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

.vocab-illus-frame.is-compact {
  height: 98px;
  margin: 0 0 10px;
}

.vocab-illus-fallback {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 10px;
  text-align: center;
  color: rgba(255, 255, 255, 0.94);
}

.vocab-illus-emoji {
  font-size: 32px;
  line-height: 1;
  filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.25));
}

.vocab-illus-cap {
  font-size: 11.5px;
  font-weight: 700;
  opacity: 0.92;
  max-width: 92%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.vocab-illus-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.28s ease;
}

.vocab-illus-img.is-loaded {
  opacity: 1;
}

body.hide-vocab-illus .vocab-illus-frame {
  display: none !important;
}


/* ==================== IELTS EXAM STUDIO HERO & TABS ==================== */
.ielts-studio-hero {
  border-top: 3px solid var(--red-600);
}

.ielts-studio-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}


/* ==================== ULTRA-SMOOTH GPU 120FPS FLIPBOOK ACCELERATION ==================== */
.fb-book-spread {
  transform-style: preserve-3d;
  perspective: 2200px;
  will-change: transform;
}

.fb-3d-sheet {
  will-change: transform;
  transform-style: preserve-3d;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.fb-3d-face {
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  transform: translateZ(0);
}

.fb-3d-cast-shadow {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 50%;
  pointer-events: none;
  opacity: 0;
  z-index: 4;
  will-change: opacity;
}

.fb-3d-cast-shadow.is-next {
  left: 0;
  background: rgba(15, 23, 42, 0.34);
}

.fb-3d-cast-shadow.is-prev {
  right: 0;
  background: rgba(15, 23, 42, 0.34);
}


/* ==================== INTERACTIVE 44-SOUND IPA PHONEMIC CHART ==================== */
.ipa-shell {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.ipa-guide-card {
  padding: 18px 20px;
  border-radius: 18px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.06);
}

.ipa-guide-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
}

.ipa-big-badge {
  width: 78px;
  height: 78px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  font-weight: 800;
  color: #ffffff;
  flex-shrink: 0;
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.2);
}

.ipa-big-badge.group-mono { background: #dc2626; }
.ipa-big-badge.group-diph { background: #d97706; }
.ipa-big-badge.group-cons { background: #0284c7; }

.ipa-how-line {
  font-size: 14px;
  color: var(--text-main);
  line-height: 1.55;
  margin-bottom: 4px;
}

.ipa-trap-line {
  font-size: 13px;
  color: var(--text-sub);
  line-height: 1.5;
}

.ipa-examples-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(175px, 1fr));
  gap: 10px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed var(--border);
}

.ipa-ex-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 13px;
  border-radius: 12px;
  background: var(--surface-soft);
  border: 1.5px solid var(--border);
  cursor: pointer;
  transition: transform 0.14s ease, border-color 0.14s ease;
  text-align: left;
}

.ipa-ex-btn:hover {
  transform: translateY(-2px);
  border-color: var(--red-500);
}

.ipa-ex-word {
  font-size: 14px;
  font-weight: 800;
  color: var(--text-main);
}

.ipa-ex-ph {
  font-size: 12px;
  color: var(--red-600);
}

.ipa-ex-vi {
  font-size: 11.5px;
  color: var(--text-sub);
}

.ipa-group-box {
  padding: 16px 18px;
  border-radius: 18px;
  background: var(--surface);
  border: 1.5px solid var(--border);
}

.ipa-group-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 12px;
}

.ipa-group-head h3 {
  margin: 0;
  font-size: 15.5px;
  font-weight: 800;
  color: var(--text-main);
}

.ipa-group-head span {
  font-size: 12px;
  color: var(--text-sub);
}

.ipa-tile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
  gap: 9px;
}

.ipa-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 11px 6px;
  border-radius: 14px;
  background: var(--surface-soft);
  border: 1.5px solid var(--border);
  cursor: pointer;
  transition: transform 0.14s ease, border-color 0.14s ease, box-shadow 0.14s ease;
}

.ipa-tile:hover {
  transform: translateY(-2px);
}

.ipa-tile.group-mono:hover,
.ipa-tile.group-mono.is-active {
  border-color: #ef4444;
  background: rgba(239, 68, 68, 0.12);
  box-shadow: 0 6px 14px rgba(239, 68, 68, 0.18);
}

.ipa-tile.group-diph:hover,
.ipa-tile.group-diph.is-active {
  border-color: #f59e0b;
  background: rgba(245, 158, 11, 0.14);
  box-shadow: 0 6px 14px rgba(245, 158, 11, 0.18);
}

.ipa-tile.group-cons:hover,
.ipa-tile.group-cons.is-active {
  border-color: #0ea5e9;
  background: rgba(14, 165, 233, 0.14);
  box-shadow: 0 6px 14px rgba(14, 165, 233, 0.18);
}

.ipa-tile-sym {
  font-size: 21px;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.15;
}

.ipa-tile-key {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-sub);
}

.ipa-vdot {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.ipa-vdot.is-voiced {
  background: #10b981;
}

.ipa-vdot.is-voiceless {
  background: #94a3b8;
}


/* ==================== MULTI-TIER ARENA & ENDLESS SURVIVAL ==================== */
.arena-shell {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.arena-rank-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 18px;
  border-radius: 16px;
  background: var(--surface);
  border: 1.5px solid var(--border);
}

.arena-mode-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}

.arena-mode-card {
  display: flex;
  flex-direction: column;
  padding: 16px;
  border-radius: 18px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-top: 4px solid #94a3b8;
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.arena-mode-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 26px rgba(15, 23, 42, 0.12);
}

.arena-mode-card.tier-bronze { border-top-color: #b45309; }
.arena-mode-card.tier-silver { border-top-color: #64748b; }
.arena-mode-card.tier-gold { border-top-color: #eab308; }
.arena-mode-card.tier-diamond { border-top-color: #0ea5e9; }
.arena-mode-card.tier-mythic {
  border-top-color: #a855f7;
  background: rgba(168, 85, 247, 0.08);
}
.arena-mode-card.tier-survival {
  border-top-color: #ef4444;
  background: rgba(239, 68, 68, 0.08);
}

.arena-m-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.arena-m-icon {
  font-size: 28px;
  line-height: 1;
}

.arena-m-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  color: var(--text-sub);
}

.arena-m-title {
  margin: 0 0 4px;
  font-size: 15.5px;
  font-weight: 800;
  color: var(--text-main);
}

.arena-m-desc {
  margin: 0 0 10px;
  font-size: 12.5px;
  color: var(--text-sub);
  line-height: 1.45;
  flex: 1;
}

.arena-m-meta {
  display: flex;
  justify-content: space-between;
  font-size: 12.5px;
  color: var(--text-main);
  padding-top: 8px;
  border-top: 1px dashed var(--border);
}

.arena-time-track {
  height: 8px;
  border-radius: 999px;
  background: var(--surface-soft);
  overflow: hidden;
  margin-bottom: 10px;
}

.arena-time-fill {
  height: 100%;
  border-radius: 999px;
  background: #10b981;
  transition: width 0.9s linear;
}

.arena-time-fill.is-danger {
  background: #ef4444;
}

.arena-opt-btn {
  text-align: left !important;
  white-space: normal !important;
  height: auto !important;
  padding: 12px 14px !important;
  font-size: 13.5px !important;
  line-height: 1.4 !important;
}

.arena-opt-btn.is-eliminated {
  opacity: 0.28;
  text-decoration: line-through;
}


/* ==================== USER ACCOUNT & CLOUD SYNC PILL ==================== */
.acc-pill {
  gap: 5px;
  font-weight: 700;
  color: #7c3aed;
  background: rgba(124, 58, 237, 0.12);
  border-color: rgba(124, 58, 237, 0.32);
}

.acc-pill:hover {
  background: rgba(124, 58, 237, 0.22);
}

.acc-avatar-big {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  background: var(--surface-soft);
  border: 2px solid var(--border);
  flex-shrink: 0;
}

.acc-av-pick {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1.5px solid var(--border);
  background: var(--surface-soft);
  font-size: 18px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.acc-av-pick.is-active {
  border-color: var(--red-600);
  background: rgba(220, 38, 38, 0.12);
}

[data-theme="dark"] .acc-pill {
  color: #c4b5fd;
}


/* ==========================================================================
   REDPREP 10/10 EDITORIAL FLAT DESIGN SYSTEM
   Refined Solid Palette • Uncluttered Topbar • Generous Whitespace • Pro Typography
   ========================================================================== */
:root {
  --bg: #FAFBFD;
  --surface: #FFFFFF;
  --surface-soft: #F3F5F8;
  --border: #E5E7EB;
  --border-strong: #D1D5DB;
  --text-main: #0F172A;
  --text-sub: #475569;
  --text-muted: #64748B;
  --red-50: #FEF3F2;
  --red-100: #FEE4E2;
  --red-200: #FECDCA;
  --red-500: #F04438;
  --red-600: #D92D20;
  --red-700: #B42318;
  --red-800: #912018;
  --emerald-50: #ECFDF3;
  --emerald-600: #039855;
  --emerald-700: #027A48;
  --shadow-xs: 0 1px 2px rgba(16, 24, 40, 0.04);
  --shadow-sm: 0 2px 6px rgba(16, 24, 40, 0.05);
  --shadow-md: 0 8px 20px rgba(16, 24, 40, 0.07);
}

[data-theme="dark"] {
  --bg: #0B0E14;
  --surface: #12161F;
  --surface-soft: #191F2B;
  --border: rgba(255, 255, 255, 0.085);
  --border-strong: rgba(255, 255, 255, 0.15);
  --text-main: #F8FAFC;
  --text-sub: #9CA3AF;
  --text-muted: #6B7280;
  --red-50: rgba(240, 68, 56, 0.12);
  --red-100: rgba(240, 68, 56, 0.18);
  --red-200: rgba(240, 68, 56, 0.32);
  --red-500: #F97066;
  --red-600: #F04438;
  --red-700: #FDA29B;
  --red-800: #FEE4E2;
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.28);
  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.32);
  --shadow-md: 0 12px 28px rgba(0, 0, 0, 0.42);
}

/* 1. Typography & Readability (7/10 -> 10/10) */
body {
  font-size: 15px !important;
  line-height: 1.6 !important;
  background-color: var(--bg) !important;
  color: var(--text-main) !important;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "cv02", "cv03", "cv04", "cv11";
}

h1, h2, h3, .unit-title, .hero-title, .section-heading {
  letter-spacing: -0.025em !important;
  line-height: 1.25 !important;
  color: var(--text-main) !important;
}

.unit-title {
  font-size: 26px !important;
  font-weight: 800 !important;
}

.unit-sub {
  font-size: 15px !important;
  line-height: 1.65 !important;
  color: var(--text-sub) !important;
  max-width: 78ch;
}

.lex-stat-num,
.game-w-val,
.pomo-timer-display,
.mock-clock {
  font-variant-numeric: tabular-nums;
}

/* 2. Spacious, Uncluttered Topbar Navigation (6.5/10 -> 10/10) */
.topbar {
  background: rgba(255, 255, 255, 0.92) !important;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border) !important;
  box-shadow: none !important;
}

[data-theme="dark"] .topbar {
  background: rgba(11, 14, 20, 0.9) !important;
  border-bottom-color: rgba(255, 255, 255, 0.08) !important;
}

.topbar-inner {
  max-width: 1380px !important;
  padding: 10px 24px !important;
  gap: 16px !important;
  min-height: 62px !important;
}

.brand-logo {
  background: var(--red-600) !important;
  border-radius: 10px !important;
  box-shadow: none !important;
}

.main-nav {
  gap: 2px !important;
  padding: 0 !important;
  background: transparent !important;
  border: none !important;
}

.nav-item {
  position: relative;
  padding: 8px 11px !important;
  font-size: 13.5px !important;
  font-weight: 600 !important;
  color: var(--text-sub) !important;
  background: transparent !important;
  border: none !important;
  border-radius: 9px !important;
  transition: color 0.15s ease, background-color 0.15s ease !important;
}

.nav-item:hover {
  color: var(--text-main) !important;
  background: var(--surface-soft) !important;
}

.nav-item.is-active {
  color: var(--red-600) !important;
  background: var(--red-50) !important;
  font-weight: 700 !important;
}

.nav-item .nav-badge {
  font-size: 10.5px !important;
  padding: 1px 6px !important;
  font-weight: 700 !important;
  background: var(--surface-soft) !important;
  color: var(--text-sub) !important;
  border: 1px solid var(--border) !important;
}

.nav-item.is-active .nav-badge {
  background: var(--red-600) !important;
  color: #FFFFFF !important;
  border-color: transparent !important;
}

.topbar-meta {
  gap: 6px !important;
}

.meta-pill {
  height: 34px !important;
  padding: 0 10px !important;
  font-size: 12.5px !important;
  font-weight: 600 !important;
  border-radius: 10px !important;
  background: var(--surface-soft) !important;
  border: 1px solid var(--border) !important;
  color: var(--text-main) !important;
  box-shadow: none !important;
}

.meta-pill:hover {
  border-color: var(--border-strong) !important;
  background: var(--surface) !important;
}

/* Keep topbar sleek & uncrowded on desktop by showing crisp icons on utility pills */
#topbar-dict-lbl,
#topbar-exam,
.ach-pill-lbl {
  display: none !important;
}

#quick-dict-trigger,
#exam-trigger,
#ach-trigger,
#pro-hub-trigger,
#account-trigger,
#theme-toggle-btn,
#settings-trigger {
  min-width: 34px;
  justify-content: center;
  padding: 0 9px !important;
}

/* 3. Generous Whitespace, Calm Surfaces & Visual Hierarchy (7.5/10 -> 10/10) */
.app-main {
  max-width: 1260px !important;
  padding: 28px 28px 72px !important;
}

.unit-header-card,
.prep-hero,
.pomo-card,
.pro-card,
.roadmap-daily-card,
.roadmap-chart-card,
.roadmap-stage-box,
.grammar-theory-box,
.ipa-guide-card,
.ipa-group-box {
  background: var(--surface) !important;
  border: 1px solid var(--border) !important;
  border-radius: 16px !important;
  padding: 24px 26px !important;
  box-shadow: var(--shadow-xs) !important;
}

.prep-hero {
  border-left: 4px solid var(--red-600) !important;
}

.bank-grid,
.vocab-grid,
.grammar-grid,
.game-bldg-grid,
.arena-mode-grid,
.ach-grid {
  gap: 18px !important;
}

.bank-card,
.vocab-card,
.grammar-card,
.game-bldg-card,
.ach-card,
.arena-mode-card {
  background: var(--surface) !important;
  border: 1px solid var(--border) !important;
  border-radius: 16px !important;
  padding: 20px 22px !important;
  box-shadow: var(--shadow-xs) !important;
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease !important;
}

.bank-card:hover,
.vocab-card:hover,
.grammar-card:hover,
.game-bldg-card:hover,
.ach-card:hover,
.arena-mode-card:hover {
  transform: translateY(-2px) !important;
  border-color: var(--border-strong) !important;
  box-shadow: var(--shadow-md) !important;
}

/* Clean Flat Buttons */
.btn {
  border-radius: 10px !important;
  font-weight: 600 !important;
  letter-spacing: -0.01em;
  box-shadow: none !important;
}

.btn-primary {
  background: var(--red-600) !important;
  color: #FFFFFF !important;
  border: 1px solid transparent !important;
}

.btn-primary:hover:not(:disabled) {
  background: var(--red-700) !important;
}

.btn-emerald {
  background: var(--emerald-600) !important;
  color: #FFFFFF !important;
  border: 1px solid transparent !important;
}

.btn-emerald:hover:not(:disabled) {
  background: var(--emerald-700) !important;
}

.btn-soft {
  background: var(--surface-soft) !important;
  color: var(--text-main) !important;
  border: 1px solid var(--border) !important;
}

.btn-soft:hover:not(:disabled) {
  border-color: var(--border-strong) !important;
}

.btn-outline-red {
  background: transparent !important;
  color: var(--red-600) !important;
  border: 1px solid var(--red-200) !important;
}

.btn-outline-red:hover:not(:disabled) {
  background: var(--red-50) !important;
  border-color: var(--red-600) !important;
}

/* Crisp Flat KPI Stat Cards */
.pro-stats-row .lex-stat-card {
  background: var(--surface) !important;
  border: 1px solid var(--border) !important;
  box-shadow: var(--shadow-xs) !important;
}

.pro-stats-row .lex-stat-card::before {
  height: 3px !important;
  opacity: 1 !important;
}

.pro-stats-row .lex-stat-card:nth-child(1)::before { background: var(--red-600) !important; }
.pro-stats-row .lex-stat-card:nth-child(2)::before { background: #0284C7 !important; }
.pro-stats-row .lex-stat-card:nth-child(3)::before { background: var(--emerald-600) !important; }
.pro-stats-row .lex-stat-card:nth-child(4)::before { background: #D97706 !important; }

[data-theme="dark"] .pro-stats-row .pro-stat-hero {
  background: var(--surface) !important;
  border-color: rgba(240, 68, 56, 0.35) !important;
}

/* Crisp Clean Sub-tabs */
.unit-tabs {
  gap: 6px !important;
  border-bottom: 1px solid var(--border);
  padding-bottom: 10px;
}

.unit-tab {
  border-radius: 10px !important;
  font-size: 13.5px !important;
  font-weight: 600 !important;
  padding: 8px 14px !important;
  border: 1px solid transparent !important;
  background: transparent !important;
  color: var(--text-sub) !important;
}

.unit-tab:hover {
  background: var(--surface-soft) !important;
  color: var(--text-main) !important;
}

.unit-tab.is-active {
  background: var(--red-600) !important;
  color: #FFFFFF !important;
}

/* Clean Floating RedBee AI FAB */
.redbee-fab {
  background: var(--red-600) !important;
  box-shadow: 0 8px 20px rgba(217, 45, 32, 0.32) !important;
  border: 1px solid rgba(255, 255, 255, 0.16) !important;
}


/* ==================== VEXA >_ ANIMATED LAPTOP TERMINAL MASCOT FAB ==================== */
.redbee-fab.vexa-fab {
  display: inline-flex !important;
  flex-direction: column !important;
  align-items: center !important;
  gap: 2px !important;
  padding: 6px 10px 7px !important;
  border-radius: 18px !important;
  background: var(--surface) !important;
  border: 1.5px solid var(--border-strong) !important;
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.22) !important;
  color: var(--text-main) !important;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease !important;
}

.redbee-fab.vexa-fab:hover {
  transform: translateY(-4px) scale(1.04) !important;
  border-color: #3B82F6 !important;
  box-shadow: 0 14px 32px rgba(59, 130, 246, 0.3) !important;
}

.vexa-mascot {
  display: block;
  line-height: 0;
  animation: vexaTypingBob 1.9s ease-in-out infinite;
}

.vexa-cursor {
  animation: vexaBlink 1.1s steps(2, start) infinite;
}

.vexa-laptop {
  transform-origin: 45px 55px;
  animation: vexaLaptopTap 0.95s ease-in-out infinite;
}

.vexa-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: #2563EB;
  background: rgba(59, 130, 246, 0.12);
  padding: 2px 8px;
  border-radius: 999px;
}

[data-theme="dark"] .vexa-label {
  color: #67E8F9;
  background: rgba(59, 130, 246, 0.2);
}

.vexa-tooltip {
  position: absolute;
  bottom: calc(100% + 8px);
  right: 0;
  background: #0F172A;
  color: #67E8F9;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11.5px;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: 10px;
  border: 1px solid rgba(103, 232, 249, 0.35);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transform: translateY(4px);
  transition: opacity 0.16s ease, transform 0.16s ease;
}

.redbee-fab.vexa-fab:hover .vexa-tooltip {
  opacity: 1;
  transform: translateY(0);
}

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

@keyframes vexaLaptopTap {
  0%, 100% { transform: rotate(0deg); }
  50% { transform: rotate(-1.5deg); }
}

@keyframes vexaBlink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0.2; }
}


/* ==========================================================================
   FINAL 10/10 MINIMALIST EDTECH POLISH (ALL 7 DESIGN CRITERIA -> 10/10)
   Ultra-Clean Topbar • Strict Type Scale • Calm Muted Badges • Airy Rhythm
   ========================================================================== */

/* 1. Ultra-Clean Ghost Topbar (No Cluttered Badges, Generous 68px Height) */
.topbar-inner {
  min-height: 68px !important;
  padding: 12px 28px !important;
  gap: 20px !important;
}

.main-nav {
  gap: 4px !important;
}

.main-nav .nav-badge {
  display: none !important;
}

.nav-item {
  padding: 8px 12px !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  letter-spacing: -0.01em;
  border-radius: 8px !important;
}

.nav-item.is-active {
  background: transparent !important;
  color: var(--red-600) !important;
  font-weight: 700 !important;
}

.nav-item.is-active::after {
  content: '';
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 1px;
  height: 2px;
  border-radius: 2px;
  background: var(--red-600);
}

/* Ghost-style utility controls on right — clean & airy */
.meta-pill {
  background: transparent !important;
  border-color: transparent !important;
  height: 36px !important;
  border-radius: 9px !important;
}

.meta-pill:hover {
  background: var(--surface-soft) !important;
  border-color: var(--border) !important;
}

.meta-pill.streak,
.meta-pill.lvl-pill {
  background: var(--surface-soft) !important;
  border-color: var(--border) !important;
  padding: 0 11px !important;
}

/* 2. Strict Editorial Type Scale (No Tiny Unreadable Copy) */
.prep-hero h1,
.hero-title {
  font-size: 32px !important;
  font-weight: 800 !important;
  line-height: 1.2 !important;
  letter-spacing: -0.03em !important;
}

.section-heading {
  font-size: 21px !important;
  font-weight: 800 !important;
  letter-spacing: -0.02em !important;
}

.bank-card h3,
.bank-card-title {
  font-size: 17px !important;
  font-weight: 700 !important;
  line-height: 1.35 !important;
}

.bank-card p,
.bank-card-desc,
.vocab-en-def,
.grammar-card p {
  font-size: 14.5px !important;
  line-height: 1.65 !important;
  color: var(--text-sub) !important;
}

/* 3. Airy Spacing & Generous Section Rhythm */
.app-main {
  max-width: 1220px !important;
  padding: 36px 32px 84px !important;
}

.prep-hero {
  padding: 32px 36px !important;
  margin-bottom: 28px !important;
  border-radius: 18px !important;
}

.unit-header-card {
  padding: 28px 30px !important;
  margin-bottom: 24px !important;
  border-radius: 18px !important;
}

.section-heading-row {
  margin-top: 32px !important;
  margin-bottom: 16px !important;
}

.bank-grid {
  gap: 22px !important;
}

.bank-card {
  padding: 24px 26px !important;
  border-radius: 16px !important;
}

/* 4. Calm, Restraint-First Pills (Reduce Visual Noise) */
.pill {
  font-size: 12px !important;
  font-weight: 600 !important;
  padding: 4px 10px !important;
  border-radius: 8px !important;
  letter-spacing: 0 !important;
}

.pill-amber,
.pill-red {
  background: var(--surface-soft) !important;
  color: var(--text-sub) !important;
  border: 1px solid var(--border) !important;
}

.pill-solid-red {
  background: var(--red-50) !important;
  color: var(--red-700) !important;
  border: 1px solid var(--red-200) !important;
}

[data-theme="dark"] .pill-solid-red {
  background: rgba(240, 68, 56, 0.14) !important;
  color: #FDA29B !important;
  border-color: rgba(240, 68, 56, 0.28) !important;
}

.pill-emerald {
  background: var(--emerald-50) !important;
  color: var(--emerald-700) !important;
  border: 1px solid rgba(3, 152, 85, 0.22) !important;
}

[data-theme="dark"] .pill-emerald {
  background: rgba(16, 185, 129, 0.14) !important;
  color: #6EE7B7 !important;
  border-color: rgba(16, 185, 129, 0.28) !important;
}

/* Clean, refined input fields */
.text-input,
.search-box input {
  border-radius: 10px !important;
  font-size: 14.5px !important;
  border: 1px solid var(--border-strong) !important;
  background: var(--surface) !important;
}

.text-input:focus,
.search-box input:focus {
  border-color: var(--red-600) !important;
  box-shadow: 0 0 0 3px rgba(217, 45, 32, 0.12) !important;
}


/* ==================== 4-MASCOT SWITCHER BAR ==================== */
.vexa-mascot-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  background: var(--surface-soft);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.vexa-pick-btn {
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-sub);
  cursor: pointer;
  transition: border-color 0.14s ease, color 0.14s ease, background 0.14s ease;
}

.vexa-pick-btn:hover {
  color: var(--text-main);
  border-color: var(--border-strong);
}

.vexa-pick-btn.is-active {
  background: var(--red-600);
  color: #FFFFFF;
  border-color: transparent;
}


/* ==================== FIX VEXA AI DRAWER HEADER CONTRAST (LIGHT & DARK) ==================== */
.redbee-head {
  background: #B42318 !important;
  color: #FFFFFF !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14) !important;
}

[data-theme="dark"] .redbee-head {
  background: #172033 !important;
  color: #F8FAFC !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
}

.redbee-head .bee-mode-badge {
  background: rgba(255, 255, 255, 0.18) !important;
  color: #FFFFFF !important;
}


/* ==================== OFFICIAL GOOGLE OAUTH BUTTON ==================== */
.btn-google-oauth {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 44px;
  padding: 0 16px;
  border-radius: 10px;
  background: #FFFFFF;
  color: #0F172A;
  border: 1.5px solid #D1D5DB;
  font-size: 14.5px;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.12s ease;
}

.btn-google-oauth:hover {
  background: #F8FAFC;
  border-color: #94A3B8;
  transform: translateY(-1px);
}

[data-theme="dark"] .btn-google-oauth {
  background: #FFFFFF;
  color: #0F172A;
  border-color: rgba(255, 255, 255, 0.25);
}

.acc-or-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 12px 0;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}

.acc-or-divider::before,
.acc-or-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}


/* ==================== MOBILE APP SHELL (BOTTOM TAB BAR + MORE SHEET) ==================== */
.mobile-bottom-nav,
.mobile-more-sheet {
  display: none;
}

@media (max-width: 860px) {
  .main-nav {
    display: none !important;
  }

  .topbar-inner {
    padding: 8px 14px !important;
    min-height: 54px !important;
    gap: 8px !important;
  }

  .brand-sub {
    display: none !important;
  }

  .app-main {
    padding: 16px 14px calc(86px + env(safe-area-inset-bottom, 0px)) !important;
  }

  .prep-hero,
  .unit-header-card {
    padding: 18px 16px !important;
  }

  .prep-hero h1,
  .hero-title {
    font-size: 23px !important;
  }

  .unit-title {
    font-size: 20px !important;
  }

  .redbee-fab.vexa-fab {
    bottom: calc(74px + env(safe-area-inset-bottom, 0px)) !important;
    right: 12px !important;
    transform: scale(0.86);
    transform-origin: bottom right;
  }

  .mobile-bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 900;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    align-items: center;
    padding: 6px 4px calc(8px + env(safe-area-inset-bottom, 0px));
    background: var(--surface);
    border-top: 1px solid var(--border);
    box-shadow: 0 -6px 20px rgba(0, 0, 0, 0.08);
  }

  .mnav-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 5px 2px;
    border: none;
    background: transparent;
    color: var(--text-sub);
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }

  .mnav-ico {
    font-size: 20px;
    line-height: 1.1;
  }

  .mnav-btn.is-active {
    color: var(--red-600);
    font-weight: 800;
  }

  .mobile-more-sheet {
    position: fixed;
    inset: 0;
    z-index: 980;
    display: none;
  }

  .mobile-more-sheet.is-open {
    display: block;
  }

  .mobile-sheet-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
  }

  .mobile-sheet-panel {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--surface);
    border-top: 1px solid var(--border);
    border-radius: 22px 22px 0 0;
    padding: 10px 18px calc(22px + env(safe-area-inset-bottom, 0px));
    box-shadow: 0 -14px 36px rgba(0, 0, 0, 0.28);
  }

  .mobile-sheet-handle {
    width: 40px;
    height: 4px;
    border-radius: 999px;
    background: var(--border-strong);
    margin: 0 auto 10px;
  }

  .mobile-sheet-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    font-size: 15px;
    color: var(--text-main);
  }

  .mobile-sheet-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
  }

  .msheet-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 12px 6px;
    border-radius: 14px;
    background: var(--surface-soft);
    border: 1px solid var(--border);
    color: var(--text-main);
    font-size: 11.5px;
    cursor: pointer;
  }

  .msheet-tile span {
    font-size: 22px;
    line-height: 1;
  }
}


/* ==================== MOBILE EDGE-TO-EDGE FIT + FLOATING DOCK (CLEARS NETLIFY BADGE) ==================== */
html,
body {
  max-width: 100vw;
  overflow-x: hidden;
}

@media (max-width: 860px) {
  html,
  body {
    width: 100% !important;
    min-height: 100dvh !important;
    overflow-x: hidden !important;
  }

  /* Clean uncrowded mobile header */
  #ach-trigger,
  #pro-hub-trigger,
  #account-trigger,
  #exam-wrap {
    display: none !important;
  }

  .topbar {
    width: 100% !important;
  }

  .topbar-inner {
    width: 100% !important;
    max-width: 100% !important;
    padding: 8px 10px !important;
    min-height: 54px !important;
    gap: 6px !important;
  }

  /* Keep Streak (🔥), Level (🌱 Lv.X), Theme (🌙) & Settings (⚙️) ALWAYS visible inside phone width */
  .brand-mark {
    width: 28px !important;
    height: 28px !important;
  }

  .brand-title {
    font-size: 13.5px !important;
  }

  .topbar-meta {
    gap: 4px !important;
    flex-shrink: 0 !important;
  }

  .topbar-meta .meta-pill {
    padding: 4px 7px !important;
    font-size: 11.5px !important;
    min-width: 30px !important;
    height: 30px !important;
  }

  #level-trigger {
    display: inline-flex !important;
    font-weight: 800 !important;
  }

  #quick-dict-trigger {
    display: none !important;
  }

  .mobile-sheet-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }

  /* Fix Game / Pro / Pomodoro subtabs so NO tab ever clips off right edge on mobile */
  .game-subtabs,
  .pomo-mode-switch {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 6px !important;
    width: 100% !important;
    max-width: 100% !important;
    overflow: visible !important;
    box-sizing: border-box !important;
  }

  .game-subtabs .pomo-mode-btn,
  .pomo-mode-switch .pomo-mode-btn {
    width: 100% !important;
    min-width: 0 !important;
    padding: 9px 8px !important;
    font-size: 12.5px !important;
    line-height: 1.3 !important;
    text-align: center !important;
    white-space: normal !important;
    justify-content: center !important;
  }

  .game-subtabs .pomo-mode-btn:last-child:nth-child(odd) {
    grid-column: 1 / -1 !important;
  }

  /* Full-width edge-to-edge mobile container */
  .app-main {
    width: 100% !important;
    max-width: 100% !important;
    padding: 12px 10px calc(130px + env(safe-area-inset-bottom, 0px)) !important;
  }

  .prep-hero,
  .unit-header-card,
  .pomo-card,
  .pro-card,
  .roadmap-daily-card,
  .roadmap-chart-card,
  .roadmap-stage-box,
  .grammar-theory-box,
  .ipa-guide-card,
  .ipa-group-box,
  .bank-card,
  .vocab-card,
  .grammar-card,
  .game-bldg-card,
  .ach-card,
  .arena-mode-card {
    width: 100% !important;
    max-width: 100% !important;
    padding: 16px 14px !important;
    border-radius: 14px !important;
    box-sizing: border-box !important;
  }

  /* Prevent any multi-column grid from overflowing phone width */
  .bank-grid,
  .vocab-grid,
  .grammar-grid,
  .roadmap-stages-grid,
  .roadmap-charts-grid,
  .pro-dash-grid,
  .game-bldg-grid,
  .arena-mode-grid,
  .ach-grid,
  .grammar-rules-grid,
  .sp-setup-grid {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }

  .pro-stats-row {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 10px !important;
  }

  .unit-row-item {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
    padding: 14px 12px !important;
  }

  .unit-row-actions {
    flex-direction: row !important;
    align-items: center !important;
    justify-content: flex-start !important;
    flex-wrap: wrap !important;
  }

  .modal-dialog,
  .ach-modal-dialog {
    width: calc(100vw - 16px) !important;
    max-width: calc(100vw - 16px) !important;
    max-height: 84dvh !important;
    padding: 16px 14px !important;
    border-radius: 16px !important;
  }

  .redbee-drawer {
    width: calc(100vw - 16px) !important;
    max-width: calc(100vw - 16px) !important;
    right: 8px !important;
    left: 8px !important;
    bottom: calc(82px + env(safe-area-inset-bottom, 0px)) !important;
    max-height: 70dvh !important;
  }

  /* Native floating iOS/Android Dock cleanly anchored at bottom (no Netlify watermark!) */
  .mobile-bottom-nav {
    left: 10px !important;
    right: 10px !important;
    bottom: calc(10px + env(safe-area-inset-bottom, 0px)) !important;
    border-radius: 18px !important;
    padding: 6px 4px !important;
    border: 1px solid var(--border-strong) !important;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.22) !important;
  }

  /* Keep VEXA >_ mascot comfortably above the floating dock */
  .redbee-fab.vexa-fab {
    bottom: calc(82px + env(safe-area-inset-bottom, 0px)) !important;
    right: 10px !important;
    transform: scale(0.8);
    transform-origin: bottom right;
  }

  .mobile-sheet-panel {
    padding-bottom: calc(22px + env(safe-area-inset-bottom, 0px)) !important;
  }
}


.brand-logo.el-brand-logo {
  background: transparent !important;
  padding: 0 !important;
  width: 36px !important;
  height: 36px !important;
}


/* ==================== FIX MOBILE ACCOUNT MODAL OVERFLOW, Z-INDEX & STREAK POPOVER ==================== */
.acc-2col-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 118px;
  gap: 8px;
}

.acc-auth-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.acc-2col-grid .text-input,
.acc-auth-grid .text-input {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.modal-backdrop {
  z-index: 1200 !important;
}

@media (max-width: 860px) {
  .acc-2col-grid,
  .acc-auth-grid {
    grid-template-columns: 1fr !important;
  }

  .modal-dialog {
    overflow-x: hidden !important;
    overflow-y: auto !important;
  }

  .modal-dialog input,
  .modal-dialog select,
  .modal-dialog textarea {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }

  /* Center Streak & Exam Popovers cleanly inside phone screen (ZERO left clipping!) */
  .streak-popover,
  .exam-popover {
    position: fixed !important;
    left: 10px !important;
    right: 10px !important;
    top: 60px !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: calc(100vw - 20px) !important;
    max-height: 76dvh !important;
    overflow-y: auto !important;
    z-index: 1150 !important;
    transform: none !important;
  }
}


/* ==================== IMMERSIVE FULLSCREEN REAL-BOOK READER (MOBILE & DESKTOP) ==================== */
body.fb-immersive-open {
  overflow: hidden !important;
}

body.fb-immersive-open .mobile-bottom-nav,
body.fb-immersive-open .redbee-fab.vexa-fab {
  display: none !important;
}

.fb-shell.is-fs-overlay {
  position: fixed !important;
  inset: 0 !important;
  z-index: 1500 !important;
  width: 100vw !important;
  height: 100dvh !important;
  max-width: 100vw !important;
  border-radius: 0 !important;
  margin: 0 !important;
  padding: env(safe-area-inset-top, 4px) 4px calc(6px + env(safe-area-inset-bottom, 0px)) !important;
  background: #0B0E14 !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
}

/* Ultra-slim edge-to-edge fullscreen controls so >90% of screen is pure book page */
.fb-shell.is-fs-overlay .fb-toolbar {
  padding: 4px 6px !important;
  gap: 5px !important;
  margin-bottom: 4px !important;
  flex-wrap: nowrap !important;
  overflow-x: auto !important;
  scrollbar-width: none;
}

.fb-shell.is-fs-overlay .fb-tool-left,
.fb-shell.is-fs-overlay #fb-delete-cur {
  display: none !important;
}

.fb-shell.is-fs-overlay .fb-tool-right {
  width: 100% !important;
  justify-content: space-between !important;
  flex-wrap: nowrap !important;
  gap: 4px !important;
}

.fb-shell.is-fs-overlay .fb-tool-right .btn {
  padding: 5px 8px !important;
  font-size: 12px !important;
  white-space: nowrap !important;
}

.fb-shell.is-fs-overlay .fb-bottom-bar {
  padding: 5px 6px !important;
  margin-top: 4px !important;
  gap: 6px !important;
}

.fb-shell.is-fs-overlay .fb-recent-bar,
.fb-shell.is-fs-overlay .shortcut-bar {
  display: none !important;
}

.fb-shell.is-fs-overlay .fb-stage {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  overflow: auto !important;
  -webkit-overflow-scrolling: touch !important;
  padding: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.fb-stage.is-zoomed {
  align-items: flex-start !important;
  justify-content: flex-start !important;
  overflow: auto !important;
  -webkit-overflow-scrolling: touch !important;
}

.fb-shell.is-fs-overlay .fb-book-spread:not(.is-zoomed-spread) {
  width: 100% !important;
  max-width: 100% !important;
  height: 100% !important;
  max-height: 100% !important;
}

.fb-book-spread.is-zoomed-spread .fb-leaf,
.fb-book-spread.is-zoomed-spread .fb-pdf-img-wrap {
  width: 100% !important;
  height: auto !important;
  overflow: visible !important;
}

.fb-book-spread.is-zoomed-spread .fb-pdf-img-wrap img {
  width: 100% !important;
  max-width: none !important;
  max-height: none !important;
  height: auto !important;
}

.fb-shell.is-fs-overlay .fb-nav-arrow {
  position: fixed !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  z-index: 1510 !important;
  opacity: 0.72 !important;
}

.fb-shell.is-fs-overlay .fb-nav-prev {
  left: 6px !important;
}

.fb-shell.is-fs-overlay .fb-nav-next {
  right: 6px !important;
}

.fb-pdf-img-wrap {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.fb-pdf-img-wrap img {
  max-width: 100% !important;
  max-height: 100% !important;
  width: auto !important;
  height: auto !important;
  object-fit: contain !important;
  display: block;
}

@media (max-width: 860px) {
  .fb-book-spread.is-single {
    width: 100% !important;
    max-width: 100% !important;
    min-height: 460px;
  }

  .fb-leaf-single {
    width: 100% !important;
  }

  .fb-nav-arrow {
    width: 34px !important;
    height: 34px !important;
    font-size: 20px !important;
  }
}

/* ==================== AUTO-LANDSCAPE 2-PAGE REAL-BOOK MODE ==================== */
.fb-shell.is-fs-overlay.is-landscape-book {
  padding: 6px 10px 8px !important;
}

.fb-shell.is-fs-overlay.is-landscape-book .fb-toolbar {
  padding: 6px 8px !important;
  gap: 6px !important;
  flex-wrap: nowrap !important;
  overflow-x: auto !important;
  scrollbar-width: none;
}

.fb-shell.is-fs-overlay.is-landscape-book .fb-doc-meta {
  display: none !important;
}

.fb-shell.is-fs-overlay.is-landscape-book .fb-bottom-bar {
  padding: 5px 8px !important;
  margin-top: 4px !important;
}

.fb-shell.is-fs-overlay.is-landscape-book .fb-stage {
  padding: 4px 28px !important;
  overflow: hidden !important;
}

.fb-shell.is-fs-overlay.is-landscape-book .fb-book-spread:not(.is-single) {
  width: 100% !important;
  max-width: 100% !important;
  height: 100% !important;
  max-height: 100% !important;
  min-height: 0 !important;
  display: flex !important;
  align-items: stretch !important;
  justify-content: center !important;
}

.fb-shell.is-fs-overlay.is-landscape-book .fb-leaf-left,
.fb-shell.is-fs-overlay.is-landscape-book .fb-leaf-right {
  flex: 1 1 50% !important;
  min-width: 0 !important;
  height: 100% !important;
  max-height: 100% !important;
}

/* Seamless 90° CSS Landscape Fallback for iOS Safari & Portrait-Locked Android */
.fb-shell.is-fs-overlay.is-force-landscape {
  top: 50% !important;
  left: 50% !important;
  right: auto !important;
  bottom: auto !important;
  width: 100dvh !important;
  height: 100vw !important;
  max-width: none !important;
  transform: translate(-50%, -50%) rotate(90deg) !important;
  transform-origin: center center !important;
}
