/* ═══════════════════════════════════════════════════════════
   EPS-TOPIK Master — Modern Design System v2.0
   Scoped to #eps-topik-app to prevent WordPress conflicts
   ═══════════════════════════════════════════════════════════ */

/* ─── Reset (scoped with :where() for 0 specificity) ─── */
:where(#eps-topik-app),
:where(#eps-topik-app) *,
:where(#eps-topik-app) *::before,
:where(#eps-topik-app) *::after {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

:where(#eps-topik-app) h1,
:where(#eps-topik-app) h2,
:where(#eps-topik-app) h3,
:where(#eps-topik-app) h4,
:where(#eps-topik-app) h5,
:where(#eps-topik-app) h6,
:where(#eps-topik-app) p,
:where(#eps-topik-app) ul,
:where(#eps-topik-app) ol,
:where(#eps-topik-app) figure,
:where(#eps-topik-app) blockquote {
  margin: 0;
  padding: 0;
}

:where(#eps-topik-app) ul,
:where(#eps-topik-app) ol {
  list-style: none;
}

:where(#eps-topik-app) a {
  text-decoration: none;
  color: inherit;
}

:where(#eps-topik-app) button {
  cursor: pointer;
  font-family: inherit;
  font-size: inherit;
  background: none;
  border: 0;
  padding: 0;
  color: inherit;
  margin: 0;
}

:where(#eps-topik-app) input,
:where(#eps-topik-app) textarea,
:where(#eps-topik-app) select {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  background: transparent;
  border: 0;
  outline: none;
  margin: 0;
  padding: 0;
}

:where(#eps-topik-app) img,
:where(#eps-topik-app) svg {
  display: block;
  max-width: 100%;
}

:where(#eps-topik-app) h1,
:where(#eps-topik-app) h2,
:where(#eps-topik-app) h3,
:where(#eps-topik-app) h4 {
  font-weight: inherit;
}

/* ─── Design Tokens ─── */
#eps-topik-app {
  /* Brand */
  --brand: #E8443A;
  --brand-hover: #D53A30;
  --brand-active: #BB2F26;
  --brand-soft: rgba(232, 68, 58, 0.08);
  --brand-softer: rgba(232, 68, 58, 0.04);
  --brand-border: rgba(232, 68, 58, 0.16);

  /* Accents */
  --gold: #D4A745;
  --gold-soft: rgba(212, 167, 69, 0.1);
  --success: #059669;
  --success-soft: rgba(5, 150, 105, 0.1);
  --warning: #D97706;
  --warning-soft: rgba(217, 119, 6, 0.1);
  --info: #2563EB;
  --info-soft: rgba(37, 99, 235, 0.1);
  --purple: #7C3AED;
  --purple-soft: rgba(124, 58, 237, 0.1);

  /* Neutrals - light mode */
  --bg: #FAFAF7;
  --bg-muted: #F5F4F0;
  --surface: #FFFFFF;
  --surface-hover: #FAFAF7;
  --surface-elevated: #FFFFFF;
  --border: #EAE7E0;
  --border-strong: #D5D2CB;
  --text: #0F1729;
  --text-2: #57544C;
  --text-3: #8B877E;
  --text-4: #B8B5AD;

  /* Shadows */
  --shadow-xs: 0 1px 2px rgba(15, 23, 41, 0.04);
  --shadow-sm: 0 1px 3px rgba(15, 23, 41, 0.06), 0 1px 2px rgba(15, 23, 41, 0.04);
  --shadow: 0 4px 12px rgba(15, 23, 41, 0.06), 0 1px 3px rgba(15, 23, 41, 0.04);
  --shadow-md: 0 8px 20px rgba(15, 23, 41, 0.08), 0 2px 6px rgba(15, 23, 41, 0.04);
  --shadow-lg: 0 16px 40px rgba(15, 23, 41, 0.10), 0 4px 12px rgba(15, 23, 41, 0.06);
  --shadow-xl: 0 24px 60px rgba(15, 23, 41, 0.14);
  --shadow-brand: 0 8px 24px rgba(232, 68, 58, 0.24);

  /* Radius */
  --radius-xs: 6px;
  --radius-sm: 8px;
  --radius: 12px;
  --radius-md: 16px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-full: 9999px;

  /* Spacing */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 20px;
  --sp-6: 24px;
  --sp-7: 28px;
  --sp-8: 32px;
  --sp-10: 40px;
  --sp-12: 48px;
  --sp-16: 64px;

  /* Typography */
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-display: 'Plus Jakarta Sans', 'Inter', sans-serif;
  --font-ko: 'Noto Sans KR', sans-serif;
  --font-ur: 'Noto Nastaliq Urdu', serif;

  /* Transitions */
  --t-fast: 120ms cubic-bezier(0.4, 0, 0.2, 1);
  --t: 200ms cubic-bezier(0.4, 0, 0.2, 1);
  --t-slow: 320ms cubic-bezier(0.4, 0, 0.2, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);

  /* Layout */
  --sidebar-w: 256px;
  --sidebar-w-collapsed: 72px;
  --header-h: 64px;
  --nav-h-mobile: 68px;

  /* Base styles */
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: 'cv11', 'ss01';
  font-variant-numeric: tabular-nums;
  min-height: 100vh;
}

/* ─── Dark Mode ─── */
#eps-topik-app.dark {
  --bg: #0A0A0C;
  --bg-muted: #121215;
  --surface: #16161A;
  --surface-hover: #1C1C22;
  --surface-elevated: #1C1C22;
  --border: #26262E;
  --border-strong: #3A3A44;
  --text: #F5F5F5;
  --text-2: #A8A8B0;
  --text-3: #6B6B75;
  --text-4: #45454D;
  --brand-soft: rgba(232, 68, 58, 0.14);
  --brand-softer: rgba(232, 68, 58, 0.07);
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4);
  --shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 8px 20px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.6);
}

/* ─── App Shell Layout ─── */
.eps-shell {
  display: flex;
  min-height: 100vh;
  position: relative;
}

/* ─── Sidebar (Desktop) ─── */
.eps-sidebar {
  width: var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: var(--sp-6) 0;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 40;
  transition: width var(--t);
}

.eps-sidebar-brand {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: 0 var(--sp-6);
  margin-bottom: var(--sp-8);
}

.eps-brand-mark {
  width: 40px;
  height: 40px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--brand), #FF6B60);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-family: var(--font-ko);
  font-weight: 900;
  font-size: 18px;
  box-shadow: var(--shadow-brand);
  flex-shrink: 0;
}

.eps-brand-text {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 17px;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.eps-brand-text small {
  display: block;
  font-family: var(--font);
  font-size: 11px;
  font-weight: 500;
  color: var(--text-3);
  letter-spacing: 0;
  text-transform: uppercase;
  margin-top: 1px;
}

.eps-nav-section {
  padding: 0 var(--sp-4);
  margin-bottom: var(--sp-6);
}

.eps-nav-label {
  padding: 0 var(--sp-3) var(--sp-2);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.eps-nav-item {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-2);
  transition: all var(--t-fast);
  margin-bottom: 2px;
  width: 100%;
  text-align: left;
}

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

.eps-nav-item.active {
  background: var(--brand-soft);
  color: var(--brand);
  font-weight: 600;
}

.eps-nav-item svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.eps-nav-item span {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.eps-nav-item .badge {
  background: var(--brand);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: var(--radius-full);
}

.eps-sidebar-footer {
  margin-top: auto;
  padding: var(--sp-4);
  border-top: 1px solid var(--border);
}

.eps-user-card {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3);
  border-radius: var(--radius-sm);
  transition: background var(--t-fast);
  width: 100%;
  text-align: left;
}

.eps-user-card:hover {
  background: var(--surface-hover);
}

.eps-avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--brand), var(--gold));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
}

.eps-user-info {
  flex: 1;
  min-width: 0;
}

.eps-user-name {
  font-weight: 600;
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.eps-user-plan {
  font-size: 11px;
  color: var(--text-3);
}

/* ─── Main Content Area ─── */
.eps-main {
  flex: 1;
  margin-left: var(--sidebar-w);
  min-width: 0;
  display: flex;
  flex-direction: column;
}

/* ─── Top Bar ─── */
.eps-topbar {
  height: var(--header-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  padding: 0 var(--sp-6);
  position: sticky;
  top: 0;
  z-index: 30;
  backdrop-filter: saturate(180%) blur(8px);
  -webkit-backdrop-filter: saturate(180%) blur(8px);
  background: rgba(255, 255, 255, 0.85);
}

#eps-topik-app.dark .eps-topbar {
  background: rgba(22, 22, 26, 0.85);
}

.eps-page-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.01em;
  flex: 1;
}

.eps-topbar-actions {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

.eps-icon-btn {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-2);
  transition: all var(--t-fast);
  position: relative;
}

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

.eps-icon-btn svg {
  width: 20px;
  height: 20px;
}

.eps-icon-btn .dot {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  background: var(--brand);
  border: 2px solid var(--surface);
}

/* Streak chip */
.eps-streak-chip {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-3);
  background: linear-gradient(135deg, var(--gold-soft), transparent);
  border: 1px solid var(--gold);
  border-radius: var(--radius-full);
  font-weight: 700;
  font-size: 13px;
  color: var(--gold);
}

.eps-streak-chip .flame {
  font-size: 16px;
}

/* ─── Page Content ─── */
.eps-page {
  flex: 1;
  padding: var(--sp-8) var(--sp-8);
  max-width: 1280px;
  width: 100%;
  margin: 0 auto;
  animation: eps-fade-in 240ms ease-out;
}

@keyframes eps-fade-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ─── Hero Welcome ─── */
.eps-hero {
  margin-bottom: var(--sp-8);
}

.eps-hero-greeting {
  font-family: var(--font-display);
  font-size: clamp(24px, 4vw, 32px);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin-bottom: var(--sp-2);
}

.eps-hero-date {
  color: var(--text-3);
  font-size: 14px;
}

/* ─── Main Grid Layout ─── */
.eps-home-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: var(--sp-6);
  margin-bottom: var(--sp-8);
}

@media (max-width: 1024px) {
  .eps-home-grid {
    grid-template-columns: 1fr;
  }
}

/* ─── Readiness Card (Hero) ─── */
.eps-readiness {
  background: linear-gradient(135deg, #0F1729 0%, #1A2340 50%, #2A1E2E 100%);
  border-radius: var(--radius-lg);
  padding: var(--sp-8);
  color: #fff;
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--sp-6);
  align-items: center;
  box-shadow: var(--shadow-lg);
}

.eps-readiness::before {
  content: '한';
  position: absolute;
  right: -40px;
  bottom: -80px;
  font-family: var(--font-ko);
  font-size: 280px;
  font-weight: 900;
  color: rgba(255, 255, 255, 0.03);
  line-height: 1;
  pointer-events: none;
}

.eps-readiness-content {
  position: relative;
  z-index: 2;
}

.eps-readiness-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: var(--sp-3);
}

.eps-readiness-score {
  font-family: var(--font-display);
  font-size: clamp(32px, 5vw, 44px);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1;
  margin-bottom: var(--sp-2);
}

.eps-readiness-score em {
  font-style: normal;
  color: var(--gold);
}

.eps-readiness-sub {
  color: rgba(255, 255, 255, 0.65);
  font-size: 15px;
  margin-bottom: var(--sp-6);
  max-width: 360px;
}

.eps-readiness-cta {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-4) var(--sp-6);
  background: var(--brand);
  color: #fff;
  border-radius: var(--radius);
  font-weight: 700;
  font-size: 15px;
  transition: all var(--t);
  box-shadow: var(--shadow-brand);
}

.eps-readiness-cta:hover {
  background: var(--brand-hover);
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(232, 68, 58, 0.32);
}

/* Progress Ring */
.eps-ring-wrapper {
  position: relative;
  width: 160px;
  height: 160px;
  flex-shrink: 0;
  z-index: 2;
}

.eps-ring-svg {
  transform: rotate(-90deg);
  width: 100%;
  height: 100%;
}

.eps-ring-bg {
  fill: none;
  stroke: rgba(255, 255, 255, 0.1);
  stroke-width: 10;
}

.eps-ring-fg {
  fill: none;
  stroke: url(#ringGrad);
  stroke-width: 10;
  stroke-linecap: round;
  transition: stroke-dashoffset 1s ease-out;
}

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

.eps-ring-value {
  font-family: var(--font-display);
  font-size: 38px;
  font-weight: 800;
  line-height: 1;
  color: #fff;
}

.eps-ring-total {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.5);
  margin-top: 2px;
}

@media (max-width: 640px) {
  .eps-readiness {
    grid-template-columns: 1fr;
    text-align: center;
    padding: var(--sp-6);
  }
  .eps-ring-wrapper {
    margin: 0 auto;
    width: 140px;
    height: 140px;
  }
  .eps-readiness-cta {
    width: 100%;
    justify-content: center;
  }
}

/* ─── Today's Goal Card ─── */
.eps-goal-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--sp-6);
  box-shadow: var(--shadow-sm);
}

.eps-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--sp-5);
}

.eps-card-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
  letter-spacing: -0.01em;
}

.eps-card-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  background: var(--brand-soft);
  color: var(--brand);
}

.eps-goal-item {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) 0;
  border-bottom: 1px solid var(--border);
}

.eps-goal-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.eps-goal-check {
  width: 24px;
  height: 24px;
  border-radius: var(--radius-full);
  border: 2px solid var(--border-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all var(--t);
}

.eps-goal-item.done .eps-goal-check {
  background: var(--success);
  border-color: var(--success);
  color: #fff;
}

.eps-goal-item.done .eps-goal-check svg {
  width: 14px;
  height: 14px;
}

.eps-goal-text {
  flex: 1;
  font-size: 14px;
  font-weight: 500;
}

.eps-goal-item.done .eps-goal-text {
  color: var(--text-3);
  text-decoration: line-through;
}

.eps-goal-xp {
  font-size: 12px;
  font-weight: 700;
  color: var(--gold);
}

/* ─── Stats Grid ─── */
.eps-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--sp-4);
  margin-bottom: var(--sp-8);
}

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

.eps-stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--sp-5);
  box-shadow: var(--shadow-xs);
  transition: all var(--t);
}

.eps-stat:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  border-color: var(--border-strong);
}

.eps-stat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--sp-3);
}

.eps-stat-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}

.eps-stat-icon svg {
  width: 20px;
  height: 20px;
}

.eps-stat-icon.red { background: var(--brand-soft); color: var(--brand); }
.eps-stat-icon.green { background: var(--success-soft); color: var(--success); }
.eps-stat-icon.blue { background: var(--info-soft); color: var(--info); }
.eps-stat-icon.gold { background: var(--gold-soft); color: var(--gold); }
.eps-stat-icon.purple { background: var(--purple-soft); color: var(--purple); }

.eps-stat-trend {
  font-size: 11px;
  font-weight: 700;
  color: var(--success);
  display: flex;
  align-items: center;
  gap: 2px;
}

.eps-stat-value {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: var(--text);
}

.eps-stat-label {
  font-size: 13px;
  color: var(--text-3);
  margin-top: 2px;
}

/* ─── Section Header ─── */
.eps-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--sp-5);
}

.eps-section-title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.eps-section-link {
  font-size: 13px;
  font-weight: 600;
  color: var(--brand);
  display: flex;
  align-items: center;
  gap: 4px;
}

.eps-section-link:hover {
  text-decoration: underline;
}

/* ─── Quick Access Grid ─── */
.eps-quick-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--sp-4);
  margin-bottom: var(--sp-8);
}

@media (max-width: 768px) {
  .eps-quick-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.eps-quick-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--sp-5);
  box-shadow: var(--shadow-xs);
  transition: all var(--t);
  text-align: left;
  position: relative;
  overflow: hidden;
}

.eps-quick-card::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 80px;
  height: 80px;
  background: radial-gradient(circle at top right, var(--brand-softer), transparent 70%);
  opacity: 0;
  transition: opacity var(--t);
}

.eps-quick-card:hover {
  border-color: var(--brand);
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.eps-quick-card:hover::after {
  opacity: 1;
}

.eps-quick-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--sp-3);
}

.eps-quick-icon svg {
  width: 22px;
  height: 22px;
}

.eps-quick-title {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 2px;
  letter-spacing: -0.01em;
}

.eps-quick-desc {
  font-size: 13px;
  color: var(--text-3);
}

/* ─── Weekly Chart Card ─── */
.eps-chart-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--sp-6);
  margin-bottom: var(--sp-8);
  box-shadow: var(--shadow-sm);
}

.eps-chart {
  display: flex;
  align-items: flex-end;
  gap: var(--sp-3);
  height: 160px;
  padding-top: var(--sp-4);
}

.eps-chart-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-2);
  height: 100%;
}

.eps-chart-bar {
  width: 100%;
  max-width: 48px;
  background: linear-gradient(180deg, var(--brand), var(--brand-hover));
  border-radius: var(--radius-xs) var(--radius-xs) 2px 2px;
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 6px;
  min-height: 8px;
  transition: all var(--t-slow) var(--ease-spring);
}

.eps-chart-bar.inactive {
  background: var(--border);
  color: var(--text-3);
}

.eps-chart-bar-value {
  font-size: 10px;
  font-weight: 700;
  color: #fff;
}

.eps-chart-col.today .eps-chart-bar {
  background: linear-gradient(180deg, var(--gold), #B88A2E);
  box-shadow: 0 4px 12px rgba(212, 167, 69, 0.32);
}

.eps-chart-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-3);
  text-transform: uppercase;
}

.eps-chart-col.today .eps-chart-label {
  color: var(--gold);
}

/* ─── Vocabulary Page ─── */
.eps-search-row {
  display: flex;
  gap: var(--sp-3);
  margin-bottom: var(--sp-5);
  flex-wrap: wrap;
}

.eps-search {
  flex: 1;
  min-width: 240px;
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color var(--t);
}

.eps-search:focus-within {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
}

.eps-search svg {
  width: 18px;
  height: 18px;
  color: var(--text-3);
  flex-shrink: 0;
}

.eps-search input {
  flex: 1;
  border: 0;
  background: transparent;
  font-size: 14px;
  color: var(--text);
}

.eps-search input::placeholder {
  color: var(--text-3);
}

.eps-filter-pills {
  display: flex;
  gap: var(--sp-2);
  overflow-x: auto;
  padding-bottom: var(--sp-2);
  margin-bottom: var(--sp-5);
  scrollbar-width: none;
}

.eps-filter-pills::-webkit-scrollbar {
  display: none;
}

.eps-pill {
  flex-shrink: 0;
  padding: var(--sp-2) var(--sp-4);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all var(--t-fast);
  white-space: nowrap;
}

.eps-pill:hover {
  border-color: var(--brand);
  color: var(--text);
}

.eps-pill.active {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
  box-shadow: var(--shadow-brand);
}

/* Word Grid */
.eps-word-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--sp-4);
}

.eps-word-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--sp-5);
  transition: all var(--t);
  cursor: pointer;
  text-align: left;
}

.eps-word-card:hover {
  border-color: var(--brand);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.eps-word-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--sp-3);
  margin-bottom: var(--sp-3);
}

.eps-word-ko {
  font-family: var(--font-ko);
  font-size: 28px;
  font-weight: 900;
  color: var(--brand);
  line-height: 1;
}

.eps-word-cat {
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  background: var(--info-soft);
  color: var(--info);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.eps-word-pr {
  font-size: 13px;
  color: var(--text-3);
  font-style: italic;
  margin-bottom: var(--sp-2);
}

.eps-word-meaning {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: var(--sp-1);
}

.eps-word-meaning-ur {
  font-family: var(--font-ur);
  font-size: 14px;
  color: var(--text-2);
  direction: rtl;
}

.eps-word-ex {
  font-family: var(--font-ko);
  font-size: 13px;
  color: var(--text-2);
  padding-top: var(--sp-3);
  margin-top: var(--sp-3);
  border-top: 1px solid var(--border);
}

/* ─── Flashcard ─── */
.eps-flash-wrap {
  max-width: 560px;
  margin: 0 auto;
}

.eps-flash-progress {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  margin-bottom: var(--sp-6);
}

.eps-flash-progress-bar {
  flex: 1;
  height: 8px;
  background: var(--border);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.eps-flash-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--brand), var(--gold));
  border-radius: var(--radius-full);
  transition: width var(--t-slow);
}

.eps-flash-progress-text {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  tab-size: 2;
  min-width: 48px;
  text-align: right;
}

.eps-flashcard {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--sp-12) var(--sp-8);
  min-height: 320px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: all var(--t);
  margin-bottom: var(--sp-5);
  position: relative;
}

.eps-flashcard:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.eps-flashcard-hint {
  position: absolute;
  bottom: var(--sp-4);
  left: 0;
  right: 0;
  text-align: center;
  font-size: 12px;
  color: var(--text-3);
  font-weight: 500;
}

.eps-flash-ko-big {
  font-family: var(--font-ko);
  font-size: clamp(48px, 10vw, 72px);
  font-weight: 900;
  color: var(--brand);
  line-height: 1;
  margin-bottom: var(--sp-3);
}

.eps-flash-ko-med {
  font-family: var(--font-ko);
  font-size: 42px;
  font-weight: 900;
  color: var(--brand);
  margin-bottom: var(--sp-2);
  line-height: 1;
}

.eps-flash-pr {
  font-size: 15px;
  color: var(--text-3);
  font-style: italic;
  margin-bottom: var(--sp-4);
}

.eps-flash-meaning {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: var(--sp-3);
}

.eps-flash-ex {
  font-family: var(--font-ko);
  font-size: 14px;
  color: var(--text-2);
  padding: var(--sp-3) var(--sp-4);
  background: var(--bg-muted);
  border-radius: var(--radius-sm);
  margin-top: var(--sp-4);
}

.eps-flash-actions {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: var(--sp-3);
}

.eps-flash-btn {
  padding: var(--sp-4);
  border-radius: var(--radius);
  font-weight: 700;
  font-size: 14px;
  transition: all var(--t-fast);
  border: 2px solid var(--border);
  background: var(--surface);
  color: var(--text);
}

.eps-flash-btn:hover {
  transform: translateY(-2px);
}

.eps-flash-btn.hard {
  border-color: var(--brand);
  color: var(--brand);
}

.eps-flash-btn.hard:hover {
  background: var(--brand);
  color: #fff;
}

.eps-flash-btn.good {
  border-color: var(--info);
  color: var(--info);
}

.eps-flash-btn.good:hover {
  background: var(--info);
  color: #fff;
}

.eps-flash-btn.easy {
  border-color: var(--success);
  color: var(--success);
}

.eps-flash-btn.easy:hover {
  background: var(--success);
  color: #fff;
}

/* ─── Grammar ─── */
.eps-lesson-list {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}

.eps-lesson {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--sp-5);
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  transition: all var(--t);
  cursor: pointer;
  text-align: left;
}

.eps-lesson:hover {
  border-color: var(--brand);
  transform: translateX(4px);
  box-shadow: var(--shadow);
}

.eps-lesson-num {
  width: 48px;
  height: 48px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--info), var(--purple));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 18px;
  flex-shrink: 0;
}

.eps-lesson-body {
  flex: 1;
  min-width: 0;
}

.eps-lesson-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
  margin-bottom: var(--sp-1);
  letter-spacing: -0.01em;
}

.eps-lesson-meta {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  font-size: 12px;
  color: var(--text-3);
}

.eps-lesson-level {
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background: var(--info-soft);
  color: var(--info);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 10px;
  letter-spacing: 0.04em;
}

.eps-lesson-level.intermediate {
  background: var(--warning-soft);
  color: var(--warning);
}

.eps-lesson-arrow {
  color: var(--text-3);
  transition: transform var(--t);
  flex-shrink: 0;
}

.eps-lesson:hover .eps-lesson-arrow {
  transform: translateX(4px);
  color: var(--brand);
}

.eps-lesson-content {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--sp-8);
  font-size: 15px;
  line-height: 1.8;
  white-space: pre-wrap;
  box-shadow: var(--shadow-sm);
}

/* ─── Mock Exam ─── */
.eps-exam-intro {
  max-width: 560px;
  margin: var(--sp-12) auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--sp-12);
  text-align: center;
  box-shadow: var(--shadow);
}

.eps-exam-intro-icon {
  width: 88px;
  height: 88px;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, var(--brand), var(--gold));
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--sp-5);
  box-shadow: var(--shadow-brand);
}

.eps-exam-intro-icon svg {
  width: 40px;
  height: 40px;
  color: #fff;
}

.eps-exam-intro h2 {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: var(--sp-3);
}

.eps-exam-intro p {
  color: var(--text-2);
  margin-bottom: var(--sp-6);
  line-height: 1.7;
}

.eps-exam-details {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-3);
  margin-bottom: var(--sp-8);
  padding: var(--sp-5);
  background: var(--bg-muted);
  border-radius: var(--radius);
}

.eps-exam-detail {
  text-align: center;
}

.eps-exam-detail-value {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 800;
  color: var(--brand);
}

.eps-exam-detail-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: 2px;
}

.eps-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  padding: var(--sp-4) var(--sp-6);
  border-radius: var(--radius);
  font-weight: 700;
  font-size: 15px;
  transition: all var(--t);
  border: 0;
}

.eps-btn-primary {
  background: var(--brand);
  color: #fff;
  box-shadow: var(--shadow-brand);
}

.eps-btn-primary:hover {
  background: var(--brand-hover);
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(232, 68, 58, 0.32);
}

.eps-btn-outline {
  border: 2px solid var(--border-strong);
  color: var(--text);
  background: transparent;
}

.eps-btn-outline:hover {
  border-color: var(--brand);
  color: var(--brand);
}

.eps-btn-lg {
  padding: var(--sp-5) var(--sp-8);
  font-size: 16px;
}

.eps-btn-full {
  width: 100%;
}

/* Exam Question */
.eps-exam-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-4) var(--sp-5);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: var(--sp-5);
  box-shadow: var(--shadow-xs);
}

.eps-exam-progress {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
}

.eps-exam-timer {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-4);
  background: var(--warning-soft);
  color: var(--warning);
  border-radius: var(--radius-full);
  font-weight: 700;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.eps-exam-section {
  font-size: 11px;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.eps-exam-section.reading {
  background: var(--info-soft);
  color: var(--info);
}

.eps-exam-section.listening {
  background: var(--purple-soft);
  color: var(--purple);
}

.eps-exam-body {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--sp-8);
  box-shadow: var(--shadow-sm);
  margin-bottom: var(--sp-5);
}

.eps-exam-passage {
  background: var(--bg-muted);
  border-left: 3px solid var(--brand);
  padding: var(--sp-4) var(--sp-5);
  border-radius: var(--radius-sm);
  font-size: 15px;
  line-height: 1.8;
  margin-bottom: var(--sp-5);
  font-family: var(--font-ko);
}

.eps-exam-question {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  margin-bottom: var(--sp-5);
  line-height: 1.4;
}

.eps-exam-options {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}

.eps-option {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  padding: var(--sp-4) var(--sp-5);
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
  text-align: left;
  transition: all var(--t-fast);
  width: 100%;
}

.eps-option:hover {
  border-color: var(--brand);
  transform: translateX(4px);
}

.eps-option.selected {
  border-color: var(--brand);
  background: var(--brand-soft);
}

.eps-option-letter {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: var(--bg-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  color: var(--text-2);
  flex-shrink: 0;
  transition: all var(--t-fast);
}

.eps-option.selected .eps-option-letter {
  background: var(--brand);
  color: #fff;
}

.eps-exam-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-3);
}

/* Exam Result */
.eps-result {
  max-width: 560px;
  margin: var(--sp-8) auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--sp-12) var(--sp-8);
  text-align: center;
  box-shadow: var(--shadow-lg);
}

.eps-result-icon {
  font-size: 72px;
  margin-bottom: var(--sp-4);
}

.eps-result-score {
  font-family: var(--font-display);
  font-size: 64px;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
  margin-bottom: var(--sp-2);
}

.eps-result-score.passed { color: var(--success); }
.eps-result-score.failed { color: var(--brand); }

.eps-result-status {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  margin-bottom: var(--sp-2);
}

.eps-result-status.passed { color: var(--success); }
.eps-result-status.failed { color: var(--brand); }

.eps-result-note {
  color: var(--text-3);
  font-size: 14px;
  margin-bottom: var(--sp-6);
}

.eps-result-breakdown {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-4);
  padding: var(--sp-5);
  background: var(--bg-muted);
  border-radius: var(--radius);
  margin-bottom: var(--sp-6);
}

.eps-result-stat-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.eps-result-stat-value {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 800;
  margin-top: 4px;
}

.eps-result-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-3);
}

/* ─── AI Tutor ─── */
.eps-chat {
  display: flex;
  flex-direction: column;
  max-width: 720px;
  margin: 0 auto;
  height: calc(100vh - var(--header-h) - 160px);
  min-height: 480px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.eps-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: var(--sp-5);
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
}

.eps-msg {
  display: flex;
  gap: var(--sp-3);
  max-width: 85%;
}

.eps-msg.user {
  margin-left: auto;
  flex-direction: row-reverse;
}

.eps-msg-avatar {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}

.eps-msg.bot .eps-msg-avatar {
  background: linear-gradient(135deg, var(--brand), var(--gold));
  color: #fff;
}

.eps-msg.user .eps-msg-avatar {
  background: var(--info);
  color: #fff;
  font-weight: 700;
}

.eps-msg-bubble {
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--radius);
  font-size: 14px;
  line-height: 1.6;
  white-space: pre-wrap;
}

.eps-msg.bot .eps-msg-bubble {
  background: var(--bg-muted);
  border-top-left-radius: 4px;
}

.eps-msg.user .eps-msg-bubble {
  background: var(--brand);
  color: #fff;
  border-top-right-radius: 4px;
}

.eps-chat-input {
  padding: var(--sp-4);
  border-top: 1px solid var(--border);
  display: flex;
  gap: var(--sp-3);
}

.eps-chat-field {
  flex: 1;
  padding: var(--sp-3) var(--sp-4);
  background: var(--bg-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  font-size: 14px;
  color: var(--text);
}

.eps-chat-field:focus {
  border-color: var(--brand);
}

.eps-chat-send {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  background: var(--brand);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all var(--t-fast);
}

.eps-chat-send:hover {
  background: var(--brand-hover);
  transform: scale(1.05);
}

.eps-chat-send svg {
  width: 18px;
  height: 18px;
}

.eps-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
  padding: 0 var(--sp-5) var(--sp-4);
}

.eps-suggestion {
  padding: var(--sp-2) var(--sp-3);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  font-size: 12px;
  color: var(--text-2);
  transition: all var(--t-fast);
}

.eps-suggestion:hover {
  border-color: var(--brand);
  color: var(--brand);
}

/* ─── Progress Page ─── */
.eps-progress-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-5);
  margin-bottom: var(--sp-6);
}

@media (max-width: 768px) {
  .eps-progress-grid {
    grid-template-columns: 1fr;
  }
}

.eps-cat-progress {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--sp-6);
}

.eps-cat-item {
  margin-bottom: var(--sp-4);
}

.eps-cat-item:last-child {
  margin-bottom: 0;
}

.eps-cat-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: var(--sp-2);
  font-size: 13px;
}

.eps-cat-name {
  font-weight: 600;
}

.eps-cat-pct {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.eps-cat-bar {
  height: 8px;
  background: var(--bg-muted);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.eps-cat-fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width var(--t-slow);
}

/* ─── Settings ─── */
.eps-settings-list {
  max-width: 640px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}

.eps-setting {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--sp-5);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
}

.eps-setting-info {
  flex: 1;
}

.eps-setting-title {
  font-weight: 600;
  font-size: 15px;
  margin-bottom: 2px;
}

.eps-setting-desc {
  font-size: 13px;
  color: var(--text-3);
}

.eps-toggle {
  width: 44px;
  height: 26px;
  border-radius: var(--radius-full);
  background: var(--border-strong);
  position: relative;
  transition: background var(--t);
  flex-shrink: 0;
  cursor: pointer;
  border: 0;
}

.eps-toggle.on {
  background: var(--success);
}

.eps-toggle-dot {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: var(--radius-full);
  background: #fff;
  transition: left var(--t) var(--ease-spring);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.eps-toggle.on .eps-toggle-dot {
  left: 21px;
}

/* ─── Language Picker (First Screen) ─── */
.eps-lang-screen {
  min-height: 100vh;
  background: linear-gradient(160deg, #0A0A0C 0%, #0F1729 40%, #2A1E2E 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--sp-6);
  position: relative;
  overflow: hidden;
}

.eps-lang-screen::before {
  content: '한';
  position: absolute;
  font-family: var(--font-ko);
  font-size: 680px;
  font-weight: 900;
  color: rgba(255, 255, 255, 0.02);
  line-height: 1;
  right: -200px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
}

.eps-lang-content {
  max-width: 480px;
  width: 100%;
  text-align: center;
  position: relative;
  z-index: 2;
  animation: eps-fade-in 500ms ease-out;
}

.eps-lang-flag {
  font-size: 64px;
  margin-bottom: var(--sp-5);
  display: inline-block;
  animation: eps-float 3s ease-in-out infinite;
}

@keyframes eps-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.eps-lang-title {
  font-family: var(--font-display);
  font-size: clamp(28px, 6vw, 40px);
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin-bottom: var(--sp-3);
}

.eps-lang-sub {
  color: rgba(255, 255, 255, 0.65);
  font-size: 16px;
  margin-bottom: var(--sp-2);
  line-height: 1.5;
}

.eps-lang-sub-ur {
  font-family: var(--font-ur);
  color: rgba(255, 255, 255, 0.65);
  font-size: 16px;
  margin-bottom: var(--sp-10);
}

.eps-lang-label {
  color: var(--gold);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: var(--sp-5);
}

.eps-lang-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-4);
}

.eps-lang-btn {
  padding: var(--sp-6) var(--sp-5);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: var(--radius-lg);
  color: #fff;
  transition: all var(--t);
  text-align: center;
}

.eps-lang-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--brand);
  transform: translateY(-4px);
  box-shadow: 0 20px 40px rgba(232, 68, 58, 0.2);
}

.eps-lang-btn-flag {
  font-size: 44px;
  margin-bottom: var(--sp-3);
}

.eps-lang-btn-label {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 4px;
}

.eps-lang-btn-label.ur {
  font-family: var(--font-ur);
}

.eps-lang-btn-sub {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.6);
}

/* ─── Mobile Bottom Nav ─── */
.eps-mobile-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--nav-h-mobile);
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: var(--sp-2) var(--sp-3) calc(var(--sp-2) + env(safe-area-inset-bottom));
  z-index: 100;
  justify-content: space-around;
  align-items: center;
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  background: rgba(255, 255, 255, 0.92);
}

#eps-topik-app.dark .eps-mobile-nav {
  background: rgba(22, 22, 26, 0.92);
}

.eps-mobile-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: var(--sp-2) var(--sp-2);
  border-radius: var(--radius-sm);
  color: var(--text-3);
  font-size: 10px;
  font-weight: 600;
  flex: 1;
  max-width: 80px;
  transition: color var(--t-fast);
}

.eps-mobile-nav-item svg {
  width: 22px;
  height: 22px;
}

.eps-mobile-nav-item.active {
  color: var(--brand);
}

.eps-mobile-menu-btn {
  display: none;
}

/* ─── Responsive Breakpoints ─── */
@media (max-width: 1024px) {
  .eps-sidebar {
    transform: translateX(-100%);
    box-shadow: var(--shadow-xl);
    transition: transform var(--t);
  }
  .eps-sidebar.open {
    transform: translateX(0);
  }
  .eps-main {
    margin-left: 0;
  }
  .eps-mobile-menu-btn {
    display: flex;
  }
  .eps-mobile-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 39;
    opacity: 0;
    transition: opacity var(--t);
  }
  .eps-mobile-backdrop.show {
    display: block;
    opacity: 1;
  }
}

@media (max-width: 768px) {
  .eps-page {
    padding: var(--sp-5) var(--sp-4);
    padding-bottom: calc(var(--nav-h-mobile) + var(--sp-6));
  }
  .eps-mobile-nav {
    display: flex;
  }
  .eps-topbar {
    padding: 0 var(--sp-4);
  }
  .eps-hero {
    margin-bottom: var(--sp-5);
  }
  .eps-readiness {
    padding: var(--sp-6);
  }
  .eps-readiness-score {
    font-size: 28px;
  }
  .eps-exam-intro {
    padding: var(--sp-8) var(--sp-5);
  }
  .eps-flashcard {
    padding: var(--sp-8) var(--sp-5);
    min-height: 280px;
  }
}

/* ─── Loading ─── */
.eps-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--sp-16);
  color: var(--text-3);
}

.eps-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--brand);
  border-radius: var(--radius-full);
  animation: eps-spin 800ms linear infinite;
  margin-bottom: var(--sp-4);
}

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

/* ─── Scroll bars ─── */
#eps-topik-app ::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

#eps-topik-app ::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: var(--radius-full);
}

#eps-topik-app ::-webkit-scrollbar-thumb:hover {
  background: var(--text-3);
}

#eps-topik-app ::-webkit-scrollbar-track {
  background: transparent;
}

/* ─── Focus visible ─── */
#eps-topik-app button:focus-visible,
#eps-topik-app a:focus-visible,
#eps-topik-app input:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

/* ═══════════════════════════════════════════════════════════
   AUTH: Modal + Login Required + Sign-in button
   ═══════════════════════════════════════════════════════════ */

/* Small button variant for topbar */
.eps-btn-sm {
  padding: 8px 16px;
  font-size: 13px;
}

/* User mini button in topbar */
.eps-user-mini {
  padding: 0 !important;
  width: auto !important;
  height: auto !important;
}
.eps-user-mini:hover {
  background: transparent !important;
}
.eps-user-mini:hover .eps-avatar {
  transform: scale(1.05);
}
.eps-user-mini .eps-avatar {
  transition: transform var(--t-fast);
}

/* ─── Auth Modal Overlay ─── */
.eps-auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(15, 23, 41, 0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--sp-4);
  animation: eps-fade-in 200ms ease-out;
}

#eps-topik-app.dark .eps-auth-overlay {
  background: rgba(0, 0, 0, 0.7);
}

.eps-auth-modal {
  background: var(--surface);
  border-radius: var(--radius-xl);
  padding: var(--sp-8);
  max-width: 420px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  box-shadow: var(--shadow-xl);
  animation: eps-modal-pop 280ms var(--ease-spring);
  border: 1px solid var(--border);
}

@keyframes eps-modal-pop {
  0% { opacity: 0; transform: translateY(20px) scale(0.96); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

.eps-auth-x {
  position: absolute;
  top: var(--sp-4);
  right: var(--sp-4);
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-3);
  transition: all var(--t-fast);
  background: transparent;
  border: 0;
  cursor: pointer;
}
.eps-auth-x:hover {
  background: var(--bg-muted);
  color: var(--text);
}

.eps-auth-brand {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  margin-bottom: var(--sp-6);
}
.eps-auth-brand .eps-brand-mark {
  width: 36px;
  height: 36px;
  font-size: 16px;
}
.eps-auth-brand .eps-brand-text {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 18px;
}

.eps-auth-title {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-bottom: var(--sp-2);
}

.eps-auth-subtitle {
  font-size: 14px;
  color: var(--text-3);
  margin-bottom: var(--sp-6);
  line-height: 1.5;
}

.eps-auth-error {
  background: rgba(232, 68, 58, 0.08);
  border: 1px solid rgba(232, 68, 58, 0.24);
  color: var(--brand);
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  margin-bottom: var(--sp-4);
  line-height: 1.4;
}

.eps-auth-form {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
}

.eps-auth-field {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}

.eps-auth-field label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.eps-auth-field input {
  width: 100%;
  padding: var(--sp-3) var(--sp-4);
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 15px;
  color: var(--text);
  transition: all var(--t-fast);
}

.eps-auth-field input:focus {
  outline: none;
  border-color: var(--brand);
  background: var(--surface);
  box-shadow: 0 0 0 3px var(--brand-soft);
}

.eps-auth-field input::placeholder {
  color: var(--text-3);
}

.eps-auth-submit {
  width: 100%;
  padding: var(--sp-4);
  background: var(--brand);
  color: #fff;
  border: 0;
  border-radius: var(--radius);
  font-family: var(--font);
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  transition: all var(--t-fast);
  box-shadow: var(--shadow-brand);
  margin-top: var(--sp-2);
}

.eps-auth-submit:hover:not(:disabled) {
  background: var(--brand-hover);
  transform: translateY(-1px);
}

.eps-auth-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.eps-auth-switch {
  text-align: center;
  margin-top: var(--sp-5);
  padding-top: var(--sp-5);
  border-top: 1px solid var(--border);
  font-size: 14px;
  color: var(--text-2);
}

.eps-auth-switch a {
  color: var(--brand);
  font-weight: 700;
  text-decoration: none;
  margin-left: 4px;
}

.eps-auth-switch a:hover {
  text-decoration: underline;
}

/* ─── Login Required Card (for protected pages) ─── */
.eps-locked-card {
  max-width: 480px;
  margin: var(--sp-12) auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: var(--sp-12) var(--sp-8);
  text-align: center;
  box-shadow: var(--shadow);
}

.eps-locked-icon {
  width: 72px;
  height: 72px;
  margin: 0 auto var(--sp-5);
  border-radius: var(--radius-lg);
  background: var(--brand-soft);
  color: var(--brand);
  display: flex;
  align-items: center;
  justify-content: center;
}

.eps-locked-card h2 {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-bottom: var(--sp-3);
}

.eps-locked-card p {
  font-size: 15px;
  color: var(--text-2);
  line-height: 1.6;
  margin-bottom: var(--sp-6);
}

.eps-locked-actions {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}

@media (min-width: 480px) {
  .eps-locked-actions {
    flex-direction: row;
    justify-content: center;
  }
  .eps-locked-actions .eps-btn {
    flex: 1;
    max-width: 200px;
  }
}

/* Mobile auth modal adjustments */
@media (max-width: 480px) {
  .eps-auth-modal {
    padding: var(--sp-6);
    max-height: 100vh;
    border-radius: var(--radius-md);
  }
  .eps-locked-card {
    padding: var(--sp-8) var(--sp-5);
    margin: var(--sp-6) auto;
  }
}

/* ═══════════════════════════════════════════════════════════
   ALPHABET PAGE + SPEAKER BUTTONS
   ═══════════════════════════════════════════════════════════ */

/* Vocab card: pronunciation row */
:where(#eps-topik-app) .eps-word-pr-row {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  margin-bottom: var(--sp-2);
}
:where(#eps-topik-app) .eps-word-pr-row .eps-word-pr { margin: 0; flex: 1; }

:where(#eps-topik-app) .eps-speak-btn {
  width: 32px; height: 32px;
  border-radius: var(--radius-full);
  background: var(--brand-soft);
  color: var(--brand);
  display: flex; align-items: center; justify-content: center;
  border: 0;
  cursor: pointer;
  flex-shrink: 0;
  transition: all var(--t-fast);
}
:where(#eps-topik-app) .eps-speak-btn:hover {
  background: var(--brand);
  color: #fff;
  transform: scale(1.08);
}
:where(#eps-topik-app) .eps-speak-btn.eps-speaking,
:where(#eps-topik-app) .eps-letter-card.eps-speaking {
  animation: eps-pulse 600ms ease-out;
}
@keyframes eps-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(232, 68, 58, 0.5); }
  70%  { box-shadow: 0 0 0 16px rgba(232, 68, 58, 0); }
  100% { box-shadow: 0 0 0 0 rgba(232, 68, 58, 0); }
}

:where(#eps-topik-app) .eps-speak-btn-sm {
  width: 22px; height: 22px;
  border-radius: var(--radius-full);
  background: transparent;
  color: var(--text-3);
  display: inline-flex; align-items: center; justify-content: center;
  border: 0; cursor: pointer;
  margin-right: var(--sp-2);
  vertical-align: middle;
  transition: all var(--t-fast);
}
:where(#eps-topik-app) .eps-speak-btn-sm:hover {
  color: var(--brand);
  background: var(--brand-soft);
}
:where(#eps-topik-app) .eps-speak-btn-sm svg {
  width: 14px; height: 14px;
}

/* ─── Alphabet Page ─── */
:where(#eps-topik-app) .eps-alpha-tip {
  background: var(--brand-softer);
  border: 1px solid var(--brand-border);
  border-radius: var(--radius);
  padding: var(--sp-4) var(--sp-5);
  margin-bottom: var(--sp-8);
  font-size: 14px;
  color: var(--text);
  line-height: 1.5;
}

:where(#eps-topik-app) .eps-alpha-section {
  margin-bottom: var(--sp-10);
}

:where(#eps-topik-app) .eps-alpha-section-head {
  margin-bottom: var(--sp-5);
}

:where(#eps-topik-app) .eps-alpha-section-title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.01em;
  margin-bottom: 6px;
}

:where(#eps-topik-app) .eps-alpha-section-desc {
  font-size: 13px;
  color: var(--text-3);
  line-height: 1.5;
  max-width: 640px;
  margin: 0;
}

:where(#eps-topik-app) .eps-alpha-divider {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  margin: var(--sp-10) 0 var(--sp-8);
}
:where(#eps-topik-app) .eps-alpha-divider::before,
:where(#eps-topik-app) .eps-alpha-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}
:where(#eps-topik-app) .eps-alpha-divider span {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 0 var(--sp-3);
}

/* Letter grid */
:where(#eps-topik-app) .eps-letter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: var(--sp-3);
}

:where(#eps-topik-app) .eps-letter-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: var(--sp-5) var(--sp-3) var(--sp-4);
  text-align: center;
  cursor: pointer;
  position: relative;
  transition: all var(--t);
  font-family: var(--font);
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 180px;
}

:where(#eps-topik-app) .eps-letter-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--brand);
}

:where(#eps-topik-app) .eps-letter-ko {
  font-family: var(--font-ko);
  font-size: 48px;
  font-weight: 900;
  line-height: 1;
  margin-bottom: var(--sp-2);
  color: var(--text);
}

:where(#eps-topik-app) .eps-letter-r {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
  color: var(--brand);
  margin-bottom: 4px;
  letter-spacing: -0.01em;
}

:where(#eps-topik-app) .eps-letter-en {
  font-size: 12px;
  color: var(--text-2);
  line-height: 1.35;
  margin-bottom: 8px;
}

:where(#eps-topik-app) .eps-letter-ex {
  font-family: var(--font-ko);
  font-size: 11px;
  color: var(--text-3);
  padding-top: var(--sp-2);
  margin-top: auto;
  border-top: 1px solid var(--border);
  width: 100%;
  line-height: 1.3;
}

:where(#eps-topik-app) .eps-letter-speaker {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-full);
  background: var(--bg-muted);
  color: var(--text-3);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--t-fast);
}
:where(#eps-topik-app) .eps-letter-speaker svg {
  width: 14px; height: 14px;
}
:where(#eps-topik-app) .eps-letter-card:hover .eps-letter-speaker {
  background: var(--brand);
  color: #fff;
}

/* Category accent colors for letter cards */
:where(#eps-topik-app) .eps-letter-card.eps-letter-vowel .eps-letter-ko { color: var(--brand); }
:where(#eps-topik-app) .eps-letter-card.eps-letter-vowel-2 .eps-letter-ko { color: #D97706; }
:where(#eps-topik-app) .eps-letter-card.eps-letter-cons .eps-letter-ko { color: var(--info); }
:where(#eps-topik-app) .eps-letter-card.eps-letter-cons-2 .eps-letter-ko { color: var(--purple); }
:where(#eps-topik-app) .eps-letter-card.eps-letter-cons-3 .eps-letter-ko { color: var(--success); }

/* Mobile adjustments */
@media (max-width: 640px) {
  :where(#eps-topik-app) .eps-letter-grid {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: var(--sp-2);
  }
  :where(#eps-topik-app) .eps-letter-card {
    padding: var(--sp-4) var(--sp-2) var(--sp-3);
    min-height: 150px;
  }
  :where(#eps-topik-app) .eps-letter-ko { font-size: 38px; }
  :where(#eps-topik-app) .eps-letter-r { font-size: 14px; }
  :where(#eps-topik-app) .eps-letter-en { font-size: 11px; }
  :where(#eps-topik-app) .eps-letter-ex { font-size: 10px; }
  :where(#eps-topik-app) .eps-alpha-section-title { font-size: 17px; }
}

/* ═══════════════════════════════════════════════════════════
   BOOKMARKS + CHAT ERROR
   ═══════════════════════════════════════════════════════════ */

/* Vocab top-right (bookmark + category pill) */
:where(#eps-topik-app) .eps-word-top-right {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

/* Bookmark button */
:where(#eps-topik-app) .eps-bookmark-btn {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  background: transparent;
  color: var(--text-3);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  cursor: pointer;
  transition: all var(--t-fast);
  flex-shrink: 0;
}

:where(#eps-topik-app) .eps-bookmark-btn:hover {
  background: var(--brand-soft);
  color: var(--brand);
  transform: scale(1.1);
}

:where(#eps-topik-app) .eps-bookmark-btn.active {
  color: var(--brand);
}

:where(#eps-topik-app) .eps-bookmark-btn.active:hover {
  background: var(--brand-soft);
}

/* Bookmarks filter pill */
:where(#eps-topik-app) .eps-pill-bookmarks {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

:where(#eps-topik-app) .eps-pill-bookmarks svg {
  color: var(--brand);
}

:where(#eps-topik-app) .eps-pill-bookmarks.active svg {
  color: #fff;
}

/* Empty state (for "Saved" with no bookmarks) */
:where(#eps-topik-app) .eps-empty-state {
  text-align: center;
  padding: var(--sp-10) var(--sp-5);
  background: var(--surface);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  max-width: 480px;
  margin: var(--sp-4) auto;
}

:where(#eps-topik-app) .eps-empty-icon {
  width: 72px;
  height: 72px;
  margin: 0 auto var(--sp-4);
  border-radius: var(--radius-lg);
  background: var(--brand-soft);
  color: var(--brand);
  display: flex;
  align-items: center;
  justify-content: center;
}

:where(#eps-topik-app) .eps-empty-state h3 {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: var(--sp-2);
}

:where(#eps-topik-app) .eps-empty-state p {
  font-size: 14px;
  color: var(--text-2);
  line-height: 1.5;
  margin: 0;
  max-width: 320px;
  margin: 0 auto;
}

/* Chat: error message styling (bot message containing ⚠️) */
:where(#eps-topik-app) .eps-chat-msg.bot[data-error="true"] {
  background: rgba(232, 68, 58, 0.08);
  border-color: rgba(232, 68, 58, 0.24);
  color: var(--brand);
}

/* ═══════════════════════════════════════════════════════════
   LISTENING + WRITING PRACTICE
   ═══════════════════════════════════════════════════════════ */

/* Score bar */
:where(#eps-topik-app) .eps-practice-score {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  margin-bottom: var(--sp-5);
  padding: var(--sp-3) var(--sp-4);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: fit-content;
}
:where(#eps-topik-app) .eps-practice-correct {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 18px;
  color: var(--brand);
}
:where(#eps-topik-app) .eps-practice-correct svg { width: 20px; height: 20px; }
:where(#eps-topik-app) .eps-practice-total {
  font-size: 13px;
  color: var(--text-3);
  font-weight: 500;
}

/* Practice card */
:where(#eps-topik-app) .eps-practice-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: var(--sp-8);
  max-width: 640px;
  box-shadow: var(--shadow);
}

/* ─── Listening ─── */
:where(#eps-topik-app) .eps-practice-word-display {
  text-align: center;
  margin-bottom: var(--sp-6);
  padding-bottom: var(--sp-6);
  border-bottom: 1px solid var(--border);
}
:where(#eps-topik-app) .eps-practice-listen-icon {
  margin-bottom: var(--sp-4);
}
:where(#eps-topik-app) .eps-listen-play {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-6) var(--sp-8);
  background: linear-gradient(135deg, var(--brand), #FF6B60);
  color: #fff;
  border: 0;
  border-radius: var(--radius-xl);
  cursor: pointer;
  transition: all var(--t);
  box-shadow: var(--shadow-brand);
}
:where(#eps-topik-app) .eps-listen-play svg {
  width: 48px;
  height: 48px;
}
:where(#eps-topik-app) .eps-listen-play span {
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
  opacity: 0.9;
}
:where(#eps-topik-app) .eps-listen-play:hover {
  transform: scale(1.05);
  box-shadow: 0 12px 32px rgba(232, 68, 58, 0.35);
}
:where(#eps-topik-app) .eps-listen-play:active {
  transform: scale(0.98);
}

:where(#eps-topik-app) .eps-practice-hint {
  font-family: var(--font-ko);
  font-size: 56px;
  font-weight: 900;
  color: var(--text-3);
  line-height: 1;
}
:where(#eps-topik-app) .eps-practice-reveal {
  color: var(--text);
}

/* Quiz options */
:where(#eps-topik-app) .eps-quiz-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-3);
  margin-bottom: var(--sp-5);
}
@media (max-width: 480px) {
  :where(#eps-topik-app) .eps-quiz-options { grid-template-columns: 1fr; }
}
:where(#eps-topik-app) .eps-quiz-option {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-4) var(--sp-5);
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  font-family: var(--font);
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
  transition: all var(--t-fast);
  text-align: left;
}
:where(#eps-topik-app) .eps-quiz-option:hover:not(:disabled) {
  border-color: var(--brand);
  background: var(--brand-softer);
}
:where(#eps-topik-app) .eps-quiz-option:disabled {
  cursor: default;
  opacity: 0.7;
}
:where(#eps-topik-app) .eps-quiz-option.correct {
  border-color: var(--success) !important;
  background: rgba(5, 150, 105, 0.08) !important;
  color: var(--success) !important;
  opacity: 1 !important;
}
:where(#eps-topik-app) .eps-quiz-option.wrong {
  border-color: var(--brand) !important;
  background: rgba(232, 68, 58, 0.06) !important;
  color: var(--brand) !important;
  opacity: 1 !important;
}
:where(#eps-topik-app) .eps-quiz-option-letter {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-full);
  background: var(--surface);
  border: 1.5px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 12px;
  color: var(--text-3);
  flex-shrink: 0;
}
:where(#eps-topik-app) .eps-quiz-option.correct .eps-quiz-option-letter {
  background: var(--success);
  border-color: var(--success);
  color: #fff;
}
:where(#eps-topik-app) .eps-quiz-option.wrong .eps-quiz-option-letter {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

/* Feedback */
:where(#eps-topik-app) .eps-practice-feedback {
  padding: var(--sp-4) var(--sp-5);
  border-radius: var(--radius);
  font-size: 15px;
  line-height: 1.5;
  margin-bottom: var(--sp-4);
}
:where(#eps-topik-app) .eps-practice-feedback.correct {
  background: rgba(5, 150, 105, 0.08);
  border: 1px solid rgba(5, 150, 105, 0.24);
  color: #047857;
}
:where(#eps-topik-app) .eps-practice-feedback.wrong {
  background: rgba(232, 68, 58, 0.06);
  border: 1px solid rgba(232, 68, 58, 0.2);
  color: var(--brand);
}
:where(#eps-topik-app) .eps-practice-next {
  width: 100%;
  margin-top: var(--sp-2);
}

/* ─── Writing ─── */
:where(#eps-topik-app) .eps-writing-prompt {
  text-align: center;
  padding: var(--sp-6) var(--sp-4);
  margin-bottom: var(--sp-5);
  border-bottom: 1px solid var(--border);
}
:where(#eps-topik-app) .eps-writing-prompt-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: var(--sp-3);
}
:where(#eps-topik-app) .eps-writing-prompt-en {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.02em;
  margin-bottom: var(--sp-2);
}
:where(#eps-topik-app) .eps-writing-prompt-ur {
  font-family: var(--font-ur);
  font-size: 20px;
  color: var(--text-2);
  direction: rtl;
  margin-bottom: var(--sp-2);
}
:where(#eps-topik-app) .eps-writing-prompt-hint {
  font-size: 12px;
  color: var(--text-3);
  font-weight: 500;
}

:where(#eps-topik-app) .eps-writing-input-row {
  display: flex;
  gap: var(--sp-3);
  margin-bottom: var(--sp-5);
}
:where(#eps-topik-app) .eps-writing-input {
  flex: 1;
  padding: var(--sp-4) var(--sp-5);
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--font-ko);
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
  text-align: center;
  transition: all var(--t-fast);
}
:where(#eps-topik-app) .eps-writing-input:focus {
  outline: none;
  border-color: var(--brand);
  background: var(--surface);
  box-shadow: 0 0 0 3px var(--brand-soft);
}
:where(#eps-topik-app) .eps-writing-input::placeholder {
  color: var(--text-3);
  font-size: 16px;
  font-weight: 400;
}
:where(#eps-topik-app) .eps-writing-input:disabled {
  opacity: 0.6;
}

:where(#eps-topik-app) .eps-writing-answer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-3);
  margin-top: var(--sp-3);
  padding: var(--sp-3);
  background: rgba(232, 68, 58, 0.04);
  border-radius: var(--radius-sm);
}
:where(#eps-topik-app) .eps-writing-answer-ko {
  font-family: var(--font-ko);
  font-size: 28px;
  font-weight: 900;
  color: var(--text);
}
:where(#eps-topik-app) .eps-writing-answer-pr {
  font-size: 14px;
  color: var(--text-2);
}

/* Mobile adjustments */
@media (max-width: 640px) {
  :where(#eps-topik-app) .eps-practice-card { padding: var(--sp-5); }
  :where(#eps-topik-app) .eps-writing-prompt-en { font-size: 24px; }
  :where(#eps-topik-app) .eps-practice-hint { font-size: 40px; }
  :where(#eps-topik-app) .eps-writing-input { font-size: 20px; }
  :where(#eps-topik-app) .eps-writing-input-row { flex-direction: column; }
}

/* ═══════════════════════════════════════════════════════════
   CHAPTERS (book-aligned 7 themes × 50 lessons)
   ═══════════════════════════════════════════════════════════ */

/* ─── Overall progress bar on Chapters home ─── */
:where(#eps-topik-app) .eps-ch-overall-progress {
  background: linear-gradient(135deg, #0F1729 0%, #1A2340 100%);
  border-radius: var(--radius-xl);
  padding: var(--sp-5) var(--sp-6);
  color: #fff;
  margin-bottom: var(--sp-8);
  display: flex;
  align-items: center;
  gap: var(--sp-5);
  flex-wrap: wrap;
  position: relative;
  overflow: hidden;
  box-sizing: border-box;
  width: 100%;
}
:where(#eps-topik-app) .eps-ch-overall-progress::before {
  content: '50';
  position: absolute;
  right: -20px;
  bottom: -30px;
  font-family: var(--font-display);
  font-size: 140px;
  font-weight: 900;
  color: rgba(255,255,255,0.04);
  line-height: 1;
  pointer-events: none;
}
:where(#eps-topik-app) .eps-ch-overall-stats {
  flex-shrink: 0;
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
}
:where(#eps-topik-app) .eps-ch-overall-num {
  font-family: var(--font-display);
  font-weight: 800;
  line-height: 1;
  color: #fff;
  margin-bottom: 6px;
  display: flex;
  align-items: baseline;
  gap: 4px;
}
:where(#eps-topik-app) .eps-ch-overall-num-done {
  font-size: 36px;
  color: #fff;
}
:where(#eps-topik-app) .eps-ch-overall-num-total {
  font-size: 20px;
  color: rgba(255,255,255,0.5);
  font-weight: 600;
}
:where(#eps-topik-app) .eps-ch-overall-label {
  font-size: 12px;
  color: rgba(255,255,255,0.65);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
:where(#eps-topik-app) .eps-ch-overall-bar {
  flex: 1 1 200px;
  height: 10px;
  background: rgba(255,255,255,0.1);
  border-radius: var(--radius-full);
  overflow: hidden;
  min-width: 200px;
  position: relative;
  z-index: 1;
}
:where(#eps-topik-app) .eps-ch-overall-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--brand), #D4A745);
  border-radius: var(--radius-full);
  transition: width 400ms ease-out;
}
:where(#eps-topik-app) .eps-ch-overall-pct {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  color: rgba(255,255,255,0.75);
  white-space: nowrap;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}

@media (max-width: 640px) {
  :where(#eps-topik-app) .eps-ch-overall-progress {
    grid-template-columns: 1fr;
    text-align: center;
    gap: var(--sp-4);
    padding: var(--sp-5);
  }
  :where(#eps-topik-app) .eps-ch-overall-bar { width: 100%; }
}

/* ─── Theme grid (Level 1) ─── */
:where(#eps-topik-app) .eps-theme-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: var(--sp-4);
}

:where(#eps-topik-app) .eps-theme-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--sp-5) var(--sp-6);
  display: flex;
  align-items: flex-start;
  gap: var(--sp-4);
  cursor: pointer;
  transition: all var(--t);
  text-align: left;
  font-family: var(--font);
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-xs);
}
:where(#eps-topik-app) .eps-theme-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; bottom: 0;
  width: 4px;
  background: var(--theme-color, var(--brand));
  transition: width var(--t);
}
:where(#eps-topik-app) .eps-theme-card:hover {
  transform: translateY(-3px);
  border-color: var(--theme-color, var(--brand));
  box-shadow: var(--shadow-md);
}
:where(#eps-topik-app) .eps-theme-card:hover::before {
  width: 6px;
}

:where(#eps-topik-app) .eps-theme-card-icon {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--theme-color, var(--brand)) 12%, transparent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-family: var(--font-ko);
  font-weight: 900;
  flex-shrink: 0;
  color: var(--theme-color, var(--brand));
}

:where(#eps-topik-app) .eps-theme-card-body { flex: 1; min-width: 0; }

:where(#eps-topik-app) .eps-theme-card-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 17px;
  color: var(--text);
  letter-spacing: -0.01em;
  margin-bottom: 2px;
}
:where(#eps-topik-app) .eps-theme-card-ko {
  font-family: var(--font-ko);
  font-weight: 700;
  font-size: 14px;
  color: var(--theme-color, var(--brand));
  margin-bottom: var(--sp-2);
}
:where(#eps-topik-app) .eps-theme-card-desc {
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.45;
  margin-bottom: var(--sp-4);
  margin-top: 0;
}
:where(#eps-topik-app) .eps-theme-card-stats {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
}
:where(#eps-topik-app) .eps-theme-card-chcount {
  font-size: 12px;
  color: var(--text-3);
  font-weight: 600;
}
:where(#eps-topik-app) .eps-theme-card-progress-wrap {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  flex: 1;
  max-width: 180px;
}
:where(#eps-topik-app) .eps-theme-card-progress-bar {
  flex: 1;
  height: 6px;
  background: var(--bg-muted);
  border-radius: var(--radius-full);
  overflow: hidden;
}
:where(#eps-topik-app) .eps-theme-card-progress-fill {
  height: 100%;
  background: var(--theme-color, var(--brand));
  border-radius: var(--radius-full);
  transition: width 400ms ease-out;
}
:where(#eps-topik-app) .eps-theme-card-pct {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 11px;
  color: var(--text-3);
  white-space: nowrap;
}

/* ─── Breadcrumb back link ─── */
:where(#eps-topik-app) .eps-breadcrumb {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  margin-bottom: var(--sp-4);
  padding: 6px 10px 6px 6px;
  border-radius: var(--radius-sm);
  transition: all var(--t-fast);
  text-decoration: none;
}
:where(#eps-topik-app) .eps-breadcrumb:hover {
  color: var(--brand);
  background: var(--brand-soft);
}

/* ─── Theme detail header (Level 2) ─── */
:where(#eps-topik-app) .eps-theme-detail-header {
  border-radius: var(--radius-xl);
  padding: var(--sp-7) var(--sp-8);
  color: #fff;
  margin-bottom: var(--sp-6);
  position: relative;
  overflow: hidden;
}
:where(#eps-topik-app) .eps-theme-detail-icon {
  font-size: 40px;
  font-family: var(--font-ko);
  font-weight: 900;
  line-height: 1;
  margin-bottom: var(--sp-3);
}
:where(#eps-topik-app) .eps-theme-detail-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 28px;
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: #fff;
  margin-bottom: 4px;
}
:where(#eps-topik-app) .eps-theme-detail-ko {
  font-family: var(--font-ko);
  font-weight: 700;
  font-size: 16px;
  color: rgba(255,255,255,0.85);
  margin-bottom: var(--sp-3);
}
:where(#eps-topik-app) .eps-theme-detail-desc {
  font-size: 14px;
  color: rgba(255,255,255,0.78);
  line-height: 1.5;
  margin: 0 0 var(--sp-4);
  max-width: 640px;
}
:where(#eps-topik-app) .eps-theme-detail-progress {
  font-size: 14px;
  color: rgba(255,255,255,0.92);
  font-weight: 500;
}
:where(#eps-topik-app) .eps-theme-detail-progress strong {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 20px;
}

/* ─── Chapter list (Level 2 content) ─── */
:where(#eps-topik-app) .eps-chapter-list {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}
:where(#eps-topik-app) .eps-chapter-card {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  padding: var(--sp-4) var(--sp-5);
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all var(--t);
  text-align: left;
  font-family: var(--font);
  box-shadow: var(--shadow-xs);
}
:where(#eps-topik-app) .eps-chapter-card:hover {
  border-color: var(--brand);
  transform: translateX(4px);
  box-shadow: var(--shadow-sm);
}
:where(#eps-topik-app) .eps-chapter-card.completed {
  background: rgba(5, 150, 105, 0.03);
  border-color: rgba(5, 150, 105, 0.25);
}
:where(#eps-topik-app) .eps-chapter-card-number {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  background: var(--brand-soft);
  color: var(--brand);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 18px;
  flex-shrink: 0;
  position: relative;
}
:where(#eps-topik-app) .eps-chapter-card.completed .eps-chapter-card-number {
  background: rgba(5, 150, 105, 0.12);
  color: var(--success, #059669);
}
:where(#eps-topik-app) .eps-chapter-check {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 18px;
  height: 18px;
  background: var(--success, #059669);
  color: #fff;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--surface);
}
:where(#eps-topik-app) .eps-chapter-card-body { flex: 1; min-width: 0; }
:where(#eps-topik-app) .eps-chapter-card-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  color: var(--text);
  margin-bottom: 2px;
  line-height: 1.3;
}
:where(#eps-topik-app) .eps-chapter-card-ko {
  font-family: var(--font-ko);
  font-weight: 600;
  font-size: 13px;
  color: var(--text-2);
  margin-bottom: 4px;
}
:where(#eps-topik-app) .eps-chapter-card-meta {
  font-size: 11px;
  color: var(--text-3);
  font-weight: 500;
}
:where(#eps-topik-app) .eps-chapter-card-arrow {
  font-size: 20px;
  color: var(--text-3);
  flex-shrink: 0;
  transition: transform var(--t);
}
:where(#eps-topik-app) .eps-chapter-card:hover .eps-chapter-card-arrow {
  color: var(--brand);
  transform: translateX(4px);
}

/* ─── Chapter detail (Level 3) ─── */
:where(#eps-topik-app) .eps-ch-detail-header {
  padding: var(--sp-6) 0 var(--sp-5);
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--sp-6);
}
:where(#eps-topik-app) .eps-ch-detail-number {
  display: inline-block;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 11px;
  color: var(--brand);
  background: var(--brand-soft);
  padding: 4px 12px;
  border-radius: var(--radius-full);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: var(--sp-3);
}
:where(#eps-topik-app) .eps-ch-detail-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(22px, 3vw, 28px);
  color: var(--text);
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin-bottom: var(--sp-2);
}
:where(#eps-topik-app) .eps-ch-detail-ko {
  font-family: var(--font-ko);
  font-weight: 700;
  font-size: 20px;
  color: var(--text-2);
  margin-bottom: var(--sp-4);
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
}
:where(#eps-topik-app) .eps-ch-detail-theme {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--radius-full);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 12px;
}

:where(#eps-topik-app) .eps-ch-info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--sp-3);
  margin-bottom: var(--sp-6);
}
:where(#eps-topik-app) .eps-ch-info-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--sp-4);
}
:where(#eps-topik-app) .eps-ch-info-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 6px;
}
:where(#eps-topik-app) .eps-ch-info-value {
  font-family: var(--font);
  font-size: 14px;
  color: var(--text);
  font-weight: 500;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}

:where(#eps-topik-app) .eps-ch-vocab-section {
  margin-bottom: var(--sp-6);
}
:where(#eps-topik-app) .eps-ch-section-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 18px;
  color: var(--text);
  margin-bottom: var(--sp-4);
  display: flex;
  align-items: baseline;
  gap: var(--sp-3);
}
:where(#eps-topik-app) .eps-ch-section-count {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-3);
  background: var(--bg-muted);
  padding: 3px 10px;
  border-radius: var(--radius-full);
}

:where(#eps-topik-app) .eps-ch-detail-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: var(--sp-6);
  padding-top: var(--sp-5);
  border-top: 1px solid var(--border);
}

/* Mobile adjustments */
@media (max-width: 640px) {
  :where(#eps-topik-app) .eps-theme-detail-header { padding: var(--sp-5); }
  :where(#eps-topik-app) .eps-theme-detail-title { font-size: 22px; }
  :where(#eps-topik-app) .eps-chapter-card { padding: var(--sp-3) var(--sp-4); gap: var(--sp-3); }
  :where(#eps-topik-app) .eps-chapter-card-number { width: 36px; height: 36px; font-size: 15px; }
  :where(#eps-topik-app) .eps-chapter-card-title { font-size: 14px; }
  :where(#eps-topik-app) .eps-ch-detail-actions { justify-content: stretch; }
  :where(#eps-topik-app) .eps-ch-detail-actions .eps-btn { flex: 1; }
}

/* ═══════════════════════════════════════════════════════════
   GRAMMAR LESSONS (book-aligned, 50 lessons with filters)
   ═══════════════════════════════════════════════════════════ */

/* ─── Filter bar ─── */
:where(#eps-topik-app) .eps-gr-filter-bar {
  display: flex;
  gap: var(--sp-2);
  margin-bottom: var(--sp-5);
  flex-wrap: wrap;
  padding-bottom: var(--sp-2);
}
:where(#eps-topik-app) .eps-gr-filter-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-full);
  background: var(--surface);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  cursor: pointer;
  transition: all var(--t-fast);
  white-space: nowrap;
}
:where(#eps-topik-app) .eps-gr-filter-btn:hover {
  border-color: var(--brand);
  color: var(--brand);
}
:where(#eps-topik-app) .eps-gr-filter-btn.active {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}
:where(#eps-topik-app) .eps-gr-filter-count {
  display: inline-block;
  padding: 1px 7px;
  border-radius: var(--radius-full);
  background: rgba(0,0,0,0.07);
  font-size: 11px;
  font-weight: 700;
  color: inherit;
}
:where(#eps-topik-app) .eps-gr-filter-btn.active .eps-gr-filter-count {
  background: rgba(255,255,255,0.25);
}

/* ─── Grid of lesson cards ─── */
:where(#eps-topik-app) .eps-gr-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--sp-3);
}
:where(#eps-topik-app) .eps-gr-card {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  padding: var(--sp-4) var(--sp-5);
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all var(--t);
  text-align: left;
  font-family: var(--font);
  position: relative;
  box-shadow: var(--shadow-xs);
}
:where(#eps-topik-app) .eps-gr-card:hover {
  transform: translateY(-2px);
  border-color: var(--brand);
  box-shadow: var(--shadow-md);
}
:where(#eps-topik-app) .eps-gr-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-2);
  margin-bottom: var(--sp-1);
}
:where(#eps-topik-app) .eps-gr-card-ch {
  display: inline-block;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 10px;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  background: var(--brand-soft);
  color: var(--brand);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
:where(#eps-topik-app) .eps-gr-card-level {
  display: inline-block;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 10px;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
:where(#eps-topik-app) .eps-gr-card-level.beginner {
  background: rgba(5, 150, 105, 0.12);
  color: #059669;
}
:where(#eps-topik-app) .eps-gr-card-level.intermediate {
  background: rgba(217, 119, 6, 0.12);
  color: #d97706;
}
:where(#eps-topik-app) .eps-gr-card-level.advanced {
  background: rgba(220, 38, 38, 0.12);
  color: #dc2626;
}
:where(#eps-topik-app) .eps-gr-card-pattern {
  font-family: var(--font-ko);
  font-weight: 700;
  font-size: 18px;
  color: var(--brand);
  line-height: 1.2;
  margin-top: var(--sp-2);
}
:where(#eps-topik-app) .eps-gr-card-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  color: var(--text);
  line-height: 1.35;
  letter-spacing: -0.01em;
}
:where(#eps-topik-app) .eps-gr-card-arrow {
  position: absolute;
  top: var(--sp-4);
  right: var(--sp-4);
  color: var(--text-3);
  transition: transform var(--t-fast);
  font-size: 14px;
  display: none; /* hidden since header already has level pill */
}
:where(#eps-topik-app) .eps-gr-empty {
  text-align: center;
  padding: var(--sp-7) var(--sp-5);
  color: var(--text-3);
  font-size: 14px;
}

/* ─── Detail view header ─── */
:where(#eps-topik-app) .eps-gr-detail-header {
  padding: var(--sp-6) 0 var(--sp-5);
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--sp-6);
}
:where(#eps-topik-app) .eps-gr-chapter-badge {
  display: inline-block;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 11px;
  color: var(--brand);
  background: var(--brand-soft);
  padding: 4px 12px;
  border-radius: var(--radius-full);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: var(--sp-3);
}
:where(#eps-topik-app) .eps-gr-pattern {
  font-family: var(--font-ko);
  font-weight: 800;
  font-size: 28px;
  color: var(--brand);
  line-height: 1.2;
  margin-bottom: var(--sp-2);
  letter-spacing: -0.01em;
}
:where(#eps-topik-app) .eps-gr-detail-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(22px, 3vw, 28px);
  color: var(--text);
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin: 0 0 var(--sp-3);
}
:where(#eps-topik-app) .eps-gr-level-pill {
  display: inline-block;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 11px;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
:where(#eps-topik-app) .eps-gr-level-pill.beginner {
  background: rgba(5, 150, 105, 0.12);
  color: #059669;
}
:where(#eps-topik-app) .eps-gr-level-pill.intermediate {
  background: rgba(217, 119, 6, 0.12);
  color: #d97706;
}
:where(#eps-topik-app) .eps-gr-level-pill.advanced {
  background: rgba(220, 38, 38, 0.12);
  color: #dc2626;
}

/* ─── Content block ─── */
:where(#eps-topik-app) .eps-gr-content {
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.7;
  color: var(--text);
  margin-bottom: var(--sp-6);
}
:where(#eps-topik-app) .eps-gr-content[dir="rtl"],
:where(#eps-topik-app) html[lang="ur"] .eps-gr-content {
  font-family: var(--font-ur, 'Noto Nastaliq Urdu', var(--font));
  font-size: 17px;
  line-height: 2;
}

/* ─── Examples section ─── */
:where(#eps-topik-app) .eps-gr-section-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 18px;
  color: var(--text);
  margin: 0 0 var(--sp-4);
  letter-spacing: -0.01em;
}
:where(#eps-topik-app) .eps-gr-examples {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  margin-bottom: var(--sp-6);
}
:where(#eps-topik-app) .eps-gr-example {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--brand);
  border-radius: var(--radius);
  padding: var(--sp-4) var(--sp-5);
  box-shadow: var(--shadow-xs);
}
:where(#eps-topik-app) .eps-gr-example-ko-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  margin-bottom: 4px;
}
:where(#eps-topik-app) .eps-gr-example-ko {
  font-family: var(--font-ko);
  font-weight: 700;
  font-size: 18px;
  color: var(--text);
  line-height: 1.4;
  flex: 1;
  min-width: 0;
  word-break: keep-all;
}
:where(#eps-topik-app) .eps-gr-example-pr {
  font-family: var(--font);
  font-size: 13px;
  color: var(--text-3);
  font-style: italic;
  margin-bottom: 4px;
}
:where(#eps-topik-app) .eps-gr-example-en {
  font-family: var(--font);
  font-size: 14px;
  color: var(--text-2);
  line-height: 1.5;
  margin-bottom: 2px;
}
:where(#eps-topik-app) .eps-gr-example-ur {
  font-family: var(--font-ur, 'Noto Nastaliq Urdu', var(--font));
  font-size: 15px;
  color: var(--text-2);
  line-height: 1.9;
  margin-top: 4px;
}

/* ─── Disclaimer ─── */
:where(#eps-topik-app) .eps-gr-disclaimer {
  background: rgba(217, 119, 6, 0.08);
  border: 1px solid rgba(217, 119, 6, 0.2);
  border-radius: var(--radius);
  padding: var(--sp-3) var(--sp-4);
  font-size: 12px;
  color: var(--text-2);
  line-height: 1.55;
  margin-top: var(--sp-6);
}

/* Mobile adjustments */
@media (max-width: 640px) {
  :where(#eps-topik-app) .eps-gr-grid { grid-template-columns: 1fr; }
  :where(#eps-topik-app) .eps-gr-pattern { font-size: 22px; }
  :where(#eps-topik-app) .eps-gr-example-ko { font-size: 16px; }
  :where(#eps-topik-app) .eps-gr-filter-btn { font-size: 12px; padding: 6px 10px; }
}

/* ═══════════════════════════════════════════════════════════
   DIALOGS (100 dialogs across 50 chapters, conversation bubbles)
   ═══════════════════════════════════════════════════════════ */

/* ─── List view ─── */
:where(#eps-topik-app) .eps-dl-list {
  display: flex;
  flex-direction: column;
  gap: var(--sp-7);
}
:where(#eps-topik-app) .eps-dl-chapter-section {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}
:where(#eps-topik-app) .eps-dl-chapter-header {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding-bottom: var(--sp-2);
  border-bottom: 2px solid var(--border);
}
:where(#eps-topik-app) .eps-dl-chapter-num {
  display: inline-block;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 11px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  background: var(--brand);
  color: #fff;
  letter-spacing: 0.06em;
}
:where(#eps-topik-app) .eps-dl-chapter-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 17px;
  color: var(--text);
  margin: 0;
  letter-spacing: -0.01em;
}

/* ─── Card grid (2 cards per chapter side by side) ─── */
:where(#eps-topik-app) .eps-dl-card-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--sp-3);
}
@media (max-width: 720px) {
  :where(#eps-topik-app) .eps-dl-card-grid { grid-template-columns: 1fr; }
}
:where(#eps-topik-app) .eps-dl-card {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  padding: var(--sp-4) var(--sp-5);
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all var(--t);
  text-align: left;
  font-family: var(--font);
  box-shadow: var(--shadow-xs);
}
:where(#eps-topik-app) .eps-dl-card:hover {
  transform: translateY(-2px);
  border-color: var(--brand);
  box-shadow: var(--shadow-md);
}
:where(#eps-topik-app) .eps-dl-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-2);
}
:where(#eps-topik-app) .eps-dl-card-num {
  font-family: var(--font-ko);
  font-weight: 700;
  font-size: 13px;
  color: var(--brand);
  letter-spacing: 0.02em;
}
:where(#eps-topik-app) .eps-dl-card-lines {
  font-family: var(--font);
  font-weight: 600;
  font-size: 11px;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  background: var(--brand-soft);
  color: var(--brand);
}
:where(#eps-topik-app) .eps-dl-card-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  color: var(--text);
  line-height: 1.4;
  letter-spacing: -0.01em;
}
:where(#eps-topik-app) .eps-dl-card-preview {
  font-family: var(--font-ko);
  font-size: 14px;
  color: var(--text-2);
  line-height: 1.5;
  padding: var(--sp-2) 0;
  border-top: 1px dashed var(--border);
  border-bottom: 1px dashed var(--border);
}
:where(#eps-topik-app) .eps-dl-card-speakers {
  font-family: var(--font);
  font-size: 12px;
  color: var(--text-3);
  font-weight: 500;
}

/* ─── Detail view header ─── */
:where(#eps-topik-app) .eps-dl-detail-header {
  padding: var(--sp-6) 0 var(--sp-5);
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--sp-6);
}
:where(#eps-topik-app) .eps-dl-chapter-badge {
  display: inline-block;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 11px;
  color: var(--brand);
  background: var(--brand-soft);
  padding: 4px 12px;
  border-radius: var(--radius-full);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: var(--sp-3);
}
:where(#eps-topik-app) .eps-dl-detail-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(22px, 3vw, 28px);
  color: var(--text);
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin: 0 0 var(--sp-4);
}
:where(#eps-topik-app) .eps-dl-meta {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  flex-wrap: wrap;
}
:where(#eps-topik-app) .eps-dl-meta-item {
  font-family: var(--font);
  font-size: 13px;
  color: var(--text-2);
  font-weight: 500;
}

/* ─── Conversation bubbles ─── */
:where(#eps-topik-app) .eps-dl-conversation {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
  margin-bottom: var(--sp-6);
}
:where(#eps-topik-app) .eps-dl-line {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-width: 85%;
}
:where(#eps-topik-app) .eps-dl-line.speaker-a {
  align-self: flex-start;
  align-items: flex-start;
}
:where(#eps-topik-app) .eps-dl-line.speaker-b {
  align-self: flex-end;
  align-items: flex-end;
}
:where(#eps-topik-app) .eps-dl-speaker {
  font-family: var(--font);
  font-size: 11px;
  font-weight: 700;
  color: var(--text-3);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0 var(--sp-3);
}
:where(#eps-topik-app) .eps-dl-bubble {
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--radius-lg);
  border: 1.5px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
  min-width: 220px;
}
:where(#eps-topik-app) .eps-dl-line.speaker-a .eps-dl-bubble {
  background: var(--brand-soft);
  border-color: rgba(232, 68, 58, 0.18);
  border-bottom-left-radius: 4px;
}
:where(#eps-topik-app) .eps-dl-line.speaker-b .eps-dl-bubble {
  background: var(--surface-alt, #fafafa);
  border-color: var(--border);
  border-bottom-right-radius: 4px;
}
:where(#eps-topik-app) .eps-dl-ko-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--sp-3);
  margin-bottom: 4px;
}
:where(#eps-topik-app) .eps-dl-ko {
  font-family: var(--font-ko);
  font-weight: 700;
  font-size: 17px;
  color: var(--text);
  line-height: 1.4;
  flex: 1;
  min-width: 0;
  word-break: keep-all;
}
:where(#eps-topik-app) .eps-dl-pr {
  font-family: var(--font);
  font-size: 12px;
  color: var(--text-3);
  font-style: italic;
  margin-bottom: 4px;
}
:where(#eps-topik-app) .eps-dl-en {
  font-family: var(--font);
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.5;
}
:where(#eps-topik-app) .eps-dl-ur {
  font-family: var(--font-ur, 'Noto Nastaliq Urdu', var(--font));
  font-size: 14px;
  color: var(--text-2);
  line-height: 1.9;
  margin-top: 4px;
}

/* Small "Play All" button variant */
:where(#eps-topik-app) .eps-btn.eps-btn-sm {
  padding: 6px 12px;
  font-size: 12px;
  border-radius: var(--radius);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

@media (max-width: 640px) {
  :where(#eps-topik-app) .eps-dl-line { max-width: 92%; }
  :where(#eps-topik-app) .eps-dl-bubble { min-width: 180px; }
  :where(#eps-topik-app) .eps-dl-ko { font-size: 15px; }
}

/* ═══════════════════════════════════════════════════════════
   EPS-TOPIK MOCK EXAM — sectioned format
   ═══════════════════════════════════════════════════════════ */

/* ─── Intro / rules ─── */
:where(#eps-topik-app) .eps-exam-rules {
  background: var(--brand-soft);
  border: 1px solid rgba(232, 68, 58, 0.18);
  border-radius: var(--radius-lg);
  padding: var(--sp-4) var(--sp-5);
  margin: var(--sp-5) 0;
  text-align: left;
}
:where(#eps-topik-app) .eps-exam-rules h3 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  color: var(--brand);
  margin: 0 0 var(--sp-3);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
:where(#eps-topik-app) .eps-exam-rules ul {
  margin: 0;
  padding-left: var(--sp-5);
  list-style: disc;
}
:where(#eps-topik-app) .eps-exam-rules li {
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.7;
  margin-bottom: 4px;
}

/* ─── Audio block (listening section) ─── */
:where(#eps-topik-app) .eps-exam-audio-block {
  background: linear-gradient(135deg, rgba(232, 68, 58, 0.05), rgba(212, 167, 69, 0.05));
  border: 1.5px dashed rgba(232, 68, 58, 0.25);
  border-radius: var(--radius-lg);
  padding: var(--sp-4) var(--sp-5);
  margin-bottom: var(--sp-5);
}
:where(#eps-topik-app) .eps-exam-audio-label {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 11px;
  color: var(--brand);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: var(--sp-3);
}
:where(#eps-topik-app) .eps-exam-audio-play {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  background: var(--brand);
  color: #fff;
  border: none;
  border-radius: var(--radius-full);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--t-fast);
  margin-bottom: var(--sp-3);
}
:where(#eps-topik-app) .eps-exam-audio-play:hover {
  background: var(--brand-dark, #c93e35);
  transform: translateY(-1px);
}
:where(#eps-topik-app) .eps-exam-audio-text {
  font-family: var(--font-ko);
  font-size: 16px;
  color: var(--text);
  line-height: 1.5;
  padding: var(--sp-3) var(--sp-4);
  background: rgba(255,255,255,0.6);
  border-radius: var(--radius);
  white-space: pre-line;
}

/* ─── Timer warning state ─── */
:where(#eps-topik-app) .eps-exam-timer.low {
  background: var(--brand);
  color: #fff;
  animation: eps-pulse 1.5s ease-in-out infinite;
}
@keyframes eps-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

/* ─── Section result cards ─── */
:where(#eps-topik-app) .eps-exam-section-results {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-3);
  margin: var(--sp-5) 0;
  width: 100%;
  max-width: 480px;
}
:where(#eps-topik-app) .eps-exam-section-result {
  padding: var(--sp-4) var(--sp-5);
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  text-align: center;
}
:where(#eps-topik-app) .eps-exam-section-result-label {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 12px;
  color: var(--text-3);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: var(--sp-2);
}
:where(#eps-topik-app) .eps-exam-section-result-score {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 32px;
  color: var(--text);
  letter-spacing: -0.02em;
  line-height: 1;
}
:where(#eps-topik-app) .eps-exam-section-result-meta {
  font-family: var(--font);
  font-size: 12px;
  color: var(--text-2);
  font-weight: 600;
  margin-top: var(--sp-2);
}

@media (max-width: 480px) {
  :where(#eps-topik-app) .eps-exam-section-results { grid-template-columns: 1fr; }
}

/* ─── Review screen ─── */
:where(#eps-topik-app) .eps-review-list {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
}
:where(#eps-topik-app) .eps-review-q {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--sp-4) var(--sp-5);
  border-left-width: 4px;
}
:where(#eps-topik-app) .eps-review-q.correct {
  border-left-color: #059669;
}
:where(#eps-topik-app) .eps-review-q.wrong {
  border-left-color: #dc2626;
}
:where(#eps-topik-app) .eps-review-q.skipped {
  border-left-color: #d97706;
}
:where(#eps-topik-app) .eps-review-q-header {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  margin-bottom: var(--sp-3);
  font-family: var(--font);
  font-size: 12px;
  font-weight: 600;
}
:where(#eps-topik-app) .eps-review-q-num {
  font-family: var(--font-display);
  font-weight: 800;
  color: var(--text-3);
}
:where(#eps-topik-app) .eps-review-q-status {
  margin-left: auto;
  font-weight: 700;
  font-size: 11px;
  padding: 3px 10px;
  border-radius: var(--radius-full);
}
:where(#eps-topik-app) .eps-review-q.correct .eps-review-q-status {
  background: rgba(5, 150, 105, 0.12);
  color: #059669;
}
:where(#eps-topik-app) .eps-review-q.wrong .eps-review-q-status {
  background: rgba(220, 38, 38, 0.12);
  color: #dc2626;
}
:where(#eps-topik-app) .eps-review-q.skipped .eps-review-q-status {
  background: rgba(217, 119, 6, 0.12);
  color: #d97706;
}
:where(#eps-topik-app) .eps-review-audio,
:where(#eps-topik-app) .eps-review-passage {
  background: var(--brand-soft);
  padding: var(--sp-3);
  border-radius: var(--radius);
  font-family: var(--font-ko);
  font-size: 14px;
  color: var(--text);
  margin-bottom: var(--sp-3);
  line-height: 1.5;
  white-space: pre-line;
}
:where(#eps-topik-app) .eps-review-question {
  font-family: var(--font);
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
  margin-bottom: var(--sp-3);
}
:where(#eps-topik-app) .eps-review-opts {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: var(--sp-3);
}
:where(#eps-topik-app) .eps-review-opt {
  font-family: var(--font);
  font-size: 13px;
  padding: 8px 12px;
  border-radius: var(--radius);
  background: rgba(0,0,0,0.03);
  color: var(--text-2);
}
:where(#eps-topik-app) .eps-review-opt.correct {
  background: rgba(5, 150, 105, 0.12);
  color: #059669;
  font-weight: 700;
  border: 1.5px solid #059669;
}
:where(#eps-topik-app) .eps-review-opt.wrong {
  background: rgba(220, 38, 38, 0.12);
  color: #dc2626;
  font-weight: 600;
  text-decoration: line-through;
}
:where(#eps-topik-app) .eps-review-explanation {
  font-family: var(--font);
  font-size: 12px;
  color: var(--text-2);
  background: rgba(212, 167, 69, 0.10);
  border: 1px solid rgba(212, 167, 69, 0.25);
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--radius);
  line-height: 1.6;
}

/* ═══════════════════════════════════════════════════════════
   SUBSCRIPTION · TRIAL BANNER · PAYWALL  (v2.12)
   ═══════════════════════════════════════════════════════════ */

/* ─── Trial / upgrade banner ─── */
.eps-trial-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  flex-wrap: wrap;
  margin: var(--sp-5) var(--sp-6) 0;
  padding: var(--sp-3) var(--sp-4);
  background: var(--brand-soft);
  border: 1px solid var(--brand-border);
  border-radius: var(--radius);
}
.eps-trial-banner.low {
  background: var(--warning-soft);
  border-color: rgba(217, 119, 6, 0.28);
}
.eps-trial-text {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
}
.eps-trial-text svg { color: var(--brand); flex-shrink: 0; }
.eps-trial-banner.low .eps-trial-text svg { color: var(--warning); }
.eps-trial-cta {
  flex-shrink: 0;
  padding: 7px 16px;
  background: var(--brand);
  color: #fff;
  border: 0;
  border-radius: var(--radius-full);
  font-family: var(--font);
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  transition: background var(--t-fast);
}
.eps-trial-cta:hover { background: var(--brand-hover); }

/* ─── Paywall page ─── */
.eps-pay-page {
  max-width: 640px;
  margin: 0 auto;
}

.eps-pay-hero {
  text-align: center;
  padding: var(--sp-6);
  background: linear-gradient(160deg, var(--brand) 0%, var(--brand-active) 100%);
  border-radius: var(--radius-lg);
  color: #fff;
  box-shadow: var(--shadow-brand);
}
.eps-pay-badge {
  display: inline-block;
  padding: 4px 12px;
  background: rgba(255, 255, 255, 0.18);
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
}
.eps-pay-title {
  margin: var(--sp-4) 0 var(--sp-2);
  font-family: var(--font-display, var(--font));
  font-size: 24px;
  font-weight: 800;
  color: #fff;
}
.eps-pay-sub {
  margin: 0 auto;
  max-width: 420px;
  font-size: 14px;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.88);
}
.eps-pay-price {
  margin: var(--sp-5) 0 var(--sp-4);
}
.eps-pay-price-num {
  font-size: 32px;
  font-weight: 800;
  color: #fff;
}
.eps-pay-price-per {
  font-size: 15px;
  color: rgba(255, 255, 255, 0.8);
}
.eps-pay-benefits {
  list-style: none;
  margin: 0;
  padding: var(--sp-4) 0 0;
  display: grid;
  gap: var(--sp-2);
  text-align: left;
  max-width: 340px;
  margin-inline: auto;
}
.eps-pay-benefits li {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  font-size: 13.5px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.95);
}
.eps-pay-benefits svg {
  flex-shrink: 0;
  color: #fff;
  background: rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-full);
  padding: 3px;
  width: 20px;
  height: 20px;
}

/* ─── How-to-pay block ─── */
.eps-pay-instructions {
  margin-top: var(--sp-5);
  padding: var(--sp-5);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}
.eps-pay-instructions h3 {
  margin: 0 0 var(--sp-2);
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}
.eps-pay-instructions p {
  margin: 0 0 var(--sp-3);
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--text-2);
}
.eps-pay-account {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  padding: var(--sp-4);
  background: var(--brand-soft);
  border: 1px dashed var(--brand-border);
  border-radius: var(--radius-sm);
}
.eps-pay-account-num {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: var(--text);
}
.eps-pay-account-name {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-2);
}
.eps-pay-copy {
  flex-shrink: 0;
  padding: 8px 16px;
  background: var(--brand);
  color: #fff;
  border: 0;
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  transition: background var(--t-fast);
}
.eps-pay-copy:hover { background: var(--brand-hover); }
.eps-pay-step2 {
  margin: var(--sp-3) 0 0 !important;
  font-size: 12.5px !important;
  color: var(--text-3) !important;
}

/* ─── Payment form card ─── */
.eps-pay-card {
  margin-top: var(--sp-4);
  padding: var(--sp-5);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}
.eps-pay-card-title {
  margin: 0 0 var(--sp-4);
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}
.eps-pay-form {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
}
.eps-pay-field {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}
.eps-pay-field label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
.eps-pay-field input[type="number"],
.eps-pay-field input[type="text"],
.eps-pay-field input[type="file"] {
  width: 100%;
  padding: var(--sp-3) var(--sp-4);
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 15px;
  color: var(--text);
  transition: all var(--t-fast);
}
.eps-pay-field input[type="file"] {
  padding: var(--sp-3);
  font-size: 13px;
}
.eps-pay-field input:focus {
  outline: none;
  border-color: var(--brand);
  background: var(--surface);
}
.eps-pay-hint {
  font-size: 11.5px;
  color: var(--text-3);
}
.eps-pay-methods {
  display: flex;
  gap: var(--sp-3);
}
.eps-pay-method {
  flex: 1;
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-4);
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  transition: all var(--t-fast);
}
.eps-pay-method:has(input:checked) {
  border-color: var(--brand);
  background: var(--brand-soft);
}
.eps-pay-method input { accent-color: var(--brand); }
.eps-pay-submit {
  margin-top: var(--sp-2);
  padding: var(--sp-4);
  background: var(--brand);
  color: #fff;
  border: 0;
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: background var(--t-fast);
}
.eps-pay-submit:hover { background: var(--brand-hover); }
.eps-pay-submit:disabled { opacity: 0.6; cursor: not-allowed; }

/* ─── Status cards (pending / rejected) ─── */
.eps-pay-status {
  margin-top: var(--sp-4);
  padding: var(--sp-5);
  border-radius: var(--radius-md);
  text-align: center;
}
.eps-pay-status h3 {
  margin: 0 0 var(--sp-2);
  font-size: 16px;
  font-weight: 700;
}
.eps-pay-status p {
  margin: 0 auto;
  max-width: 380px;
  font-size: 13.5px;
  line-height: 1.55;
}
.eps-pay-status.pending {
  background: var(--warning-soft);
  border: 1px solid rgba(217, 119, 6, 0.28);
}
.eps-pay-status.pending h3 { color: var(--warning); }
.eps-pay-status.pending p { color: var(--text-2); }
.eps-pay-status.rejected {
  background: var(--brand-soft);
  border: 1px solid var(--brand-border);
  text-align: left;
}
.eps-pay-status.rejected h3 { color: var(--brand); }
.eps-pay-status.rejected p { color: var(--text-2); margin: 0 0 var(--sp-2); }
.eps-pay-status-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  margin-bottom: var(--sp-3);
  background: rgba(217, 119, 6, 0.16);
  border-radius: var(--radius-full);
  color: var(--warning);
}
.eps-pay-status-icon svg { width: 24px; height: 24px; }

@media (max-width: 640px) {
  .eps-pay-account { flex-direction: column; align-items: stretch; text-align: center; }
  .eps-pay-copy { width: 100%; }
  .eps-pay-methods { flex-direction: column; }
  .eps-trial-banner { margin-inline: var(--sp-4); }
}

/* ─── Progress tab: exam date input + empty state (v2.12) ─── */
:where(#eps-topik-app) .eps-date-input {
  padding: var(--sp-2) var(--sp-3);
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 14px;
  color: var(--text);
  cursor: pointer;
}
:where(#eps-topik-app) .eps-date-input:focus {
  outline: none;
  border-color: var(--brand);
}
:where(#eps-topik-app) .eps-progress-empty {
  margin: 0 0 var(--sp-4);
  padding: var(--sp-4);
  background: var(--bg-muted);
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  color: var(--text-2);
  text-align: center;
}
:where(#eps-topik-app) .eps-stat-action {
  transition: border-color var(--t-fast);
}
:where(#eps-topik-app) .eps-stat-action:hover {
  border-color: var(--brand);
}

/* ─── Access check loading state (v2.12.3) ─── */
:where(#eps-topik-app) .eps-loading-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--sp-4);
  padding: var(--sp-10) var(--sp-5);
  min-height: 240px;
  color: var(--text-2);
  font-size: 14px;
}
:where(#eps-topik-app) .eps-loading-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: eps-spin 800ms linear infinite;
}
@keyframes eps-spin {
  to { transform: rotate(360deg); }
}
