/* ==========================================================================
   King of L3 — feuille de style
   Tokens en haut, puis layout, composants, blocs de contenu, pratique.
   ========================================================================== */

:root {
  --bg: #f4f2ec;
  --bg-2: #ebe8e0;
  --surface: #ffffff;
  --surface-2: #faf9f5;
  --surface-3: #f2f0ea;
  --ink: #1b1a17;
  --ink-2: #4a463e;
  --ink-3: #85806f;
  --line: #e4dfd3;
  --line-2: #d3ccbc;

  --accent: #4f46e5;
  --accent-ink: #ffffff;
  --accent-soft: color-mix(in srgb, var(--accent) 11%, transparent);
  --accent-line: color-mix(in srgb, var(--accent) 35%, transparent);

  --good: #15803d;
  --good-soft: color-mix(in srgb, var(--good) 12%, transparent);
  --bad: #c2410c;
  --bad-soft: color-mix(in srgb, var(--bad) 12%, transparent);
  --warn: #b45309;
  --warn-soft: color-mix(in srgb, var(--warn) 13%, transparent);
  --gold: #c8930a;

  /* palette catégorielle (formules, graphiques) */
  --c1: #4f46e5;
  --c2: #0d9488;
  --c3: #d97706;
  --c4: #db2777;
  --c5: #7c3aed;
  --c6: #0284c7;
  --c7: #65a30d;

  --radius: 18px;
  --radius-m: 13px;
  --radius-s: 9px;
  --shadow-1: 0 1px 2px rgba(27, 26, 23, .05), 0 2px 8px rgba(27, 26, 23, .04);
  --shadow-2: 0 2px 4px rgba(27, 26, 23, .05), 0 12px 32px rgba(27, 26, 23, .09);

  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --serif: 'Fraunces', Georgia, 'Times New Roman', serif;
  --mono: 'JetBrains Mono', ui-monospace, Consolas, monospace;

  --sidebar-w: 250px;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #111113;
  --bg-2: #18181b;
  --surface: #1b1b1f;
  --surface-2: #202025;
  --surface-3: #26262c;
  --ink: #edebe6;
  --ink-2: #bcb8ae;
  --ink-3: #85817a;
  --line: #2b2b31;
  --line-2: #3a3a42;
  --accent-soft: color-mix(in srgb, var(--accent) 20%, transparent);
  --good: #4ade80;
  --bad: #fb923c;
  --warn: #fbbf24;
  --gold: #facc15;
  --c1: #8b85ff;
  --c2: #2dd4bf;
  --c3: #fbbf24;
  --c4: #f472b6;
  --c5: #a78bfa;
  --c6: #38bdf8;
  --c7: #a3e635;
  --shadow-1: 0 1px 2px rgba(0, 0, 0, .3);
  --shadow-2: 0 8px 30px rgba(0, 0, 0, .45);
  color-scheme: dark;
}

/* couleurs par thème (tuile) */
[data-topic="aa"]  { --accent: #4f46e5; }
[data-topic="pc"]  { --accent: #0d9488; }
[data-topic="pm"]  { --accent: #d97706; }
[data-topic="drm"] { --accent: #db2777; }
[data-topic="eth"] { --accent: #7c3aed; }
[data-topic="pmp"] { --accent: #0284c7; }
:root[data-theme="dark"] [data-topic="aa"]  { --accent: #8b85ff; --accent-ink: #111; }
:root[data-theme="dark"] [data-topic="pc"]  { --accent: #2dd4bf; --accent-ink: #111; }
:root[data-theme="dark"] [data-topic="pm"]  { --accent: #fbbf24; --accent-ink: #111; }
:root[data-theme="dark"] [data-topic="drm"] { --accent: #f472b6; --accent-ink: #111; }
:root[data-theme="dark"] [data-topic="eth"] { --accent: #a78bfa; --accent-ink: #111; }
:root[data-theme="dark"] [data-topic="pmp"] { --accent: #38bdf8; --accent-ink: #111; }
:root[data-theme="dark"] { --accent: #8b85ff; --accent-ink: #111; }

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--bg); }
body {
  margin: 0;
  background: transparent;
  color: var(--ink);
  font: 400 16.5px/1.62 var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
h1, h2, h3, h4 { margin: 0; line-height: 1.2; font-weight: 650; letter-spacing: -.01em; }
h1, h2, .serif { font-family: var(--serif); font-weight: 600; letter-spacing: -.015em; }
p { margin: 0 0 .8em; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font: inherit; color: inherit; }
strong { font-weight: 650; }
mark { background: color-mix(in srgb, var(--gold) 28%, transparent); color: inherit; padding: 0 .15em; border-radius: 3px; }
code { font-family: var(--mono); font-size: .88em; background: var(--surface-3); padding: .1em .35em; border-radius: 5px; }
sub, sup { font-size: .72em; }
.muted { color: var(--ink-3); }
.small { font-size: .88rem; }
.tiny { font-size: .78rem; }
.num { font-variant-numeric: tabular-nums; }
.hidden { display: none !important; }
:focus-visible { outline: 2.5px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
::selection { background: var(--accent-soft); }

/* ---------- layout ---------- */
#app { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 100vh; }
#sidebar {
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  border-right: 1px solid var(--line);
  background: var(--bg);
  padding: 22px 14px;
  display: flex; flex-direction: column; gap: 4px;
}
#main { min-width: 0; padding: 34px 44px 140px; }
.page { max-width: 1060px; margin: 0 auto; animation: pageIn .35s ease both; }
.reading { max-width: 760px; margin: 0 auto; }
@keyframes pageIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 18px; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand-logo { width: 36px; height: 36px; border-radius: 11px; background: linear-gradient(135deg, #2a2560, #4f46e5 55%, #c8930a); display: grid; place-items: center; box-shadow: var(--shadow-1); }
.brand-name { font-family: var(--serif); font-weight: 650; font-size: 1.15rem; line-height: 1; }
.brand-sub { font-size: .72rem; color: var(--ink-3); letter-spacing: .04em; text-transform: uppercase; margin-top: 3px; }

.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 12px; border-radius: 11px;
  color: var(--ink-2); font-weight: 520; font-size: .95rem;
  border: 0; background: none; cursor: pointer; text-align: left; width: 100%;
}
.nav-item:hover { background: var(--surface-3); text-decoration: none; color: var(--ink); }
.nav-item.active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-1); }
.nav-item svg { width: 19px; height: 19px; flex: none; opacity: .85; }
.nav-item .badge { margin-left: auto; }
.nav-sep { height: 1px; background: var(--line); margin: 12px 8px; }
.nav-label { font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); padding: 6px 12px 4px; font-weight: 600; }
.nav-topic { padding-left: 14px; font-size: .9rem; }
.nav-topic .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); flex: none; }
.nav-topic.locked { opacity: .5; }
.sidebar-foot { margin-top: auto; padding: 14px 8px 0; }

#tabbar {
  display: none;
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
  padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
  justify-content: space-around;
}
.tab { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: .68rem; color: var(--ink-3); padding: 5px 10px; border-radius: 10px; position: relative; min-width: 58px; }
.tab svg { width: 22px; height: 22px; }
.tab.active { color: var(--accent); }
.tab:hover { text-decoration: none; }
.tab .badge { position: absolute; top: 0; right: 8px; }

@media (max-width: 920px) {
  #app { grid-template-columns: minmax(0, 1fr); }
  #sidebar { display: none; }
  #tabbar { display: flex; }
  #main { padding: 18px 16px 110px; }
  body { font-size: 16px; }
}

/* ---------- éléments génériques ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px; border-radius: 12px; border: 1px solid var(--line-2);
  background: var(--surface); color: var(--ink); font-weight: 600; font-size: .95rem;
  cursor: pointer; transition: transform .12s ease, background .15s, border-color .15s, box-shadow .15s;
  text-decoration: none !important; white-space: nowrap;
}
.btn:hover { border-color: var(--ink-3); }
.btn:active { transform: scale(.97); }
.btn svg { width: 18px; height: 18px; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); box-shadow: 0 4px 14px color-mix(in srgb, var(--accent) 30%, transparent); }
.btn-primary:hover { border-color: var(--accent); filter: brightness(1.06); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: var(--surface-3); border-color: transparent; }
.btn-small { padding: 6px 12px; font-size: .85rem; border-radius: 10px; }
.btn-big { padding: 14px 26px; font-size: 1.03rem; border-radius: 14px; }
.btn[disabled] { opacity: .45; pointer-events: none; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

.badge { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--accent); color: var(--accent-ink); font-size: .72rem; font-weight: 700; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 99px; font-size: .78rem; font-weight: 600; background: var(--surface-3); color: var(--ink-2); border: 1px solid var(--line); white-space: nowrap; }
.chip-accent { background: var(--accent-soft); color: var(--accent); border-color: var(--accent-line); }
.chip-good { background: var(--good-soft); color: var(--good); border-color: transparent; }
.chip-cmd { font-family: var(--mono); font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; cursor: help; }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow-1); }
.panel-tight { padding: 16px; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-auto { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
@media (max-width: 760px) { .grid-2, .grid-3 { grid-template-columns: minmax(0, 1fr); } }
.stack > * + * { margin-top: 14px; }
.row { display: flex; align-items: center; gap: 12px; }
.spacer { flex: 1; }
.section-title { font-family: var(--serif); font-size: 1.35rem; margin: 38px 0 14px; display: flex; align-items: center; gap: 10px; }
.section-title .muted { font-family: var(--font); font-size: .85rem; font-weight: 500; }
.eyebrow { font-size: .74rem; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--accent); }
.crumbs { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: .84rem; color: var(--ink-3); margin-bottom: 14px; }
.crumbs a { color: var(--ink-3); }
.crumbs a:hover { color: var(--ink); }

.ring { display: block; }
.ring-track { stroke: var(--line); }
.ring-bar { stroke: var(--accent); transition: stroke-dashoffset .8s cubic-bezier(.2, .8, .2, 1); }
.ring-label { font: 700 13px var(--font); fill: var(--ink); }

.bar { height: 7px; border-radius: 99px; background: var(--line); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: inherit; background: var(--accent); transition: width .6s cubic-bezier(.2, .8, .2, 1); }

.empty { text-align: center; padding: 50px 20px; color: var(--ink-3); }
.empty .big { font-size: 2.6rem; margin-bottom: 6px; }

/* ---------- tableau de bord ---------- */
.hello { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 18px; margin-bottom: 26px; }
.hello h1 { font-size: clamp(1.9rem, 4vw, 2.6rem); }
.hello .sub { color: var(--ink-3); margin-top: 6px; }
.stat-pills { display: flex; gap: 10px; flex-wrap: wrap; margin-left: auto; }
.stat-pill { display: flex; align-items: center; gap: 9px; padding: 9px 15px 9px 11px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-1); }
.stat-pill .ico { font-size: 1.3rem; line-height: 1; }
.stat-pill b { display: block; font-size: 1.05rem; line-height: 1.1; }
.stat-pill span { font-size: .72rem; color: var(--ink-3); }

.hero-card {
  position: relative; overflow: hidden;
  border-radius: 24px; padding: 28px 30px; color: #fff;
  background: radial-gradient(120% 140% at 0% 0%, #3b33c4 0%, #1f1b5e 55%, #14123a 100%);
  box-shadow: var(--shadow-2);
}
.hero-card::after {
  content: ''; position: absolute; right: -60px; top: -60px; width: 260px; height: 260px; border-radius: 50%;
  background: radial-gradient(circle, rgba(250, 204, 21, .35), transparent 65%);
}
.hero-card .eyebrow { color: #fcd34d; }
.hero-card h2 { font-size: 1.7rem; margin: 6px 0 8px; color: #fff; }
.hero-card p { color: rgba(255, 255, 255, .78); max-width: 560px; }
.hero-card .btn { background: #fff; color: #1f1b5e; border-color: #fff; }
.countdown { display: flex; align-items: baseline; gap: 8px; }
.countdown b { font-family: var(--serif); font-size: 3rem; line-height: 1; }

.topic-tile {
  position: relative; display: flex; flex-direction: column; gap: 10px;
  padding: 20px; border-radius: var(--radius); background: var(--surface);
  border: 1px solid var(--line); box-shadow: var(--shadow-1); color: var(--ink);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s;
  overflow: hidden; min-height: 190px;
}
.topic-tile::before { content: ''; position: absolute; inset: 0 0 auto 0; height: 5px; background: var(--accent); }
.topic-tile:hover { transform: translateY(-3px); box-shadow: var(--shadow-2); text-decoration: none; border-color: var(--accent-line); }
.topic-tile .t-num { font: 700 .72rem var(--font); letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.topic-tile h3 { font-family: var(--serif); font-size: 1.25rem; font-weight: 600; }
.topic-tile .t-fr { color: var(--ink-3); font-size: .88rem; margin-top: -4px; }
.topic-tile .t-foot { margin-top: auto; display: flex; align-items: center; gap: 10px; font-size: .8rem; color: var(--ink-3); }
.topic-tile .t-foot .bar { flex: 1; }
.topic-tile.locked { opacity: .62; }
.topic-tile.locked::after { content: 'Coming soon'; position: absolute; top: 16px; right: 16px; font-size: .7rem; font-weight: 700; padding: 3px 9px; border-radius: 99px; background: var(--surface-3); color: var(--ink-3); border: 1px solid var(--line); }
.topic-icon { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.topic-icon svg { width: 22px; height: 22px; }

.heatmap { display: grid; grid-auto-flow: column; grid-template-rows: repeat(7, 12px); gap: 3px; overflow-x: auto; padding-bottom: 4px; }
.heatmap i { width: 12px; height: 12px; border-radius: 3px; background: var(--line); display: block; }
.heatmap i[data-l="1"] { background: color-mix(in srgb, var(--accent) 30%, var(--line)); }
.heatmap i[data-l="2"] { background: color-mix(in srgb, var(--accent) 55%, var(--line)); }
.heatmap i[data-l="3"] { background: color-mix(in srgb, var(--accent) 80%, var(--line)); }
.heatmap i[data-l="4"] { background: var(--accent); }

.tip-card { display: flex; gap: 14px; align-items: flex-start; }
.tip-card .ico { font-size: 1.6rem; line-height: 1; }

/* ---------- page thème / module ---------- */
.topic-head {
  position: relative; border-radius: 26px; padding: 30px 32px; margin-bottom: 26px; overflow: hidden;
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 16%, var(--surface)) 0%, var(--surface) 70%);
  border: 1px solid var(--accent-line);
}
.topic-head h1 { font-size: clamp(1.8rem, 4vw, 2.5rem); margin: 6px 0; }
.topic-head .en { color: var(--ink-3); font-size: .95rem; }
.topic-head .meta { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.topic-head .ring { position: absolute; right: 26px; top: 26px; }
.topic-head > h1, .topic-head > .en, .topic-head > p { max-width: calc(100% - 92px); }
@media (max-width: 700px) {
  .topic-head { padding: 22px 20px; }
  .topic-head .ring { position: static; margin-top: 14px; }
  .topic-head > h1, .topic-head > .en, .topic-head > p { max-width: none; }
}

.module-card {
  display: grid; grid-template-columns: 54px minmax(0, 1fr) auto; gap: 16px; align-items: center;
  padding: 18px 20px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line);
  color: var(--ink); box-shadow: var(--shadow-1); transition: transform .15s, border-color .15s, box-shadow .15s;
}
.module-card:hover { transform: translateY(-2px); border-color: var(--accent-line); box-shadow: var(--shadow-2); text-decoration: none; }
.module-card .m-num { width: 54px; height: 54px; border-radius: 15px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font: 700 1.25rem var(--serif); }
.module-card h3 { font-size: 1.06rem; font-weight: 650; }
.module-card .en { font-size: .82rem; color: var(--ink-3); margin-top: 2px; }
.module-card.locked { opacity: .55; pointer-events: none; }
@media (max-width: 600px) { .module-card { grid-template-columns: 44px minmax(0, 1fr); } .module-card .m-num { width: 44px; height: 44px; } .module-card > :last-child { grid-column: 1 / -1; } }

.bigideas { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; }
.bigidea { padding: 16px 18px; border-radius: var(--radius-m); background: var(--surface); border: 1px solid var(--line); position: relative; }
.bigidea b { display: block; font-family: var(--serif); font-size: 1.6rem; color: var(--accent); line-height: 1; margin-bottom: 6px; }

.path { position: relative; padding-left: 8px; }
.path-item {
  position: relative; display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 14px; align-items: center;
  padding: 12px 14px; margin-left: 4px; border-radius: var(--radius-m); color: var(--ink);
  transition: background .15s;
}
.path-item:hover { background: var(--surface); text-decoration: none; }
.path-item::before { content: ''; position: absolute; left: 35px; top: 56px; bottom: -12px; width: 2px; background: var(--line); }
.path-item:last-child::before { display: none; }
.path-node { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); border: 2px solid var(--line-2); font-weight: 700; color: var(--ink-3); position: relative; z-index: 1; }
.path-item.done .path-node { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.path-item.current .path-node { border-color: var(--accent); color: var(--accent); box-shadow: 0 0 0 5px var(--accent-soft); }
.path-item h4 { font-size: 1rem; font-weight: 620; }
.path-item .sub { font-size: .82rem; color: var(--ink-3); }

.practice-tile { display: flex; flex-direction: column; gap: 6px; padding: 18px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); color: var(--ink); box-shadow: var(--shadow-1); transition: transform .15s, border-color .15s; }
.practice-tile:hover { transform: translateY(-2px); border-color: var(--accent-line); text-decoration: none; }
.practice-tile .ico { font-size: 1.7rem; }
.practice-tile h4 { font-size: 1.02rem; }
.practice-tile p { font-size: .86rem; color: var(--ink-3); margin: 0; }

.los-list { display: flex; flex-direction: column; gap: 10px; }
.los-item { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: start; padding: 12px 14px; border-radius: var(--radius-m); background: var(--surface); border: 1px solid var(--line); }
.los-item .fr { font-weight: 560; }
.los-item .en { font-size: .8rem; color: var(--ink-3); margin-top: 3px; }
.mastery-dots { display: flex; gap: 3px; margin-top: 4px; }
.mastery-dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--line-2); }
.mastery-dots i.on { background: var(--accent); }

/* ---------- leçon ---------- */
.lesson-top { position: sticky; top: 0; z-index: 20; margin: -34px -44px 22px; padding: 12px 44px; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
@media (max-width: 920px) { .lesson-top { margin: -18px -16px 18px; padding: 10px 16px; } }
.lesson-top .row { max-width: 760px; margin: 0 auto; }
.lesson-top .bar { flex: 1; height: 8px; }
.lesson-top a { color: var(--ink-2); display: inline-flex; padding: 4px; margin-left: -4px; border-radius: 8px; }
.lesson-top a:hover { background: var(--surface-3); }
.lesson-top a svg { width: 22px; height: 22px; }
a > svg, button > svg { flex: none; }
svg:not([width]):not(.chart) { max-width: 100%; }
.btn svg, .card-foot svg { width: 17px; height: 17px; }
.lesson-hero { margin: 10px 0 26px; }
.lesson-hero h1 { font-size: clamp(1.7rem, 4.2vw, 2.35rem); margin: 8px 0 12px; }
.idea {
  font-family: var(--serif); font-size: 1.22rem; line-height: 1.45; color: var(--ink);
  padding: 16px 20px; border-left: 4px solid var(--accent); background: var(--accent-soft); border-radius: 0 14px 14px 0;
}
.los-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }

.card {
  position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: 22px;
  padding: 26px 28px 20px; margin-bottom: 18px; box-shadow: var(--shadow-1);
  animation: cardIn .45s cubic-bezier(.2, .8, .2, 1) both;
}
@keyframes cardIn { from { opacity: 0; transform: translateY(14px) scale(.99); } to { opacity: 1; transform: none; } }
@media (max-width: 600px) { .card { padding: 20px 18px 16px; border-radius: 18px; } }
.card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.card-n { width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-weight: 700; font-size: .85rem; flex: none; }
.card-tag { font-size: .7rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.card h2 { font-family: var(--serif); font-size: 1.42rem; margin-bottom: 12px; }
.card-foot { display: flex; justify-content: flex-end; gap: 6px; margin-top: 8px; padding-top: 10px; border-top: 1px dashed var(--line); }
.continue-zone { display: flex; justify-content: center; padding: 8px 0 30px; }
.continue-zone .btn { min-width: 220px; }
.kbd { font: 600 .72rem var(--mono); padding: 1px 6px; border-radius: 5px; border: 1px solid var(--line-2); color: var(--ink-3); }

.done-banner { text-align: center; padding: 34px 24px; border-radius: 24px; background: linear-gradient(135deg, var(--accent-soft), transparent); border: 1px solid var(--accent-line); }
.done-banner .big { font-size: 3rem; line-height: 1; }
.done-banner h2 { font-family: var(--serif); margin: 10px 0 6px; }

/* ---------- blocs de contenu ---------- */
.blocks > * + * { margin-top: 14px; }
.blocks p { margin: 0; }
.lead { font-size: 1.12rem; color: var(--ink); }
.blocks h3 { font-size: 1.08rem; margin-top: 22px; }
.blocks ul, .blocks ol { margin: 0; padding-left: 1.3em; }
.blocks li + li { margin-top: 6px; }
.blocks li::marker { color: var(--accent); }
ul.l-check, ul.l-arrow { list-style: none; padding-left: 0; }
ul.l-check li, ul.l-arrow li { position: relative; padding-left: 28px; }
ul.l-check li::before { content: '✓'; position: absolute; left: 4px; color: var(--good); font-weight: 800; }
ul.l-arrow li::before { content: '→'; position: absolute; left: 3px; color: var(--accent); font-weight: 700; }
.li-title { font-weight: 650; }

.callout { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 10px; padding: 14px 16px; border-radius: 14px; background: var(--surface-3); border: 1px solid var(--line); }
.callout .c-ico { font-size: 1.25rem; line-height: 1.3; text-align: center; }
.callout .c-title { font-weight: 700; font-size: .84rem; letter-spacing: .02em; margin-bottom: 3px; }
.callout-exam { background: color-mix(in srgb, var(--c1) 8%, var(--surface)); border-color: color-mix(in srgb, var(--c1) 26%, transparent); }
.callout-exam .c-title { color: var(--c1); }
.callout-trap { background: var(--bad-soft); border-color: color-mix(in srgb, var(--bad) 28%, transparent); }
.callout-trap .c-title { color: var(--bad); }
.callout-memo { background: color-mix(in srgb, var(--c5) 9%, var(--surface)); border-color: color-mix(in srgb, var(--c5) 26%, transparent); }
.callout-memo .c-title { color: var(--c5); }
.callout-insight { background: color-mix(in srgb, var(--gold) 12%, var(--surface)); border-color: color-mix(in srgb, var(--gold) 34%, transparent); }
.callout-insight .c-title { color: var(--warn); }
.callout-real { background: color-mix(in srgb, var(--c2) 9%, var(--surface)); border-color: color-mix(in srgb, var(--c2) 28%, transparent); }
.callout-real .c-title { color: var(--c2); }
.callout-example { background: var(--surface-2); }

.deeper { border: 1px solid var(--line); border-radius: 14px; background: var(--surface-2); overflow: hidden; }
.deeper > summary {
  list-style: none; cursor: pointer; padding: 12px 16px; display: flex; align-items: center; gap: 10px;
  font-weight: 620; font-size: .95rem; color: var(--ink-2); user-select: none;
}
.deeper > summary::-webkit-details-marker { display: none; }
.deeper > summary:hover { color: var(--ink); background: var(--surface-3); }
.deeper > summary .d-ico { width: 24px; height: 24px; border-radius: 8px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-size: .8rem; transition: transform .25s; flex: none; }
.deeper[open] > summary .d-ico { transform: rotate(90deg); }
.deeper > summary .d-kind { margin-left: auto; font-size: .7rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--ink-3); }
.deeper > .blocks { padding: 4px 18px 18px; animation: pageIn .3s ease both; }
.deeper .deeper { background: var(--surface); }

.formula { border-radius: 16px; border: 1px solid var(--line); background: var(--surface-2); padding: 16px 18px; }
.formula .f-title { font-size: .74rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 10px; }
.eq { display: flex; flex-wrap: wrap; align-items: center; gap: 7px 8px; font-size: 1rem; }
.eq .op { font: 600 1.15rem var(--mono); color: var(--ink-3); padding: 0 1px; }
.eq .var {
  display: inline-flex; flex-direction: column; align-items: center; padding: 6px 12px; border-radius: 11px;
  background: color-mix(in srgb, var(--vc) 13%, var(--surface)); border: 1.5px solid color-mix(in srgb, var(--vc) 45%, transparent);
  color: var(--ink); font-weight: 620; line-height: 1.2; text-align: center;
}
.eq .var small { font-weight: 500; font-size: .72rem; color: var(--ink-3); margin-top: 2px; }
.eq .var.result { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.eq .var.result small { color: color-mix(in srgb, var(--surface) 70%, transparent); }
.formula .f-words { margin-top: 12px; color: var(--ink-2); }
.formula .f-book { margin-top: 10px; }
.formula .f-book button { background: none; border: 0; padding: 0; color: var(--ink-3); font-size: .82rem; cursor: pointer; text-decoration: underline dotted; }
.formula .f-book .book { margin-top: 8px; font: 500 .98rem/1.7 var(--mono); padding: 10px 14px; border-radius: 10px; background: var(--surface); border: 1px dashed var(--line-2); overflow-x: auto; }
.formula .f-legend { margin-top: 10px; display: grid; gap: 4px; font-size: .88rem; color: var(--ink-2); }

.tbl-wrap { overflow-x: auto; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); }
table.tbl { width: 100%; border-collapse: collapse; font-size: .92rem; }
.tbl th, .tbl td { padding: 10px 12px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.tbl th { background: var(--surface-3); font-weight: 650; font-size: .82rem; color: var(--ink-2); white-space: nowrap; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl td:first-child { font-weight: 600; }
.tbl-caption { font-size: .8rem; color: var(--ink-3); margin-top: 6px; }
.sym-up { color: var(--good); font-weight: 800; }
.sym-down { color: var(--bad); font-weight: 800; }
.sym-flat { color: var(--ink-3); font-weight: 800; }
.sym-yes { color: var(--good); font-weight: 800; }
.sym-no { color: var(--bad); font-weight: 800; }

.compare { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.compare > div { padding: 14px 16px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface-2); border-top: 4px solid var(--vc, var(--accent)); }
.compare h4 { font-size: .98rem; margin-bottom: 8px; }
.compare ul { padding-left: 1.1em; font-size: .92rem; }

.steps { counter-reset: st; display: flex; flex-direction: column; gap: 0; }
.step { position: relative; display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 12px; padding-bottom: 14px; }
.step::before { counter-increment: st; content: counter(st); width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); font-weight: 700; font-size: .85rem; z-index: 1; }
.step::after { content: ''; position: absolute; left: 14px; top: 30px; bottom: 0; width: 2px; background: var(--accent-line); }
.step:last-child::after { display: none; }
.step .s-title { font-weight: 650; }
.step .s-text { color: var(--ink-2); font-size: .94rem; }

.keys { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.key { padding: 14px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); }
.key b { display: block; font-family: var(--serif); font-size: 1.55rem; color: var(--accent); line-height: 1.1; }
.key span { font-size: .85rem; color: var(--ink-2); }

.example { border-radius: 16px; border: 1px solid var(--line); overflow: hidden; }
.example .ex-head { padding: 12px 16px; background: var(--surface-3); display: flex; gap: 10px; align-items: center; font-weight: 650; }
.example .ex-body { padding: 14px 16px; }
.example .ex-step { display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 10px; padding: 10px 0; border-top: 1px dashed var(--line); animation: cardIn .35s ease both; }
.example .ex-step .n { width: 24px; height: 24px; border-radius: 7px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-size: .78rem; font-weight: 700; }
.example .ex-answer { margin-top: 8px; padding: 12px 14px; border-radius: 12px; background: var(--good-soft); border: 1px solid color-mix(in srgb, var(--good) 30%, transparent); animation: cardIn .35s ease both; }
.example .ex-actions { padding-top: 10px; }

.flipgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.flip { perspective: 900px; cursor: pointer; min-height: 120px; border: 0; background: none; padding: 0; text-align: left; }
.flip-inner { position: relative; width: 100%; height: 100%; min-height: 120px; transition: transform .55s cubic-bezier(.3, .7, .2, 1); transform-style: preserve-3d; }
.flip.on .flip-inner { transform: rotateY(180deg); }
.flip-face { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; border-radius: 14px; padding: 14px; display: flex; flex-direction: column; justify-content: center; border: 1px solid var(--line); background: var(--surface-2); font-size: .9rem; }
.flip-face.front { font-weight: 650; font-size: .98rem; text-align: center; align-items: center; }
.flip-face.front::after { content: 'toucher pour retourner'; font-size: .66rem; font-weight: 500; color: var(--ink-3); margin-top: 8px; }
.flip-face.back { transform: rotateY(180deg); background: var(--accent-soft); border-color: var(--accent-line); }

/* termes du glossaire + popover */
.gl { border-bottom: 1.5px dotted var(--accent); cursor: help; font-weight: 560; }
.gl:hover { background: var(--accent-soft); border-radius: 3px; }
#popover {
  position: fixed; z-index: 100; max-width: min(360px, calc(100vw - 24px));
  background: var(--surface); border: 1px solid var(--line-2); border-radius: 14px; box-shadow: var(--shadow-2);
  padding: 14px 16px; font-size: .9rem; animation: popIn .16s ease both;
}
@keyframes popIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
#popover .p-term { font-weight: 700; }
#popover .p-fr { color: var(--accent); font-size: .82rem; font-weight: 600; margin-bottom: 6px; }
#popover .p-src { color: var(--ink-3); font-size: .74rem; margin-top: 8px; }

#toast { position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%); z-index: 120; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
@media (max-width: 920px) { #toast { bottom: 90px; } }
.toast { background: var(--ink); color: var(--surface); padding: 10px 18px; border-radius: 99px; font-weight: 600; font-size: .9rem; box-shadow: var(--shadow-2); animation: toastIn .3s cubic-bezier(.2, .9, .3, 1.3) both; }
.toast.out { animation: toastOut .3s ease both; }
@keyframes toastIn { from { opacity: 0; transform: translateY(16px) scale(.9); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateY(8px); } }

/* ---------- widgets ---------- */
.widget { border-radius: 20px; border: 1px solid var(--accent-line); background: var(--surface); overflow: hidden; box-shadow: 0 0 0 4px var(--accent-soft); }
.widget-head { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); background: linear-gradient(90deg, var(--accent-soft), transparent); }
.widget-head .w-badge { font-size: .66rem; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; color: var(--accent); background: var(--surface); border: 1px solid var(--accent-line); padding: 2px 8px; border-radius: 99px; }
.widget-head .w-title { font-weight: 680; font-size: .98rem; }
.widget-body { padding: 16px; }
.widget-caption { padding: 0 16px 14px; font-size: .86rem; color: var(--ink-3); }
.widget-error { padding: 16px; color: var(--bad); font-size: .9rem; }

.w-controls { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px 18px; margin-bottom: 14px; }
.slider { display: flex; flex-direction: column; gap: 4px; }
.slider .s-top { display: flex; justify-content: space-between; gap: 10px; font-size: .86rem; }
.slider .s-label { color: var(--ink-2); font-weight: 560; }
.slider .s-val { font: 700 .9rem var(--mono); color: var(--accent); white-space: nowrap; }
input[type="range"] { -webkit-appearance: none; appearance: none; width: 100%; height: 26px; background: transparent; cursor: pointer; margin: 0; }
input[type="range"]::-webkit-slider-runnable-track { height: 6px; border-radius: 99px; background: linear-gradient(to right, var(--accent) 0 var(--p, 50%), var(--line) var(--p, 50%) 100%); }
input[type="range"]::-moz-range-track { height: 6px; border-radius: 99px; background: var(--line); }
input[type="range"]::-moz-range-progress { height: 6px; border-radius: 99px; background: var(--accent); }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 22px; height: 22px; border-radius: 50%; background: var(--surface); border: 3px solid var(--accent); margin-top: -8px; box-shadow: var(--shadow-1); transition: transform .1s; }
input[type="range"]::-moz-range-thumb { width: 16px; height: 16px; border-radius: 50%; background: var(--surface); border: 3px solid var(--accent); }
input[type="range"]:active::-webkit-slider-thumb { transform: scale(1.18); }

.seg { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; border-radius: 13px; background: var(--surface-3); border: 1px solid var(--line); }
.seg button { border: 0; background: none; padding: 7px 13px; border-radius: 9px; font-weight: 600; font-size: .86rem; color: var(--ink-2); cursor: pointer; transition: background .15s, color .15s; }
.seg button:hover { color: var(--ink); }
.seg button.on { background: var(--surface); color: var(--accent); box-shadow: var(--shadow-1); }

.readouts { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin-top: 12px; }
.readout { padding: 10px 12px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); }
.readout .r-label { font-size: .74rem; color: var(--ink-3); font-weight: 600; }
.readout .r-val { font: 700 1.25rem var(--mono); color: var(--ink); transition: color .2s; }
.readout.hl { background: var(--accent-soft); border-color: var(--accent-line); }
.readout.hl .r-val { color: var(--accent); }

svg.chart { width: 100%; height: auto; display: block; overflow: visible; }
svg.chart text { font-family: var(--font); fill: var(--ink-3); font-size: 11px; }
svg.chart .axis line, svg.chart .axis path { stroke: var(--line-2); }
svg.chart .grid line { stroke: var(--line); stroke-dasharray: 2 4; }
svg.chart .lbl { fill: var(--ink-2); font-weight: 600; }

.w-note { font-size: .88rem; color: var(--ink-2); padding: 10px 12px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); margin-top: 12px; transition: background .2s; }
.w-note.flash { animation: flash .6s ease; }
@keyframes flash { 0% { background: var(--accent-soft); } 100% { background: var(--surface-2); } }

/* décomposition (stack) */
.stackbar { display: flex; height: 46px; border-radius: 12px; overflow: hidden; background: var(--surface-3); border: 1px solid var(--line); }
.stackbar > div { display: flex; align-items: center; justify-content: center; color: #fff; font: 700 .8rem var(--mono); min-width: 0; overflow: hidden; white-space: nowrap; transition: flex-basis .35s cubic-bezier(.2, .8, .2, 1), background .2s; }
.stackbar > div.neg { background-image: repeating-linear-gradient(45deg, rgba(255,255,255,.22) 0 6px, transparent 6px 12px); }
.waterfall { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; }
.wf-row { display: grid; grid-template-columns: minmax(120px, 38%) minmax(0, 1fr) 70px; gap: 10px; align-items: center; font-size: .86rem; }
.wf-row .wf-track { position: relative; height: 20px; }
.wf-row .wf-bar { position: absolute; top: 0; height: 100%; border-radius: 5px; transition: left .35s, width .35s; }
.wf-row .wf-zero { position: absolute; top: -3px; bottom: -3px; width: 1.5px; background: var(--ink-3); }
.wf-row .wf-val { font: 700 .85rem var(--mono); text-align: right; }
.wf-row.total { border-top: 1px solid var(--line); padding-top: 6px; font-weight: 700; }
@media (max-width: 560px) { .wf-row { grid-template-columns: 1fr 64px; } .wf-row .wf-track { grid-column: 1 / -1; grid-row: 2; } }

/* jeux : classify / match / order / truefalse */
.game-prompt { font-weight: 600; margin-bottom: 12px; }
.pool { display: flex; flex-wrap: wrap; gap: 8px; min-height: 44px; padding: 10px; border-radius: 14px; background: var(--surface-3); border: 1px dashed var(--line-2); margin-bottom: 12px; }
.token { padding: 8px 12px; border-radius: 11px; background: var(--surface); border: 1.5px solid var(--line-2); font-size: .9rem; font-weight: 560; cursor: pointer; user-select: none; transition: transform .12s, border-color .15s, box-shadow .15s, background .2s; text-align: left; }
.token:hover { border-color: var(--accent); }
.token.sel { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); transform: translateY(-2px); }
.token.ok { border-color: var(--good); background: var(--good-soft); cursor: default; }
.token.ko { animation: shake .4s ease; border-color: var(--bad); }
.token.dragging { opacity: .4; }
@keyframes shake { 20%, 60% { transform: translateX(-5px); } 40%, 80% { transform: translateX(5px); } }
.buckets { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; }
.bucket { border-radius: 14px; border: 1.5px solid var(--line-2); background: var(--surface-2); padding: 10px; min-height: 90px; cursor: pointer; transition: border-color .15s, background .15s; display: flex; flex-direction: column; gap: 6px; }
.bucket:hover, .bucket.over { border-color: var(--accent); background: var(--accent-soft); }
.bucket .b-title { font-weight: 700; font-size: .88rem; color: var(--ink-2); display: flex; align-items: center; gap: 8px; }
.bucket .b-title i { width: 10px; height: 10px; border-radius: 3px; background: var(--vc, var(--accent)); }
.bucket .token { font-size: .82rem; padding: 6px 10px; }
.game-feedback { margin-top: 12px; min-height: 24px; font-size: .9rem; }
.game-feedback .fb { padding: 10px 12px; border-radius: 12px; animation: cardIn .3s ease both; }
.game-feedback .fb.ok { background: var(--good-soft); }
.game-feedback .fb.ko { background: var(--bad-soft); }
.game-score { display: flex; align-items: center; gap: 12px; margin-top: 12px; font-weight: 650; }

.match-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.match-cols .col { display: flex; flex-direction: column; gap: 8px; }
.match-cols .token { width: 100%; }

.order-list { display: flex; flex-direction: column; gap: 8px; }
.order-item { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 12px; background: var(--surface); border: 1.5px solid var(--line-2); transition: transform .2s, border-color .2s, background .2s; }
.order-item .o-n { width: 26px; height: 26px; border-radius: 8px; background: var(--surface-3); display: grid; place-items: center; font-weight: 700; font-size: .8rem; }
.order-item .o-btns { display: flex; gap: 4px; }
.order-item .o-btns button { width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface-2); cursor: pointer; }
.order-item.ok { border-color: var(--good); background: var(--good-soft); }
.order-item.ko { border-color: var(--bad); background: var(--bad-soft); }

.tf-card { text-align: center; padding: 22px 18px; border-radius: 16px; background: var(--surface-2); border: 1px solid var(--line); font-size: 1.05rem; font-weight: 560; min-height: 110px; display: grid; place-items: center; animation: cardIn .3s ease both; }
.tf-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.tf-btns .btn { padding: 14px; }

.scenario-result { margin-top: 14px; animation: cardIn .3s ease both; }

/* ---------- quiz ---------- */
.quiz { display: flex; flex-direction: column; gap: 14px; }
.q-card { border-radius: 20px; border: 1px solid var(--line); background: var(--surface); padding: 22px; box-shadow: var(--shadow-1); animation: cardIn .35s ease both; }
.q-meta { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; font-size: .78rem; color: var(--ink-3); font-weight: 600; }
.q-stem { font-size: 1.04rem; font-weight: 560; margin-bottom: 14px; }
.q-lang { font-size: .68rem; font-weight: 700; color: var(--ink-3); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; }
.opts { display: flex; flex-direction: column; gap: 9px; }
.opt { display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 12px; align-items: center; text-align: left; padding: 12px 14px; border-radius: 13px; border: 1.5px solid var(--line-2); background: var(--surface-2); cursor: pointer; transition: border-color .15s, background .15s, transform .1s; font-size: .96rem; }
.opt:hover { border-color: var(--accent); }
.opt:active { transform: scale(.99); }
.opt .l { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--surface); border: 1px solid var(--line-2); font-weight: 700; font-size: .85rem; }
.opt.right { border-color: var(--good); background: var(--good-soft); }
.opt.right .l { background: var(--good); color: #fff; border-color: var(--good); }
.opt.wrong { border-color: var(--bad); background: var(--bad-soft); }
.opt.wrong .l { background: var(--bad); color: #fff; border-color: var(--bad); }
.opts.answered .opt { cursor: default; }
.opts.answered .opt:not(.right):not(.wrong) { opacity: .55; }
.q-why { margin-top: 14px; padding: 14px 16px; border-radius: 14px; background: var(--surface-3); border-left: 4px solid var(--accent); animation: cardIn .3s ease both; font-size: .95rem; }
.q-why .verdict { font-weight: 750; margin-bottom: 4px; }
.q-why .verdict.ok { color: var(--good); }
.q-why .verdict.ko { color: var(--bad); }
.q-nav { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 14px; }
.q-progress { display: flex; gap: 5px; }
.q-progress i { width: 26px; height: 6px; border-radius: 99px; background: var(--line); }
.q-progress i.ok { background: var(--good); }
.q-progress i.ko { background: var(--bad); }
.q-progress i.cur { background: var(--accent); }

.vignette-layout { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 22px; align-items: start; }
.vignette-case { position: sticky; top: 16px; max-height: calc(100vh - 32px); overflow-y: auto; }
.vignette-case .case-text { font-size: .94rem; line-height: 1.65; }
.vignette-case .case-text p { margin-bottom: .75em; }
@media (max-width: 1100px) { .vignette-layout { grid-template-columns: minmax(0, 1fr); } .vignette-case { position: static; max-height: none; } }
.timer { font: 700 .95rem var(--mono); padding: 5px 12px; border-radius: 10px; background: var(--surface-3); }

/* essais */
.essay-part { border-radius: 20px; border: 1px solid var(--line); background: var(--surface); padding: 22px; box-shadow: var(--shadow-1); }
.essay-part + .essay-part { margin-top: 18px; }
.essay-prompt { font-weight: 560; font-size: 1.02rem; margin: 8px 0 14px; }
textarea.answer { width: 100%; min-height: 150px; resize: vertical; padding: 14px; border-radius: 14px; border: 1.5px solid var(--line-2); background: var(--surface-2); color: var(--ink); font: 400 .95rem/1.55 var(--font); }
textarea.answer:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.tpl-options { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.tpl-options label { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 11px; border: 1.5px solid var(--line-2); cursor: pointer; font-weight: 600; font-size: .9rem; }
.tpl-options label:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.model { margin-top: 16px; border-radius: 16px; border: 1px solid color-mix(in srgb, var(--good) 35%, transparent); background: color-mix(in srgb, var(--good) 6%, var(--surface)); padding: 16px 18px; animation: cardIn .35s ease both; }
.model h4 { color: var(--good); font-size: .82rem; letter-spacing: .06em; text-transform: uppercase; margin-bottom: 8px; }
.keypoints { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.keypoints label { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; gap: 10px; align-items: start; padding: 10px 12px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); cursor: pointer; font-size: .92rem; }
.keypoints input { width: 18px; height: 18px; accent-color: var(--good); margin-top: 2px; }
.keypoints .pts { font: 700 .78rem var(--mono); color: var(--ink-3); }
.essay-score { font: 700 1.1rem var(--mono); }

/* flashcards */
.fc-stage { max-width: 620px; margin: 0 auto; }
.fc { perspective: 1400px; cursor: pointer; }
.fc-inner { position: relative; min-height: 300px; transition: transform .6s cubic-bezier(.3, .7, .2, 1); transform-style: preserve-3d; }
.fc.on .fc-inner { transform: rotateY(180deg); }
.fc-face { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; border-radius: 26px; padding: 30px; display: flex; flex-direction: column; justify-content: center; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-2); overflow-y: auto; }
.fc-face.front { align-items: center; text-align: center; font-family: var(--serif); font-size: 1.45rem; line-height: 1.35; }
.fc-face.back { transform: rotateY(180deg); font-size: 1.02rem; background: linear-gradient(160deg, var(--accent-soft), var(--surface) 60%); }
.fc-face .fc-src { position: absolute; top: 16px; left: 20px; font: 600 .7rem var(--font); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
.fc-face .fc-hint { position: absolute; bottom: 16px; left: 0; right: 0; text-align: center; font: 500 .75rem var(--font); color: var(--ink-3); }
.fc-grades { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 18px; }
.fc-grades .btn { flex-direction: column; gap: 2px; padding: 12px; }
.fc-grades .btn small { font-weight: 500; font-size: .72rem; color: var(--ink-3); }
.fc-grades .g-again { border-color: color-mix(in srgb, var(--bad) 45%, transparent); }
.fc-grades .g-hard { border-color: color-mix(in srgb, var(--warn) 45%, transparent); }
.fc-grades .g-easy { border-color: color-mix(in srgb, var(--good) 45%, transparent); }
.fc-count { text-align: center; color: var(--ink-3); font-size: .86rem; margin-bottom: 12px; }

/* glossaire */
.search { width: 100%; padding: 13px 16px 13px 44px; border-radius: 14px; border: 1.5px solid var(--line-2); background: var(--surface); color: var(--ink); font-size: 1rem; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%2385806f' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: 14px center; }
.search:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.gloss-list { display: flex; flex-direction: column; gap: 8px; margin-top: 16px; }
.gloss-item { padding: 14px 16px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); }
.gloss-item .gi-term { font-weight: 700; }
.gloss-item .gi-fr { color: var(--accent); font-size: .85rem; font-weight: 600; }
.gloss-item .gi-def { margin-top: 4px; font-size: .93rem; color: var(--ink-2); }
.gloss-letter { font-family: var(--serif); font-size: 1.4rem; color: var(--accent); margin: 18px 0 2px; }

/* réglages */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-weight: 600; font-size: .9rem; }
.field input[type="text"], .field input[type="date"], .field input[type="number"], .field select {
  padding: 11px 14px; border-radius: 12px; border: 1.5px solid var(--line-2); background: var(--surface-2); color: var(--ink); font: inherit;
}

/* fiche express */
.sheet ol { counter-reset: s; list-style: none; padding: 0; }
.sheet ol li { counter-increment: s; position: relative; padding: 10px 0 10px 44px; border-bottom: 1px solid var(--line); }
.sheet ol li::before { content: counter(s); position: absolute; left: 0; top: 10px; width: 30px; height: 30px; border-radius: 9px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-weight: 700; font-size: .85rem; }

/* impression : fiche express propre */
@media print {
  #sidebar, #tabbar, .lesson-top, .btn, .no-print { display: none !important; }
  #app { display: block; }
  #main { padding: 0; }
  body { background: #fff; }
  .panel, .card { box-shadow: none; }
}

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

/* ==========================================================================
   WOW LAYER — ambient light, cover art, banners, motion
   ========================================================================== */
body::before {
  content: ''; position: fixed; inset: -25vh -25vw; z-index: -1; pointer-events: none;
  background:
    radial-gradient(38vw 38vw at 12% 4%, rgba(99, 102, 241, .11), transparent 70%),
    radial-gradient(30vw 30vw at 92% 8%, rgba(245, 158, 11, .09), transparent 70%),
    radial-gradient(44vw 44vw at 75% 100%, rgba(20, 184, 166, .08), transparent 70%);
}
:root[data-theme="dark"] body::before {
  background:
    radial-gradient(38vw 38vw at 12% 4%, rgba(99, 102, 241, .20), transparent 70%),
    radial-gradient(30vw 30vw at 92% 8%, rgba(236, 72, 153, .12), transparent 70%),
    radial-gradient(44vw 44vw at 75% 100%, rgba(20, 184, 166, .12), transparent 70%);
}
#sidebar { background: color-mix(in srgb, var(--bg) 72%, transparent); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); }
.nav-item.active { box-shadow: var(--shadow-1), inset 3px 0 0 var(--accent); }

.btn-primary { background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 62%, #ec4899)); border-color: transparent; }
.btn-primary:hover { border-color: transparent; filter: brightness(1.08) saturate(1.1); box-shadow: 0 8px 24px color-mix(in srgb, var(--accent) 40%, transparent); }

.section-title::before { content: ''; width: 6px; height: 22px; border-radius: 3px; background: linear-gradient(180deg, var(--accent), color-mix(in srgb, var(--accent) 40%, #f59e0b)); }

/* cover art */
svg.art { display: block; }
.art-motif { transform-origin: 70% 50%; animation: artFloat 9s ease-in-out infinite; }
.art-stars circle { animation: twinkle 4s ease-in-out infinite; }
.art-stars circle:nth-child(3n) { animation-delay: -1.3s; }
.art-stars circle:nth-child(3n+1) { animation-delay: -2.6s; }
@keyframes artFloat { 0%, 100% { transform: translateY(0) scale(1); } 50% { transform: translateY(-5px) scale(1.015); } }
@keyframes twinkle { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }

/* hero (home) */
.hero {
  position: relative; overflow: hidden; isolation: isolate; border-radius: 30px; color: #fff; min-height: 290px;
  box-shadow: 0 30px 70px -30px rgba(30, 27, 75, .75), 0 0 0 1px rgba(255, 255, 255, .06) inset;
}
.hero > .art { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -3; }
.hero::before {
  content: ''; position: absolute; inset: -60%; z-index: -2; mix-blend-mode: screen; opacity: .7;
  background: conic-gradient(from 0deg, transparent 0deg, rgba(236, 72, 153, .35) 60deg, transparent 120deg, rgba(250, 204, 21, .28) 200deg, transparent 250deg, rgba(45, 212, 191, .3) 310deg, transparent 360deg);
  filter: blur(50px); animation: aurora 22s linear infinite;
}
.hero::after { content: ''; position: absolute; inset: 0; z-index: -1; background: linear-gradient(100deg, rgba(8, 6, 30, .72) 0%, rgba(8, 6, 30, .35) 55%, rgba(8, 6, 30, .1) 100%); }
@keyframes aurora { to { transform: rotate(360deg); } }
.hero-inner { padding: 30px 34px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 22px 30px; align-items: center; }
.hero h1 { color: #fff; font-size: clamp(1.9rem, 4vw, 2.7rem); }
.hero .sub { color: rgba(255, 255, 255, .72); margin-top: 6px; }
.hero .eyebrow { color: #fcd34d; }
.hero .count { display: flex; align-items: baseline; gap: 10px; margin: 18px 0 4px; }
.hero .count b { font-family: var(--serif); font-size: clamp(3.4rem, 8vw, 5rem); line-height: .9; background: linear-gradient(180deg, #fff, #fde68a); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero .count span { color: rgba(255, 255, 255, .8); font-weight: 560; }
.hero p { color: rgba(255, 255, 255, .78); max-width: 560px; margin: 6px 0 0; font-size: .95rem; }
.hero .btn { background: #fff; color: #1e1b4b; border-color: #fff; box-shadow: 0 10px 30px -10px rgba(0, 0, 0, .5); }
.hero .btn:hover { filter: none; transform: translateY(-1px); }
.hero .ring-track { stroke: rgba(255, 255, 255, .18); }
.hero .ring-bar { stroke: #fcd34d; }
.hero .ring-label { fill: #fff; }
.hero-stats { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 20px; }
.glass-pill { display: flex; align-items: center; gap: 9px; padding: 8px 14px 8px 10px; border-radius: 14px; background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .16); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); color: #fff; text-decoration: none !important; transition: background .2s; }
.glass-pill:hover { background: rgba(255, 255, 255, .18); }
.glass-pill .ico { font-size: 1.25rem; }
.glass-pill b { display: block; line-height: 1.1; }
.glass-pill span { font-size: .72rem; color: rgba(255, 255, 255, .7); }
.hero-side { text-align: center; }
.hero-side .tiny { color: rgba(255, 255, 255, .7); margin-top: 6px; }
@media (max-width: 700px) { .hero-inner { grid-template-columns: minmax(0, 1fr); padding: 24px 20px; } .hero-side { display: none; } }

/* topic tiles with cover */
.topic-tile { padding: 0; gap: 0; min-height: 0; }
.topic-tile::before { display: none; }
.topic-tile .cover { position: relative; height: 118px; overflow: hidden; }
.topic-tile .cover .art { width: 100%; height: 100%; transition: transform .7s cubic-bezier(.2, .8, .2, 1); }
.topic-tile:hover .cover .art { transform: scale(1.07); }
.topic-tile .cover::after { content: ''; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, .28) 45%, transparent 60%); transform: translateX(-120%); transition: transform .9s ease; }
.topic-tile:hover .cover::after { transform: translateX(120%); }
.topic-tile .cover .t-badge { position: absolute; left: 14px; bottom: 12px; font: 700 .68rem var(--font); letter-spacing: .08em; text-transform: uppercase; color: #fff; background: rgba(0, 0, 0, .25); backdrop-filter: blur(6px); padding: 4px 9px; border-radius: 99px; }
.topic-tile .tile-body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.topic-tile .t-foot { margin-top: 10px; }
.topic-tile.locked { opacity: .78; }
.topic-tile.locked .cover { filter: grayscale(.55) brightness(.9); }
.topic-tile.locked::after { top: 12px; right: 12px; z-index: 2; background: rgba(0, 0, 0, .35); color: #fff; border-color: rgba(255, 255, 255, .25); }

/* banners (topic, module, lesson) */
.banner { position: relative; overflow: hidden; isolation: isolate; border-radius: 28px; color: #fff; margin-bottom: 26px; box-shadow: 0 24px 60px -30px rgba(0, 0, 0, .55); }
.banner > .art { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -2; }
.banner::after { content: ''; position: absolute; inset: 0; z-index: -1; background: linear-gradient(95deg, rgba(6, 6, 20, .74) 0%, rgba(6, 6, 20, .45) 55%, rgba(6, 6, 20, .08) 100%); }
.banner-inner { padding: 32px 34px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 20px; align-items: center; }
.banner h1 { color: #fff; font-size: clamp(1.8rem, 4vw, 2.6rem); margin: 8px 0 6px; }
.banner .eyebrow { color: #fde68a; }
.banner .en { color: rgba(255, 255, 255, .72); font-size: .92rem; }
.banner p { color: rgba(255, 255, 255, .86); max-width: 640px; margin: 12px 0 0; }
.banner .meta { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.banner .chip { background: rgba(255, 255, 255, .13); color: #fff; border-color: rgba(255, 255, 255, .22); backdrop-filter: blur(6px); }
.banner .btn { background: rgba(255, 255, 255, .14); color: #fff; border-color: rgba(255, 255, 255, .3); backdrop-filter: blur(6px); }
.banner .btn-primary { background: #fff; color: #111; border-color: #fff; box-shadow: 0 10px 30px -12px rgba(0, 0, 0, .6); }
.banner .ring-track { stroke: rgba(255, 255, 255, .2); }
.banner .ring-bar { stroke: #fff; }
.banner .ring-label { fill: #fff; }
.banner .crumbs, .banner .crumbs a { color: rgba(255, 255, 255, .7); }
@media (max-width: 700px) { .banner-inner { grid-template-columns: minmax(0, 1fr); padding: 24px 20px; } .banner .ring { display: none; } }

/* lesson hero */
.lesson-banner { margin: 6px 0 0; border-radius: 26px; }
.lesson-banner .banner-inner { padding: 30px 30px 64px; display: block; }
.lesson-banner h1 { font-size: clamp(1.7rem, 4.2vw, 2.4rem); }
.idea-card {
  position: relative; margin: -44px 18px 24px; padding: 18px 22px 18px 58px; border-radius: 20px; z-index: 2;
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-2);
  font-family: var(--serif); font-size: 1.2rem; line-height: 1.45;
}
.idea-card::before { content: '“'; position: absolute; left: 16px; top: 2px; font-size: 3.6rem; line-height: 1; color: var(--accent); font-family: var(--serif); }
.idea-card .lbl { display: block; font: 700 .68rem var(--font); letter-spacing: .09em; text-transform: uppercase; color: var(--accent); margin-bottom: 4px; }

/* cards */
.card { overflow: hidden; }
.card::before { content: ''; position: absolute; left: 0; top: 0; right: 0; height: 4px; background: linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--accent) 45%, #f59e0b) 60%, transparent); opacity: .85; }
.card-n { background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 60%, #ec4899)); color: #fff; }

/* progress path */
.path-item.done::before { background: var(--accent); }
.path-item.current .path-node { animation: pulseNode 2.2s ease-out infinite; }
@keyframes pulseNode { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 45%, transparent); } 70% { box-shadow: 0 0 0 14px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
.path-item.done .path-node { background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 60%, #ec4899)); border-color: transparent; }

.practice-tile .ico { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; background: var(--accent-soft); font-size: 1.5rem; }
.bigidea { overflow: hidden; }
.bigidea::after { content: ''; position: absolute; right: -30px; top: -30px; width: 90px; height: 90px; border-radius: 50%; background: radial-gradient(circle, var(--accent-soft), transparent 70%); }

.confetti { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 300; }
.done-banner .big { animation: popBig .7s cubic-bezier(.2, 1.6, .4, 1) both; }
@keyframes popBig { from { transform: scale(.2) rotate(-20deg); opacity: 0; } to { transform: none; opacity: 1; } }

/* hero crown + responsive activity grid */
.hero-side .crown { display: flex; justify-content: center; margin-bottom: 10px; filter: drop-shadow(0 4px 16px rgba(252, 211, 77, .45)); animation: artFloat 6s ease-in-out infinite; }
.heatmap { grid-template-rows: repeat(7, auto); grid-auto-columns: minmax(0, 1fr); overflow: visible; }
.heatmap i { width: 100%; height: auto; aspect-ratio: 1; max-width: 15px; }

/* long button labels: wrap instead of overflowing on phones */
.btn { max-width: 100%; }
.btn-big { white-space: normal; text-align: left; line-height: 1.3; }

/* larger reading text (Settings → Text size) */
:root[data-size="large"] body { font-size: 18.5px; }
:root[data-size="large"] .card h2 { font-size: 1.55rem; }
:root[data-size="large"] .idea-card { font-size: 1.3rem; }

/* search results + card focus */
a.search-hit { display: block; color: var(--ink); text-decoration: none !important; transition: border-color .15s, transform .15s; }
a.search-hit:hover { border-color: var(--accent-line); transform: translateY(-1px); }
.flash-card { animation: cardFlash 1.6s ease; }
@keyframes cardFlash { 0%, 40% { box-shadow: 0 0 0 4px var(--accent-soft), var(--shadow-2); } 100% { box-shadow: var(--shadow-1); } }

/* celebrations (streak, new grade) */
.celebrate { position: fixed; inset: 0; z-index: 250; display: grid; place-items: center; background: rgba(10, 8, 30, .38); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); cursor: pointer; animation: celIn .25s ease both; padding: 16px; }
.celebrate.out { animation: celOut .3s ease both; }
.celebrate-card { text-align: center; padding: 30px 40px 22px; border-radius: 28px; background: var(--surface); border: 1px solid var(--line); box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .5); min-width: 280px; max-width: 420px; animation: celPop .6s cubic-bezier(.2, 1.5, .4, 1) both; }
.celebrate-ico { font-size: 4.2rem; line-height: 1; display: inline-block; animation: celBounce 1.4s ease-in-out infinite; filter: drop-shadow(0 8px 18px rgba(249, 115, 22, .35)); }
.celebrate-kicker { font: 800 .72rem var(--font); letter-spacing: .12em; text-transform: uppercase; color: var(--accent); margin-top: 12px; }
.celebrate-title { font-family: var(--serif); font-size: 2rem; line-height: 1.15; margin-top: 4px; }
.celebrate-num { display: inline-block; min-width: 1ch; color: #f97316; font-weight: 700; }
.celebrate-num.flip { animation: celFlip .55s cubic-bezier(.2, 1.5, .4, 1) both; }
.celebrate-sub { color: var(--ink-2); margin-top: 8px; }
.celebrate-tap { font-size: .7rem; color: var(--ink-3); margin-top: 16px; letter-spacing: .04em; }
@keyframes celIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes celOut { to { opacity: 0; } }
@keyframes celPop { from { opacity: 0; transform: scale(.6) translateY(20px); } to { opacity: 1; transform: none; } }
@keyframes celBounce { 0%, 100% { transform: translateY(0) scale(1); } 50% { transform: translateY(-8px) scale(1.08); } }
@keyframes celFlip { 0% { transform: translateY(-60%) scale(.4); opacity: 0; } 100% { transform: none; opacity: 1; } }

/* streak pill states + countdown milestone line */
.streak-pill.hot .ico { animation: flicker 1.8s ease-in-out infinite; display: inline-block; }
.streak-pill.cold { opacity: .78; }
.streak-pill.cold .ico { filter: grayscale(.6); }
@keyframes flicker { 0%, 100% { transform: scale(1) rotate(0); } 25% { transform: scale(1.12) rotate(-4deg); } 50% { transform: scale(.96) rotate(3deg); } 75% { transform: scale(1.08) rotate(-2deg); } }
.countdown-note { display: inline-block; margin: 6px 0 2px; padding: 5px 12px; border-radius: 99px; background: rgba(252, 211, 77, .16); border: 1px solid rgba(252, 211, 77, .4); color: #fde68a; font-size: .85rem; font-weight: 600; }
.celebrate-card { width: min(400px, 92vw); min-width: 0; padding: 28px 28px 20px; }
.celebrate-title { font-size: 1.8rem; }

/* static description for web-filter crawlers (hidden once the app runs) */
.js .seo-intro { display: none; }
.seo-intro { max-width: 760px; margin: 40px auto; font-size: 1rem; }

/* sync button (top right) */
.sync-btn { position: fixed; top: 14px; right: 18px; z-index: 60; display: inline-flex; align-items: center; gap: 7px; padding: 7px 12px 7px 10px; border-radius: 99px; border: 1px solid var(--line-2); background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); box-shadow: var(--shadow-1); font: 600 .82rem var(--font); color: var(--ink-2); cursor: pointer; transition: transform .12s, box-shadow .15s; }
.sync-btn:hover { box-shadow: var(--shadow-2); color: var(--ink); }
.sync-btn:active { transform: scale(.96); }
.sync-btn .sync-ico { font-size: 1rem; line-height: 1; }
.sync-btn .sync-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--line-2); }
.sync-btn[data-state="ok"] .sync-dot { background: #22c55e; }
.sync-btn[data-state="dirty"] .sync-dot { background: #f59e0b; box-shadow: 0 0 0 3px rgba(245, 158, 11, .2); }
.sync-btn[data-state="error"] .sync-dot { background: var(--bad); }
.sync-btn[data-state="busy"] .sync-ico { animation: syncSpin 1s linear infinite; display: inline-block; }
@keyframes syncSpin { 50% { transform: translateY(-3px) scale(1.1); } }
@media (max-width: 920px) {
  .sync-btn { top: 10px; right: 10px; padding: 7px; }
  .sync-btn .sync-label { display: none; }
  .lesson-top .row { padding-right: 44px; }
}
@media print { .sync-btn { display: none !important; } }

/* modal (connect a device) */
.modal { position: fixed; inset: 0; z-index: 260; display: grid; place-items: center; padding: 16px; background: rgba(10, 8, 30, .4); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); animation: celIn .2s ease both; }
.modal-card { width: min(420px, 94vw); padding: 24px 24px 18px; border-radius: 22px; background: var(--surface); border: 1px solid var(--line); box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .5); animation: celPop .45s cubic-bezier(.2, 1.4, .4, 1) both; }
.modal-ico { font-size: 2.2rem; }
.modal-card h3 { font-family: var(--serif); font-size: 1.4rem; margin: 6px 0 8px; }
.sync-input { width: 100%; padding: 13px 14px; border-radius: 12px; border: 1.5px solid var(--line-2); background: var(--surface-2); color: var(--ink); font: 700 1.05rem var(--mono); letter-spacing: .08em; text-align: center; text-transform: uppercase; }
.sync-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.sync-input.shake { animation: shake .4s ease; }

/* promotion scene (new grade) */
.promo { overflow: hidden; }
.promo .promo-rays { position: absolute; width: 160vmax; height: 160vmax; left: 50%; top: 50%; margin: -80vmax 0 0 -80vmax; background: repeating-conic-gradient(from 0deg, rgba(252, 211, 77, .24) 0deg 7deg, transparent 7deg 20deg); -webkit-mask-image: radial-gradient(circle, #000 0 14%, transparent 52%); mask-image: radial-gradient(circle, #000 0 14%, transparent 52%); animation: raysSpin 16s linear infinite; pointer-events: none; }
@keyframes raysSpin { to { transform: rotate(360deg); } }
.promo-card { position: relative; width: min(420px, 92vw); padding: 24px 26px 18px; border-radius: 28px; text-align: center; background: linear-gradient(180deg, var(--surface), var(--surface-2)); border: 1px solid rgba(252, 211, 77, .55); box-shadow: 0 0 0 6px rgba(252, 211, 77, .14), 0 30px 80px -20px rgba(0, 0, 0, .55); animation: celPop .6s cubic-bezier(.2, 1.5, .4, 1) both; }
.promo-card.shake { animation: promoShake .5s ease; }
@keyframes promoShake { 10%, 90% { transform: translateX(-2px); } 20%, 80% { transform: translateX(4px); } 30%, 50%, 70% { transform: translateX(-7px) rotate(-1deg); } 40%, 60% { transform: translateX(7px) rotate(1deg); } }
.promo-kicker { font: 800 .74rem var(--font); letter-spacing: .16em; text-transform: uppercase; color: #d97706; }
.promo-stage { position: relative; height: 176px; margin: 12px 0 4px; perspective: 900px; }
.promo-badge { width: 168px; height: 168px; margin: 0 auto; }
.promo-inner { position: relative; width: 100%; height: 100%; transition: transform .9s cubic-bezier(.3, 1.4, .5, 1); transform-style: preserve-3d; }
.promo-badge.flipped .promo-inner { transform: rotateY(180deg); }
.promo-face { position: absolute; inset: 0; border-radius: 50%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 18px; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.promo-face.front { background: var(--surface-3); border: 3px solid var(--line-2); color: var(--ink-3); filter: grayscale(.5); }
.promo-face.back { transform: rotateY(180deg); background: radial-gradient(circle at 35% 30%, #fff7cc, #fcd34d 45%, #d97706); border: 3px solid #fde68a; box-shadow: 0 10px 40px rgba(217, 119, 6, .45); color: #3b2300; }
.promo-ico { font-size: 3.3rem; line-height: 1; }
.promo-face small { font-size: .78rem; font-weight: 600; }
.promo-face b { font-family: var(--serif); font-size: 1.02rem; line-height: 1.15; }
.promo-stamp { position: absolute; left: 50%; top: 80%; transform: translate(-50%, -50%) rotate(-12deg) scale(3); opacity: 0; font: 900 1.45rem var(--font); letter-spacing: .14em; color: #dc2626; border: 4px solid #dc2626; border-radius: 10px; padding: 3px 14px; background: rgba(255, 255, 255, .9); pointer-events: none; box-shadow: 0 6px 18px rgba(220, 38, 38, .25); }
.promo-stamp.slam { animation: stampSlam .45s cubic-bezier(.2, 1.6, .4, 1) forwards; }
@keyframes stampSlam { 0% { opacity: 0; transform: translate(-50%, -50%) rotate(-12deg) scale(3); } 60% { opacity: 1; transform: translate(-50%, -50%) rotate(-12deg) scale(.9); } 100% { opacity: .95; transform: translate(-50%, -50%) rotate(-12deg) scale(1); } }
.promo-quip { font-family: var(--serif); font-style: italic; font-size: 1.12rem; color: var(--ink); margin-top: 12px; opacity: 0; transform: translateY(8px); transition: opacity .5s, transform .5s; }
.promo-next { margin-top: 8px; font-size: .88rem; color: var(--ink-2); opacity: 0; transition: opacity .5s .25s; }
.promo-quip.in, .promo-next.in { opacity: 1; transform: none; }
.promo-stamp { left: 76%; top: 16%; font-size: 1.05rem; padding: 2px 10px; border-width: 3px; }
