.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.17em;
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--accent-2);
  margin-bottom: 12px;
}

.btn {
  --btn-bg: var(--surface);
  --btn-fg: var(--ink);
  --btn-border: rgba(148, 163, 184, 0.45);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 999px;
  border: 1px solid var(--btn-border);
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-weight: 700;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease, background-color 0.22s ease;
}

.btn.primary {
  --btn-bg: linear-gradient(128deg, var(--accent-2), #1d4ed8 55%, var(--accent));
  --btn-fg: #f8fbff;
  --btn-border: rgba(29, 78, 216, 0.75);
  box-shadow: 0 16px 36px rgba(37, 99, 235, 0.3);
}

.btn.secondary {
  --btn-bg: linear-gradient(128deg, var(--accent), #0f766e);
  --btn-fg: #f5ffff;
  --btn-border: rgba(15, 118, 110, 0.7);
  box-shadow: 0 15px 34px rgba(14, 165, 164, 0.28);
}

.btn.ghost {
  --btn-bg: rgba(255, 255, 255, 0.7);
  --btn-fg: var(--accent-2);
  --btn-border: rgba(37, 99, 235, 0.35);
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 38px rgba(15, 23, 42, 0.18);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.nav-links a {
  position: relative;
  padding-bottom: 6px;
}

.nav-links a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent-2), var(--accent));
  transition: width 0.3s ease;
}

.nav-links a:hover::after,
.nav-links a.active::after {
  width: 100%;
}

.nav-links a.active {
  color: var(--ink);
  font-weight: 700;
}

.meta-label {
  display: block;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted-2);
  font-weight: 700;
}

.meta-value {
  display: inline-block;
  margin-top: 2px;
  font-weight: 700;
  color: var(--ink);
}

.hero-card {
  background: linear-gradient(155deg, rgba(255, 255, 255, 0.95), rgba(248, 250, 252, 0.9));
  padding: 24px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  border: 1px solid rgba(148, 163, 184, 0.35);
}

.hero-card.accent {
  background: linear-gradient(130deg, rgba(37, 99, 235, 0.14), rgba(14, 165, 164, 0.13), rgba(249, 115, 22, 0.14));
}

.hero-card ol {
  padding-left: 19px;
  color: var(--muted);
}

.card-title {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--muted-2);
  margin-bottom: 8px;
  font-weight: 700;
}

.pill {
  display: inline-flex;
  margin-top: 12px;
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid rgba(14, 165, 164, 0.28);
  background: rgba(14, 165, 164, 0.12);
  color: #0f766e;
  font-size: 0.74rem;
  font-weight: 700;
}

.feature-card,
.step-card {
  background: linear-gradient(150deg, #ffffff, #f8fbff);
  padding: 24px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(148, 163, 184, 0.35);
  box-shadow: var(--shadow-sm);
  display: grid;
  gap: 10px;
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.feature-card:hover,
.step-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.feature-card p,
.step-card p {
  color: var(--muted);
}

.step-index {
  display: inline-flex;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--accent-2), var(--accent));
  color: #fff;
  font-weight: 800;
  font-size: 1.05rem;
  font-family: "Sora", sans-serif;
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.28);
  flex-shrink: 0;
}

/* ─── Home quiz (index.html) ─────────────────────────────────────────────── */
body.home-page::after {
  display: none;
}

body.home-page::before {
  width: 340px;
  height: 340px;
  right: -140px;
  top: 100px;
}

.home-hero::before {
  width: 500px;
  height: 500px;
  right: -220px;
  top: -250px;
  background: radial-gradient(circle at 38% 36%, rgba(37, 99, 235, 0.24), rgba(37, 99, 235, 0));
  filter: blur(10px);
}

.home-hero-grid {
  align-items: stretch;
}

.home-kpi-row {
  margin-top: 24px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.home-kpi {
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.3);
  background: linear-gradient(150deg, rgba(255, 255, 255, 0.94), rgba(248, 250, 252, 0.9));
  padding: 12px 14px;
  display: grid;
  gap: 2px;
}

.home-kpi-value {
  font-size: 1.28rem;
  font-family: "Sora", sans-serif;
  font-weight: 700;
  color: var(--accent-2);
  line-height: 1.1;
}

.home-kpi-label {
  font-size: 0.84rem;
  color: var(--muted);
}

.home-launch {
  display: grid;
  gap: 14px;
  align-content: start;
  max-width: 430px;
  justify-self: end;
}

.home-launch-main,
.home-launch-mini {
  border-radius: var(--radius-lg);
  border: 1px solid rgba(148, 163, 184, 0.34);
  box-shadow: var(--shadow-md);
  background: linear-gradient(150deg, rgba(255, 255, 255, 0.96), rgba(248, 250, 252, 0.91));
  padding: 22px;
  display: grid;
  gap: 12px;
}

.home-launch-main {
  background: linear-gradient(145deg, rgba(37, 99, 235, 0.13), rgba(14, 165, 164, 0.1), rgba(255, 255, 255, 0.96) 68%);
  position: relative;
  overflow: hidden;
}

.home-launch-main::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent-2), var(--accent));
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.home-launch-main .btn,
.home-launch-mini .btn {
  width: fit-content;
}

.home-launch-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.home-launch-mini ol {
  padding-left: 18px;
  color: var(--muted);
}

.quiz-mode-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.quiz-mode-card {
  border-radius: var(--radius-lg);
  border: 1px solid rgba(148, 163, 184, 0.34);
  background: linear-gradient(150deg, rgba(255, 255, 255, 0.96), rgba(248, 250, 252, 0.9));
  box-shadow: var(--shadow-sm);
  padding: 22px;
  display: grid;
  gap: 10px;
  position: relative;
  overflow: hidden;
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.quiz-mode-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.quiz-mode-card:nth-child(1)::before {
  background: linear-gradient(90deg, var(--accent-2), #818cf8);
}

.quiz-mode-card:nth-child(2)::before {
  background: linear-gradient(90deg, var(--accent), #059669);
}

.quiz-mode-card:nth-child(3)::before {
  background: linear-gradient(90deg, #7c3aed, #c026d3);
}

.quiz-mode-card:nth-child(4)::before {
  background: linear-gradient(90deg, var(--accent-3), #f59e0b);
}

.quiz-mode-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.quiz-mode-card p,
.quiz-mode-card ul {
  color: var(--muted);
}

.quiz-mode-card ul {
  padding-left: 18px;
}

.home-scoreboard {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.home-scoreboard-card {
  border-radius: var(--radius-lg);
  border: 1px solid rgba(148, 163, 184, 0.34);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(248, 250, 252, 0.9));
  box-shadow: var(--shadow-sm);
  padding: 22px;
  display: grid;
  gap: 10px;
}

.home-score-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: rgba(248, 250, 252, 0.8);
  padding: 9px 12px;
}

.home-score-row span {
  color: var(--accent-2);
  font-weight: 700;
}

.home-challenge-list {
  padding-left: 18px;
  color: var(--muted);
  display: grid;
  gap: 6px;
}

@media (max-width: 980px) {
  .home-launch {
    justify-self: start;
    max-width: 100%;
  }

  .home-kpi-row {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  }
}

@media (max-width: 640px) {
  .home-kpi-row {
    grid-template-columns: 1fr;
  }

  .home-launch-main,
  .home-launch-mini,
  .home-scoreboard-card {
    padding: 18px;
  }
}

.filter-label {
  display: block;
  font-weight: 700;
  margin-bottom: 10px;
  color: var(--ink);
}

.chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.chip-section-label {
  width: 100%;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 4px;
  padding-left: 2px;
}
.chip-section-label:first-of-type { margin-top: 0; }

.chip-subsection-label {
  flex-basis: 100%;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.chip {
  padding: 9px 14px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.5);
  background: rgba(255, 255, 255, 0.78);
  color: var(--ink);
  font-weight: 700;
  cursor: pointer;
  transition: all 0.22s ease;
}

.chip:hover {
  border-color: rgba(37, 99, 235, 0.55);
  transform: translateY(-1px);
}

.chip.active {
  background: linear-gradient(120deg, var(--accent-2), var(--accent));
  color: #eff8ff;
  border-color: transparent;
  box-shadow: 0 12px 26px rgba(37, 99, 235, 0.26);
}

.objective-card {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(248, 250, 252, 0.95));
  padding: 22px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(148, 163, 184, 0.34);
  box-shadow: var(--shadow-sm);
  display: grid;
  gap: 13px;
}

.objective-card ul {
  padding-left: 18px;
  color: var(--muted);
}

.badges {
  display: flex;
  gap: 9px;
  flex-wrap: wrap;
}

.badge {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  background: rgba(37, 99, 235, 0.14);
  color: #1d4ed8;
  border: 1px solid rgba(37, 99, 235, 0.22);
}

.badge.alt {
  background: rgba(14, 165, 164, 0.12);
  color: #0f766e;
  border: 1px solid rgba(14, 165, 164, 0.24);
}

/* ─── Explorer redesign ──────────────────────────────────────────────────── */
.explorer-shell {
  display: grid;
  grid-template-columns: minmax(260px, 320px) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.explorer-sidebar {
  position: sticky;
  top: 16px;
  display: grid;
  gap: 12px;
  padding: 16px;
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.34);
  background: linear-gradient(150deg, rgba(255, 255, 255, 0.94), rgba(241, 245, 249, 0.9));
}

.explorer-sidebar .eyebrow {
  margin-bottom: 2px;
}

.explorer-sidebar h2 {
  font-size: 1.18rem;
  line-height: 1.2;
}

.filter-stack {
  display: grid;
  gap: 10px;
}

.filter-stack .filter-block {
  display: grid;
  gap: 8px;
}

.filter-stack .filter-label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted-2);
  margin: 0;
}

.filter-stack .chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-height: 170px;
  overflow: auto;
  padding-right: 2px;
}

.filter-stack .chip {
  font-size: 0.88rem;
  font-weight: 700;
  padding: 7px 11px;
}

.explorer-count {
  margin-top: 2px;
  padding-top: 10px;
  border-top: 1px solid rgba(148, 163, 184, 0.28);
  font-size: 0.86rem;
}

.explorer-results {
  min-width: 0;
}

.explorer-grid {
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}

.explorer .objective-card {
  padding: 16px;
  gap: 10px;
  align-content: start;
  grid-auto-rows: min-content;
  border: 1px solid rgba(148, 163, 184, 0.3);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.94));
}

.explorer .objective-card h3 {
  margin: 0;
  font-size: clamp(1.04rem, 1.6vw, 1.28rem);
  line-height: 1.25;
}

.explorer .badges {
  gap: 6px;
}

.explorer .badge {
  font-size: 0.68rem;
  padding: 3px 8px;
}

.objective-summary {
  color: var(--muted);
  margin: 0;
}

.objective-preview {
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: rgba(248, 250, 252, 0.86);
  padding: 10px 11px;
}

.objective-preview-title {
  margin: 0 0 6px;
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted-2);
  font-weight: 700;
}

.objective-preview-steps {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
}

.objective-more {
  margin: 6px 0 0;
  font-size: 0.82rem;
  color: var(--accent-2);
  font-weight: 700;
}

.objective-details {
  border-top: 1px dashed rgba(148, 163, 184, 0.34);
  padding-top: 8px;
}

.objective-details summary {
  cursor: pointer;
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--accent-2);
  list-style: none;
}

.objective-details summary::-webkit-details-marker {
  display: none;
}

.objective-details summary::before {
  content: "▸";
  margin-right: 6px;
  color: var(--accent);
}

.objective-details[open] summary::before {
  content: "▾";
}

.objective-steps {
  padding-left: 18px;
  color: var(--muted);
  margin: 10px 0 4px;
}

.objective-example {
  margin: 4px 0 0;
}

@media (max-width: 980px) {
  .explorer-shell {
    grid-template-columns: 1fr;
  }

  .explorer-sidebar {
    position: static;
  }

  .filter-stack .chip-group {
    max-height: none;
    overflow: visible;
  }
}

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

.secure-note {
  display: inline-flex;
  margin-top: 12px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(249, 115, 22, 0.12);
  border: 1px solid rgba(249, 115, 22, 0.34);
  color: #c2410c;
  font-size: 0.84rem;
  font-weight: 700;
}

.deck-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 22px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(148, 163, 184, 0.36);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.9), rgba(241, 245, 249, 0.9));
  box-shadow: var(--shadow-sm);
}

.deck-summary h3 {
  font-size: 1.28rem;
}

.deck-summary .muted {
  margin-top: 6px;
}

.study-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.58);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 999;
  backdrop-filter: blur(3px);
}

.study-overlay.is-open {
  display: flex;
}

.study-panel {
  width: min(980px, 100%);
  background: linear-gradient(155deg, rgba(255, 255, 255, 0.97), rgba(248, 250, 252, 0.95));
  border-radius: var(--radius-xl);
  border: 1px solid rgba(148, 163, 184, 0.4);
  box-shadow: var(--shadow-lg);
  padding: 28px;
  display: grid;
  gap: 24px;
  max-height: calc(100vh - 56px);
  overflow-y: auto;
}

.study-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.study-card {
  width: 100%;
  min-height: 320px;
}

.study-face {
  gap: 14px;
}

.study-card h3 {
  font-size: 1.64rem;
  line-height: 1.2;
}

.study-card p {
  font-size: 1rem;
}

.study-face ol {
  padding-left: 19px;
  color: var(--muted);
}

.study-face ol .step-table-item {
  list-style: none;
  margin-left: -19px;
  margin-top: 8px;
}

.study-controls {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.study-controls .btn {
  min-width: 144px;
}

.study-controls .btn.is-known {
  background: rgba(14, 165, 164, 0.14);
  border-color: rgba(14, 165, 164, 0.4);
  color: #0f766e;
}

.flashcard {
  position: relative;
  border: none;
  background: transparent;
  padding: 0;
  cursor: pointer;
  perspective: 1200px;
  width: 100%;
  min-height: 300px;
}

.flashcard-inner {
  position: relative;
  width: 100%;
  height: 100%;
  display: block;
  transform-style: preserve-3d;
  transition: transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

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

.flashcard-face {
  position: absolute;
  inset: 0;
  padding: 24px;
  border-radius: var(--radius-lg);
  backface-visibility: hidden;
  background: #fff;
  border: 1px solid rgba(148, 163, 184, 0.35);
  box-shadow: var(--shadow-sm);
  display: grid;
  gap: 12px;
  align-content: start;
  grid-auto-rows: min-content;
  overflow-wrap: break-word;
}

.flashcard-face h3 {
  font-size: 1.12rem;
  line-height: 1.24;
}

.flashcard-face p {
  font-size: 0.96rem;
}

.flashcard-face.front {
  background: linear-gradient(148deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.95));
}

.flashcard-face.back {
  background: linear-gradient(138deg, rgba(37, 99, 235, 0.12), rgba(14, 165, 164, 0.12), rgba(249, 115, 22, 0.11));
  transform: rotateY(180deg);
}

.flashcard ol {
  padding-left: 18px;
  color: var(--muted);
}

.plan-card {
  background: linear-gradient(152deg, #ffffff, #f8fbff);
  border-radius: var(--radius-lg);
  padding: 28px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  box-shadow: var(--shadow-sm);
  display: grid;
  gap: 14px;
}

.plan-card.highlight {
  background: linear-gradient(145deg, rgba(37, 99, 235, 0.14), rgba(14, 165, 164, 0.11), #ffffff 66%);
}

.plan-card.is-selected {
  border-color: rgba(14, 165, 164, 0.48);
  box-shadow: 0 24px 46px rgba(14, 165, 164, 0.2);
}

.price {
  font-size: 1.9rem;
  color: var(--ink);
  font-weight: 800;
}

.plan-card ul {
  padding-left: 18px;
  color: var(--muted);
}

.lead-form {
  display: grid;
  gap: 16px;
  margin-top: 28px;
}

.lead-form label {
  display: block;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--ink);
}

.lead-form input {
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(148, 163, 184, 0.5);
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
}

.auth-panel {
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
}

.auth-role-switch {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
}

.auth-form {
  display: grid;
  gap: 16px;
}

.auth-form label {
  display: block;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--ink);
}

.auth-form input,
.auth-form textarea,
.auth-form select {
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(148, 163, 184, 0.5);
  background: rgba(255, 255, 255, 0.94);
  color: var(--ink);
  font-family: inherit;
}

.auth-form textarea {
  min-height: 100px;
  resize: vertical;
}

.auth-form input:focus,
.auth-form textarea:focus,
.auth-form select:focus,
.lead-form input:focus {
  border-color: rgba(37, 99, 235, 0.56);
  outline: none;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14);
}

.blank-card {
  padding: 22px;
  border-radius: var(--radius-lg);
  border: 1px dashed rgba(100, 116, 139, 0.45);
  background: linear-gradient(150deg, rgba(255, 255, 255, 0.86), rgba(241, 245, 249, 0.78));
  display: grid;
  gap: 12px;
}

.blank-title {
  font-weight: 700;
}

.blank-lines span {
  display: block;
  height: 2px;
  background: rgba(71, 85, 105, 0.28);
  margin-bottom: 10px;
}

.blank-cta {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 18px;
}

@media (max-width: 760px) {
  .deck-summary {
    flex-direction: column;
    align-items: flex-start;
  }

  .study-panel {
    padding: 20px;
  }

  .study-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .study-card-inner {
    min-height: 300px;
  }
}

@media (max-width: 600px) {
  .flashcard-face {
    padding: 20px;
  }
}

/* ─── Rich text content (renderContent) ──────────────────────────────────── */
.content-table {
  border-collapse: collapse;
  width: 100%;
  margin: 8px 0;
  font-size: 0.9rem;
}
.content-table th,
.content-table td {
  border: 1px solid rgba(148, 163, 184, 0.4);
  padding: 6px 10px;
  text-align: left;
}
.content-table th {
  background: rgba(241, 245, 249, 0.9);
  font-weight: 700;
  font-size: 0.82rem;
}
.content-table tr:nth-child(even) td {
  background: rgba(248, 250, 252, 0.6);
}
.content-list {
  margin: 6px 0;
  padding-left: 20px;
  display: grid;
  gap: 4px;
}
.content-list li {
  color: var(--muted-2);
  font-size: 0.95rem;
}
.content-img {
  max-width: 100%;
  max-height: 200px;
  border-radius: 6px;
  margin: 4px 0;
  display: block;
}
.math-fallback {
  font-family: serif;
  font-style: italic;
  color: #1d4ed8;
}

/* ─── Intro du prof ──────────────────────────────────────────────────────── */
.intro-prof-banner {
  display: flex;
  justify-content: flex-start;
  padding: 12px 0;
}
.intro-prof-btn {
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.08), rgba(37, 99, 235, 0.08));
  border-color: rgba(124, 58, 237, 0.35);
  color: #7c3aed;
  font-weight: 700;
}
.intro-prof-btn:hover {
  background: rgba(124, 58, 237, 0.12);
  border-color: rgba(124, 58, 237, 0.55);
}

/* Modal intro du prof */
.intro-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 8000;
}
.intro-modal[hidden] { display: none !important; }
.intro-modal-inner {
  background: white;
  border-radius: var(--radius-lg);
  padding: 0;
  max-width: 600px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
}
.intro-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 28px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.25);
  position: sticky;
  top: 0;
  background: white;
  z-index: 1;
}
.intro-modal-header h3 { margin: 0; }
.intro-modal-content {
  padding: 24px 28px;
  font-size: 1rem;
  line-height: 1.7;
  white-space: pre-wrap;
}

/* ─── Prérequis alert ─────────────────────────────────────────────────────── */
.prereq-alert {
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.4);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.prereq-alert p { margin: 0; flex: 1; font-weight: 600; color: #92400e; }
.prereq-btns {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.prereq-return-btn { font-size: 0.88rem; }

/* ─── Badge SF ────────────────────────────────────────────────────────────── */
.badge.sf {
  background: rgba(37, 99, 235, 0.12);
  color: #1d4ed8;
  border-color: rgba(37, 99, 235, 0.22);
}
.prereq-notice {
  font-size: 0.85rem;
  color: #92400e;
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-radius: 4px;
  padding: 4px 10px;
  margin: 4px 0 8px;
}
.chip.has-intro::after {
  content: "•";
  color: #7c3aed;
  margin-left: 4px;
  font-weight: 900;
}

/* ─── Section livre (index.html) ──────────────────────────────────────────── */
.book-section { background: linear-gradient(135deg, rgba(124, 58, 237, 0.04), rgba(37, 99, 235, 0.04)); }
.book-inner {
  display: grid;
  grid-template-columns: 1fr 200px;
  gap: 40px;
  align-items: center;
  max-width: 860px;
  margin: 0 auto;
}
@media (max-width: 640px) {
  .book-inner { grid-template-columns: 1fr; }
  .book-cover { display: none; }
}
.book-text { }
.book-text .lead { font-weight: 600; margin-bottom: 12px; }
.book-link { margin-top: 16px; border-color: rgba(124, 58, 237, 0.4); color: #7c3aed; }
.book-link:hover { background: rgba(124, 58, 237, 0.06); }

.book-cover-placeholder {
  background: linear-gradient(135deg, #1d4ed8, #7c3aed);
  border-radius: 8px;
  padding: 24px 16px;
  text-align: center;
  color: white;
  height: 260px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: 4px 8px 24px rgba(0,0,0,0.2);
}
.book-cover-title { font-size: 1rem; font-weight: 700; line-height: 1.3; margin: 0 0 12px; }
.book-cover-sub { font-size: 0.8rem; opacity: 0.8; margin: 0; }

/* ─── sfAutoLabel dans admin ─────────────────────────────────────────────── */
#sfAutoLabel { color: #0f766e; font-weight: 700; }

/* ─── Study card flip (stable) ───────────────────────────────────────────── */
.study-card {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
  min-height: 320px;
  position: relative;
}
.study-card-inner {
  position: relative;
  width: 100%;
  min-height: 320px;
  background: #ffffff;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(148, 163, 184, 0.34);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.study-face {
  position: absolute;
  inset: 0;
  padding: clamp(24px, 3vw, 34px);
  display: grid !important;
  gap: 14px;
  align-content: start;
  border-radius: var(--radius-lg);
  overflow: auto;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0s linear 0.2s;
}
.study-face.front {
  background: linear-gradient(148deg, #ffffff, #f8fbff);
}
.study-face.back {
  background: linear-gradient(138deg, rgba(37,99,235,0.07), rgba(14,165,164,0.07), #ffffff 60%);
}
.study-card[data-side="front"] .study-face.front,
.study-card[data-side="back"] .study-face.back {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  transition-delay: 0s;
}
.study-card[data-side="front"] .study-face.back,
.study-card[data-side="back"] .study-face.front {
  opacity: 0;
  visibility: hidden;
}

/* ─── Barre de progression session ──────────────────────────────────────── */
.study-progress-track {
  height: 5px;
  background: rgba(148, 163, 184, 0.22);
  border-radius: 999px;
  overflow: hidden;
}
.study-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-2), var(--accent));
  border-radius: 999px;
  transition: width 0.4s cubic-bezier(0.22, 1, 0.36, 1);
  width: 0%;
}

/* ─── Raccourcis clavier hint ────────────────────────────────────────────── */
.kbd-hint {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
  justify-content: center;
  font-size: 0.78rem;
  color: var(--muted);
}
.kbd-hint span { display: flex; align-items: center; gap: 5px; }
kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 22px;
  padding: 0 6px;
  background: rgba(241, 245, 249, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.5);
  border-bottom-width: 2px;
  border-radius: 5px;
  font-size: 0.73rem;
  font-family: inherit;
  font-weight: 700;
  color: var(--muted-2);
}

/* ─── Session récap ──────────────────────────────────────────────────────── */
.session-recap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  padding: 32px 24px;
  text-align: center;
  animation: fadeSlideUp 0.4s ease;
}
@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}
.session-recap-icon { font-size: 3.2rem; line-height: 1; }
.session-recap h3 { font-size: 1.7rem; }
.recap-stats {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  justify-content: center;
}
.recap-stat {
  background: rgba(248, 250, 252, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: var(--radius-md);
  padding: 16px 24px;
  min-width: 110px;
}
.recap-stat-value {
  display: block;
  font-size: 2rem;
  font-weight: 800;
  color: var(--accent-2);
  font-family: "Sora", sans-serif;
}
.recap-stat-label {
  display: block;
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  font-weight: 700;
  margin-top: 4px;
}
.session-recap-actions { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }

/* ─── Skeleton loaders ───────────────────────────────────────────────────── */
@keyframes shimmer {
  0%   { background-position: -600px 0; }
  100% { background-position: 600px 0; }
}
.skeleton {
  background: linear-gradient(90deg, #f0f4f8 25%, #e2e8f0 50%, #f0f4f8 75%);
  background-size: 600px 100%;
  animation: shimmer 1.4s infinite linear;
  border-radius: 8px;
}
.skeleton-card {
  background: rgba(255,255,255,0.9);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(148,163,184,0.25);
  padding: 22px;
  display: grid;
  gap: 12px;
}
.skeleton-line { height: 14px; }
.skeleton-line.short { width: 40%; }
.skeleton-line.medium { width: 70%; }
.skeleton-line.full { width: 100%; }
.skeleton-title { height: 22px; width: 60%; }
.skeleton-badge { height: 20px; width: 60px; border-radius: 999px; }

/* ─── Empty states ───────────────────────────────────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 48px 24px;
  text-align: center;
  color: var(--muted);
  grid-column: 1 / -1;
}
.empty-state-icon { font-size: 2.8rem; opacity: 0.5; }
.empty-state h4 { color: var(--muted-2); }
.empty-state p { font-size: 0.9rem; max-width: 30ch; }

/* ─── Toast notifications ────────────────────────────────────────────────── */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 99999;
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-radius: var(--radius-md);
  background: rgba(15, 23, 42, 0.92);
  color: #f8fafc;
  font-size: 0.9rem;
  font-weight: 600;
  box-shadow: 0 8px 32px rgba(15,23,42,0.22);
  pointer-events: all;
  animation: toastIn 0.3s cubic-bezier(0.22, 1, 0.36, 1);
  max-width: 340px;
  backdrop-filter: blur(8px);
}
.toast.is-out { animation: toastOut 0.3s ease forwards; }
@keyframes toastIn {
  from { opacity: 0; transform: translateY(12px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes toastOut {
  from { opacity: 1; transform: translateY(0); }
  to   { opacity: 0; transform: translateY(8px); }
}
.toast.success { background: rgba(15, 118, 110, 0.95); }
.toast.error   { background: rgba(185, 28, 28, 0.95); }
.toast.info    { background: rgba(37, 99, 235, 0.95); }
.toast-icon { font-size: 1.1rem; flex-shrink: 0; }

/* ─── Dashboard élève (index.html) ───────────────────────────────────────── */
.dashboard-section {
  display: grid;
  gap: 18px;
}
.dashboard-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}
.dash-card {
  background: linear-gradient(145deg, rgba(255,255,255,0.95), rgba(248,250,252,0.9));
  border: 1px solid rgba(148,163,184,0.32);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  box-shadow: var(--shadow-sm);
  display: grid;
  gap: 8px;
}
.dash-card-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.13em;
  color: var(--muted-2);
  font-weight: 700;
}
.dash-card-value {
  font-size: 2.2rem;
  font-weight: 800;
  font-family: "Sora", sans-serif;
  color: var(--accent-2);
  line-height: 1;
}
.dash-card-sub { font-size: 0.84rem; color: var(--muted); }
.dash-progress-bar {
  height: 6px;
  background: rgba(148,163,184,0.2);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 6px;
}
.dash-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-2), var(--accent));
  border-radius: 999px;
  transition: width 0.6s ease;
}
.dash-quick-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.dash-welcome {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--ink);
}
.dash-welcome span { color: var(--accent-2); }

/* ─── Quiz eleve ───────────────────────────────────────────────────────────── */
.quiz-shell { display: grid; gap: 22px; }
.quiz-controls {
  display: grid;
  gap: 10px;
  padding: 18px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(148, 163, 184, 0.32);
  background: rgba(255, 255, 255, 0.82);
}
.quiz-control-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.quiz-control-row label {
  font-size: 0.84rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted-2);
  font-weight: 700;
}
.quiz-control-row select {
  min-width: 90px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(148, 163, 184, 0.5);
  background: white;
  padding: 10px 12px;
  color: var(--ink);
  font-family: inherit;
}
.quiz-form { display: grid; gap: 14px; }
.quiz-questions { display: grid; gap: 14px; }
.quiz-question-card {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: var(--radius-md);
  padding: 18px;
  display: grid;
  gap: 10px;
}
.quiz-question-meta {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--muted);
  font-weight: 700;
}
.quiz-question-text { color: var(--ink); font-weight: 600; }
.quiz-answer-label {
  font-size: 0.78rem;
  color: var(--muted-2);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.quiz-question-card textarea {
  width: 100%;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(148, 163, 184, 0.45);
  background: white;
  padding: 12px;
  resize: vertical;
  font-family: inherit;
  color: var(--ink);
}
.quiz-question-card textarea:focus {
  outline: none;
  border-color: rgba(37, 99, 235, 0.55);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.16);
}
/* ─── Quiz mode tabs ──────────────────────────────────────────────────────── */
.quiz-mode-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.btn.quiz-mode-tab {
  font-size: 0.88rem;
  padding: 9px 16px;
  border-radius: 999px;
}
.btn.quiz-mode-tab.is-active {
  background: linear-gradient(128deg, var(--accent-2), #1d4ed8);
  color: #fff;
  border-color: rgba(29, 78, 216, 0.7);
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.28);
}
.quiz-mode-panel { display: grid; gap: 10px; }

/* ─── Quiz une question à la fois ────────────────────────────────────────── */
.quiz-single-question { display: grid; gap: 12px; }
.quiz-single-result { display: grid; gap: 12px; }
.quiz-single-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.quiz-generate-btn { justify-self: start; }

/* ─── Attempt actions ─────────────────────────────────────────────────────── */
.attempt-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.attempt-actions .btn {
  font-size: 0.84rem;
  padding: 7px 14px;
}

.quiz-submit-wrap { display: flex; justify-content: flex-end; }
.quiz-results { display: grid; gap: 14px; }
.quiz-summary {
  border-radius: var(--radius-md);
  padding: 18px;
  border: 1px solid rgba(148, 163, 184, 0.3);
  background: rgba(255, 255, 255, 0.9);
}
.quiz-summary.is-pass {
  border-color: rgba(15, 118, 110, 0.3);
  background: linear-gradient(155deg, rgba(15, 118, 110, 0.08), rgba(255, 255, 255, 0.95));
}
.quiz-summary.is-fail {
  border-color: rgba(220, 38, 38, 0.3);
  background: linear-gradient(155deg, rgba(220, 38, 38, 0.08), rgba(255, 255, 255, 0.95));
}
.quiz-summary-score {
  font-size: 2rem;
  font-weight: 800;
  color: var(--accent-2);
  line-height: 1;
  margin: 6px 0;
}
.quiz-result-list { display: grid; gap: 12px; }
.quiz-result-card {
  border-radius: var(--radius-md);
  border: 1px solid rgba(148, 163, 184, 0.3);
  background: rgba(255, 255, 255, 0.9);
  padding: 16px;
  display: grid;
  gap: 8px;
}
.quiz-result-card.is-pass { border-left: 4px solid #0f766e; }
.quiz-result-card.is-fail { border-left: 4px solid #b91c1c; }
.ai-feedback {
  line-height: 1.55;
}
.quiz-result-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-radius: var(--radius-sm);
  padding: 10px 14px;
}
.quiz-result-head.is-pass {
  background: linear-gradient(155deg, rgba(15, 118, 110, 0.1), rgba(255, 255, 255, 0.9));
  border: 1px solid rgba(15, 118, 110, 0.25);
}
.quiz-result-head.is-fail {
  background: linear-gradient(155deg, rgba(220, 38, 38, 0.08), rgba(255, 255, 255, 0.9));
  border: 1px solid rgba(220, 38, 38, 0.22);
}
.quiz-score-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent-2);
  border: 1px solid rgba(37, 99, 235, 0.32);
  background: rgba(37, 99, 235, 0.08);
}
.quiz-attempts { display: grid; gap: 12px; }
.quiz-attempt-card {
  border-radius: var(--radius-md);
  border: 1px solid rgba(148, 163, 184, 0.3);
  background: rgba(255, 255, 255, 0.9);
  padding: 16px;
  display: grid;
  gap: 8px;
}
.quiz-attempt-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.quiz-attempt-detail {
  display: grid;
  gap: 8px;
  margin-top: 2px;
}
.attempt-answer {
  border-radius: var(--radius-sm);
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: rgba(248, 250, 252, 0.9);
  padding: 10px 12px;
  display: grid;
  gap: 4px;
}

/* ─── Suivi eleves ─────────────────────────────────────────────────────────── */
.tracking-student-list {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}
.tracking-student-card {
  border-radius: var(--radius-md);
  border: 1px solid rgba(148, 163, 184, 0.32);
  background: rgba(255, 255, 255, 0.9);
  padding: 16px;
  display: grid;
  gap: 8px;
}
.tracking-student-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.tracking-detail {
  display: grid;
  gap: 14px;
}
.tracking-columns {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}
.tracking-block {
  border-radius: var(--radius-md);
  border: 1px solid rgba(148, 163, 184, 0.3);
  background: rgba(255, 255, 255, 0.9);
  padding: 14px;
  display: grid;
  gap: 8px;
}
.tracking-row {
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(248, 250, 252, 0.9);
  padding: 10px 12px;
  display: grid;
  gap: 2px;
}
.tracking-row span {
  font-size: 0.85rem;
  color: var(--muted);
}
.tracking-row.is-known {
  border-left: 4px solid #0f766e;
}
.tracking-row.is-unknown {
  border-left: 4px solid #b45309;
}

/* ─── Mobile improvements ────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .study-controls { gap: 8px; }
  .study-controls .btn { min-width: 0; padding: 10px 14px; font-size: 0.88rem; flex: 1; }
  .kbd-hint { display: none; }
  .recap-stats { gap: 12px; }
  .recap-stat { padding: 12px 16px; min-width: 90px; }
  .recap-stat-value { font-size: 1.6rem; }
  #toast-container { bottom: 16px; right: 16px; left: 16px; }
  .toast { max-width: 100%; }
  .nav-links { font-size: 0.9rem; gap: 10px; }
  .dash-card-value { font-size: 1.8rem; }
}
@media (max-width: 480px) {
  .study-panel { max-height: 95vh; overflow-y: auto; }
  .filter-panel { gap: 16px; }
  .chip { padding: 7px 11px; font-size: 0.88rem; }
  main { padding-bottom: 60px; }
}

/* ─── Bouton Exemple ─────────────────────────────────────────────────────── */
.btn.exemple-btn {
  background: linear-gradient(128deg, rgba(234, 88, 12, 0.12), rgba(234, 88, 12, 0.08));
  border-color: rgba(234, 88, 12, 0.4);
  color: #ea580c;
}
.btn.exemple-btn:hover {
  background: rgba(234, 88, 12, 0.16);
  border-color: rgba(234, 88, 12, 0.6);
  box-shadow: 0 10px 24px rgba(234, 88, 12, 0.2);
}

/* ─── Bouton Astuce du prof ──────────────────────────────────────────────── */
.btn.tip-btn {
  background: linear-gradient(128deg, rgba(124, 58, 237, 0.12), rgba(124, 58, 237, 0.08));
  border-color: rgba(124, 58, 237, 0.4);
  color: #7c3aed;
}
.btn.tip-btn:hover {
  background: rgba(124, 58, 237, 0.16);
  border-color: rgba(124, 58, 237, 0.6);
  box-shadow: 0 10px 24px rgba(124, 58, 237, 0.2);
}

/* ─── Bouton Carte mentale ───────────────────────────────────────────────── */
.btn.mind-map-btn {
  background: linear-gradient(128deg, rgba(14, 165, 164, 0.12), rgba(14, 165, 164, 0.08));
  border-color: rgba(14, 165, 164, 0.4);
  color: #0f766e;
}
.btn.mind-map-btn:hover {
  background: rgba(14, 165, 164, 0.16);
  border-color: rgba(14, 165, 164, 0.6);
  box-shadow: 0 10px 24px rgba(14, 165, 164, 0.18);
}
.btn.mind-map-btn.is-locked {
  opacity: 0.55;
  cursor: not-allowed;
  filter: grayscale(0.4);
}
.btn.mind-map-btn.is-locked:hover {
  transform: none;
  box-shadow: none;
}

/* ─── Feature modals (Astuce + Carte mentale) ────────────────────────────── */
.feature-modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.58);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 8500;
  padding: 24px;
  backdrop-filter: blur(4px);
  animation: fadeIn 0.2s ease;
}
.feature-modal[hidden] { display: none !important; }
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.feature-modal-inner {
  background: white;
  border-radius: var(--radius-lg);
  max-width: 560px;
  width: 100%;
  max-height: 82vh;
  overflow-y: auto;
  box-shadow: 0 24px 64px rgba(15, 23, 42, 0.28);
  animation: slideUp 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}
.feature-modal-inner--wide {
  max-width: 820px;
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.feature-modal-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 24px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.22);
  position: sticky;
  top: 0;
  background: white;
  z-index: 1;
}
.feature-modal-icon { font-size: 1.4rem; flex-shrink: 0; }
.feature-modal-header h3 { margin: 0; flex: 1; font-size: 1.1rem; }
.feature-modal-content {
  padding: 22px 24px;
  font-size: 1rem;
  line-height: 1.72;
}
.feature-modal-content--img {
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.mind-map-img {
  max-width: 100%;
  max-height: 65vh;
  border-radius: var(--radius-md);
  object-fit: contain;
}

/* ─── Anecdote scientifique du jour ────────────────────────────────────────── */
.anecdote-section { padding-top: 0; }
.anecdote-card {
  border-radius: var(--radius-lg);
  border: 1px solid rgba(124, 58, 237, 0.2);
  border-left: 4px solid #7c3aed;
  background: linear-gradient(140deg, rgba(124, 58, 237, 0.07), rgba(255, 255, 255, 0.94));
  padding: 28px 36px;
  max-width: 760px;
  margin: 0 auto;
  box-shadow: 0 8px 28px rgba(124, 58, 237, 0.1);
  position: relative;
}

.anecdote-card::after {
  content: "\201C";
  position: absolute;
  top: 14px;
  right: 24px;
  font-size: 4rem;
  font-family: "Sora", serif;
  font-weight: 800;
  color: rgba(124, 58, 237, 0.13);
  line-height: 1;
  pointer-events: none;
}

.anecdote-text {
  font-size: 1.05rem;
  line-height: 1.75;
  color: var(--ink);
  margin: 10px 0 8px;
  font-weight: 500;
}
.anecdote-source {
  font-size: 0.8rem;
  color: #7c3aed;
  font-style: italic;
  opacity: 0.75;
}

/* Admin label-hint */
.label-hint {
  display: block;
  font-size: 0.78rem;
  color: var(--muted-2);
  margin-top: 3px;
}

/* ─── Page Matiere ───────────────────────────────────────────────────────── */
.matiere-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 24px;
  max-width: 960px;
  margin: 0 auto;
  padding: 0 24px 48px;
}

.matiere-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  padding: 32px 28px;
  background: rgba(255, 255, 255, 0.82);
  border: 1.5px solid rgba(148, 163, 184, 0.35);
  border-radius: var(--radius-lg);
  text-decoration: none;
  color: var(--ink);
  transition: all 0.22s ease;
  box-shadow: var(--shadow-sm);
}
.matiere-card:hover {
  border-color: rgba(37, 99, 235, 0.45);
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}
.matiere-card--soon {
  opacity: 0.55;
  pointer-events: none;
}
.matiere-card-icon {
  font-size: 2.4rem;
  line-height: 1;
}
.matiere-card h2 {
  font-size: 1.25rem;
  font-weight: 800;
  margin: 0;
}
.matiere-card p {
  font-size: 0.92rem;
  color: var(--muted);
  margin: 0;
}
.matiere-card-btn {
  margin-top: auto;
}
.matiere-card-badge {
  margin-top: auto;
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.2);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* ─── Mode Création — cartes élève ───────────────────────────────────────── */
.study-header-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.btn.create-card-btn {
  font-size: 0.85rem;
}

.create-card-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.create-card-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.create-card-field label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--ink);
}

.create-card-field input,
.create-card-field textarea {
  padding: 9px 12px;
  border: 1.5px solid rgba(148, 163, 184, 0.5);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.9rem;
  resize: vertical;
  background: #fff;
  color: var(--ink);
}

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

.create-card-status {
  font-size: 0.82rem;
  color: var(--accent);
  min-height: 18px;
}

.create-card-empty {
  font-size: 0.88rem;
  color: var(--muted);
  margin-top: 8px;
}

.create-card-list-title {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
  margin: 20px 0 8px;
}

.my-cards-list {
  margin-top: 4px;
}

.my-card-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(148, 163, 184, 0.3);
  background: rgba(255,255,255,0.7);
  margin-bottom: 6px;
}

.my-card-title {
  font-size: 0.9rem;
  font-weight: 600;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.my-card-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.my-card-actions .btn {
  font-size: 0.78rem;
  padding: 4px 10px;
}
