@charset "UTF-8";

/* deploy-marker: v20260806c */
/* Si cette barre cyan apparait en haut de page, le CSS est bien charge */
html {
  border-top: 6px solid #22d3ee !important;
}

/* ==========================================================================
   autoMATHismes - Feuille de style globale (mobile-first, dark mode)
   ========================================================================== */

:root {
  /* Surfaces */
  --bg-0: #0b1220;
  --bg-1: #111a2e;
  --bg-2: #18233b;
  --bg-3: #1f2d4a;
  --border: rgba(148, 163, 184, 0.18);
  --border-strong: rgba(148, 163, 184, 0.35);

  /* Texte */
  --text: #e8eef9;
  --text-muted: #9aa8c2;
  --text-dim: #6b7a96;

  /* Accents */
  --cyan: #22d3ee;
  --cyan-dim: rgba(34, 211, 238, 0.15);
  --emerald: #34d399;
  --emerald-dim: rgba(52, 211, 153, 0.15);
  --amber: #fbbf24;
  --danger: #f87171;

  /* Kora (vert pelouse / or) */
  --kora-green: #1a8f3c;
  --kora-green-deep: #0d5c24;
  --kora-gold: #e8c547;
  --kora-gold-bright: #ffe082;

  /* Typo & layout */
  --font: "Outfit", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
  --max: 1080px;
  --header-h: 64px;

  /* Motion */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--font);
  color: var(--text);
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(34, 211, 238, 0.12), transparent 55%),
    radial-gradient(900px 500px at 100% 0%, rgba(52, 211, 153, 0.1), transparent 50%),
    var(--bg-0);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

img,
canvas {
  max-width: 100%;
  display: block;
}

a {
  color: var(--cyan);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--cyan);
  color: #042f2e;
  padding: 0.6rem 1rem;
  z-index: 1000;
}

.skip-link:focus {
  left: 0.5rem;
  top: 0.5rem;
}

.container {
  width: min(100% - 2rem, var(--max));
  margin-inline: auto;
}

/* --------------------------------------------------------------------------
   Header / Footer
   -------------------------------------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(14px);
  background: rgba(11, 18, 32, 0.82);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: var(--header-h);
  gap: 1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: inherit;
  text-decoration: none;
}

.brand:hover {
  text-decoration: none;
}

.brand-mark {
  width: 2.7rem;
  height: 2.4rem;
  padding: 0.28rem 0.35rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--cyan), var(--emerald));
  color: #042f2e;
  flex-shrink: 0;
  box-sizing: border-box;
}

.brand-mark-svg {
  display: block;
  width: 100%;
  height: auto;
  max-height: 1.55rem;
  overflow: visible;
}

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

.brand-text strong {
  font-size: 1.05rem;
  letter-spacing: -0.02em;
}

.brand-text small {
  color: var(--text-muted);
  font-size: 0.75rem;
}

.nav-main {
  display: flex;
  gap: 0.85rem;
  align-items: center;
}

.nav-main a {
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.92rem;
  text-decoration: none;
}

.nav-main a:hover {
  color: var(--text);
}

.nav-kora {
  padding: 0.45rem 1.05rem;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--kora-green), var(--kora-green-deep));
  color: #fff !important;
  border: 1px solid rgba(232, 197, 71, 0.45);
  white-space: nowrap;
  font-size: 0.9rem;
  letter-spacing: 0.01em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  box-sizing: border-box;
}

.nav-kora-mark {
  display: none;
  width: 2.7rem;
  height: 2.4rem;
  padding: 0.28rem 0.35rem;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--kora-green), var(--kora-green-deep));
  border: 1px solid rgba(232, 197, 71, 0.45);
  color: #ffe082;
  flex-shrink: 0;
  box-sizing: border-box;
  line-height: 0;
}

.nav-kora-mark-svg {
  display: block;
  width: 100%;
  height: auto;
  max-height: 1.55rem;
  overflow: visible;
  color: inherit;
}

.nav-kora-long {
  display: inline;
}

@media (max-width: 640px) {
  /* Sur mobile : meme forme de bouton que le monogramme autoMATHismes */
  .nav-kora {
    padding: 0;
    border: none;
    background: transparent;
    min-width: 0;
    min-height: 0;
  }

  .nav-kora-mark {
    display: inline-flex;
  }

  .nav-kora-long {
    display: none;
  }
}

.site-footer {
  margin-top: 4rem;
  padding: 2rem 0;
  border-top: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 0.9rem;
}

.site-footer.compact {
  margin-top: 2rem;
  padding: 1.25rem 0;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  justify-content: space-between;
}

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0.7rem 1.25rem;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.15s var(--ease), background 0.2s, border-color 0.2s, opacity 0.2s;
}

.btn:hover {
  text-decoration: none;
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn-primary {
  background: linear-gradient(135deg, var(--cyan), #06b6d4);
  color: #042f2e;
  box-shadow: 0 8px 24px rgba(34, 211, 238, 0.25);
}

.btn-secondary {
  background: var(--emerald-dim);
  color: var(--emerald);
  border-color: rgba(52, 211, 153, 0.35);
}

.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border-strong);
}

.btn-tiny {
  padding: 0.35rem 0.75rem;
  font-size: 0.8rem;
  font-weight: 600;
  background: var(--bg-3);
  color: var(--text-muted);
  border-color: var(--border);
}

.btn-xl {
  padding: 0.95rem 1.5rem;
  font-size: 1.05rem;
}

.btn-block {
  width: 100%;
}

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

/* --------------------------------------------------------------------------
   Home - Hero
   -------------------------------------------------------------------------- */

.hero {
  padding: 2.75rem 0 1.75rem;
}

.hero-centered {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 1.15rem;
  max-width: 40rem;
  margin-inline: auto;
}

.hero-title {
  margin: 0;
  font-size: clamp(2.05rem, 5.5vw, 3.35rem);
  line-height: 1.08;
  letter-spacing: -0.03em;
  font-weight: 800;
  background: linear-gradient(
    115deg,
    #67e8f9 0%,
    var(--cyan) 28%,
    #6ee7b7 55%,
    var(--emerald) 78%,
    #22d3ee 100%
  );
  background-size: 180% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  animation: heroShine 8s ease-in-out infinite alternate;
}

@keyframes heroShine {
  from {
    background-position: 0% 50%;
  }
  to {
    background-position: 100% 50%;
  }
}

.accent {
  background: linear-gradient(120deg, var(--cyan), var(--emerald));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-centered .lead {
  margin: 0;
  color: var(--text-muted);
  font-size: clamp(1.05rem, 2.4vw, 1.2rem);
  font-weight: 600;
  max-width: none;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 0.35rem;
}

.hero-card {
  position: relative;
  width: 28rem;
  height: 15rem;
  max-width: calc(100vw - 2rem);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  gap: 0.45rem;
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 4px);
  padding: 0.9rem 1.15rem 0.85rem;
  text-align: center;
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: opacity 0.35s var(--ease), transform 0.35s var(--ease);
  box-sizing: border-box;
}

.hero-card.is-switching {
  opacity: 0;
  transform: translateY(8px) scale(0.98);
}

.pulse-ring {
  position: absolute;
  inset: -20%;
  background: radial-gradient(circle at 50% 30%, rgba(34, 211, 238, 0.12), transparent 55%);
  pointer-events: none;
}

.hero-card-head {
  position: relative;
  z-index: 1;
  text-align: left;
  align-self: stretch;
  flex: 0 0 auto;
}

.hero-card-title {
  margin: 0;
  color: var(--text-dim);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.hero-card-meta {
  margin: 0.2rem 0 0;
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.35;
}

.hero-card-body {
  position: relative;
  z-index: 1;
  width: 100%;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  overflow: hidden;
}

.hero-card--media .hero-card-body {
  flex-direction: row;
  flex-wrap: nowrap;
  justify-content: center;
  align-items: center;
  gap: 0.75rem 1rem;
}

.hero-card-media {
  position: relative;
  z-index: 1;
  flex: 0 1 42%;
  width: auto;
  max-width: 10.5rem;
  max-height: 100%;
  margin: 0;
  line-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.hero-card-media.is-hidden {
  display: none;
}

.hero-card-media svg {
  width: 100%;
  height: auto;
  max-height: 8.25rem;
  display: block;
  border-radius: var(--radius-sm);
  background: transparent;
}

.hero-card-formula {
  position: relative;
  z-index: 1;
  margin: 0;
  padding: 0 0.2rem;
  font-size: clamp(0.95rem, 2.2vw, 1.35rem);
  font-family: var(--font-mono);
  color: var(--text);
  min-width: 0;
  min-height: 0;
  max-width: 100%;
  max-height: 100%;
  overflow: hidden;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.25rem 0.4rem;
  line-height: 1.3;
}

.hero-card--media .hero-card-formula {
  flex: 1 1 0;
  font-size: clamp(0.9rem, 2vw, 1.2rem);
}

.hero-card-formula:empty {
  display: none;
}

.hero-card-formula .katex {
  white-space: normal;
  font-size: 0.92em;
  max-width: 100%;
}

.hero-card-timer {
  position: relative;
  z-index: 1;
  flex: 0 0 auto;
  margin: 0;
  font-family: var(--font-mono);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--cyan);
}

/* Legacy grid (unused on home, kept for safety) */
.hero-grid {
  display: grid;
  gap: 2rem;
  align-items: center;
}

.eyebrow {
  display: none;
}

/* --------------------------------------------------------------------------
   Kora banner (conserve pour d'eventuelles pages, non utilise en home)
   -------------------------------------------------------------------------- */

.kora-banner {
  padding: 0.5rem 0 2rem;
}

.kora-card {
  display: grid;
  gap: 1rem;
  padding: 1.35rem 1.4rem;
  border-radius: var(--radius);
  text-decoration: none;
  color: #fff;
  background:
    linear-gradient(135deg, rgba(232, 197, 71, 0.18), transparent 40%),
    linear-gradient(145deg, var(--kora-green), var(--kora-green-deep) 70%);
  border: 1px solid rgba(232, 197, 71, 0.55);
  box-shadow:
    0 0 0 1px rgba(26, 143, 60, 0.4),
    0 16px 40px rgba(13, 92, 36, 0.45);
  position: relative;
  overflow: hidden;
  transition: transform 0.2s var(--ease), box-shadow 0.2s;
}

.kora-card::after {
  content: "";
  position: absolute;
  right: -40px;
  top: -40px;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(232, 197, 71, 0.35), transparent 70%);
  pointer-events: none;
}

.kora-card:hover {
  transform: translateY(-3px) scale(1.01);
  text-decoration: none;
  box-shadow:
    0 0 0 1px rgba(232, 197, 71, 0.7),
    0 20px 48px rgba(13, 92, 36, 0.55);
}

.kora-badge {
  position: absolute;
  top: 0.85rem;
  right: 0.85rem;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  background: var(--kora-gold);
  color: #1a2e12;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  z-index: 1;
}

.kora-content {
  display: flex;
  gap: 1rem;
  align-items: center;
  z-index: 1;
}

.kora-icon {
  font-size: 2.2rem;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.25));
}

.kora-content h2 {
  margin: 0 0 0.25rem;
  font-size: clamp(1.15rem, 3vw, 1.45rem);
  color: var(--kora-gold-bright);
}

.kora-content p {
  margin: 0;
  color: rgba(255, 255, 255, 0.88);
  font-size: 0.95rem;
  max-width: 42ch;
}

.kora-cta {
  z-index: 1;
  font-weight: 800;
  color: var(--kora-gold-bright);
  font-size: 0.95rem;
}

@media (min-width: 700px) {
  .kora-card {
    grid-template-columns: 1fr auto;
    align-items: center;
  }
}

/* --------------------------------------------------------------------------
   Levels grid
   -------------------------------------------------------------------------- */

.section {
  padding: 2rem 0 3rem;
}

.section-head {
  margin-bottom: 1.5rem;
}

.section-head h2 {
  margin: 0 0 0.35rem;
  font-size: clamp(1.5rem, 3vw, 2rem);
  letter-spacing: -0.02em;
}

.section-head p {
  margin: 0;
  color: var(--text-muted);
}

.levels-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.85rem;
}

@media (min-width: 640px) {
  .levels-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.level-btn {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 1.1rem 1rem;
  border-radius: var(--radius);
  background: var(--bg-1);
  border: 1px solid var(--border);
  color: inherit;
  text-decoration: none;
  min-height: 7.5rem;
  transition: border-color 0.2s, transform 0.15s var(--ease), background 0.2s;
}

.level-btn:hover {
  text-decoration: none;
}

.level-btn.is-active {
  border-color: rgba(34, 211, 238, 0.55);
  background: linear-gradient(160deg, rgba(34, 211, 238, 0.12), var(--bg-1));
  box-shadow: 0 8px 28px rgba(34, 211, 238, 0.12);
}

.level-btn.is-active:hover {
  transform: translateY(-2px);
  border-color: var(--cyan);
}

.level-btn.is-disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

.level-cycle {
  font-size: 0.75rem;
  color: var(--text-dim);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.level-name {
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.level-status {
  margin-top: auto;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
}

.level-btn.is-active .level-status {
  color: var(--emerald);
}

/* --------------------------------------------------------------------------
   Page niveau - config & quiz
   -------------------------------------------------------------------------- */

.app-shell {
  padding: 1.5rem 0 2rem;
  max-width: 720px;
}

.screen {
  display: none;
  animation: fadeUp 0.35s var(--ease);
}

.screen.is-visible,
.screen:not([hidden]).is-visible {
  display: block;
}

.screen[hidden] {
  display: none !important;
}

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

.screen-head h1 {
  margin: 0 0 0.35rem;
  font-size: clamp(1.6rem, 4vw, 2rem);
  letter-spacing: -0.02em;
}

.screen-head p {
  margin: 0 0 1.5rem;
  color: var(--text-muted);
}

.config-panel {
  display: grid;
  gap: 1.25rem;
}

.config-block {
  margin: 0;
  padding: 1.15rem 1.1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-1);
}

.config-block legend {
  padding: 0 0.35rem;
  font-weight: 800;
  font-size: 0.95rem;
  color: var(--cyan);
}

.chapters-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.85rem;
}

.chapters-grid {
  display: grid;
  gap: 0.55rem;
}

@media (min-width: 560px) {
  .chapters-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.chapter-item {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.75rem 0.8rem;
  border-radius: var(--radius-sm);
  background: var(--bg-2);
  border: 1px solid transparent;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.chapter-item:has(input:checked) {
  border-color: rgba(34, 211, 238, 0.45);
  background: var(--cyan-dim);
}

.chapter-item input {
  margin-top: 0.2rem;
  accent-color: var(--cyan);
  width: 1.1rem;
  height: 1.1rem;
}

.chapter-item span {
  font-weight: 600;
  font-size: 0.92rem;
}

/* Segmented controls & chips */

.segmented {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.4rem;
}

.time-mode {
  grid-template-columns: 1fr 1fr 1fr;
  margin-bottom: 1rem;
}

@media (max-width: 520px) {
  .time-mode {
    grid-template-columns: 1fr;
  }
}

.segment,
.chip {
  position: relative;
  cursor: pointer;
}

.segment input,
.chip input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.segment span,
.chip span {
  display: grid;
  place-items: center;
  text-align: center;
  padding: 0.65rem 0.4rem;
  border-radius: var(--radius-sm);
  background: var(--bg-2);
  border: 1px solid var(--border);
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--text-muted);
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}

.segment input:checked + span,
.chip input:checked + span {
  background: var(--cyan-dim);
  border-color: rgba(34, 211, 238, 0.5);
  color: var(--cyan);
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.chip span {
  padding: 0.55rem 0.9rem;
  min-width: 4rem;
}

.field-label {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
}

.hint {
  margin: 0.75rem 0 0;
  font-size: 0.82rem;
  color: var(--text-dim);
}

.time-mode-notice {
  margin: 0;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-2);
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.time-mode-notice strong {
  color: var(--text);
  font-weight: 700;
}

.time-custom {
  margin-top: 0.75rem;
}

.time-custom input[type="number"] {
  width: 100%;
  max-width: 12rem;
  box-sizing: border-box;
  padding: 0.65rem 0.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--bg-2);
  color: var(--text);
  font: inherit;
  font-family: var(--font-mono);
}

.time-custom input[type="number"]:focus {
  outline: 2px solid rgba(34, 211, 238, 0.45);
  outline-offset: 1px;
}

.time-options.is-hidden,
.is-hidden {
  display: none !important;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--cyan);
}

.range-value {
  margin: 0.4rem 0 0;
  font-family: var(--font-mono);
  color: var(--emerald);
  font-weight: 700;
}

.form-error {
  margin: 0;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  background: rgba(248, 113, 113, 0.12);
  border: 1px solid rgba(248, 113, 113, 0.4);
  color: var(--danger);
  font-weight: 600;
}

/* --------------------------------------------------------------------------
   Quiz UI
   -------------------------------------------------------------------------- */

.quiz-top {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.quiz-progress {
  margin: 0;
  font-weight: 800;
  font-size: 1rem;
}

.quiz-meta {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 600;
}

.timer-wrap {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.75rem;
  align-items: center;
  margin-bottom: 1.5rem;
}

.timer-bar {
  height: 10px;
  border-radius: 999px;
  background: var(--bg-3);
  overflow: hidden;
}

.timer-bar-fill {
  height: 100%;
  width: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--emerald), var(--cyan));
  transform-origin: left center;
  transition: background 0.2s;
}

.timer-bar-fill.is-urgent {
  background: linear-gradient(90deg, var(--amber), var(--danger));
}

.timer-digits {
  margin: 0;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--cyan);
  min-width: 3.2rem;
  text-align: right;
}

.quiz-advance-wrap {
  margin: 1rem 0 0;
  display: flex;
  justify-content: center;
}

.quiz-advance-wrap.is-hidden {
  display: none !important;
}

.quiz-stage {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem 1.25rem;
  min-height: 220px;
  display: grid;
  place-items: center;
  gap: 1rem;
  box-shadow: var(--shadow);
}

.q-latex {
  font-size: clamp(1.4rem, 5vw, 2.15rem);
  text-align: center;
  line-height: 1.4;
  word-break: break-word;
}

.q-latex .katex {
  font-size: 1.05em;
}

.q-media {
  width: min(100%, 340px);
}

.q-media img,
.q-media canvas,
.q-media .q-figure {
  width: 100%;
  border-radius: var(--radius-sm);
  background: transparent;
  border: 1px solid var(--border);
}

.q-media img,
.q-media canvas {
  background: var(--bg-2);
}

.q-media .q-figure {
  overflow: hidden;
  line-height: 0;
}

.q-media .q-figure svg {
  display: block;
  width: 100%;
  height: auto;
}

.q-media .q-figure.is-hidden {
  display: none;
}

.q-media canvas:not(.is-drawn),
.q-media img:not([src]),
.q-media img[src=""] {
  display: none;
}

.correction-panel {
  margin-top: 1.25rem;
  padding: 1.15rem;
  border-radius: var(--radius);
  background: var(--emerald-dim);
  border: 1px solid rgba(52, 211, 153, 0.4);
  text-align: center;
  animation: fadeUp 0.3s var(--ease);
}

.correction-label {
  margin: 0 0 0.35rem;
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--emerald);
}

.correction-latex {
  font-size: clamp(1.25rem, 4vw, 1.75rem);
  margin-bottom: 0.85rem;
}

/* Summary */

.summary-card {
  text-align: center;
  padding: 2rem 1.25rem;
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.summary-emoji {
  margin: 0;
  font-size: 2.5rem;
}

.summary-card h1 {
  margin: 0.5rem 0 1rem;
  font-size: clamp(1.4rem, 4vw, 1.85rem);
  letter-spacing: -0.02em;
}

.summary-stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem 1.25rem;
  margin: 0 0 1.75rem;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.summary-stats strong {
  color: var(--cyan);
  font-family: var(--font-mono);
}

.summary-actions {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.summary-corrections {
  text-align: left;
  margin: 0 0 1.75rem;
  padding-top: 0.25rem;
  border-top: 1px solid var(--border);
}

.summary-corrections-title {
  margin: 1.25rem 0 0.85rem;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
  text-align: center;
}

.summary-corrections-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.summary-correction-item {
  padding: 0.9rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.03);
}

.summary-correction-head {
  margin: 0 0 0.45rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.summary-correction-enonce {
  margin: 0 0 0.65rem;
  font-size: 0.98rem;
  line-height: 1.45;
}

.summary-correction-rep-label {
  margin: 0 0 0.25rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--emerald);
}

.summary-correction-reponse {
  font-size: 1.05rem;
  color: var(--emerald);
}

@media (min-width: 520px) {
  .summary-actions {
    flex-direction: row;
    justify-content: center;
    flex-wrap: wrap;
  }
}

/* --------------------------------------------------------------------------
   Reduced motion
   -------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
