/* ==========================================================================
   BLACKBOOK VOCABULARY MASTERY — WARM PAPER & MODERN RESPONSIVE STYLES
   ========================================================================== */

:root {
  --bg-paper: #FAF7F0;
  --bg-paper-dark: #F2ECE1;
  --surface-white: #FFFFFF;
  --surface-warm: #FDFBF7;
  --surface-card: #FFFFFF;
  
  --text-primary: #1E293B;
  --text-secondary: #64748B;
  --text-muted: #94A3B8;

  /* Forest / Emerald Green (Mastered & Active) */
  --green-primary: #15803D;
  --green-bright: #16A34A;
  --green-soft: #DCFCE7;
  --green-border: #BBF7D0;

  /* Warm Amber / Gold (Streak, Highlights, Warning) */
  --amber-primary: #D97706;
  --amber-bright: #F59E0B;
  --amber-soft: #FEF3C7;
  --amber-border: #FDE68A;

  /* Coral / Crimson (Needs Practice Counter) */
  --coral-text: #DC2626;
  --coral-soft: #FEE2E2;
  --coral-border: #FECACA;

  /* Sky Blue / Indigo (Tags & Accents) */
  --blue-primary: #0284C7;
  --blue-soft: #E0F2FE;
  --blue-border: #BAE6FD;

  /* Borders & Shadows */
  --border-subtle: #E7E0D2;
  --border-card: #EAE3D5;
  --shadow-sm: 0 2px 8px rgba(30, 41, 59, 0.04);
  --shadow-md: 0 8px 24px rgba(30, 41, 59, 0.07);
  --shadow-lg: 0 18px 40px rgba(30, 41, 59, 0.12);

  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --radius-pill: 9999px;
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out-quint: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --transition: all 0.22s var(--ease-out-quint);
}

[data-theme="dark"] {
  --bg-paper: #0B1120;
  --bg-paper-dark: #070B14;
  --surface-white: #131D31;
  --surface-warm: #18243C;
  --surface-card: #131D31;
  
  --text-primary: #F8FAFC;
  --text-secondary: #94A3B8;
  --text-muted: #64748B;

  --border-subtle: #1E293B;
  --border-card: #1E293B;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.25);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 18px 40px rgba(0, 0, 0, 0.55);

  --green-soft: rgba(22, 163, 74, 0.18);
  --green-border: rgba(22, 163, 74, 0.35);
  --amber-soft: rgba(245, 158, 11, 0.18);
  --amber-border: rgba(245, 158, 11, 0.35);
  --coral-soft: rgba(220, 38, 38, 0.18);
  --coral-border: rgba(220, 38, 38, 0.35);
  --blue-soft: rgba(2, 132, 199, 0.18);
  --blue-border: rgba(2, 132, 199, 0.35);
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg-paper);
  color: var(--text-primary);
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color 0.25s ease, color 0.25s ease;
  overflow-x: hidden;
}

::selection {
  background: rgba(21, 128, 61, 0.16);
  color: inherit;
}

[data-theme="dark"] ::selection {
  background: rgba(74, 222, 128, 0.24);
}

/* Subtle static paper texture unifying warm parchment & dark slate (MotionSites surface craft) */
.page-grain {
  position: fixed;
  inset: 0;
  z-index: 40;
  pointer-events: none;
  opacity: 0.32;
  background-size: 200px 200px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.88' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.06'/%3E%3C/svg%3E");
}

[data-theme="dark"] .page-grain {
  opacity: 0.22;
}

/* Tabular numerals across counters & live progress badges */
.nav-stat-pill,
.hero-progress-header,
.kpi-value,
.pill-count,
.study-words-badge,
.study-mastered-badge,
#fcCounterText,
#quizProgressNum,
#quizScoreBadge {
  font-variant-numeric: tabular-nums;
}

/* ==========================================================================
   VIEW ROUTING (DASHBOARD VIEW vs FULL-PAGE DAY VIEW)
   ========================================================================== */
.view-container {
  display: none;
  animation: viewFadeIn 0.25s ease;
}

.view-container.active {
  display: block;
}

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

/* ==========================================================================
   TOPBAR
   ========================================================================== */
.topbar {
  background: var(--bg-paper);
  background: color-mix(in srgb, var(--bg-paper) 92%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-subtle);
  position: sticky;
  top: 0;
  z-index: 50;
  height: 54px;
}

.topbar-inner {
  max-width: 1280px;
  height: 54px;
  margin: 0 auto;
  padding: 0 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: nowrap !important;
}

/* Responsive visibility utilities */
.mobile-only {
  display: none !important;
}

.desktop-only {
  display: inline-flex !important;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  flex-shrink: 0;
  min-width: 0;
}

.brand-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, #1E293B 0%, #334155 100%);
  color: #FAF7F0;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 8px rgba(30, 41, 59, 0.16);
  flex-shrink: 0;
}

[data-theme="dark"] .brand-icon {
  background: linear-gradient(135deg, #10B981 0%, #059669 100%);
  color: #FFFFFF;
}

.brand-text {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.brand-title {
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  white-space: nowrap;
}

.brand-subtitle {
  font-size: 0.78rem;
  color: var(--text-secondary);
  font-weight: 500;
  white-space: nowrap;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap !important;
  flex-shrink: 0;
  margin-left: auto;
}

.nav-stat-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  white-space: nowrap;
  flex-shrink: 0;
}

.nav-stat-pill.streak {
  background: var(--amber-soft);
  color: var(--amber-primary);
  border-color: var(--amber-border);
}

.nav-stat-pill.mastered {
  background: var(--green-soft);
  color: var(--green-primary);
  border-color: var(--green-border);
}

.btn-refresh-cache {
  background: var(--surface-white);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  padding: 6px 10px;
  cursor: pointer;
  font-size: 0.95rem;
  line-height: 1;
  transition: transform 0.25s ease, background 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.btn-refresh-cache:hover {
  transform: rotate(180deg);
  background: var(--surface-hover);
}
[data-theme="dark"] .btn-refresh-cache {
  background: var(--surface-card);
  border-color: var(--border-subtle);
}

/* Cloud Sync Trigger Pill */
.btn-sync-cloud {
  background: var(--surface-white);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  height: 36px;
  padding: 0 11px;
  border-radius: var(--radius-pill);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  cursor: pointer;
  position: relative;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
  flex-shrink: 0;
}

.btn-sync-cloud.is-compact {
  width: 34px;
  height: 34px;
  padding: 0;
}

.btn-sync-cloud:hover {
  background: var(--bg-paper-dark);
  border-color: var(--green-primary);
}

.sync-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #94a3b8;
  display: inline-block;
  flex-shrink: 0;
}

.btn-sync-cloud.is-compact .sync-dot {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 7px;
  height: 7px;
  border: 1.5px solid var(--surface-white);
}

.sync-dot.is-connected {
  background: #16a34a;
  box-shadow: 0 0 0 2px rgba(22, 163, 74, 0.2);
}

.sync-dot.is-syncing {
  background: #2563eb;
  animation: syncPulse 1s infinite ease-in-out;
}

@keyframes syncPulse {
  0%, 100% { transform: scale(0.85); opacity: 0.65; }
  50% { transform: scale(1.25); opacity: 1; }
}

.theme-toggle-btn {
  background: var(--surface-white);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  width: 36px;
  height: 36px;
  border-radius: var(--radius-pill);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1rem;
  transition: var(--transition);
}

.theme-toggle-btn:hover {
  background: var(--bg-paper-dark);
}

/* Back to Hub Nav Button */
.btn-back-hub {
  background: var(--surface-white);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 7px 14px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}

.btn-back-hub:hover {
  background: var(--bg-paper-dark);
  border-color: var(--green-primary);
  color: var(--green-primary);
}

/* PWA Install Button */
.btn-install-pwa {
  background: linear-gradient(135deg, var(--green-primary) 0%, #166534 100%);
  color: #FFFFFF;
  border: none;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: var(--transition);
  box-shadow: 0 2px 10px rgba(21, 128, 61, 0.3);
}

.btn-install-pwa:hover {
  background: #166534;
  transform: translateY(-1px);
}

/* ==========================================================================
   BUTTONS
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  padding: 10px 18px;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  white-space: nowrap;
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  position: relative;
  overflow: hidden;
  background: var(--green-primary);
  color: #FFFFFF;
  box-shadow: 0 1px 2px rgba(21, 128, 61, 0.2), 0 6px 16px rgba(21, 128, 61, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.24);
}

.btn-primary::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(110deg, transparent 25%, rgba(255, 255, 255, 0.22) 50%, transparent 75%);
  transform: translateX(-125%);
  transition: transform 0.6s var(--ease-out-expo);
}

.btn-primary:hover {
  background: #166534;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(21, 128, 61, 0.22), 0 10px 24px rgba(21, 128, 61, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.btn-primary:hover::after {
  transform: translateX(125%);
}

.btn-launch .launch-arrow {
  display: inline-block;
  transition: transform 0.25s var(--ease-out-expo);
}

.btn-launch:hover .launch-arrow {
  transform: translateX(3px);
}

.btn-outline {
  background: var(--surface-white);
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-sm);
}

.btn-outline:hover {
  background: var(--bg-paper-dark);
}

/* ==========================================================================
   DASHBOARD HERO & KPIS
   ========================================================================== */
.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 24px 20px 60px;
}

.hero-banner {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, var(--surface-white) 0%, var(--surface-warm) 100%);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 22px 26px;
  margin-bottom: 22px;
  box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255, 255, 255, 0.7);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

[data-theme="dark"] .hero-banner {
  box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

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

.hero-text h1 {
  font-size: clamp(1.22rem, 2.2vw, 1.5rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.2;
  color: var(--text-primary);
  margin-bottom: 6px;
  animation: heroBlurRise 0.65s var(--ease-out-expo) both;
}

.hero-text p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  max-width: 640px;
  animation: heroFadeRise 0.65s var(--ease-out-expo) 90ms both;
}

.hero-progress-box {
  position: relative;
  z-index: 1;
  min-width: 280px;
  flex: 1;
  max-width: 430px;
  background: var(--bg-paper);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55);
  animation: heroFadeRise 0.7s var(--ease-out-expo) 150ms both;
}

[data-theme="dark"] .hero-progress-box {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.hero-progress-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.78rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text-primary);
}

#heroRoadmapPct {
  color: var(--green-primary);
  white-space: nowrap;
}

[data-theme="dark"] #heroRoadmapPct {
  color: #4ade80;
}

.progress-track {
  height: 9px;
  background: var(--border-subtle);
  border-radius: var(--radius-pill);
  overflow: hidden;
  display: flex;
}

.progress-fill-green {
  position: relative;
  overflow: hidden;
  background: linear-gradient(90deg, var(--green-primary), var(--green-bright));
  height: 100%;
  transition: width 0.65s var(--ease-out-expo);
}

.progress-fill-green.has-progress {
  min-width: 6px;
}

.progress-fill-green.has-progress::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.32), transparent);
  transform: translateX(-100%);
  animation: progressGleam 2.8s var(--ease-out-expo) infinite;
}

.progress-fill-amber {
  background: var(--amber-bright);
  height: 100%;
  transition: width 0.4s ease;
}

/* KPI Grid */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 24px;
}

.kpi-card {
  position: relative;
  overflow: hidden;
  background: var(--surface-white);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: 14px;
  transition: var(--transition);
  animation: heroFadeRise 0.55s var(--ease-out-expo) calc(120ms + var(--stagger, 0) * 55ms) both;
}

.kpi-card > * {
  position: relative;
  z-index: 1;
}

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

.kpi-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}

.kpi-icon.green { background: var(--green-soft); color: var(--green-primary); }
.kpi-icon.amber { background: var(--amber-soft); color: var(--amber-primary); }
.kpi-icon.slate { background: var(--bg-paper-dark); color: var(--text-secondary); }
.kpi-icon.gold  { background: var(--amber-soft); color: var(--amber-primary); }

.kpi-label {
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.kpi-value {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin-top: 2px;
}

.kpi-sub {
  font-size: 0.74rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Controls Bar */
.controls-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 20px;
  background: var(--surface-white);
  padding: 12px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-card);
  box-shadow: var(--shadow-sm);
}

.filter-pills {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.pill-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.pill-btn:hover {
  background: var(--bg-paper);
  color: var(--text-primary);
}

.pill-btn.active {
  background: var(--green-primary);
  color: #FFFFFF;
  box-shadow: 0 2px 8px rgba(21, 128, 61, 0.22);
}

.pill-count {
  font-size: 0.7rem;
  padding: 1px 6px;
  border-radius: var(--radius-pill);
  background: rgba(0, 0, 0, 0.08);
}

.pill-btn.active .pill-count {
  background: rgba(255, 255, 255, 0.25);
  color: #FFFFFF;
}

.pill-btn.pill-reset {
  margin-left: auto;
  border-color: var(--coral-border);
  color: var(--coral-text);
  background: var(--coral-soft);
}

.pill-btn.pill-reset:hover {
  background: var(--coral-primary);
  color: #FFFFFF;
  border-color: var(--coral-primary);
}

.search-and-toggle {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  flex: 1;
  justify-content: flex-end;
}

.search-box {
  position: relative;
  min-width: 220px;
  max-width: 320px;
  width: 100%;
}

.search-box input {
  width: 100%;
  padding: 8px 14px 8px 36px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-subtle);
  background: var(--bg-paper);
  font-family: inherit;
  font-size: 0.84rem;
  color: var(--text-primary);
  outline: none;
  transition: var(--transition);
}

.search-box input:focus {
  background: var(--surface-white);
  border-color: var(--green-primary);
  box-shadow: 0 0 0 3px rgba(21, 128, 61, 0.12);
}

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

.toggle-locked {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  user-select: none;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  background: var(--bg-paper);
  border: 1px solid var(--border-subtle);
}

.toggle-locked input {
  accent-color: var(--green-primary);
  width: 14px;
  height: 14px;
  cursor: pointer;
}

/* Days Grid */
.days-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(295px, 1fr));
  gap: 18px;
}

.day-card {
  background: var(--surface-white);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
  animation: heroFadeRise 0.48s var(--ease-out-expo) calc(var(--card-idx, 0) * 35ms) both;
}

.day-card > * {
  position: relative;
  z-index: 1;
}

/* Interactive Spotlight Glow across Desktop Cards (React Bits SpotlightCard pattern) */
@media (hover: hover) and (pointer: fine) {
  .hero-banner::before,
  .kpi-card::before,
  .day-card:not(.is-locked)::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    z-index: 0;
    opacity: var(--spot-opacity, 0);
    background: radial-gradient(
      340px circle at var(--spot-x, 50%) var(--spot-y, 50%),
      rgba(21, 128, 61, 0.085),
      transparent 70%
    );
    transition: opacity 0.28s ease;
  }

  [data-theme="dark"] .hero-banner::before,
  [data-theme="dark"] .kpi-card::before,
  [data-theme="dark"] .day-card:not(.is-locked)::before {
    background: radial-gradient(
      340px circle at var(--spot-x, 50%) var(--spot-y, 50%),
      rgba(74, 222, 128, 0.11),
      transparent 70%
    );
  }
}

.day-card:hover:not(.is-locked) {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--green-border);
  cursor: pointer;
}

.day-card.is-today {
  border: 2px solid var(--green-primary);
  background: linear-gradient(180deg, var(--surface-white) 0%, var(--surface-warm) 100%);
  box-shadow: var(--shadow-sm), 0 0 0 3px rgba(21, 128, 61, 0.08);
}

.day-card.is-locked {
  background: var(--bg-paper-dark);
  border-style: dashed;
  opacity: 0.8;
}

.day-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.day-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.8rem;
  font-weight: 800;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  background: var(--green-primary);
  color: #FFFFFF;
  white-space: nowrap;
  flex-shrink: 0;
}

.day-card.is-locked .day-badge {
  background: #94A3B8;
  color: #FFFFFF;
}

.status-pill {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.status-mastered {
  background: var(--green-soft);
  color: var(--green-primary);
  border: 1px solid var(--green-border);
}

.status-progress {
  background: var(--amber-soft);
  color: var(--amber-primary);
  border: 1px solid var(--amber-border);
}

.status-ready {
  background: var(--blue-soft);
  color: var(--blue-primary);
  border: 1px solid var(--blue-border);
}

.status-locked {
  background: var(--bg-paper-dark);
  color: var(--text-muted);
  border: 1px solid var(--border-subtle);
}

.day-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.day-meta {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 500;
  margin-bottom: 12px;
}

.word-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}

.word-tag {
  font-size: 0.72rem;
  font-weight: 600;
  background: var(--bg-paper);
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
  padding: 2px 8px;
  border-radius: 6px;
}

.card-progress {
  margin-bottom: 14px;
}

.card-progress-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.74rem;
  font-weight: 600;
  margin-bottom: 5px;
}

.lbl-mastered { color: var(--green-primary); }
.lbl-practice { color: var(--coral-text); }

.mini-track {
  height: 6px;
  background: var(--border-subtle);
  border-radius: var(--radius-pill);
  overflow: hidden;
  display: flex;
}

.day-card-footer {
  padding-top: 12px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.file-pill {
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 0.72rem;
  color: var(--text-secondary);
  background: var(--bg-paper);
  padding: 3px 8px;
  border-radius: 6px;
  border: 1px solid var(--border-subtle);
}

.btn-launch {
  padding: 7px 14px;
  font-size: 0.8rem;
  border-radius: var(--radius-pill);
}

/* ==========================================================================
   FULL-PAGE DAY LEARNING SUITE (FOCUSED & DISTRACTION-FREE)
   ========================================================================== */
body.in-day-view .topbar {
  display: none !important;
}

/* Single Unified Study Topbar */
.study-topbar {
  background: var(--bg-paper);
  background: color-mix(in srgb, var(--bg-paper) 92%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-subtle);
  position: sticky;
  top: 0;
  z-index: 50;
}

.study-topbar-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 8px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 52px;
}

.study-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.btn-study-back {
  background: var(--surface-white);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 6px 12px 6px 8px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}

.btn-study-back:hover {
  background: var(--bg-paper-dark);
  border-color: var(--green-primary);
  color: var(--green-primary);
}

.study-badge-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-day-nav {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1px solid var(--border-subtle);
  background: var(--surface-white);
  color: var(--text-primary);
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  padding: 0;
  line-height: 1;
}

.btn-day-nav:hover {
  background: var(--green-soft);
  border-color: var(--green-border);
  color: var(--green-primary);
}

.study-words-badge {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-secondary);
  background: var(--bg-paper-dark);
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-subtle);
  white-space: nowrap;
  flex-shrink: 0;
}

.study-mastered-badge {
  font-size: 0.72rem;
  font-weight: 700;
  color: #15803d;
  background: #dcfce7;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  border: 1px solid #bbf7d0;
  white-space: nowrap;
  flex-shrink: 0;
}
[data-theme="dark"] .study-mastered-badge {
  color: #4ade80;
  background: rgba(34, 197, 94, 0.18);
  border-color: rgba(34, 197, 94, 0.35);
}

.study-center {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-align: center;
}

.study-lesson-title {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  margin: 0 auto;
}

.study-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.btn-skip-mastered {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 11px;
  height: 32px;
  border-radius: var(--radius-pill);
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  background: var(--surface-white);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  transition: all var(--transition-fast);
  white-space: nowrap;
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
}

.btn-skip-mastered:hover {
  background: var(--bg-paper-dark);
  color: var(--text-primary);
  border-color: var(--border-medium);
}

.btn-skip-mastered.active {
  background: var(--green-soft);
  color: var(--green-primary);
  border-color: var(--green-border);
  box-shadow: 0 0 0 1px var(--green-primary);
}

.btn-skip-mastered .skip-status-tag {
  font-size: 0.66rem;
  padding: 1px 5px;
  border-radius: 9999px;
  background: var(--bg-paper-dark);
  color: var(--text-muted);
  font-weight: 800;
  text-transform: uppercase;
}

.btn-skip-mastered.active .skip-status-tag {
  background: var(--green-primary);
  color: #FFFFFF;
}

/* Mode Switcher Tabs */
.day-suite-tabs {
  display: flex;
  justify-content: center;
  gap: 6px;
  background: var(--bg-paper);
  padding: 6px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-subtle);
  max-width: 680px;
  margin: 0 auto 16px;
}

.tab-label-mobile {
  display: none;
}

.tab-label-desktop {
  display: inline;
}

.tab-icon {
  font-size: 0.95rem;
  line-height: 1;
}

.suite-tab-btn {
  background: transparent;
  border: none;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-secondary);
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.suite-tab-btn:hover {
  color: var(--text-primary);
}

.suite-tab-btn.active {
  background: var(--surface-white);
  color: var(--green-primary);
  box-shadow: var(--shadow-sm);
}

[data-theme="dark"] .suite-tab-btn.active {
  background: var(--surface-warm);
}

.day-content-wrap {
  max-width: 900px;
  margin: 0 auto;
  padding: 24px 20px 80px;
}

.suite-section {
  display: none;
  animation: viewFadeIn 0.25s ease;
}

.suite-section.active {
  display: block;
}

/* --- FLASHCARD STAGE --- */
.flashcard-box-outer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}

.fc-meta-bar {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.84rem;
  color: var(--text-secondary);
}

.card-perspective-box {
  width: 100%;
  max-width: 620px;
  height: 380px;
  perspective: 1200px;
  cursor: pointer;
  user-select: none;
}

@media (max-height: 720px) {
  .card-perspective-box {
    height: 330px;
  }
}

.card-flip-flipper {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.45s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}

.card-flip-flipper.flipped {
  transform: rotateY(180deg);
}

.flipper-face {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: var(--radius-lg);
  background: var(--surface-white);
  border: 1px solid var(--border-card);
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow-y: auto;
}

.flipper-face.face-back {
  transform: rotateY(180deg);
  background: linear-gradient(145deg, var(--surface-white), var(--surface-warm));
  border-color: var(--green-border);
}

.fc-top-tags {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.fc-badge-ows {
  background: var(--green-soft);
  color: var(--green-primary);
  font-size: 0.74rem;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 8px;
  border: 1px solid var(--green-border);
}

.fc-badge-idiom {
  background: var(--amber-soft);
  color: var(--amber-primary);
  font-size: 0.74rem;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 8px;
  border: 1px solid var(--amber-border);
}

.fc-badge-syno {
  background: #ede9fe;
  color: #6d28d9;
  font-size: 0.74rem;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 8px;
  border: 1px solid #c4b5fd;
}

[data-theme="dark"] .fc-badge-syno {
  background: #2e1065;
  color: #c4b5fd;
  border-color: #5b21b6;
}

.fc-badge-anto {
  background: #fee2e2;
  color: #b91c1c;
  font-size: 0.74rem;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 8px;
  border: 1px solid #fecaca;
}

[data-theme="dark"] .fc-badge-anto {
  background: rgba(220, 38, 38, 0.2);
  color: #fca5a5;
  border-color: rgba(220, 38, 38, 0.45);
}

.fc-badge-homonym {
  background: #f5f3ff;
  color: #7c3aed;
  font-size: 0.74rem;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 8px;
  border: 1px solid #ddd6fe;
}

[data-theme="dark"] .fc-badge-homonym {
  background: rgba(124, 58, 237, 0.2);
  color: #c4b5fd;
  border-color: rgba(124, 58, 237, 0.4);
}

.fc-badge-proverb {
  background: #fef3c7;
  color: #b45309;
  font-size: 0.74rem;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 8px;
  border: 1px solid #fde68a;
}

[data-theme="dark"] .fc-badge-proverb {
  background: rgba(245, 158, 11, 0.2);
  color: #fcd34d;
  border-color: rgba(245, 158, 11, 0.4);
}

.fc-badge-phrasal {
  background: #ccfbf1;
  color: #0f766e;
  font-size: 0.74rem;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 8px;
  border: 1px solid #99f6e4;
}

[data-theme="dark"] .fc-badge-phrasal {
  background: rgba(20, 184, 166, 0.2);
  color: #5eead4;
  border-color: rgba(20, 184, 166, 0.4);
}

.fc-badge-spelling {
  background: #e0f2fe;
  color: #0369a1;
  font-size: 0.74rem;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 8px;
  border: 1px solid #bae6fd;
}

[data-theme="dark"] .fc-badge-spelling {
  background: rgba(14, 165, 233, 0.2);
  color: #7dd3fc;
  border-color: rgba(14, 165, 233, 0.4);
}

.fc-badge-preposition {
  background: #cffafe;
  color: #0e7490;
  font-size: 0.74rem;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 8px;
  border: 1px solid #a5f3fc;
}

[data-theme="dark"] .fc-badge-preposition {
  background: rgba(6, 182, 212, 0.2);
  color: #67e8f9;
  border-color: rgba(6, 182, 212, 0.4);
}

.fc-badge-editorial {
  background: #e0e7ff;
  color: #3730a3;
  font-size: 0.74rem;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 8px;
  border: 1px solid #c7d2fe;
}

[data-theme="dark"] .fc-badge-editorial {
  background: rgba(99, 102, 241, 0.2);
  color: #a5b4fc;
  border-color: rgba(99, 102, 241, 0.4);
}

.fc-badge-foreign {
  background: #fce7f3;
  color: #be185d;
  font-size: 0.74rem;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 8px;
  border: 1px solid #fbcfe8;
}

[data-theme="dark"] .fc-badge-foreign {
  background: rgba(236, 72, 153, 0.2);
  color: #f9a8d4;
  border-color: rgba(236, 72, 153, 0.4);
}

.fc-badge-root {
  background: #ecfccb;
  color: #3f6212;
  font-size: 0.74rem;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 8px;
  border: 1px solid #d9f99d;
}

[data-theme="dark"] .fc-badge-root {
  background: rgba(132, 204, 22, 0.2);
  color: #bef264;
  border-color: rgba(132, 204, 22, 0.4);
}

/* --- DEDICATED HOMONYMS (CONFUSING WORDS) SECTION --- */
.fc-homonym-section {
  margin: 10px 0 12px 0;
  text-align: left;
}

.fc-homonym-header {
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
  color: #7c3aed;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

[data-theme="dark"] .fc-homonym-header {
  color: #a78bfa;
}

.fc-homonym-cards-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.homonym-pair-card {
  background: #faf5ff;
  border: 1px solid #e9d5ff;
  border-radius: 10px;
  padding: 10px 14px;
  transition: all 0.15s ease;
}

[data-theme="dark"] .homonym-pair-card {
  background: rgba(147, 51, 234, 0.1);
  border-color: rgba(147, 51, 234, 0.28);
}

.homonym-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.homonym-word-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-primary);
}

.homonym-pos-badge {
  font-size: 0.72rem;
  font-weight: 700;
  background: #ede9fe;
  color: #6d28d9;
  padding: 2px 8px;
  border-radius: 6px;
}

[data-theme="dark"] .homonym-pos-badge {
  background: rgba(124, 58, 237, 0.25);
  color: #c4b5fd;
}

.homo-explanation-box {
  margin-top: 8px;
  padding: 8px 12px;
  background: #faf5ff;
  border: 1px solid #e9d5ff;
  border-radius: 8px;
  text-align: left;
}
[data-theme="dark"] .homo-explanation-box {
  background: rgba(147, 51, 234, 0.12);
  border-color: rgba(147, 51, 234, 0.3);
}
.homo-explanation-term {
  color: #6d28d9;
  font-weight: 800;
}
[data-theme="dark"] .homo-explanation-term {
  color: #c4b5fd;
}

.homonym-en-def {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.35;
  margin-bottom: 3px;
}

.homonym-hi-meaning {
  font-size: 0.84rem;
  font-weight: 500;
  color: #7c3aed;
  line-height: 1.3;
}

[data-theme="dark"] .homonym-hi-meaning {
  color: #c4b5fd;
}

.homonym-vs-divider {
  text-align: center;
  font-size: 0.72rem;
  font-weight: 800;
  color: #9333ea;
  text-transform: uppercase;
  margin: -3px 0;
  opacity: 0.85;
}

/* --- DEDICATED SYNONYMS & ANTONYMS SECTION --- */
.fc-syno-section {
  margin: 10px 0 12px 0;
}

.fc-syno-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

@media (max-width: 600px) {
  .fc-syno-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }
}

.fc-syn-col, .fc-ant-col {
  padding: 10px 12px;
  border-radius: 12px;
  text-align: left;
}

.fc-syn-col {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
}

[data-theme="dark"] .fc-syn-col {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.32);
}

.fc-ant-col {
  background: #fff1f2;
  border: 1px solid #fecdd3;
}

[data-theme="dark"] .fc-ant-col {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.32);
}

.fc-chip-header {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.fc-syn-head {
  color: #15803d;
}

[data-theme="dark"] .fc-syn-head {
  color: #4ade80;
}

.fc-ant-head {
  color: #b91c1c;
}

[data-theme="dark"] .fc-ant-head {
  color: #f87171;
}

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

.chip-tag {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.35;
  user-select: all;
  transition: transform 0.12s ease;
}

.chip-tag:active {
  transform: scale(0.96);
}

.chip-syn {
  background: #dcfce7;
  color: #166534;
  border: 1px solid #86efac;
}

[data-theme="dark"] .chip-syn {
  background: rgba(34, 197, 94, 0.22);
  color: #86efac;
  border-color: rgba(34, 197, 94, 0.45);
}

.chip-ant {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fca5a5;
}

[data-theme="dark"] .chip-ant {
  background: rgba(239, 68, 68, 0.22);
  color: #fca5a5;
  border-color: rgba(239, 68, 68, 0.45);
}

/* Front Face Syn/Ant Preview Tag */
.fc-front-syno-preview {
  margin: 4px 0 10px 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 999px;
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}

[data-theme="dark"] .fc-front-syno-preview {
  background: rgba(16, 185, 129, 0.15);
  color: #6ee7b7;
  border-color: rgba(16, 185, 129, 0.3);
}

/* Universal Category Focus Bar (Flashcards, Spell, Match) */
.cat-focus-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.cat-focus-pill {
  background: var(--bg-paper);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  padding: 5px 11px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.cat-focus-pill:hover {
  background: var(--surface-warm);
  color: var(--text-primary);
}

.cat-focus-pill.active {
  background: var(--green-primary);
  color: #ffffff;
  border-color: var(--green-primary);
  box-shadow: 0 2px 6px rgba(21, 128, 61, 0.22);
}

/* Quiz Practice Focus Selector */
.quiz-mode-selector {
  display: flex;
  gap: 6px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.quiz-mode-pill {
  background: var(--bg-paper);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.quiz-mode-pill:hover {
  background: var(--surface-warm);
  color: var(--text-primary);
}

.quiz-mode-pill.active {
  background: var(--green-primary);
  color: #ffffff;
  border-color: var(--green-primary);
  box-shadow: 0 2px 8px rgba(21, 128, 61, 0.25);
}

.quiz-method-bar {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--bg-paper);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.quiz-method-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.quiz-method-title {
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--text-primary);
}

.quiz-method-desc {
  font-size: 0.74rem;
  color: var(--text-secondary);
}

.quiz-submode-selector {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}

.quiz-sub-pill {
  background: var(--surface-white);
  border: 1px solid var(--border-card);
  color: var(--text-secondary);
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.quiz-sub-pill:hover {
  border-color: var(--green-primary);
  color: var(--text-primary);
}

.quiz-sub-pill.active {
  background: var(--green-soft);
  color: var(--green-primary);
  border-color: var(--green-primary);
}

.quiz-pair-context-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 700;
  color: #6d28d9;
  background: #f3e8ff;
  border: 1px solid #d8b4fe;
  padding: 4px 10px;
  border-radius: 8px;
  margin-bottom: 8px;
}

[data-theme="dark"] .quiz-pair-context-pill {
  color: #d8b4fe;
  background: rgba(124, 58, 237, 0.22);
  border-color: rgba(167, 139, 250, 0.4);
}

.quiz-cloze-blank {
  display: inline-block;
  min-width: 90px;
  padding: 0 8px;
  margin: 0 3px;
  border-bottom: 2.5px dashed var(--green-primary);
  color: var(--green-primary);
  background: var(--green-soft);
  border-radius: 4px;
  font-weight: 800;
  text-align: center;
}

.badge-synonym-text {
  color: #15803d;
  font-weight: 800;
  background: #dcfce7;
  padding: 1px 8px;
  border-radius: 4px;
}

[data-theme="dark"] .badge-synonym-text {
  color: #4ade80;
  background: rgba(34, 197, 94, 0.22);
}

.badge-antonym-text {
  color: #b91c1c;
  font-weight: 800;
  background: #fee2e2;
  padding: 1px 8px;
  border-radius: 4px;
}

[data-theme="dark"] .badge-antonym-text {
  color: #f87171;
  background: rgba(239, 68, 68, 0.22);
}

.quiz-target-term {
  font-size: 1.32rem;
  color: var(--text-primary);
  font-weight: 800;
  display: inline-block;
  margin-top: 4px;
}

.quiz-target-hindi {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-secondary);
}

/* Word List Syn/Ant Rows */
.word-list-syn-row, .word-list-ant-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 4px;
  font-size: 0.82rem;
}

.syn-badge-label {
  font-weight: 700;
  color: #15803d;
  font-size: 0.76rem;
  min-width: 60px;
}

.ant-badge-label {
  font-weight: 700;
  color: #b91c1c;
  font-size: 0.76rem;
  min-width: 60px;
}

.fc-badge-pyq {
  background: var(--amber-soft);
  color: #B45309;
  font-size: 0.74rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 8px;
  border: 1px solid var(--amber-border);
}

.fc-center {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  padding: 10px 0;
}

.fc-word-title {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 8px;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.fc-pos-pill {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--green-primary);
  background: var(--green-soft);
  padding: 3px 12px;
  border-radius: var(--radius-pill);
  margin-bottom: 14px;
}

.fc-speak-btn {
  background: var(--bg-paper);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  font-size: 0.84rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: var(--transition);
}

.fc-speak-btn:hover {
  border-color: var(--green-primary);
  color: var(--green-primary);
}

.fc-back-section {
  text-align: left;
  margin-bottom: 11px;
}

.fc-back-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  font-weight: 800;
  color: var(--green-primary);
  letter-spacing: 0.06em;
  margin-bottom: 3px;
}

.fc-english-label {
  color: var(--green-primary);
}

.fc-english-text {
  font-size: 1.32rem;
  font-weight: 750;
  color: var(--text-primary);
  line-height: 1.34;
  letter-spacing: -0.01em;
}

.fc-hindi-label {
  color: var(--text-secondary);
  font-size: 0.70rem;
}

.fc-hindi-text {
  font-size: 0.96rem;
  font-weight: 500;
  color: var(--text-secondary);
  line-height: 1.4;
}

.fc-example-box {
  background: var(--bg-paper);
  border-left: 3px solid var(--amber-primary);
  padding: 10px 14px;
  border-radius: 0 10px 10px 0;
  font-size: 0.88rem;
  color: var(--text-secondary);
  font-style: italic;
}

.fc-action-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  width: 100%;
  max-width: 620px;
}

.btn-practice-lg {
  background: var(--coral-soft);
  color: var(--coral-text);
  border: 1px solid var(--coral-border);
  padding: 14px 18px;
  border-radius: var(--radius-pill);
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.btn-practice-lg:hover {
  background: #FECACA;
  transform: translateY(-1px);
}

.btn-master-lg {
  background: var(--green-primary);
  color: #FFFFFF;
  border: none;
  padding: 14px 18px;
  border-radius: var(--radius-pill);
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(21, 128, 61, 0.25);
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.btn-master-lg:hover {
  background: #166534;
  transform: translateY(-1px);
}

.fc-nav-controls {
  display: flex;
  justify-content: space-between;
  width: 100%;
  max-width: 620px;
  gap: 10px;
}

/* --- QUIZ STAGE --- */
.quiz-container {
  background: var(--surface-white);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  box-shadow: var(--shadow-sm);
  max-width: 640px;
  margin: 0 auto;
}

.quiz-top-bar {
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 14px;
}

.quiz-progress-track-wrap {
  width: 100%;
}

.quiz-progress-labels {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--text-primary);
}

.quiz-prompt-wrap {
  margin-bottom: 16px;
}

.quiz-type-tag {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: var(--green-primary);
  background: var(--green-soft);
  border: 1px solid var(--green-border);
  padding: 3px 9px;
  border-radius: 6px;
  margin-bottom: 6px;
}

.quiz-question-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.35;
}

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

.quiz-opt-btn {
  background: var(--surface-white);
  border: 1.5px solid var(--border-card);
  padding: 12px 16px;
  border-radius: var(--radius-md);
  text-align: left;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  box-shadow: var(--shadow-sm);
  touch-action: manipulation;
}

.quiz-opt-btn:hover:not(:disabled) {
  border-color: var(--green-primary);
  background: var(--green-soft);
  transform: translateY(-1px);
}

.quiz-opt-btn:active:not(:disabled) {
  transform: scale(0.98);
}

.opt-letter {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--bg-paper);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.82rem;
  color: var(--text-secondary);
  flex-shrink: 0;
  transition: var(--transition);
}

.opt-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}

.opt-hindi {
  display: none !important;
}

.opt-english {
  font-size: 0.96rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.4;
}

.opt-term {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-primary);
}

.quiz-opt-btn.correct {
  background: var(--green-soft) !important;
  border-color: var(--green-primary) !important;
  animation: quizCorrectPop 0.34s var(--ease-spring) both;
}

.quiz-opt-btn.correct .opt-letter {
  background: var(--green-primary);
  color: #FFFFFF;
  border-color: var(--green-primary);
}

.quiz-opt-btn.correct .opt-english,
.quiz-opt-btn.correct .opt-term {
  color: var(--green-primary) !important;
}

.quiz-opt-btn.incorrect {
  background: var(--coral-soft) !important;
  border-color: var(--coral-text) !important;
  animation: quizWrongShake 0.32s ease both;
}

.quiz-opt-btn.incorrect .opt-letter {
  background: var(--coral-text);
  color: #FFFFFF;
  border-color: var(--coral-text);
}

.quiz-opt-btn.incorrect .opt-english,
.quiz-opt-btn.incorrect .opt-term {
  color: var(--coral-text) !important;
}

.pill-master-all {
  background: var(--green-soft) !important;
  color: var(--green-primary) !important;
  border-color: var(--green-border) !important;
  font-weight: 700 !important;
}

.pill-master-all:hover {
  background: var(--green-primary) !important;
  color: #FFFFFF !important;
}

.btn-quiz-continue {
  width: 100%;
  min-height: 50px;
  font-size: 0.96rem;
  font-weight: 700;
  border-radius: var(--radius-md);
  margin-top: 14px;
  box-shadow: 0 4px 14px rgba(21, 128, 61, 0.28);
}

.quiz-feedback {
  display: none;
  background: var(--bg-paper);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  margin-bottom: 16px;
  border-left: 4px solid var(--green-primary);
}

.quiz-feedback.show {
  display: block;
}

/* --- SPELL / TYPE STAGE --- */
.type-card-wrap {
  background: var(--surface-white);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 24px;
  max-width: 640px;
  margin: 0 auto;
  box-shadow: var(--shadow-md);
}

.blanks-box {
  font-family: monospace;
  font-size: 1.6rem;
  letter-spacing: 5px;
  color: var(--amber-primary);
  margin: 16px 0;
  text-align: center;
  padding: 14px;
  background: var(--bg-paper);
  border-radius: var(--radius-sm);
  border: 1px dashed var(--border-subtle);
}

.spell-input {
  width: 100%;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: var(--bg-paper);
  font-size: 1.1rem;
  font-family: inherit;
  color: var(--text-primary);
  outline: none;
}

.spell-input:focus {
  border-color: var(--green-primary);
  box-shadow: 0 0 0 3px rgba(21, 128, 61, 0.12);
}

/* --- SPEED MATCH STAGE --- */
.match-grid-box {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  max-width: 680px;
  margin: 0 auto;
}

.match-tile-btn {
  background: var(--surface-white);
  border: 2px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 16px 14px;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  text-align: center;
  min-height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  user-select: none;
}

.match-tile-btn:hover {
  border-color: var(--green-primary);
  background: var(--green-soft);
}

.match-tile-btn.selected {
  border-color: var(--amber-primary);
  background: var(--amber-soft);
  box-shadow: 0 0 12px rgba(217, 119, 6, 0.25);
}

.match-tile-btn.matched {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

/* --- MASTER WORD LIST --- */
.word-row-item {
  background: var(--surface-white);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 10px;
  transition: var(--transition);
}

@media (min-width: 640px) {
  .word-row-item {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

.word-row-item:hover {
  box-shadow: var(--shadow-sm);
  border-color: var(--green-border);
}

/* ==========================================================================
   ADAPTIVE LEARNING ENGINE UI (HUD, STAGE PILL, 5s BLITZ, TYPING & BADGES)
   ========================================================================== */
.quiz-adaptive-hud {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  background: var(--bg-paper);
  border: 1px solid var(--border-subtle);
}

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

.adaptive-chip {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-subtle);
  background: var(--surface-white);
  color: var(--text-secondary);
}

.adaptive-chip.chip-weak {
  color: var(--coral-text);
  background: var(--coral-soft);
  border-color: var(--coral-border);
}

.adaptive-chip.chip-due {
  color: var(--amber-primary);
  background: var(--amber-soft);
  border-color: var(--amber-border);
}

.adaptive-chip.chip-learning {
  color: var(--blue-primary);
  background: var(--blue-soft);
  border-color: var(--blue-border);
}

.adaptive-chip.chip-mastered {
  color: var(--green-primary);
  background: var(--green-soft);
  border-color: var(--green-border);
}

.quiz-tag-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.quiz-tag-row .quiz-type-tag {
  margin-bottom: 0;
}

.quiz-stage-pill {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  background: var(--blue-soft);
  color: var(--blue-primary);
  border: 1px solid var(--blue-border);
}

.quiz-sentence-box {
  display: block;
  margin-top: 10px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--bg-paper);
  border: 1px solid var(--border-subtle);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.5;
  color: var(--text-primary);
}

.quiz-highlight-term {
  background: var(--amber-soft);
  color: var(--amber-primary);
  padding: 1px 6px;
  border-radius: 5px;
  font-weight: 800;
}

.quiz-trap-word {
  display: inline-block;
  margin-top: 8px;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  background: var(--coral-soft);
  border: 1px dashed var(--coral-border);
  color: var(--coral-text);
  font-family: monospace;
  font-size: 1.25rem;
  font-weight: 800;
}

.quiz-timer-wrap {
  margin-bottom: 14px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--bg-paper);
  border: 1px solid var(--amber-border);
}

.quiz-timer-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  font-weight: 800;
  margin-bottom: 6px;
  color: var(--amber-primary);
}

.quiz-timer-track {
  width: 100%;
  height: 7px;
  border-radius: var(--radius-pill);
  background: var(--border-subtle);
  overflow: hidden;
}

.quiz-timer-fill {
  height: 100%;
  background: var(--green-bright);
  transition: width 0.09s linear, background-color 0.2s ease;
}

.quiz-timer-fill.warning {
  background: var(--amber-bright);
}

.quiz-timer-fill.urgent {
  background: var(--coral-text);
}

.quiz-typing-panel {
  margin-top: 12px;
  margin-bottom: 14px;
}

.quiz-dictation-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 10px;
}

.quiz-audio-fallback {
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.look-cover-word-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  background: var(--amber-soft);
  border: 1px solid var(--amber-border);
  margin-bottom: 10px;
}

.look-cover-word {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--text-primary);
}

.quiz-confusion-callout {
  margin-top: 8px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: var(--amber-soft);
  border: 1px solid var(--amber-border);
  color: var(--text-primary);
  font-size: 0.82rem;
  font-weight: 600;
}

/* Extended Adaptive Status Pills */
.status-learning {
  color: var(--blue-primary);
  background: var(--blue-soft);
  border: 1px solid var(--blue-border);
}

.status-weak {
  color: var(--coral-text);
  background: var(--coral-soft);
  border: 1px solid var(--coral-border);
}

.status-familiar {
  color: #6d28d9;
  background: #ede9fe;
  border: 1px solid #ddd6fe;
}

[data-theme="dark"] .status-familiar {
  color: #c4b5fd;
  background: rgba(139, 92, 246, 0.18);
  border-color: rgba(139, 92, 246, 0.35);
}

.status-due {
  color: var(--amber-primary);
  background: var(--amber-soft);
  border: 1px solid var(--amber-border);
}

@media (max-width: 768px) {
  .quiz-adaptive-hud {
    padding: 6px 8px;
  }

  .adaptive-chip {
    font-size: 0.66rem;
    padding: 2px 6px;
  }

  .quiz-sentence-box {
    font-size: 0.92rem;
    padding: 8px 10px;
  }
}

/* Toast Notification */
.toast-notice {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #FFFFFF;
  padding: 12px 20px;
  border-radius: var(--radius-pill);
  font-size: 0.86rem;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  z-index: 1100;
  transform: translateY(100px);
  opacity: 0;
  transition: transform 0.36s var(--ease-out-expo), opacity 0.25s ease;
  pointer-events: none;
}

.toast-notice.show {
  transform: translateY(0);
  opacity: 1;
}

@media (max-width: 768px) {
  body.in-day-view .toast-notice {
    bottom: calc(74px + env(safe-area-inset-bottom, 0px));
  }

  .toast-notice {
    left: 50%;
    right: auto;
    transform: translate(-50%, 100px);
    max-width: calc(100vw - 32px);
    text-align: center;
  }

  .toast-notice.show {
    transform: translate(-50%, 0);
  }
}

/* ==========================================================================
   MOTIONSITES & REACT-BITS INSPIRED MOTION CHOREOGRAPHY
   ========================================================================== */
@keyframes heroBlurRise {
  from {
    opacity: 0;
    transform: translateY(14px);
    filter: blur(6px);
  }
  to {
    opacity: 1;
    transform: none;
    filter: blur(0);
  }
}

@keyframes heroFadeRise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes progressGleam {
  0% { transform: translateX(-120%); }
  45%, 100% { transform: translateX(220%); }
}

@keyframes quizCorrectPop {
  0% { transform: scale(0.98); }
  55% { transform: scale(1.018); }
  100% { transform: none; }
}

@keyframes quizWrongShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  65% { transform: translateX(4px); }
}

@media (prefers-reduced-motion: reduce) {
  .hero-text h1,
  .hero-text p,
  .hero-progress-box,
  .kpi-card,
  .day-card,
  .quiz-opt-btn.correct,
  .quiz-opt-btn.incorrect,
  .progress-fill-green.has-progress::after {
    animation: none !important;
  }
  .btn-primary::after,
  .progress-fill-green,
  .btn-launch .launch-arrow {
    transition: none !important;
  }
}

/* ==========================================================================
   MOBILE-FIRST RESPONSIVE ENGINE (TOUCH-FIRST & NATIVE-APP OPTIMIZED)
   ========================================================================== */

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

/* ==========================================================================
   CROSS-DEVICE CLOUD SYNC & QR MODAL
   ========================================================================== */
.sync-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1200;
  background: rgba(15, 23, 42, 0.56);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

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

.sync-modal {
  background: var(--surface-white);
  border: 1px solid var(--border-subtle);
  border-radius: 22px;
  box-shadow: 0 24px 64px rgba(15, 23, 42, 0.25);
  width: 100%;
  max-width: 540px;
  max-height: 88vh;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.sync-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.sync-modal-title-wrap {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.sync-modal-header h2 {
  font-size: 1.08rem;
  font-weight: 800;
  color: var(--text-primary);
  margin: 0;
}

.sync-status-pill {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  background: var(--bg-paper-dark);
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
}

.sync-status-pill.is-connected {
  background: var(--green-soft);
  color: var(--green-primary);
  border-color: var(--green-border);
}

.sync-status-pill.is-syncing {
  background: #dbeafe;
  color: #1d4ed8;
  border-color: #93c5fd;
}

[data-theme="dark"] .sync-status-pill.is-syncing {
  background: rgba(37, 99, 235, 0.22);
  color: #93c5fd;
  border-color: rgba(147, 197, 253, 0.35);
}

.sync-close-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--border-subtle);
  background: var(--bg-paper-dark);
  color: var(--text-primary);
  cursor: pointer;
  font-size: 0.95rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sync-incoming-banner {
  background: var(--green-soft);
  border: 1.5px solid var(--green-border);
  border-radius: 14px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sync-incoming-text {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--green-primary);
  line-height: 1.4;
}

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

.sync-card {
  background: var(--bg-paper);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

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

.sync-card-head h3 {
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--text-primary);
  margin: 0;
}

.sync-help-link {
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--green-primary);
  text-decoration: none;
}

.sync-help-link:hover {
  text-decoration: underline;
}

.sync-card-sub {
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.42;
  margin: 0;
}

.sync-form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.sync-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sync-field span {
  font-size: 0.73rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.sync-field input,
.sync-import-box textarea {
  width: 100%;
  background: var(--surface-white);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  border-radius: 10px;
  padding: 9px 11px;
  font-family: inherit;
  font-size: 0.83rem;
  transition: border-color 0.15s ease;
}

.sync-field input:focus,
.sync-import-box textarea:focus {
  outline: none;
  border-color: var(--green-primary);
}

.sync-checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
}

.sync-btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.sync-btn-row .btn,
.sync-file-btn {
  font-size: 0.78rem;
  padding: 7px 12px;
  min-height: 36px;
}

.sync-danger-btn {
  color: var(--coral-text);
  border-color: var(--coral-border);
}

.sync-meta-line {
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.sync-qr-panel {
  background: var(--bg-paper);
  border: 1.5px solid var(--green-border);
  border-radius: 16px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
}

.sync-qr-header {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.86rem;
  color: var(--text-primary);
}

.sync-mini-btn {
  padding: 4px 10px !important;
  min-height: 28px !important;
  font-size: 0.73rem !important;
}

.sync-qr-box {
  background: #ffffff;
  padding: 10px;
  border-radius: 14px;
  border: 1px solid #e2e8f0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  max-width: 100%;
}

.sync-qr-box svg {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  image-rendering: pixelated;
}

.sync-qr-sub {
  font-size: 0.75rem;
  color: var(--text-secondary);
  line-height: 1.4;
  margin: 0;
}

.sync-lock-screen {
  background: var(--bg-paper);
  border: 1.5px solid var(--amber-border);
  border-radius: 18px;
  padding: 24px 18px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.sync-lock-icon {
  font-size: 2.2rem;
  line-height: 1;
}

.sync-lock-screen h3 {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-primary);
  margin: 0;
}

.sync-lock-desc {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.45;
  max-width: 400px;
  margin: 0;
}

.sync-lock-form {
  display: flex;
  width: 100%;
  max-width: 320px;
  gap: 8px;
  margin-top: 4px;
}

.sync-lock-form input {
  flex: 1 1 auto;
  background: var(--surface-white);
  border: 1.5px solid var(--border-subtle);
  border-radius: 10px;
  padding: 9px 12px;
  font-size: 0.9rem;
  color: var(--text-primary);
  text-align: center;
  letter-spacing: 2px;
}

.sync-lock-form input:focus {
  outline: none;
  border-color: var(--green-primary);
}

.sync-main-content {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

@media (max-width: 768px) {
  .mobile-only {
    display: inline-block !important;
  }

  .desktop-only {
    display: none !important;
  }

  /* --- TOPBAR NATIVE APP BAR (MOBILE FIRST) --- */
  .topbar {
    height: 50px;
    min-height: 50px;
    border-bottom: 1px solid var(--border-subtle);
  }

  .topbar-inner {
    height: 50px;
    padding: 0 12px;
    gap: 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: nowrap !important;
  }

  .brand {
    gap: 8px;
    align-items: center;
    flex-shrink: 0;
    min-width: 0;
  }

  .brand-icon {
    width: 32px;
    height: 32px;
    min-width: 32px;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(30, 41, 59, 0.12);
  }

  .brand-text {
    display: flex;
    align-items: center;
    min-width: 0;
  }

  .brand-title {
    font-size: 0.95rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--text-primary);
    white-space: nowrap;
  }

  .topbar-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: nowrap !important;
    margin-left: auto;
    flex-shrink: 0;
  }

  /* Word count badge hidden on mobile topbar */
  .nav-stat-pill.mastered {
    display: none !important;
  }

  .nav-stat-pill.streak {
    padding: 4px 9px;
    height: 30px;
    font-size: 0.78rem;
    font-weight: 800;
    border-radius: 9999px;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    background: var(--amber-soft);
    color: var(--amber-primary);
    border: 1px solid var(--amber-border);
    white-space: nowrap;
    flex-shrink: 0;
  }

  .btn-refresh-cache {
  background: var(--surface-white);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  padding: 6px 10px;
  cursor: pointer;
  font-size: 0.95rem;
  line-height: 1;
  transition: transform 0.25s ease, background 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.btn-refresh-cache:hover {
  transform: rotate(180deg);
  background: var(--surface-hover);
}
[data-theme="dark"] .btn-refresh-cache {
  background: var(--surface-card);
  border-color: var(--border-subtle);
}

.theme-toggle-btn {
    width: 32px;
    height: 32px;
    min-width: 32px;
    font-size: 0.9rem;
    border-radius: 9999px;
    flex-shrink: 0;
    background: var(--surface-white);
    border: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
  }

  .btn-install-pwa {
    padding: 4px 8px;
    font-size: 0.74rem;
    height: 30px;
    border-radius: 9999px;
    white-space: nowrap;
    flex-shrink: 0;
  }

  .btn-back-hub {
    display: none !important;
  }

  /* --- DASHBOARD MOBILE LAYOUT --- */
  .container {
    padding: 14px 12px 40px;
  }

  .hero-banner {
    padding: 16px 14px;
    margin-bottom: 16px;
    border-radius: var(--radius-md);
  }

  .hero-text h1 {
    font-size: 1.15rem;
    line-height: 1.3;
  }

  .hero-text p {
    font-size: 0.82rem;
  }

  .hero-progress-box {
    min-width: 100%;
    padding: 12px 14px;
    margin-top: 6px;
  }

  /* KPI Grid: Clean 2x2 Phone Layout */
  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 16px;
  }

  .kpi-card {
    padding: 12px 14px;
    gap: 10px;
    border-radius: 14px;
  }

  .kpi-icon {
    width: 36px;
    height: 36px;
    font-size: 1.05rem;
    border-radius: 10px;
  }

  .kpi-value {
    font-size: 1.15rem;
  }

  .kpi-label {
    font-size: 0.68rem;
  }

  .kpi-sub {
    font-size: 0.68rem;
  }

  /* Controls Bar: Horizontal Scrollable Filters */
  .controls-bar {
    padding: 10px 12px;
    gap: 10px;
    margin-bottom: 16px;
    border-radius: 14px;
  }

  .filter-pills {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    width: 100%;
    padding-bottom: 4px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    gap: 6px;
  }

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

  .pill-btn {
    padding: 5px 10px;
    font-size: 0.75rem;
    white-space: nowrap;
    flex-shrink: 0;
  }

  .search-and-toggle {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .search-box {
    max-width: 100%;
    min-width: 100%;
  }

  .toggle-locked {
    justify-content: center;
    padding: 6px 10px;
  }

  /* Day Cards Grid */
  .days-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .day-card {
    padding: 16px;
    border-radius: 18px;
  }

  .day-title {
    font-size: 0.95rem;
  }

  .day-card-footer {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .day-card-footer .file-pill {
    align-self: flex-start;
  }

  .btn-launch {
    width: 100%;
    min-height: 48px;
    font-size: 0.92rem;
    font-weight: 700;
    border-radius: 14px;
    box-shadow: 0 4px 14px rgba(21, 128, 61, 0.3);
  }

  /* --- FULL-PAGE DAY VIEW: SINGLE COMPACT TOPBAR & FIXED BOTTOM TABS --- */
  .study-topbar {
    position: sticky;
    top: 0;
    z-index: 100;
  }

  .study-topbar-inner {
    padding: 6px 8px;
    min-height: 46px;
    gap: 6px;
  }

  .study-left {
    gap: 5px;
    min-width: 0;
    flex: 1 1 auto;
    overflow: hidden;
  }

  .btn-study-back {
    padding: 0;
    width: 28px;
    height: 28px;
    justify-content: center;
    font-size: 0.72rem;
    flex-shrink: 0;
  }

  .btn-study-back span {
    display: none;
  }

  .study-badge-wrap {
    gap: 3px;
    min-width: 0;
  }

  .btn-day-nav {
    width: 20px;
    height: 20px;
    font-size: 0.6rem;
    flex-shrink: 0;
  }

  .study-badge-wrap .day-badge {
    padding: 3px 7px;
    font-size: 0.68rem;
  }

  .study-mastered-badge {
    padding: 3px 6px;
    font-size: 0.65rem;
  }

  .study-words-badge {
    display: none; /* Keep clean on small phones */
  }

  .study-center {
    display: none !important; /* Keep study bar clean and spacious on phones */
  }

  .study-right {
    gap: 4px;
    margin-left: auto;
    flex-shrink: 0;
  }

  .btn-skip-mastered {
    padding: 2px 6px;
    height: 28px;
    font-size: 0.68rem;
    gap: 3px;
  }

  .btn-skip-mastered .skip-status-tag {
    font-size: 0.58rem;
    padding: 0 4px;
  }

  .study-right .streak {
    padding: 2px 6px;
    height: 28px;
    font-size: 0.68rem;
  }

  .btn-sync-cloud {
    height: 30px;
    min-width: 30px;
    padding: 0 7px;
    font-size: 0.82rem;
  }

  .study-right .btn-sync-cloud.is-compact {
    width: 28px;
    height: 28px;
    min-width: 28px;
    padding: 0;
  }

  .study-right .theme-toggle-btn {
    width: 28px;
    height: 28px;
    min-width: 28px;
    font-size: 0.82rem;
  }

  .sync-modal {
    padding: 15px 13px;
    border-radius: 18px;
    max-height: 90vh;
  }

  .study-right .btn-refresh-cache {
  background: var(--surface-white);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  padding: 6px 10px;
  cursor: pointer;
  font-size: 0.95rem;
  line-height: 1;
  transition: transform 0.25s ease, background 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.btn-refresh-cache:hover {
  transform: rotate(180deg);
  background: var(--surface-hover);
}
[data-theme="dark"] .btn-refresh-cache {
  background: var(--surface-card);
  border-color: var(--border-subtle);
}

.theme-toggle-btn {
    width: 32px;
    height: 32px;
    font-size: 0.85rem;
  }

  /* Bottom Tab Bar (Docked to Bottom on Phone like Duolingo/Instagram) */
  .day-suite-tabs {
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    height: calc(58px + env(safe-area-inset-bottom, 0px));
    background: var(--surface-white);
    background: color-mix(in srgb, var(--surface-white) 94%, transparent);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid var(--border-subtle);
    border-radius: 0;
    border-left: none;
    border-right: none;
    border-bottom: none;
    padding: 4px 6px calc(4px + env(safe-area-inset-bottom, 0px));
    display: grid !important;
    grid-template-columns: repeat(5, 1fr);
    gap: 4px;
    z-index: 999 !important;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.08);
    margin: 0 !important;
    max-width: 100% !important;
  }

  .suite-tab-btn {
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 2px;
    padding: 4px 2px;
    border-radius: 10px;
    min-height: 46px;
    transition: transform 0.15s ease, background-color 0.15s ease;
  }

  .suite-tab-btn:active {
    transform: scale(0.92);
  }

  .tab-icon {
    font-size: 1.25rem;
    line-height: 1;
  }

  .tab-label-mobile {
    display: block;
    font-size: 0.68rem;
    font-weight: 700;
    line-height: 1.1;
  }

  .tab-label-desktop {
    display: none;
  }

  .suite-tab-btn.active {
    background: var(--green-soft);
    color: var(--green-primary);
  }

  [data-theme="dark"] .suite-tab-btn.active {
    background: rgba(22, 163, 74, 0.25);
    color: #4ade80;
  }

  /* Safe padding so bottom tab bar does not hide content */
  .day-content-wrap {
    padding: 14px 12px calc(80px + env(safe-area-inset-bottom, 16px)) !important;
  }

  /* --- FLASHCARDS MOBILE SPECIFIC --- */
  .card-perspective-box {
    height: clamp(310px, 48vh, 380px);
  }

  .flipper-face {
    padding: 18px 16px;
    border-radius: 18px;
  }

  .fc-word-title {
    font-size: clamp(1.8rem, 6.5vw, 2.3rem);
    margin-bottom: 6px;
  }

  .fc-pos-pill {
    font-size: 0.78rem;
    padding: 2px 10px;
    margin-bottom: 10px;
  }

  .fc-speak-btn {
    padding: 7px 14px;
    font-size: 0.78rem;
  }

  .fc-english-text {
    font-size: clamp(1.12rem, 4.2vw, 1.32rem);
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.35;
  }

  .fc-hindi-text {
    font-size: clamp(0.86rem, 3.2vw, 0.96rem);
    font-weight: 500;
    color: var(--text-secondary);
    line-height: 1.4;
  }

  .fc-example-box {
    padding: 8px 12px;
    font-size: 0.82rem;
  }

  /* Big Thumb-Friendly Action Buttons */
  .fc-action-buttons {
    gap: 10px;
  }

  .btn-practice-lg,
  .btn-master-lg {
    min-height: 52px;
    font-size: 0.95rem;
    border-radius: 16px;
    touch-action: manipulation;
  }

  .btn-practice-lg:active,
  .btn-master-lg:active {
    transform: scale(0.96);
  }

  .fc-nav-controls {
    gap: 8px;
  }

  .fc-nav-controls .btn {
    padding: 8px 12px;
    font-size: 0.8rem;
    min-height: 42px;
    flex: 1;
  }

  /* --- QUIZ STAGE MOBILE --- */
  .quiz-container {
    padding: 16px 14px;
    border-radius: 18px;
  }

  .quiz-top-bar {
    margin-bottom: 14px;
    padding-bottom: 10px;
  }

  .quiz-opt-btn {
    min-height: 52px;
    padding: 12px 14px;
    font-size: 0.88rem;
    border-radius: 12px;
    line-height: 1.35;
    margin-bottom: 8px;
    touch-action: manipulation;
  }

  .quiz-opt-btn:active {
    transform: scale(0.98);
  }

  #btnQuizNext {
    min-height: 50px;
    font-size: 0.95rem;
    border-radius: 14px;
  }

  /* --- SPELL STAGE MOBILE --- */
  .type-card-wrap {
    padding: 16px 14px;
    border-radius: 18px;
  }

  .blanks-box {
    font-size: 1.35rem;
    letter-spacing: 4px;
    padding: 12px 8px;
  }

  .spell-input {
    font-size: 16px; /* Prevents auto-zoom in iOS Safari */
    padding: 12px 14px;
    border-radius: 12px;
  }

  /* --- SPEED MATCH MOBILE --- */
  .match-grid-box {
    gap: 8px;
  }

  .match-tile-btn {
    min-height: 72px;
    padding: 8px 10px;
    font-size: 0.84rem;
    border-radius: 12px;
  }

  /* --- WORD LIST MOBILE --- */
  .word-row-item {
    padding: 12px 14px;
    border-radius: 14px;
  }
}

/* Extra small devices (iPhone SE, smaller Android phones) */
@media (max-width: 380px) {
  .brand-title {
    font-size: 0.88rem;
  }

  .fc-word-title {
    font-size: 1.6rem;
  }

  .kpi-grid {
    grid-template-columns: 1fr;
  }
}
