/* ===========================
   EducaIA — Design System v2
   Premium · Modern · Alive
   =========================== */

@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700;800;900&family=DM+Sans:ital,wght@0,300;0,400;0,500;0,600;0,700;1,400&display=swap');

/* ── Design Tokens ── */
:root {
  /* Primary palette — refined blues */
  --blue-50:  #eef4ff;
  --blue-100: #dae6ff;
  --blue-200: #bdd4ff;
  --blue-300: #8fb8ff;
  --blue-400: #5a91ff;
  --blue-500: #3468fc;
  --blue-600: #1e47f2;
  --blue-700: #1735de;
  --blue-800: #192db4;
  --blue-900: #1a2b8e;

  /* Accent — indigo / violet */
  --indigo-50:  #eef2ff;
  --indigo-100: #e0e7ff;
  --indigo-400: #818cf8;
  --indigo-500: #6366f1;
  --indigo-600: #4f46e5;

  /* Sky accent for gradients */
  --sky-100: #e0f2fe;
  --sky-200: #bae6fd;
  --sky-400: #38bdf8;

  /* Neutrals — Dark Mode text/bg variations */
  --white:    #ffffff;
  --gray-50:  rgba(255,255,255,0.03);
  --gray-100: rgba(255,255,255,0.05);
  --gray-200: rgba(255,255,255,0.10);
  --gray-300: rgba(255,255,255,0.20);
  --gray-400: rgba(255,255,255,0.62);
  --gray-500: rgba(255,255,255,0.75);
  --gray-600: rgba(255,255,255,0.80);
  --gray-700: rgba(255,255,255,0.88);
  --gray-800: rgba(255,255,255,0.94);
  --gray-900: #ffffff;

  /* Surfaces */
  --app-bg: #0a0b10;
  --mesh-bg: radial-gradient(ellipse 80% 60% at 50% -20%, rgba(99,102,241,0.10), transparent),
             radial-gradient(ellipse 60% 50% at 80% 50%, rgba(56,189,248,0.06), transparent),
             radial-gradient(ellipse 50% 40% at 20% 80%, rgba(168,85,247,0.06), transparent);
  --bg-gradient: var(--mesh-bg), var(--app-bg);
  --card-bg: rgba(255,255,255,0.035);
  --card-border: rgba(255,255,255,0.09);
  --glass-bg: rgba(255,255,255,0.03);
  --glass-border: rgba(255,255,255,0.10);

  /* Shadows — with color */
  --shadow-sm:  0 1px 3px rgba(0,0,0,0.3);
  --shadow-md:  0 4px 16px rgba(0,0,0,0.4), 0 2px 4px rgba(0,0,0,0.3);
  --shadow-lg:  0 12px 40px rgba(0,0,0,0.6), inset 0 1px 0 rgba(255,255,255,0.05);
  --shadow-xl:  0 24px 80px rgba(0,0,0,0.7), inset 0 1px 0 rgba(255,255,255,0.08);
  --shadow-glow: 0 0 24px rgba(99,102,241,0.25);

  /* Radii */
  --radius-sm:   8px;
  --radius-md:   12px;
  --radius-lg:   18px;
  --radius-xl:   24px;
  --radius-2xl:  32px;
  --radius-full: 9999px;

  /* Layout */
  --sidebar-w: 250px;
  --header-h:  64px;

  /* Motion */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --transition: all 0.25s var(--ease-out);
  --transition-slow: all 0.4s var(--ease-out);
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; background-color: var(--app-bg); }
body {
  font-family: 'DM Sans', system-ui, -apple-system, sans-serif;
  background: var(--bg-gradient);
  background-attachment: scroll;
  min-height: 100vh;
  color: var(--gray-800);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  letter-spacing: -0.01em;
  position: relative;
}
body::before {
  content: '';
  position: fixed; inset: 0; z-index: -1;
  background-image:
    linear-gradient(rgba(255,255,255,0.008) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.008) 1px, transparent 1px);
  background-size: 80px 80px;
  pointer-events: none;
}
a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; }
ul, ol { list-style: none; }
button { cursor: pointer; font-family: inherit; }
input, textarea, select { font-family: inherit; }

/* ── Animated mesh background ── */
.landing-bg {
  position: fixed; inset: 0; z-index: -2;
  overflow: hidden;
  background: transparent;
}
.landing-bg .orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  animation: float 8s ease-in-out infinite;
}
.orb-1 { width: 600px; height: 600px; background: rgba(99,102,241,0.12); top: -200px; left: -100px; animation-delay: 0s; }
.orb-2 { width: 500px; height: 500px; background: rgba(56,189,248,0.10); top: 40%; right: -150px; animation-delay: -3s; }
.orb-3 { width: 400px; height: 400px; background: rgba(168,85,247,0.08); bottom: -100px; left: 30%; animation-delay: -5s; }

/* ── Typography ── */
h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4 {
  font-family: 'Montserrat', sans-serif;
  letter-spacing: -0.025em;
}

.h1 { font-size: clamp(2rem, 5vw, 3.5rem); font-weight: 800; line-height: 1.08; }
.h2 { font-size: clamp(1.5rem, 3vw, 2.25rem); font-weight: 700; line-height: 1.15; }
.h3 { font-size: 1.25rem; font-weight: 700; }
.h4 { font-size: 1rem; font-weight: 700; }
.body-lg { font-size: 1.125rem; line-height: 1.7; }
.body { font-size: 0.9375rem; line-height: 1.65; }
.caption { font-size: 0.8125rem; color: var(--gray-500); }

.text-blue { color: var(--blue-600); }
.text-muted { color: var(--gray-500); }
.text-center { text-align: center; }

/* ── Gradient Text ── */
.gradient-text {
  background: linear-gradient(135deg, var(--blue-500) 0%, var(--indigo-500) 50%, var(--sky-400) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 24px;
  border-radius: var(--radius-full);
  font-family: 'Montserrat', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  border: none;
  transition: var(--transition);
  white-space: nowrap;
  position: relative;
  overflow: hidden;
  letter-spacing: -0.01em;
}
.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.2) 0%, transparent 60%);
  opacity: 0;
  transition: opacity 0.3s;
}
.btn:hover::after { opacity: 1; }

.btn-primary {
  background: linear-gradient(135deg, var(--blue-600) 0%, var(--indigo-600) 100%);
  color: var(--white);
  box-shadow: 0 4px 16px rgba(79,70,229,0.3), 0 1px 3px rgba(0,0,0,0.1);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(79,70,229,0.4), 0 2px 6px rgba(0,0,0,0.1);
}
.btn-primary:active { transform: translateY(0); }

.btn-secondary {
  background: rgba(255,255,255,0.7);
  color: var(--blue-600);
  border: 1.5px solid var(--blue-200);
  backdrop-filter: blur(10px);
}
.btn-secondary:hover {
  background: var(--white);
  border-color: var(--blue-400);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-ghost {
  background: transparent;
  color: var(--gray-600);
  border: 1.5px solid var(--gray-200);
}
.btn-ghost:hover { background: rgba(255,255,255,0.05); border-color: var(--gray-400); color: white; }

.btn-sm { padding: 7px 16px; font-size: 0.825rem; }
.btn-lg { padding: 14px 32px; font-size: 1rem; }
.btn-white { background: white; color: var(--blue-600); font-weight: 700; }
.btn-white:hover { background: #f0f5ff; transform: translateY(-2px); box-shadow: var(--shadow-lg); }

/* ── Cards ── */
.card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-xl);
  backdrop-filter: blur(20px);
  box-shadow: var(--shadow-lg);
  transition: var(--transition);
}
.card:hover { box-shadow: var(--shadow-xl); transform: translateY(-2px); }
.card-p { padding: 32px; }
.card-p-lg { padding: 40px; }

/* ── Glass Panel ── */
.glass {
  background: var(--glass-bg);
  backdrop-filter: blur(24px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-2xl);
}

/* ── Badge ── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-family: 'Montserrat', sans-serif;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.badge-blue   { background: var(--blue-100); color: var(--blue-700); }
.badge-green  { background: #dcfce7; color: #15803d; }
.badge-purple { background: #ede9fe; color: #7c3aed; }
.badge-orange { background: #fff7ed; color: #c2410c; }

/* ── Progress Bar ── */
.progress-bar {
  width: 100%;
  height: 6px;
  background: var(--gray-200);
  border-radius: var(--radius-full);
  overflow: hidden;
  position: relative;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--blue-500), var(--indigo-400), var(--sky-400));
  background-size: 200% 100%;
  border-radius: var(--radius-full);
  transition: width 0.8s var(--ease-out);
  animation: shimmer-bar 3s ease-in-out infinite;
}
@keyframes shimmer-bar {
  0%, 100% { background-position: 0% center; }
  50%      { background-position: 100% center; }
}

/* ── App Layout ── */
.app-layout {
  display: flex;
  min-height: 100vh;
}

/* ── Sidebar — Minimalist Glass ── */
.sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  height: 100vh;
  position: fixed;
  top: 0; left: 0;
  background: rgba(10,12,16,0.3);
  backdrop-filter: blur(40px);
  border-right: 1px solid rgba(255,255,255,0.03);
  display: flex;
  flex-direction: column;
  padding: 24px 0;
  z-index: 100;
  overflow-y: auto;
}
.sidebar-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px 22px 24px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  margin-bottom: 16px;
}
.sidebar-logo .logo-img {
  width: 140px;
  height: auto;
  display: block;
  object-fit: contain;
  filter: drop-shadow(0 2px 8px rgba(99,102,241,0.25));
}

.sidebar-nav { flex: 1; padding: 0 12px; display: flex; flex-direction: column; gap: 2px; }
.sidebar-init .sidebar-nav a { transition: none !important; }
.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  color: rgba(255,255,255,0.62);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.875rem;
  font-weight: 500;
  transition: var(--transition);
  position: relative;
}
.sidebar-nav a:hover {
  background: rgba(255,255,255,0.07);
  color: rgba(255,255,255,0.92);
}
.sidebar-nav a.active {
  background: rgba(99,102,241,0.12);
  color: white;
  font-weight: 600;
  border: 1px solid rgba(99,102,241,0.18);
}
.sidebar-nav a.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 22px;
  border-radius: 0 4px 4px 0;
  background: linear-gradient(180deg, var(--blue-400), var(--indigo-400));
}
.sidebar-nav a .nav-icon { font-size: 1.05rem; width: 22px; text-align: center; }

.sidebar-section-label {
  font-family: 'Montserrat', sans-serif;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255,255,255,0.42);
  padding: 16px 24px 6px;
}

.sidebar-footer {
  padding: 16px 22px 0;
  border-top: 1px solid rgba(255,255,255,0.06);
}
.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
}
.user-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--blue-400), var(--indigo-500));
  display: flex; align-items: center; justify-content: center;
  color: white;
  font-family: 'Montserrat', sans-serif;
  font-size: 0.75rem;
  font-weight: 700;
}
.user-info .user-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: rgba(255,255,255,0.88);
}
.user-info .user-role {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.50);
}
#user-email { display: none !important; }

/* ── Sidebar inline level widget ── */
#sidebar-level-inline .slv-row {
  display: flex; align-items: center; gap: 6px; margin-bottom: 3px;
}
#sidebar-level-inline .slv-badge {
  font-family: 'Montserrat', sans-serif; font-weight: 700;
  font-size: 0.68rem; color: rgba(165,180,252,0.88);
}
#sidebar-level-inline .slv-xp {
  font-size: 0.6rem; color: rgba(255,255,255,0.38);
}
#sidebar-level-inline .slv-track {
  height: 2px; background: rgba(255,255,255,0.08);
  border-radius: 99px; overflow: hidden; width: 100%;
}
[data-theme="light"] #sidebar-level-inline .slv-badge { color: var(--indigo-600); }
[data-theme="light"] #sidebar-level-inline .slv-xp    { color: rgba(0,0,0,0.42); }
[data-theme="light"] #sidebar-level-inline .slv-track { background: rgba(0,0,0,0.10); }

/* ── Main Content ── */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  padding: 36px 40px;
  min-height: 100vh;
}
.page-header { margin-bottom: 32px; }
.page-header h1 {
  font-family: 'Montserrat', sans-serif;
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--white);
  margin-bottom: 6px;
  letter-spacing: -0.03em;
}
.page-header p {
  color: var(--gray-400);
  font-size: 0.925rem;
}

/* ── Tabs ── */
.tabs {
  display: flex;
  gap: 4px;
  background: rgba(255,255,255,0.03);
  border-radius: var(--radius-md);
  padding: 4px;
  border: 1px solid rgba(255,255,255,0.05);
}
.tab-btn {
  flex: 1;
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  border: none;
  background: transparent;
  font-family: 'Montserrat', sans-serif;
  font-size: 0.825rem;
  font-weight: 600;
  color: var(--gray-400);
  transition: var(--transition);
}
.tab-btn.active {
  background: rgba(255,255,255,0.08);
  color: white;
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(255,255,255,0.08);
}
.tab-content { display: none; }
.tab-content.active { display: block; }

/* ── Forms ── */
.form-group { display: flex; flex-direction: column; gap: 6px; margin-bottom: 18px; }
.form-label {
  font-family: 'Montserrat', sans-serif;
  font-size: 0.825rem;
  font-weight: 600;
  color: var(--gray-700);
  letter-spacing: -0.01em;
}
.form-input {
  height: 46px;
  padding: 0 16px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-md);
  font-size: 0.9375rem;
  background: rgba(0,0,0,0.2);
  transition: var(--transition);
  outline: none;
  color: var(--white);
}
.form-input:focus {
  border-color: var(--indigo-400);
  background: rgba(0,0,0,0.3);
  box-shadow: 0 0 0 4px rgba(99,102,241,0.15);
}
select.form-input {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2394a3b8' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}

/* ── Drag & Drop Zone ── */
.drop-zone {
  border: 2px dashed var(--blue-300);
  border-radius: var(--radius-xl);
  padding: 56px 32px;
  text-align: center;
  background: rgba(238,244,255,0.4);
  transition: var(--transition);
  cursor: pointer;
}
.drop-zone:hover, .drop-zone.drag-over {
  border-color: var(--indigo-400);
  background: rgba(224,231,255,0.5);
  transform: scale(1.005);
}
.drop-icon { font-size: 3rem; margin-bottom: 12px; }
.drop-zone h3 {
  font-family: 'Montserrat', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 6px;
}
.drop-zone p { color: var(--gray-500); font-size: 0.875rem; }

/* ── Chat ── */
.chat-container { display: flex; flex-direction: column; height: calc(100vh - 180px); }
.chat-messages { flex: 1; overflow-y: auto; padding: 16px 0; display: flex; flex-direction: column; gap: 16px; scroll-behavior: smooth; }
.message { display: flex; gap: 12px; max-width: 75%; animation: messageIn 0.35s var(--ease-out); }
.message.user { align-self: flex-end; flex-direction: row-reverse; }
.message-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}
.message.ai .message-avatar { background: linear-gradient(135deg, var(--blue-500), var(--indigo-500)); color: white; }
.message.user .message-avatar { background: linear-gradient(135deg, #a855f7, #7c3aed); color: white; }
.message-bubble {
  padding: 14px 18px;
  border-radius: var(--radius-lg);
  font-size: 0.9375rem;
  line-height: 1.65;
}
.message.ai .message-bubble {
  background: var(--card-bg);
  border: 1px solid var(--blue-100);
  border-bottom-left-radius: 4px;
  backdrop-filter: blur(16px);
}
.message.user .message-bubble {
  background: linear-gradient(135deg, var(--blue-600), var(--indigo-600));
  color: white;
  border-bottom-right-radius: 4px;
}
.chat-input-area {
  display: flex;
  gap: 10px;
  padding: 16px 0 0;
  border-top: 1px solid var(--gray-200);
}
.chat-input {
  flex: 1;
  height: 48px;
  padding: 0 18px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-full);
  font-size: 0.9375rem;
  background: var(--white);
  outline: none;
  transition: var(--transition);
}
.chat-input:focus {
  border-color: var(--indigo-400);
  box-shadow: 0 0 0 4px rgba(99,102,241,0.08);
}

/* ── Flashcard ── */
.flashcard-scene { width: 100%; max-width: 520px; height: 280px; perspective: 1000px; margin: 0 auto; }
.flashcard {
  width: 100%; height: 100%;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.65s var(--ease-out);
  cursor: pointer;
}
.flashcard.flipped { transform: rotateY(180deg); }
.flashcard-front, .flashcard-back {
  position: absolute; inset: 0;
  backface-visibility: hidden;
  border-radius: var(--radius-xl);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 32px;
  text-align: center;
  box-shadow: var(--shadow-lg);
}
.flashcard-front {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.1);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08), 0 8px 32px rgba(0,0,0,0.4);
  color: rgba(255,255,255,0.9);
}
.flashcard-back {
  background: linear-gradient(135deg, rgba(79,70,229,0.7), rgba(37,99,235,0.7));
  border: 1px solid rgba(99,102,241,0.4);
  box-shadow: 0 0 40px rgba(99,102,241,0.25), 0 8px 32px rgba(0,0,0,0.4);
  color: white;
  transform: rotateY(180deg);
}
.flashcard-label {
  font-family: 'Montserrat', sans-serif;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: rgba(255,255,255,0.3);
  margin-bottom: 14px;
}
.flashcard-text { font-size: 1.1rem; font-weight: 600; line-height: 1.5; color: white; }
.flashcard-hint { font-size: 0.8rem; color: rgba(255,255,255,0.3); margin-top: 16px; }

/* ── Quiz ── */
.quiz-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255,255,255,0.05);
  background: transparent;
  cursor: pointer;
  transition: var(--transition);
  font-size: 0.95rem;
  font-weight: 400;
}
.quiz-option:hover {
  border-color: rgba(255,255,255,0.15);
  box-shadow: 0 0 24px rgba(255,255,255,0.03);
  transform: translateX(4px);
}
.quiz-option.selected {
  border-color: rgba(99,102,241,0.3);
  background: rgba(99,102,241,0.05);
  color: var(--white);
  box-shadow: var(--shadow-glow);
}
.quiz-option.correct { border-color: #22c55e; background: transparent; color: #4ade80; box-shadow: 0 0 24px rgba(34,197,94,0.15); }
.quiz-option.incorrect { border-color: #ef4444; background: transparent; color: #f87171; box-shadow: 0 0 24px rgba(239,68,68,0.15); }
.quiz-radio {
  width: 18px; height: 18px;
  border-radius: 50%;
  border: 2px solid var(--gray-300);
  flex-shrink: 0;
  transition: var(--transition);
}
.quiz-option.selected .quiz-radio {
  border-color: var(--indigo-500);
  background: var(--indigo-500);
}

/* ── Stat Cards ── */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; }
.stat-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-xl);
  padding: 22px;
  backdrop-filter: blur(20px);
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}
.stat-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}
.stat-icon { font-size: 1.5rem; margin-bottom: 10px; }
.stat-value {
  font-family: 'Montserrat', sans-serif;
  font-size: 1.85rem;
  font-weight: 800;
  color: var(--white);
  line-height: 1;
  letter-spacing: -0.03em;
}
.stat-label {
  font-size: 0.8rem;
  color: var(--gray-500);
  margin-top: 6px;
  font-weight: 500;
}

/* ── Lang Toggle (floating) ── */
.lang-toggle-wrap {
  position: fixed;
  top: 18px;
  right: 22px;
  z-index: 999;
}
.lang-toggle-wrap #lang-toggle,
#lang-toggle {
  padding: 6px 14px;
  background: rgba(255,255,255,0.8);
  border: 1.5px solid var(--blue-200);
  border-radius: var(--radius-full);
  font-family: 'Montserrat', sans-serif;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--indigo-600);
  cursor: pointer;
  backdrop-filter: blur(12px);
  transition: var(--transition);
  letter-spacing: 0.03em;
}
.lang-toggle-wrap #lang-toggle:hover,
#lang-toggle:hover {
  background: white;
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

/* ── Animations ── */
@keyframes messageIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-10px); }
}
@keyframes shimmer {
  0%   { background-position: -200% center; }
  100% { background-position:  200% center; }
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.95); }
  to   { opacity: 1; transform: scale(1); }
}
@keyframes spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}
@keyframes pulse-ring {
  0%   { transform: scale(1); opacity: 0.6; }
  100% { transform: scale(1.6); opacity: 0; }
}
@keyframes gradient-shift {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}
@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-20px); }
  to   { opacity: 1; transform: translateX(0); }
}

.animate-fadeup { animation: fadeUp 0.5s var(--ease-out) both; }
.animate-scalein { animation: scaleIn 0.5s var(--ease-out) both; }
.delay-1 { animation-delay: 0.08s; }
.delay-2 { animation-delay: 0.16s; }
.delay-3 { animation-delay: 0.24s; }
.delay-4 { animation-delay: 0.32s; }
.delay-5 { animation-delay: 0.40s; }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--gray-300);
  border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover { background: var(--gray-400); }

/* ── Utility ── */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.gap-24 { gap: 24px; }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.grid { display: grid; }
.grid-2 { grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
.w-full { width: 100%; }

/* ── Notification / Processing ── */
.processing-bar {
  height: 3px;
  background: linear-gradient(90deg, var(--blue-400), var(--indigo-400), var(--sky-400), var(--blue-400));
  background-size: 200% 100%;
  animation: shimmer 1.5s linear infinite;
  border-radius: var(--radius-full);
  margin-bottom: 8px;
}

/* Toast */
.toast-container { position: fixed; top: 20px; right: 20px; z-index: 9999; display: flex; flex-direction: column; gap: 8px; }
.toast {
  padding: 14px 22px;
  border-radius: var(--radius-md);
  background: var(--gray-900);
  color: white;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.875rem;
  font-weight: 500;
  box-shadow: var(--shadow-xl);
  animation: fadeUp 0.3s both;
  backdrop-filter: blur(10px);
}
.toast.success { background: #166534; }
.toast.info { background: var(--indigo-600); }

/* ── Section header "see all" link ── */
.section-link {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.45);
  text-decoration: none;
  transition: color 0.2s;
}
.section-link:hover { color: rgba(255,255,255,0.6); }

/* ── Sign-out button (sidebar footer) ── */
.btn-signout {
  margin-top: 10px;
  width: 100%;
  padding: 9px;
  border: 1px solid rgba(255,255,255,0.06);
  background: transparent;
  border-radius: 10px;
  font-size: 0.78rem;
  font-weight: 500;
  color: rgba(255,255,255,0.3);
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
  font-family: 'DM Sans', sans-serif;
  letter-spacing: 0.01em;
}
.btn-signout:hover {
  background: rgba(239,68,68,0.08);
  color: #ef4444;
  border-color: rgba(239,68,68,0.15);
}

/* ── Skeleton loader ── */
.skeleton {
  background: linear-gradient(90deg,
    rgba(255,255,255,0.03) 25%,
    rgba(255,255,255,0.08) 50%,
    rgba(255,255,255,0.03) 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s infinite;
  border-radius: var(--radius-md);
}
@keyframes skeleton-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ═══════════════════════════════════════════════
   LIGHT MODE
   ═══════════════════════════════════════════════ */
[data-theme="light"] {
  --app-bg: #f0f4ff;
  --mesh-bg:
    radial-gradient(ellipse 80% 60% at 50% -20%, rgba(99,102,241,0.06), transparent),
    radial-gradient(ellipse 60% 50% at 80% 50%, rgba(56,189,248,0.04), transparent),
    radial-gradient(ellipse 50% 40% at 20% 80%, rgba(168,85,247,0.04), transparent);
  --bg-gradient: var(--mesh-bg), var(--app-bg);
  --card-bg: rgba(255,255,255,0.92);
  --card-border: rgba(0,0,0,0.09);
  --glass-bg: rgba(255,255,255,0.80);
  --glass-border: rgba(0,0,0,0.11);
  --white: #ffffff;
  --gray-50:  rgba(0,0,0,0.02);
  --gray-100: rgba(0,0,0,0.05);
  --gray-200: rgba(0,0,0,0.11);
  --gray-300: rgba(0,0,0,0.25);
  --gray-400: rgba(0,0,0,0.58);
  --gray-500: rgba(0,0,0,0.68);
  --gray-600: rgba(0,0,0,0.74);
  --gray-700: rgba(0,0,0,0.82);
  --gray-800: rgba(0,0,0,0.90);
  --gray-900: #0a0b10;
  --shadow-sm:  0 1px 3px rgba(0,0,0,0.07);
  --shadow-md:  0 4px 16px rgba(0,0,0,0.09), 0 2px 4px rgba(0,0,0,0.05);
  --shadow-lg:  0 12px 40px rgba(0,0,0,0.11), inset 0 1px 0 rgba(255,255,255,0.9);
  --shadow-xl:  0 24px 80px rgba(0,0,0,0.14), inset 0 1px 0 rgba(255,255,255,1);
  --shadow-glow: 0 0 24px rgba(99,102,241,0.16);
}
[data-theme="light"] body {
  color: rgba(0,0,0,0.85);
}
[data-theme="light"] body::before {
  background-image:
    linear-gradient(rgba(0,0,0,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,0,0,0.04) 1px, transparent 1px);
}
[data-theme="light"] .sidebar {
  background: rgba(255,255,255,0.9);
  border-right-color: rgba(0,0,0,0.08);
  backdrop-filter: blur(24px);
}
[data-theme="light"] .sidebar-logo { border-bottom-color: rgba(0,0,0,0.07); }
[data-theme="light"] .sidebar-nav a { color: rgba(0,0,0,0.56); }
[data-theme="light"] .sidebar-nav a:hover {
  background: rgba(0,0,0,0.05);
  color: rgba(0,0,0,0.84);
}
[data-theme="light"] .sidebar-nav a.active {
  color: var(--blue-600);
  background: rgba(79,70,229,0.08);
  border-color: rgba(79,70,229,0.15);
}
[data-theme="light"] .sidebar-section-label { color: rgba(0,0,0,0.42); }
[data-theme="light"] .sidebar-footer { border-top-color: rgba(0,0,0,0.07); }
[data-theme="light"] .user-info .user-name { color: rgba(0,0,0,0.85); }
[data-theme="light"] .user-info .user-role  { color: rgba(0,0,0,0.48); }
[data-theme="light"] .btn-signout {
  border-color: rgba(0,0,0,0.09);
  color: rgba(0,0,0,0.45);
}
[data-theme="light"] .btn-signout:hover {
  background: rgba(239,68,68,0.06);
  color: #dc2626;
  border-color: rgba(239,68,68,0.18);
}
[data-theme="light"] .page-header h1 { color: #0a0b10; }
[data-theme="light"] .tabs {
  background: rgba(0,0,0,0.04);
  border-color: rgba(0,0,0,0.07);
}
[data-theme="light"] .tab-btn { color: rgba(0,0,0,0.48); }
[data-theme="light"] .tab-btn.active {
  background: rgba(255,255,255,0.95);
  color: var(--blue-600);
  border-color: rgba(0,0,0,0.08);
}
[data-theme="light"] .form-input {
  background: rgba(255,255,255,0.9);
  border-color: rgba(0,0,0,0.14);
  color: rgba(0,0,0,0.88);
}
[data-theme="light"] .form-input:focus {
  background: white;
  border-color: var(--indigo-500);
  box-shadow: 0 0 0 4px rgba(99,102,241,0.11);
}
[data-theme="light"] .chat-input {
  background: white;
  border-color: rgba(0,0,0,0.12);
  color: rgba(0,0,0,0.88);
}
[data-theme="light"] .chat-input-area { border-top-color: rgba(0,0,0,0.08); }
[data-theme="light"] .message.ai .message-bubble {
  background: rgba(255,255,255,0.95);
  border-color: rgba(0,0,0,0.07);
  color: rgba(0,0,0,0.85);
}
[data-theme="light"] .quiz-option {
  border-color: rgba(0,0,0,0.08);
  color: rgba(0,0,0,0.75);
}
[data-theme="light"] .quiz-option:hover {
  border-color: rgba(0,0,0,0.18);
  background: rgba(0,0,0,0.02);
}
[data-theme="light"] .flashcard-front {
  background: rgba(255,255,255,0.95);
  border-color: rgba(0,0,0,0.09);
  box-shadow: inset 0 1px 0 rgba(255,255,255,1), 0 8px 32px rgba(0,0,0,0.10);
}
[data-theme="light"] .flashcard-label { color: rgba(0,0,0,0.32); }
[data-theme="light"] .flashcard-text  { color: rgba(0,0,0,0.85); }
[data-theme="light"] .flashcard-hint  { color: rgba(0,0,0,0.35); }
[data-theme="light"] .skeleton {
  background: linear-gradient(90deg,
    rgba(0,0,0,0.04) 25%,
    rgba(0,0,0,0.09) 50%,
    rgba(0,0,0,0.04) 75%);
  background-size: 200% 100%;
}
[data-theme="light"] .toast { background: #1e293b; }
[data-theme="light"] .section-link { color: rgba(0,0,0,0.38); }
[data-theme="light"] .section-link:hover { color: rgba(0,0,0,0.65); }
[data-theme="light"] ::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.18); }
[data-theme="light"] ::-webkit-scrollbar-thumb:hover { background: rgba(0,0,0,0.32); }

/* ═══════════════════════════════════════════════
   FOCUS VISIBLE
   ═══════════════════════════════════════════════ */
:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--indigo-400);
  outline-offset: 2px;
}
.btn:focus-visible {
  outline: 2px solid var(--indigo-400);
  outline-offset: 3px;
  box-shadow: 0 0 0 5px rgba(99,102,241,0.20);
}
.tab-btn:focus-visible,
.quiz-option:focus-visible,
.sidebar-nav a:focus-visible {
  outline: 2px solid var(--indigo-400);
  outline-offset: 2px;
}
.flashcard:focus-visible {
  outline: 3px solid var(--indigo-400);
  outline-offset: 4px;
}

/* ═══════════════════════════════════════════════
   REDUCED MOTION
   ═══════════════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  html { scroll-behavior: auto; }
  .flashcard { transition: none; }
  .progress-fill { animation: none; }
  .processing-bar {
    animation: none;
    background: linear-gradient(90deg, var(--blue-400), var(--indigo-400));
    background-size: 100% 100%;
  }
  .skeleton { animation: none; background: rgba(255,255,255,0.06); }
  [data-theme="light"] .skeleton { background: rgba(0,0,0,0.06); }
}

/* ═══════════════════════════════════════════════
   MOBILE HAMBURGER & OVERLAY
   ═══════════════════════════════════════════════ */
.sidebar-hamburger {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  color: var(--gray-700);
  cursor: pointer;
  backdrop-filter: blur(10px);
  transition: var(--transition);
  position: fixed;
  top: 14px;
  left: 14px;
  z-index: 150;
  flex-shrink: 0;
}
.sidebar-hamburger:hover {
  background: var(--glass-bg);
  color: var(--gray-900);
  border-color: var(--glass-border);
}
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 90;
  backdrop-filter: blur(3px);
  opacity: 0;
  transition: opacity 0.3s var(--ease-out);
}
.sidebar-overlay.visible { opacity: 1; }

/* ═══════════════════════════════════════════════
   THEME & LANG TOGGLE BUTTONS
   ═══════════════════════════════════════════════ */
.btn-theme-toggle,
.btn-lang-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 12px;
  border: 1px solid rgba(255,255,255,0.07);
  background: rgba(255,255,255,0.03);
  border-radius: var(--radius-sm);
  font-size: 0.76rem;
  font-weight: 600;
  color: rgba(255,255,255,0.42);
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
  font-family: 'DM Sans', sans-serif;
  letter-spacing: 0.01em;
  margin-top: 6px;
}
.btn-theme-toggle:hover,
.btn-lang-toggle:hover {
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.72);
  border-color: rgba(255,255,255,0.12);
}
[data-theme="light"] .btn-theme-toggle,
[data-theme="light"] .btn-lang-toggle {
  border-color: rgba(0,0,0,0.09);
  background: rgba(0,0,0,0.03);
  color: rgba(0,0,0,0.48);
}
[data-theme="light"] .btn-theme-toggle:hover,
[data-theme="light"] .btn-lang-toggle:hover {
  background: rgba(0,0,0,0.05);
  color: rgba(0,0,0,0.72);
  border-color: rgba(0,0,0,0.14);
}

/* ═══════════════════════════════════════════════
   MODO ENFOQUE — Focus Mode
   ═══════════════════════════════════════════════ */

/* ── Botón del sidebar ── */
.btn-focus-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 12px;
  border: 1px solid rgba(99,102,241,0.2);
  background: rgba(99,102,241,0.05);
  border-radius: var(--radius-sm);
  font-size: 0.76rem;
  font-weight: 600;
  color: rgba(255,255,255,0.45);
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s, box-shadow 0.2s;
  font-family: 'DM Sans', sans-serif;
  letter-spacing: 0.01em;
  margin-top: 6px;
}
.btn-focus-toggle:hover {
  background: rgba(99,102,241,0.12);
  color: rgba(255,255,255,0.8);
  border-color: rgba(99,102,241,0.35);
}
.btn-focus-toggle.fm-on {
  background: rgba(99,102,241,0.14);
  border-color: rgba(99,102,241,0.5);
  color: #a5b4fc;
  box-shadow: 0 0 0 2px rgba(99,102,241,0.15), 0 0 14px rgba(99,102,241,0.2);
  animation: fmPulse 2.5s ease-in-out infinite;
}
@keyframes fmPulse {
  0%, 100% { box-shadow: 0 0 0 2px rgba(99,102,241,0.15), 0 0 14px rgba(99,102,241,0.2); }
  50%       { box-shadow: 0 0 0 3px rgba(99,102,241,0.25), 0 0 22px rgba(99,102,241,0.35); }
}
[data-theme="light"] .btn-focus-toggle {
  border-color: rgba(99,102,241,0.15);
  background: rgba(99,102,241,0.04);
  color: rgba(0,0,0,0.45);
}
[data-theme="light"] .btn-focus-toggle:hover {
  background: rgba(99,102,241,0.09);
  color: rgba(0,0,0,0.7);
  border-color: rgba(99,102,241,0.3);
}
[data-theme="light"] .btn-focus-toggle.fm-on {
  color: #4f46e5;
  background: rgba(99,102,241,0.1);
}

/* Ocultar nav bloqueado visualmente mientras el modo enfoque está activo */
.focus-mode-active .sidebar-nav a[href="friends.html"],
.focus-mode-active .sidebar-nav a[href="leaderboard.html"],
.focus-mode-active .sidebar-nav a[href="community.html"] {
  opacity: 0.3;
  pointer-events: none;
  position: relative;
}
.focus-mode-active .sidebar-nav a[href="friends.html"]::after,
.focus-mode-active .sidebar-nav a[href="leaderboard.html"]::after,
.focus-mode-active .sidebar-nav a[href="community.html"]::after {
  content: '🔒';
  font-size: 0.65rem;
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
}

/* ── HUD flotante (v2: columna timer + barra de multiplicador) ── */
.fm-hud {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 8000;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  padding: 9px 16px;
  background: rgba(10,11,16,0.88);
  border: 1px solid rgba(99,102,241,0.3);
  border-radius: 14px;
  box-shadow: 0 4px 20px rgba(99,102,241,0.2), 0 2px 8px rgba(0,0,0,0.4);
  backdrop-filter: blur(10px);
  font-family: 'Montserrat', sans-serif;
  font-size: 0.73rem;
  font-weight: 700;
  color: rgba(255,255,255,0.85);
  pointer-events: none;
  min-width: 185px;
  animation: fmFadeIn 0.4s var(--ease-out);
}
.fm-hud-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.fm-hud-ic  { font-size: 0.9rem; }
.fm-hud-t   { color: #a5b4fc; letter-spacing: 0.04em; }
.fm-hud-sep { color: rgba(255,255,255,0.2); font-size: 0.6rem; }
.fm-hud-r   { color: rgba(255,255,255,0.5); font-size: 0.68rem; }
.fm-hud-bot {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.fm-hud-prog {
  height: 3px;
  border-radius: 99px;
  background: rgba(255,255,255,0.1);
  overflow: hidden;
}
.fm-hud-pf {
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, #6366f1, #8b5cf6);
  width: 0%;
  transition: width 0.8s ease;
}
.fm-hud-nx {
  font-size: 0.62rem;
  color: rgba(255,255,255,0.35);
  letter-spacing: 0.02em;
}

/* ── Break HUD (pausa activa + respiración) ── */
.fm-bh {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 8001;
  padding: 18px 22px;
  background: linear-gradient(135deg, rgba(99,102,241,0.9), rgba(139,92,246,0.9));
  border-radius: var(--radius-xl);
  color: white;
  font-family: 'Montserrat', sans-serif;
  text-align: center;
  box-shadow: 0 8px 32px rgba(99,102,241,0.4);
  min-width: 200px;
  animation: fmFadeIn 0.4s var(--ease-out);
}
.fm-bh-icon { font-size: 1.5rem; margin-bottom: 6px; }
.fm-bh-time { font-size: 1.3rem; font-weight: 800; letter-spacing: -0.02em; }
.fm-bh-lbl  { font-size: 0.68rem; opacity: 0.75; margin-top: 3px; }

/* ── Ejercicio de respiración en caja ── */
.fm-breathe-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
}
.fm-breathe-ring {
  width: 74px;
  height: 74px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 3px solid rgba(255,255,255,0.25);
  background: rgba(255,255,255,0.06);
  transition: transform 4s ease, box-shadow 4s ease, border-color 4s ease;
}
.fm-breathe-ring.inhale {
  transform: scale(1.35);
  box-shadow: 0 0 28px rgba(165,180,252,0.7);
  border-color: #a5b4fc;
}
.fm-breathe-ring.hold {
  transform: scale(1.35);
  box-shadow: 0 0 18px rgba(196,181,253,0.5);
  border-color: #c4b5fd;
}
.fm-breathe-ring.exhale {
  transform: scale(0.85);
  box-shadow: 0 0 8px rgba(255,255,255,0.12);
  border-color: rgba(255,255,255,0.22);
}
.fm-breathe-ring.wait {
  transform: scale(0.85);
  box-shadow: none;
  border-color: rgba(255,255,255,0.12);
}
.fm-breathe-txt {
  font-family: 'Montserrat', sans-serif;
  font-size: 0.68rem;
  font-weight: 700;
  color: rgba(255,255,255,0.85);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  text-align: center;
  transition: opacity 0.3s;
}

/* ── Overlay base (penalización y pausa) ── */
.fm-ov {
  position: fixed;
  inset: 0;
  z-index: 99000;
  background: rgba(5, 6, 10, 0.96);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  backdrop-filter: blur(12px);
  animation: fmFadeIn 0.35s var(--ease-out);
}
@keyframes fmFadeIn {
  from { opacity: 0; transform: scale(0.97); }
  to   { opacity: 1; transform: scale(1); }
}

/* ── Tarjeta base ── */
.fm-card {
  background: rgba(255,255,255,0.025);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: var(--radius-2xl);
  padding: 36px 40px;
  max-width: 520px;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  box-shadow: 0 24px 80px rgba(0,0,0,0.7), inset 0 1px 0 rgba(255,255,255,0.06);
  animation: fmCardIn 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes fmCardIn {
  from { opacity: 0; transform: translateY(20px) scale(0.95); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.fm-card-icon  { font-size: 2.8rem; line-height: 1; }
.fm-card-title {
  font-family: 'Montserrat', sans-serif;
  font-size: 1.35rem;
  font-weight: 800;
  color: white;
  text-align: center;
  letter-spacing: -0.025em;
  margin: 0;
}
.fm-card-sub {
  font-size: 0.85rem;
  color: rgba(255,255,255,0.4);
  text-align: center;
  line-height: 1.6;
  margin: 0;
}

/* ── Metadatos de penalización ── */
.fm-pen-meta {
  display: flex;
  align-items: center;
  gap: 10px;
}
.fm-badge-red {
  padding: 5px 14px;
  border-radius: var(--radius-full);
  background: rgba(239,68,68,0.12);
  border: 1px solid rgba(239,68,68,0.25);
  color: #f87171;
  font-family: 'Montserrat', sans-serif;
  font-size: 0.85rem;
  font-weight: 800;
}
.fm-pen-sub {
  font-size: 0.78rem;
  color: rgba(255,255,255,0.3);
}
.fm-pen-warn {
  font-size: 0.85rem;
  color: rgba(255,255,255,0.55);
  text-align: center;
  line-height: 1.55;
  margin: -4px 0 0;
  max-width: 420px;
}
.fm-pen-warn strong { color: #a5b4fc; }

/* ── Quiz de penalización ── */
.fm-quiz-block {
  width: 100%;
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--radius-lg);
  padding: 20px;
}
.fm-quiz-hd {
  font-family: 'Montserrat', sans-serif;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,0.3);
  margin-bottom: 12px;
}
.fm-quiz-q {
  font-size: 0.95rem;
  font-weight: 600;
  color: rgba(255,255,255,0.88);
  line-height: 1.55;
  margin-bottom: 14px;
}
.fm-opts {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 10px;
}
.fm-opt {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.03);
  color: rgba(255,255,255,0.75);
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.18s;
  text-align: left;
}
.fm-opt:hover { background: rgba(255,255,255,0.07); border-color: rgba(255,255,255,0.14); color: white; }
.fm-opt-key {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px; height: 22px;
  border-radius: 6px;
  background: rgba(255,255,255,0.07);
  font-family: 'Montserrat', sans-serif;
  font-size: 0.68rem;
  font-weight: 800;
  flex-shrink: 0;
  color: rgba(255,255,255,0.5);
}
.fm-opt-sel { border-color: rgba(99,102,241,0.4); background: rgba(99,102,241,0.08); }
.fm-opt-ok  { border-color: rgba(34,197,94,0.4) !important; background: rgba(34,197,94,0.1) !important; color: #4ade80 !important; }
.fm-opt-ok .fm-opt-key { background: rgba(34,197,94,0.15); color: #4ade80; }
.fm-opt-err { border-color: rgba(239,68,68,0.4) !important; background: rgba(239,68,68,0.08) !important; color: #f87171 !important; }
.fm-opt-err .fm-opt-key { background: rgba(239,68,68,0.12); color: #f87171; }
.fm-quiz-fb { font-size: 0.83rem; line-height: 1.5; border-radius: var(--radius-sm); padding: 8px 12px; }
.fm-fb-ok  { background: rgba(34,197,94,0.07);  color: #4ade80;  border: 1px solid rgba(34,197,94,0.15); }
.fm-fb-err { background: rgba(239,68,68,0.07);  color: #f87171;  border: 1px solid rgba(239,68,68,0.15); }

/* ── Botón de reanudar ── */
.fm-resume {
  width: 100%;
  padding: 14px 24px;
  border-radius: var(--radius-lg);
  border: none;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: white;
  font-family: 'Montserrat', sans-serif;
  font-size: 0.9rem;
  font-weight: 800;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.18s;
  box-shadow: 0 4px 16px rgba(99,102,241,0.35);
  letter-spacing: -0.01em;
}
.fm-resume:hover:not(:disabled) { opacity: 0.88; transform: translateY(-1px); }
.fm-resume:disabled { opacity: 0.35; cursor: not-allowed; }

/* ── Tarjeta de pausa (variante) ── */
.fm-brk-card { max-width: 560px; }

.fm-tips {
  list-style: none;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0;
  margin: 0;
}
.fm-tips li {
  padding: 10px 14px;
  background: rgba(255,255,255,0.025);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--radius-md);
  font-size: 0.86rem;
  color: rgba(255,255,255,0.65);
  line-height: 1.5;
}

.fm-dur-wrap { width: 100%; }
.fm-dur-label {
  font-family: 'Montserrat', sans-serif;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: rgba(255,255,255,0.3);
  display: block;
  margin-bottom: 10px;
}
.fm-dur-row {
  display: flex;
  align-items: center;
  gap: 14px;
}
.fm-range {
  flex: 1;
  -webkit-appearance: none;
  height: 4px;
  border-radius: 99px;
  background: rgba(255,255,255,0.08);
  outline: none;
  cursor: pointer;
}
.fm-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  box-shadow: 0 2px 6px rgba(99,102,241,0.5);
  cursor: pointer;
}
.fm-dur-val {
  font-family: 'Montserrat', sans-serif;
  font-size: 0.82rem;
  font-weight: 700;
  color: #a5b4fc;
  min-width: 38px;
  text-align: right;
}

.fm-brk-actions {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.fm-brk-start {
  width: 100%;
  padding: 14px 24px;
  border-radius: var(--radius-lg);
  border: none;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: white;
  font-family: 'Montserrat', sans-serif;
  font-size: 0.9rem;
  font-weight: 800;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.18s;
  box-shadow: 0 4px 16px rgba(99,102,241,0.35);
}
.fm-brk-start:hover { opacity: 0.88; transform: translateY(-1px); }
.fm-brk-skip {
  width: 100%;
  padding: 11px 24px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255,255,255,0.08);
  background: transparent;
  color: rgba(255,255,255,0.35);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.82rem;
  cursor: pointer;
  transition: all 0.18s;
}
.fm-brk-skip:hover { color: rgba(255,255,255,0.65); border-color: rgba(255,255,255,0.15); }

/* ── Banner de hito ── */
.fm-milestone {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9998;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: white;
  padding: 11px 28px;
  border-radius: var(--radius-full);
  font-family: 'Montserrat', sans-serif;
  font-size: 0.88rem;
  font-weight: 800;
  box-shadow: 0 6px 28px rgba(99,102,241,0.5);
  pointer-events: none;
  letter-spacing: -0.01em;
  white-space: nowrap;
  animation: fmMsIn 0.45s cubic-bezier(0.34,1.56,0.64,1) forwards;
}
.fm-ms-out {
  animation: fmMsOut 0.5s ease forwards !important;
}
@keyframes fmMsIn {
  from { opacity: 0; transform: translateX(-50%) translateY(-16px) scale(0.85); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0)     scale(1); }
}
@keyframes fmMsOut {
  from { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
  to   { opacity: 0; transform: translateX(-50%) translateY(-10px) scale(0.9); }
}

/* ── Resumen de sesión ── */
.fm-summary-card { max-width: 440px; }
.fm-summary-subj {
  font-size: 0.82rem;
  color: rgba(255,255,255,0.4);
  text-align: center;
  margin: -8px 0 0;
}
.fm-stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  width: 100%;
}
.fm-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 14px 10px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--radius-lg);
}
.fm-stat-val {
  font-family: 'Montserrat', sans-serif;
  font-size: 1.3rem;
  font-weight: 800;
  color: #a5b4fc;
  letter-spacing: -0.02em;
}
.fm-stat-lbl {
  font-size: 0.7rem;
  color: rgba(255,255,255,0.35);
  text-align: center;
  line-height: 1.4;
}

/* ── Onboarding ── */
.fm-ob-card { max-width: 420px; }
.fm-ob-dots {
  display: flex;
  align-items: center;
  gap: 8px;
}
.fm-ob-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255,255,255,0.18);
  transition: width 0.25s ease, background 0.25s ease, border-radius 0.25s ease;
}
.fm-ob-dot.active {
  width: 20px;
  border-radius: 99px;
  background: #a5b4fc;
}
.fm-ob-body { text-align: left; max-width: 340px; }
.fm-ob-body kbd {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 5px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  font-family: monospace;
  font-size: 0.82em;
  font-weight: 700;
  color: #a5b4fc;
}

/* ── Tiempo de ausencia (overlay penalización) ── */
.fm-away-time {
  font-size: 0.82rem;
  color: rgba(255,255,255,0.45);
  text-align: center;
  margin: -6px 0 0;
}
.fm-away-time strong { color: #f87171; }

/* ── Responsive ── */
@media (max-width: 640px) {
  .fm-card { padding: 24px 20px; }
  .fm-card-title { font-size: 1.1rem; }
  .fm-hud { bottom: 12px; right: 12px; font-size: 0.68rem; padding: 7px 12px; min-width: 160px; }
  .fm-milestone { font-size: 0.78rem; padding: 9px 20px; }
  .fm-stat-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
}

/* ═══════════════════════════════════════════════
   TABLET (≤1024px)
   ═══════════════════════════════════════════════ */
@media (max-width: 1024px) {
  .main-content { padding: 28px 24px; }
  .grid-3 { grid-template-columns: 1fr 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ═══════════════════════════════════════════════
   MOBILE (≤768px)
   ═══════════════════════════════════════════════ */
@media (max-width: 768px) {
  .sidebar {
    width: 280px;
    transform: translateX(-100%);
    transition: transform 0.3s var(--ease-out);
    z-index: 100;
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-overlay { display: block; }
  .sidebar-hamburger { display: flex; }
  .main-content {
    margin-left: 0;
    padding: 72px 16px 32px;
  }
  .grid-2,
  .grid-3 { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .chat-container { height: calc(100vh - 160px); }
  .page-header h1 { font-size: 1.45rem; }
  .card-p { padding: 20px; }
  .card-p-lg { padding: 24px; }
}

/* ═══════════════════════════════════════════════
   LIGHT MODE — PER-PAGE COMPONENT OVERRIDES
   ═══════════════════════════════════════════════ */

/* ── dashboard.html ── */
[data-theme="light"] .welcome-banner { border-bottom-color: rgba(0,0,0,0.09); }
[data-theme="light"] .wb-date { color: rgba(0,0,0,0.52); }
[data-theme="light"] .welcome-banner h1 { color: #0a0b10; }
[data-theme="light"] .welcome-banner p { color: rgba(0,0,0,0.60); }
[data-theme="light"] .ne-text p { color: rgba(0,0,0,0.55); }
[data-theme="light"] .ne-arrow { color: rgba(0,0,0,0.36); }
[data-theme="light"] .ps-card {
  background: rgba(255,255,255,0.88);
  border-color: rgba(0,0,0,0.09);
}
[data-theme="light"] .ps-card:hover {
  background: rgba(255,255,255,0.98);
  border-color: rgba(0,0,0,0.14);
}
[data-theme="light"] .ps-label { color: rgba(0,0,0,0.52); }
[data-theme="light"] .ps-sub   { color: rgba(0,0,0,0.52); }
[data-theme="light"] .section-head h2 { color: rgba(0,0,0,0.52); }
[data-theme="light"] .psi-label { color: rgba(0,0,0,0.55) !important; }
[data-theme="light"] .psi-value { color: rgba(0,0,0,0.88) !important; }
[data-theme="light"] .progress-strip {
  background: rgba(0,0,0,0.03);
  border-color: rgba(0,0,0,0.09);
}
[data-theme="light"] .psi-div { background: rgba(0,0,0,0.12) !important; }
[data-theme="light"] .exams-list-container {
  background: rgba(255,255,255,0.80);
  border-color: rgba(0,0,0,0.09);
}
[data-theme="light"] .exam-mini { border-bottom-color: rgba(0,0,0,0.07); }
[data-theme="light"] .exam-mini:hover { background: rgba(0,0,0,0.03); }
[data-theme="light"] .em-text h4 { color: rgba(0,0,0,0.88); }
[data-theme="light"] .em-text p  { color: rgba(0,0,0,0.56); }
[data-theme="light"] .em-prog    { background: rgba(0,0,0,0.10); }
[data-theme="light"] .qa-card {
  background: rgba(255,255,255,0.80);
  border-color: rgba(0,0,0,0.09);
}
[data-theme="light"] .qa-card:hover {
  background: rgba(255,255,255,0.98);
  border-color: rgba(0,0,0,0.12);
}
[data-theme="light"] .qa-card h4 { color: rgba(0,0,0,0.88); }
[data-theme="light"] .qa-card p  { color: rgba(0,0,0,0.56); }
[data-theme="light"] .agenda-compact-block {
  background: rgba(255,255,255,0.80);
  border-color: rgba(0,0,0,0.09);
}
[data-theme="light"] .exam-compact-row { border-bottom-color: rgba(0,0,0,0.07); }
[data-theme="light"] .exam-compact-row:hover { background: rgba(0,0,0,0.03); }
[data-theme="light"] .ecr-subject { color: rgba(0,0,0,0.80); }
[data-theme="light"] .ads-date { color: rgba(0,0,0,0.52); }
[data-theme="light"] .ads-line { background: rgba(0,0,0,0.10); }
[data-theme="light"] .ach-label { color: rgba(0,0,0,0.52); }
/* Coefficient modal */
[data-theme="light"] .coeff-modal {
  background: #f7f9ff;
  border-color: rgba(0,0,0,0.10);
}
[data-theme="light"] .coeff-modal-header h2 { color: #0a0b10; }
[data-theme="light"] .coeff-modal-header p  { color: rgba(0,0,0,0.54); }
[data-theme="light"] .coeff-close-btn {
  background: rgba(0,0,0,0.05);
  color: rgba(0,0,0,0.46);
}
[data-theme="light"] .coeff-close-btn:hover {
  background: rgba(0,0,0,0.09);
  color: rgba(0,0,0,0.82);
}
[data-theme="light"] .cf-block {
  background: rgba(0,0,0,0.04);
  border-color: rgba(0,0,0,0.09);
}
[data-theme="light"] .cf-block .cf-desc { color: rgba(0,0,0,0.50); }
[data-theme="light"] .cf-op { color: rgba(0,0,0,0.40); }
[data-theme="light"] .formula-label { color: rgba(0,0,0,0.44); }
[data-theme="light"] .coeff-desc { color: rgba(0,0,0,0.58); }
[data-theme="light"] .coeff-desc strong { color: rgba(0,0,0,0.80); }
[data-theme="light"] .coeff-override-section { border-top-color: rgba(0,0,0,0.08); }
[data-theme="light"] .override-label { color: rgba(0,0,0,0.44); }
[data-theme="light"] .coeff-slider-range { color: rgba(0,0,0,0.42); }
[data-theme="light"] .coeff-btn-reset {
  background: rgba(0,0,0,0.04);
  border-color: rgba(0,0,0,0.09);
  color: rgba(0,0,0,0.54);
}
[data-theme="light"] .coeff-btn-reset:hover {
  background: rgba(0,0,0,0.08);
  color: rgba(0,0,0,0.76);
}
/* coeff-real-box inline-styled labels */
[data-theme="light"] .cr-stat-label { color: rgba(0,0,0,0.48) !important; }
[data-theme="light"] .cr-stat-note  { color: rgba(0,0,0,0.54) !important; }

/* ── exams.html ── */
[data-theme="light"] .exams-hero { border-bottom-color: rgba(0,0,0,0.07); }
[data-theme="light"] .exams-hero .eyebrow { color: rgba(0,0,0,0.42); }
[data-theme="light"] .exams-hero h1 { color: #0a0b10; }
[data-theme="light"] .exams-hero p  { color: rgba(0,0,0,0.56); }
[data-theme="light"] .exam-card {
  background: rgba(255,255,255,0.88);
  border-color: rgba(0,0,0,0.08);
}
[data-theme="light"] .exam-card:hover {
  box-shadow: 0 20px 60px rgba(0,0,0,0.10);
  border-color: rgba(0,0,0,0.12);
}
[data-theme="light"] .ec-subject { color: #0a0b10; }
[data-theme="light"] .ec-tag-countdown-past {
  background: rgba(0,0,0,0.05);
  color: rgba(0,0,0,0.48);
  border-color: rgba(0,0,0,0.10);
}
[data-theme="light"] .ec-ls-label { color: rgba(0,0,0,0.40); }
[data-theme="light"] .ec-stat {
  background: rgba(0,0,0,0.03);
  border-color: rgba(0,0,0,0.07);
}
[data-theme="light"] .ec-stat-label { color: rgba(0,0,0,0.44); }
[data-theme="light"] .ec-stat-value { color: #0a0b10; }
[data-theme="light"] .ec-progress-label { color: rgba(0,0,0,0.42); }
[data-theme="light"] .ec-progress-track { background: rgba(0,0,0,0.09); }
[data-theme="light"] .ec-actions {
  border-top-color: rgba(0,0,0,0.07);
  background: rgba(0,0,0,0.02);
}
[data-theme="light"] .ec-btn-secondary {
  background: rgba(0,0,0,0.04);
  border-color: rgba(0,0,0,0.09);
  color: rgba(0,0,0,0.56);
}
[data-theme="light"] .ec-btn-secondary:hover {
  background: rgba(0,0,0,0.07);
  color: rgba(0,0,0,0.82);
  border-color: rgba(0,0,0,0.15);
}
[data-theme="light"] .ec-btn-delete {
  border-color: rgba(239,68,68,0.20);
  background: rgba(239,68,68,0.05);
  color: rgba(239,68,68,0.62);
}
[data-theme="light"] .empty-state {
  color: rgba(0,0,0,0.40);
  background: rgba(0,0,0,0.02);
  border-color: rgba(0,0,0,0.09);
}
[data-theme="light"] .empty-state h3 { color: rgba(0,0,0,0.50); }
/* Result + delete modals */
[data-theme="light"] .result-modal {
  background: #f7f9ff;
  border-color: rgba(99,102,241,0.20);
}
[data-theme="light"] .result-modal h3  { color: #0a0b10; }
[data-theme="light"] .result-field label { color: rgba(0,0,0,0.54); }
[data-theme="light"] .result-field input[type="number"] {
  background: white;
  border-color: rgba(0,0,0,0.14);
  color: #0a0b10;
}
[data-theme="light"] .result-field .field-hint { color: rgba(0,0,0,0.50); }
[data-theme="light"] .result-modal-cancel {
  background: rgba(0,0,0,0.04);
  border-color: rgba(0,0,0,0.09);
  color: rgba(0,0,0,0.54);
}
[data-theme="light"] .result-modal-cancel:hover {
  background: rgba(0,0,0,0.08);
  color: rgba(0,0,0,0.82);
}
[data-theme="light"] .delete-modal {
  background: #fff5f5;
  border-color: rgba(239,68,68,0.18);
}
[data-theme="light"] .delete-modal h3 { color: #0a0b10; }
[data-theme="light"] .delete-modal p  { color: rgba(0,0,0,0.56); }
[data-theme="light"] .delete-modal-cancel {
  background: rgba(0,0,0,0.04);
  border-color: rgba(0,0,0,0.09);
  color: rgba(0,0,0,0.54);
}
[data-theme="light"] .delete-modal-cancel:hover {
  background: rgba(0,0,0,0.08);
  color: rgba(0,0,0,0.82);
}
[data-theme="light"] .plan-modal {
  background: #f7f9ff;
  border-color: rgba(0,0,0,0.09);
}
[data-theme="light"] .plan-modal h2 { color: #0a0b10; }
[data-theme="light"] .plan-modal-close {
  background: rgba(0,0,0,0.04);
  border-color: rgba(0,0,0,0.09);
  color: rgba(0,0,0,0.46);
}
[data-theme="light"] .pm-header-meta { color: rgba(0,0,0,0.50); }
[data-theme="light"] .pm-overview {
  color: rgba(0,0,0,0.62);
  background: rgba(0,0,0,0.03);
}

/* ── study.html ── */
[data-theme="light"] .study-tab.active {
  background: rgba(255,255,255,0.92);
  color: var(--indigo-600);
}
[data-theme="light"] .summary-content h3 { color: #0a0b10; }
[data-theme="light"] .quiz-q-text { color: #0a0b10; }
[data-theme="light"] .fc-nav-btn {
  background: rgba(255,255,255,0.82);
  border-color: rgba(0,0,0,0.10);
  color: rgba(0,0,0,0.70);
}
[data-theme="light"] .fc-nav-btn:hover {
  background: white;
  border-color: var(--indigo-400);
}

/* ── upload.html ── */
[data-theme="light"] .drop-zone-v2 {
  background: rgba(255,255,255,0.72);
}
[data-theme="light"] .text-area-v2 {
  background: rgba(255,255,255,0.82);
  color: rgba(0,0,0,0.85);
  border-color: rgba(0,0,0,0.12);
}
[data-theme="light"] .public-row .pr-title { color: rgba(0,0,0,0.82) !important; }
[data-theme="light"] .public-row .pr-sub   { color: rgba(0,0,0,0.56) !important; }
[data-theme="light"] .public-row .pr-slider {
  background: rgba(0,0,0,0.15);
}

/* ── Catch-all: hardcoded white headings ── */
[data-theme="light"] .ne-text h3,
[data-theme="light"] .drop-zone-v2 h3,
[data-theme="light"] .method-card h3 { color: rgba(0,0,0,0.82); }

/* ═══════════════════════════════════════════════
   PAGE TRANSITIONS
   ═══════════════════════════════════════════════ */

/* Fallback (Firefox, Safari): class-based animations */
@keyframes pageEnter {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.page-enter { animation: pageEnter 0.2s ease both; }

@keyframes pageFadeOut {
  from { opacity: 1; }
  to   { opacity: 0; }
}
.page-exit { animation: pageFadeOut 0.15s ease forwards; pointer-events: none; }


/* ═══════════════════════════════════════════════
   QUIZ RESULT MODAL
   ═══════════════════════════════════════════════ */
.quiz-result-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(5, 6, 10, 0.88);
  backdrop-filter: blur(14px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: fadeIn 0.25s var(--ease-out);
}
.quiz-result-card {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius-2xl);
  padding: 40px 44px;
  max-width: 420px;
  width: 100%;
  text-align: center;
  box-shadow: 0 32px 100px rgba(0,0,0,0.7), inset 0 1px 0 rgba(255,255,255,0.06);
  animation: fmCardIn 0.45s cubic-bezier(0.34,1.56,0.64,1);
}
.qr-emoji { font-size: 3.5rem; margin-bottom: 10px; line-height: 1; }
.qr-score {
  font-family: 'Montserrat', sans-serif;
  font-size: 3rem;
  font-weight: 900;
  letter-spacing: -0.04em;
  line-height: 1;
  margin-bottom: 6px;
}
.qr-label {
  font-size: 0.85rem;
  color: rgba(255,255,255,0.42);
  margin-bottom: 20px;
}
.qr-comment {
  font-size: 0.93rem;
  line-height: 1.6;
  color: rgba(255,255,255,0.72);
  margin-bottom: 28px;
  padding: 12px 16px;
  background: rgba(255,255,255,0.03);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255,255,255,0.06);
}
.qr-actions { display: flex; gap: 10px; }
.qr-actions .btn { flex: 1; justify-content: center; }
[data-theme="light"] .quiz-result-card {
  background: #f7f9ff;
  border-color: rgba(0,0,0,0.10);
}
[data-theme="light"] .qr-label { color: rgba(0,0,0,0.44); }
[data-theme="light"] .qr-comment { background: rgba(0,0,0,0.03); border-color: rgba(0,0,0,0.08); color: rgba(0,0,0,0.65); }

/* ═══════════════════════════════════════════════
   INLINE QUIZ EXPLANATIONS
   ═══════════════════════════════════════════════ */
.quiz-expl {
  margin-top: 8px;
  padding: 9px 14px;
  border-radius: var(--radius-md);
  font-size: 0.82rem;
  line-height: 1.55;
  display: none;
  animation: fadeUp 0.3s var(--ease-out);
}
.quiz-expl.correct { background: rgba(34,197,94,0.07); border: 1px solid rgba(34,197,94,0.18); color: #4ade80; }
.quiz-expl.incorrect { background: rgba(239,68,68,0.07); border: 1px solid rgba(239,68,68,0.18); color: #f87171; }
[data-theme="light"] .quiz-expl.correct { background: rgba(34,197,94,0.08); color: #15803d; }
[data-theme="light"] .quiz-expl.incorrect { background: rgba(239,68,68,0.07); color: #dc2626; }

/* ═══════════════════════════════════════════════
   STREAK RESCUE BANNER
   ═══════════════════════════════════════════════ */
.streak-rescue-banner {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 8500;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 20px;
  background: linear-gradient(135deg, rgba(251,146,60,0.92), rgba(249,115,22,0.92));
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: var(--radius-full);
  box-shadow: 0 8px 32px rgba(249,115,22,0.35), 0 2px 8px rgba(0,0,0,0.3);
  backdrop-filter: blur(12px);
  font-family: 'Montserrat', sans-serif;
  font-size: 0.82rem;
  font-weight: 700;
  color: white;
  white-space: nowrap;
  animation: slideUpIn 0.4s cubic-bezier(0.34,1.56,0.64,1);
  max-width: calc(100vw - 48px);
}
@keyframes slideUpIn {
  from { opacity: 0; transform: translateX(-50%) translateY(20px) scale(0.95); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
}
.srb-icon { font-size: 1.3rem; flex-shrink: 0; }
.srb-text { flex: 1; min-width: 0; }
.srb-dismiss {
  background: rgba(255,255,255,0.2);
  border: none;
  border-radius: var(--radius-full);
  color: white;
  font-size: 0.75rem;
  padding: 4px 10px;
  cursor: pointer;
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
  flex-shrink: 0;
  transition: background 0.2s;
}
.srb-dismiss:hover { background: rgba(255,255,255,0.32); }
.srb-cta {
  background: rgba(255,255,255,0.22);
  border: none;
  border-radius: var(--radius-full);
  color: white;
  font-size: 0.75rem;
  padding: 4px 12px;
  cursor: pointer;
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
  flex-shrink: 0;
  text-decoration: none;
  transition: background 0.2s;
  display: inline-flex;
  align-items: center;
}
.srb-cta:hover { background: rgba(255,255,255,0.34); }
.srb-pause {
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: var(--radius-full);
  color: white;
  font-size: 0.72rem;
  padding: 4px 10px;
  cursor: pointer;
  font-family: 'Montserrat', sans-serif;
  font-weight: 600;
  flex-shrink: 0;
  transition: background 0.2s;
}
.srb-pause:hover { background: rgba(255,255,255,0.2); }

/* ═══════════════════════════════════════════════
   UI POLISH — hover/active states, scroll-snap, truncation
   (Issues #16, #23, #24, #25)
   ═══════════════════════════════════════════════ */

/* #16 Hover lift on form-style buttons that previously felt "dead" */
.method-btn,
.level-btn {
  transition: var(--transition), transform 0.15s ease, box-shadow 0.2s;
}
.method-btn:hover,
.level-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(99,102,241,0.12);
}
.method-btn:active,
.level-btn:active { transform: translateY(0); box-shadow: none; }

.method-btn.selected,
.level-btn.selected {
  box-shadow: 0 4px 14px rgba(99,102,241,0.25), 0 0 0 2px rgba(99,102,241,0.18);
}

/* #25 Tab scroll-snap for study-exam horizontal tabs (mobile) */
.study-tabs {
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  position: relative;
}
.study-tabs::-webkit-scrollbar { display: none; }
.study-tabs .study-tab {
  scroll-snap-align: start;
  flex-shrink: 0;
}

/* Fade gradient on the right edge to indicate "more tabs to scroll" */
.study-tabs-wrap {
  position: relative;
}
.study-tabs-wrap::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 32px;
  background: linear-gradient(90deg, transparent, rgba(8,11,20,0.85));
  pointer-events: none;
  opacity: 0.85;
}
@media (min-width: 1100px) {
  .study-tabs-wrap::after { display: none; }
}

/* #23 Block-name truncation for tabs / chips that come from AI */
.truncate-30 {
  max-width: 30ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* #24 Block breadcrumb above study panels */
.block-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  margin-bottom: 14px;
  background: rgba(255,255,255,0.025);
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: 10px;
  font-size: 0.78rem;
  color: rgba(255,255,255,0.5);
  font-family: 'Montserrat', sans-serif;
  font-weight: 600;
}
.block-breadcrumb-sep { color: rgba(255,255,255,0.18); }
.block-breadcrumb-current {
  color: rgba(165,180,252,0.95);
  max-width: 30ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.block-breadcrumb-tab { color: rgba(255,255,255,0.7); }

/* ═══════════════════════════════════════════════
   POMODORO TIMER WIDGET
   ═══════════════════════════════════════════════ */
.pomo-widget {
  position: fixed;
  bottom: 24px;
  left: 280px;
  z-index: 7000;
  background: rgba(10,11,16,0.92);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: var(--radius-xl);
  padding: 12px 16px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5), 0 2px 8px rgba(99,102,241,0.15);
  backdrop-filter: blur(16px);
  display: flex;
  align-items: center;
  gap: 12px;
  animation: fadeUp 0.35s var(--ease-out);
  min-width: 200px;
}
.pomo-icon { font-size: 1.15rem; flex-shrink: 0; }
.pomo-body { flex: 1; min-width: 0; }
.pomo-time {
  font-family: 'Montserrat', sans-serif;
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: white;
  line-height: 1;
}
.pomo-label {
  font-size: 0.68rem;
  color: rgba(255,255,255,0.38);
  margin-top: 1px;
  font-family: 'DM Sans', sans-serif;
}
.pomo-actions { display: flex; gap: 6px; flex-shrink: 0; }
.pomo-btn {
  width: 30px; height: 30px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.7);
  font-size: 0.75rem;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}
.pomo-btn:hover { background: rgba(255,255,255,0.12); color: white; border-color: rgba(255,255,255,0.2); }
.pomo-btn.pomo-btn-start { background: rgba(99,102,241,0.18); border-color: rgba(99,102,241,0.3); color: #a5b4fc; }
.pomo-btn.pomo-btn-start:hover { background: rgba(99,102,241,0.28); color: white; }
.pomo-btn.pomo-btn-active { background: rgba(34,197,94,0.15); border-color: rgba(34,197,94,0.3); color: #4ade80; }
.pomo-progress {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 3px;
  background: rgba(255,255,255,0.06);
  border-radius: 0 0 var(--radius-xl) var(--radius-xl);
  overflow: hidden;
}
.pomo-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #6366f1, #8b5cf6);
  border-radius: inherit;
  transition: width 1s linear;
}
.pomo-widget { position: relative; }
.pomo-widget.break-mode { border-color: rgba(34,197,94,0.25); }
.pomo-widget.break-mode .pomo-time { color: #4ade80; }
@media (max-width: 768px) {
  .pomo-widget { left: 16px; bottom: 70px; min-width: 180px; }
}
[data-theme="light"] .pomo-widget {
  background: rgba(255,255,255,0.96);
  border-color: rgba(0,0,0,0.10);
  box-shadow: 0 8px 32px rgba(0,0,0,0.12);
}
[data-theme="light"] .pomo-time { color: #0a0b10; }
[data-theme="light"] .pomo-label { color: rgba(0,0,0,0.42); }
[data-theme="light"] .pomo-btn { border-color: rgba(0,0,0,0.10); background: rgba(0,0,0,0.04); color: rgba(0,0,0,0.56); }
[data-theme="light"] .pomo-btn:hover { background: rgba(0,0,0,0.08); color: rgba(0,0,0,0.82); }

/* ═══════════════════════════════════════════════
   SOUND TOGGLE BUTTON (sidebar)
   ═══════════════════════════════════════════════ */
.btn-sound-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 12px;
  border: 1px solid rgba(255,255,255,0.07);
  background: rgba(255,255,255,0.03);
  border-radius: var(--radius-sm);
  font-size: 0.76rem;
  font-weight: 600;
  color: rgba(255,255,255,0.42);
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
  font-family: 'DM Sans', sans-serif;
  letter-spacing: 0.01em;
  margin-top: 6px;
}
.btn-sound-toggle:hover {
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.72);
  border-color: rgba(255,255,255,0.12);
}
.btn-sound-toggle.sound-on {
  border-color: rgba(34,197,94,0.25);
  background: rgba(34,197,94,0.06);
  color: #4ade80;
}
[data-theme="light"] .btn-sound-toggle {
  border-color: rgba(0,0,0,0.09);
  background: rgba(0,0,0,0.03);
  color: rgba(0,0,0,0.48);
}
[data-theme="light"] .btn-sound-toggle:hover {
  background: rgba(0,0,0,0.05);
  color: rgba(0,0,0,0.72);
  border-color: rgba(0,0,0,0.14);
}
[data-theme="light"] .btn-sound-toggle.sound-on {
  border-color: rgba(22,163,74,0.25);
  background: rgba(22,163,74,0.06);
  color: #15803d;
}

/* ═══════════════════════════════════════════════
   SKELETON LOADERS (AI content areas)
   ═══════════════════════════════════════════════ */
.skeleton-block {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 24px;
}
.skeleton-line {
  height: 14px;
  border-radius: var(--radius-sm);
}
.skeleton-line.w-full  { width: 100%; }
.skeleton-line.w-3-4   { width: 75%; }
.skeleton-line.w-1-2   { width: 50%; }
.skeleton-line.w-2-3   { width: 66%; }
.skeleton-line.tall    { height: 22px; }
.skeleton-line.short   { height: 10px; }

/* ═══════════════════════════════════════════════
   DRAFT SAVED INDICATOR (new-exam)
   ═══════════════════════════════════════════════ */
.draft-saved-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.72rem;
  font-weight: 600;
  color: rgba(34,197,94,0.8);
  font-family: 'DM Sans', sans-serif;
  animation: fadeIn 0.3s ease;
  transition: opacity 0.5s;
}
.draft-saved-pill::before {
  content: '●';
  font-size: 0.55rem;
}
.draft-discard-btn {
  background: transparent;
  border: 1px dashed rgba(239,68,68,0.3);
  color: rgba(248,113,113,0.85);
  border-radius: 8px;
  padding: 5px 10px;
  font-size: 0.72rem;
  font-family: 'DM Sans', sans-serif;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  margin-right: 8px;
}
.draft-discard-btn:hover {
  background: rgba(239,68,68,0.06);
  border-color: rgba(239,68,68,0.5);
}

/* #31 Empty-state examples */
.es-examples {
  margin-top: 28px;
  padding-top: 22px;
  border-top: 1px dashed rgba(255,255,255,0.08);
  width: 100%;
  max-width: 520px;
}
.es-examples-label {
  font-family: 'Montserrat', sans-serif;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,0.32);
  text-align: center;
  margin-bottom: 12px;
}
.es-examples-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}
.es-example-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: rgba(99,102,241,0.06);
  border: 1px solid rgba(99,102,241,0.18);
  border-radius: 99px;
  font-size: 0.78rem;
  color: rgba(165,180,252,0.85);
  font-family: 'DM Sans', sans-serif;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: var(--transition);
}
.es-example-chip:hover {
  background: rgba(99,102,241,0.12);
  border-color: rgba(99,102,241,0.35);
  transform: translateY(-1px);
}
.es-example-emoji { font-size: 0.95rem; }

/* #29 Command palette (Cmd+K) */
.cmdk-overlay {
  position: fixed; inset: 0;
  z-index: 100000;
  background: rgba(8, 11, 20, 0.55);
  backdrop-filter: blur(6px);
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding-top: 12vh;
  animation: fadeIn 0.12s ease;
}
.cmdk-modal {
  width: min(560px, 92vw);
  max-height: 70vh;
  background: rgba(15, 19, 36, 0.96);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  box-shadow: 0 24px 60px rgba(0,0,0,0.45);
  display: flex; flex-direction: column;
  overflow: hidden;
  animation: cmdk-pop 0.16s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes cmdk-pop {
  from { transform: translateY(-8px) scale(0.98); opacity: 0; }
  to   { transform: translateY(0) scale(1); opacity: 1; }
}
.cmdk-search-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.cmdk-search-icon { font-size: 1.05rem; opacity: 0.7; }
.cmdk-input {
  flex: 1;
  background: transparent;
  border: 0;
  outline: 0;
  color: white;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.95rem;
}
.cmdk-input::placeholder { color: rgba(255,255,255,0.3); }
.cmdk-hint {
  padding: 2px 8px;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 6px;
  font-size: 0.7rem;
  color: rgba(255,255,255,0.4);
  font-family: 'Montserrat', sans-serif;
  font-weight: 600;
}
.cmdk-list {
  flex: 1;
  overflow-y: auto;
  padding: 6px;
  scrollbar-width: thin;
}
.cmdk-list::-webkit-scrollbar { width: 6px; }
.cmdk-list::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 3px; }
.cmdk-empty {
  padding: 22px;
  text-align: center;
  color: rgba(255,255,255,0.35);
  font-size: 0.85rem;
}
.cmdk-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: transparent;
  border: 0;
  border-radius: 10px;
  color: rgba(255,255,255,0.85);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9rem;
  cursor: pointer;
  text-align: left;
  transition: background 0.1s;
}
.cmdk-item.cmdk-active,
.cmdk-item:hover {
  background: rgba(99, 102, 241, 0.16);
}
.cmdk-item-emoji { font-size: 1.05rem; flex-shrink: 0; }
.cmdk-item-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cmdk-item-kind {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.3);
  flex-shrink: 0;
  font-family: 'Montserrat', sans-serif;
}
.cmdk-footer {
  display: flex;
  gap: 18px;
  padding: 8px 18px;
  border-top: 1px solid rgba(255,255,255,0.06);
  font-size: 0.7rem;
  color: rgba(255,255,255,0.32);
  font-family: 'Montserrat', sans-serif;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* #19 Generate-plan progress UI */
.generate-progress {
  margin-top: 18px;
  padding: 16px 18px;
  background: rgba(99,102,241,0.04);
  border: 1px solid rgba(99,102,241,0.15);
  border-radius: 14px;
}
.generate-progress .gp-row {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 10px;
}
.generate-progress .gp-spinner {
  width: 18px; height: 18px;
  border: 2px solid rgba(99,102,241,0.2);
  border-top-color: var(--indigo-400);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  flex-shrink: 0;
}
.generate-progress .gp-text {
  font-family: 'Montserrat', sans-serif;
  font-size: 0.85rem; font-weight: 600;
  color: rgba(255,255,255,0.85);
}
.generate-progress .gp-bar {
  height: 4px;
  background: rgba(255,255,255,0.06);
  border-radius: 99px;
  overflow: hidden;
}
.generate-progress .gp-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--indigo-500), var(--blue-500));
  width: 5%;
  transition: width 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ═══════════════════════════════════════════════
   LIGHT MODE — BROAD INLINE-STYLE FIX
   Overrides remaining JS-generated white text colours
   inside app pages (scoped to .app-layout so the
   landing page dark sections are not affected).
   ═══════════════════════════════════════════════ */
[data-theme="light"] .app-layout [style*="color:rgba(255,255,255"] {
  color: rgba(0,0,0,0.52) !important;
}
/* Modals appended outside .app-layout also need fixing */
[data-theme="light"] .coeff-modal [style*="color:rgba(255,255,255"],
[data-theme="light"] .result-modal [style*="color:rgba(255,255,255"],
[data-theme="light"] .delete-modal [style*="color:rgba(255,255,255"],
[data-theme="light"] .plan-modal   [style*="color:rgba(255,255,255"] {
  color: rgba(0,0,0,0.52) !important;
}
/* Keep white text inside hero sections that have hardcoded dark backgrounds */
[data-theme="light"] .study-hero  [style*="color:rgba(255,255,255"],
[data-theme="light"] .upload-hero [style*="color:rgba(255,255,255"] {
  color: rgba(255,255,255,0.70) !important;
}

/* ========== Toast extra variants ========== */
.toast.error   { background: #b91c1c; }
.toast.warning { background: #b45309; }

/* ========== Streak badge (dashboard) ========== */
.wb-streak {
  display: inline-flex !important;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(249,115,22,0.18), rgba(239,68,68,0.18));
  border: 1px solid rgba(249,115,22,0.35);
  color: #fdba74;
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: -0.01em;
  white-space: nowrap;
}
.wb-streak.cold {
  background: linear-gradient(135deg, rgba(255,255,255,0.04), rgba(255,255,255,0.02));
  border-color: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.45);
}
[data-theme="light"] .wb-streak { color: #c2410c; }
[data-theme="light"] .wb-streak.cold { color: rgba(0,0,0,0.45); }

/* ========== Mastery badge ========== */
.mastery-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 999px;
  background: linear-gradient(135deg, #facc15, #f59e0b);
  color: #422006;
  font-weight: 800;
  font-size: 0.7rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  box-shadow: 0 2px 8px rgba(245,158,11,0.35);
}
.mastery-badge::before { content: '🏅'; font-size: 0.85rem; }

/* ========== Empty state ========== */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 64px 24px;
  margin: 24px auto;
  max-width: 420px;
}
.empty-state .es-emoji {
  font-size: 4rem;
  margin-bottom: 18px;
  filter: drop-shadow(0 6px 18px rgba(99,102,241,0.25));
  animation: esBob 3.2s ease-in-out infinite;
}
@keyframes esBob {
  0%,100% { transform: translateY(0); }
  50%     { transform: translateY(-6px); }
}
.empty-state h3 {
  font-size: 1.15rem;
  font-weight: 800;
  margin: 0 0 8px;
  color: rgba(255,255,255,0.92);
  letter-spacing: -0.02em;
}
.empty-state p {
  font-size: 0.9rem;
  color: rgba(255,255,255,0.5);
  line-height: 1.5;
  margin: 0 0 22px;
}
[data-theme="light"] .empty-state h3 { color: rgba(0,0,0,0.85); }
[data-theme="light"] .empty-state p  { color: rgba(0,0,0,0.55); }

/* ========== AI motivational nudge card ========== */
.nudge-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 20px;
  margin: 0 0 20px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(139,92,246,0.12), rgba(99,102,241,0.10));
  border: 1px solid rgba(139,92,246,0.22);
  position: relative;
  overflow: hidden;
}
.nudge-card::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(circle at top right, rgba(139,92,246,0.18), transparent 60%);
  pointer-events: none;
}
.nudge-card .nc-icon {
  font-size: 1.6rem;
  flex-shrink: 0;
  margin-top: 2px;
}
.nudge-card .nc-text {
  flex: 1;
  color: rgba(255,255,255,0.82);
  font-size: 0.92rem;
  line-height: 1.45;
  font-weight: 500;
  letter-spacing: -0.01em;
}
.nudge-card .nc-dismiss {
  background: none;
  border: 0;
  color: rgba(255,255,255,0.35);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
}
.nudge-card .nc-dismiss:hover { color: rgba(255,255,255,0.7); }
[data-theme="light"] .nudge-card { background: linear-gradient(135deg, rgba(139,92,246,0.08), rgba(99,102,241,0.06)); }
[data-theme="light"] .nudge-card .nc-text { color: rgba(0,0,0,0.78); }
[data-theme="light"] .nudge-card .nc-dismiss { color: rgba(0,0,0,0.35); }

/* ========== Pomodoro context line ========== */
.pomo-context {
  font-size: 0.68rem;
  color: rgba(255,255,255,0.45);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 140px;
}
[data-theme="light"] .pomo-context { color: rgba(0,0,0,0.5); }

/* ========== Quiz keyboard hint ========== */
.kbd-hint {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  margin-right: 8px;
  border-radius: 4px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  font-size: 0.7rem;
  font-weight: 700;
  color: rgba(255,255,255,0.5);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
[data-theme="light"] .kbd-hint {
  background: rgba(0,0,0,0.04);
  border-color: rgba(0,0,0,0.08);
  color: rgba(0,0,0,0.5);
}
