/* CertiPrépa — feuille de style unique. Thème clair/sombre, responsive, accessible, impression. */
/* Jetons de design : registre éditorial. Papier, encre bleu nuit, un seul accent, filets fins, aucun dégradé. */
:root {
  --bg: #f7f5f0;
  --surface: #ffffff;
  --surface-2: #f0ede6;
  --text: #17202a;
  --muted: #5f646b;
  --border: #dfd9ce;
  --rule: #17202a;
  --primary: #1b2a41;
  --primary-hover: #0f1a2b;
  --primary-ink: #ffffff;
  --accent: #9b3d1f;
  --accent-soft: #f6e9e2;
  --grad: #1b2a41;
  --grad-hero: #1b2a41;
  --ink-block: #1b2a41;
  --ink-block-text: #e9e5dc;
  --ink-block-muted: #a9b0bb;
  --ok: #2d6a3e;
  --ok-soft: #e7f0e7;
  --warn: #8a5a00;
  --warn-soft: #f7efdd;
  --ko: #a3271f;
  --ko-soft: #f7e6e3;
  --gold: #8a5a00;
  --focus: #9b3d1f;
  --side: #f7f5f0;
  --side-2: #f7f5f0;
  --side-text: #17202a;
  --shadow: none;
  --shadow-lg: 0 1px 0 rgba(23, 32, 42, .06);
  --radius: 4px;
  --radius-sm: 3px;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, "Times New Roman", serif;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #15181d;
    --surface: #1b1f25;
    --surface-2: #23282f;
    --text: #ebe7df;
    --muted: #a19d95;
    --border: #333941;
    --rule: #ebe7df;
    --primary: #e7e1d5;
    --primary-hover: #ffffff;
    --primary-ink: #15181d;
    --accent: #d98a64;
    --accent-soft: #3a2a22;
    --grad: #e7e1d5;
    --grad-hero: #0f1218;
    --ink-block: #0f1218;
    --ok: #7fbf8d;
    --ok-soft: #1d2b21;
    --warn: #d9ad5c;
    --warn-soft: #2e2716;
    --ko: #e58a80;
    --ko-soft: #33201e;
    --gold: #d9ad5c;
    --focus: #d98a64;
    --side: #15181d;
    --side-2: #15181d;
    --side-text: #ebe7df;
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.6 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--primary); text-underline-offset: 2px; }
a:hover { color: var(--primary-hover); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; letter-spacing: -.02em; font-weight: 750; }
h1 { font-size: clamp(1.6rem, 2.4vw, 2rem); }
h2 { font-size: 1.2rem; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 .8em; }
code { background: var(--surface-2); padding: .1em .35em; border-radius: 4px; font-size: .9em; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: -9999px; top: 8px; z-index: 100; background: var(--surface); padding: .5rem 1rem; border-radius: var(--radius-sm); }
.skip-link:focus { left: 8px; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.center { text-align: center; }
.ok { color: var(--ok); }
.warn { color: var(--warn); }
.nowrap { white-space: nowrap; }
.noscript { padding: 2rem; }
.boot-msg { padding: 2rem; color: var(--muted); animation: boot-in 0s 2s backwards; }
@keyframes boot-in { from { visibility: hidden; } }
.boot-error { margin: 2rem; max-width: 640px; }
.boot-error pre { white-space: pre-wrap; font-size: .8rem; color: var(--muted); }
[hidden] { display: none !important; }

/* Gabarit */
#app { min-height: 100vh; display: grid; grid-template-columns: 260px 1fr; grid-template-rows: auto 1fr auto; grid-template-areas: "side top" "side main" "side foot"; }
.topbar { grid-area: top; display: none; }
.sidebar { grid-area: side; position: sticky; top: 0; height: 100vh; overflow-y: auto; background: var(--surface); border-right: 1px solid var(--border); padding: 1.1rem .8rem; display: flex; flex-direction: column; gap: 1rem; }
.sidebar ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.sidebar a { display: flex; align-items: center; gap: .7rem; padding: .55rem .7rem; border-radius: var(--radius-sm); color: var(--text); text-decoration: none; font-weight: 500; }
.sidebar a:hover { background: var(--surface-2); }
.sidebar a.active { background: var(--accent-soft); color: var(--accent); }
.sidebar svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.brand { display: flex; align-items: center; gap: .6rem; text-decoration: none; color: var(--text); font-weight: 700; font-size: 1.1rem; }
.brand small { display: block; font-size: .72rem; font-weight: 500; color: var(--muted); }
.brand-side { padding: .2rem .5rem .6rem; }
.sidebar a.cert-switch { justify-content: space-between; border: 1px solid var(--border); background: var(--surface-2); padding: .5rem .7rem; }
.cert-switch small { display: block; color: var(--muted); font-size: .72rem; font-weight: 500; }
.cert-switch strong { font-size: 1rem; }
.cert-switch-action { font-size: .8rem; color: var(--accent); font-weight: 600; }
.cert-chip { margin-left: auto; text-decoration: none; font-weight: 700; font-size: .85rem; color: var(--accent); background: var(--accent-soft); border-radius: 999px; padding: .25rem .75rem; }
.cert-card { display: flex; flex-direction: column; }
.cert-card.cert-current { border-color: var(--accent); }
.cert-card h2 .muted { font-weight: 500; font-size: .95rem; }
.cert-actions { margin-top: auto; display: flex; flex-wrap: wrap; gap: .5rem; }
.sidebar-user { margin-top: auto; border-top: 1px solid var(--border); padding-top: .8rem; display: grid; gap: .5rem; }
.sidebar-user small { display: block; color: var(--muted); font-weight: 400; font-size: .78rem; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--primary); color: var(--primary-ink); display: grid; place-items: center; font-weight: 700; flex: none; }
.main { grid-area: main; padding: 2rem clamp(1rem, 3vw, 2.5rem); max-width: 1200px; width: 100%; min-width: 0; outline: none; }
.main-bare { grid-column: 1 / -1; grid-row: 1 / -1; max-width: none; padding: 0; }
.footer { grid-area: foot; padding: 1rem clamp(1rem, 3vw, 2.5rem) 1.5rem; color: var(--muted); font-size: .8rem; }
.icon-btn { background: none; border: 0; padding: .4rem; border-radius: var(--radius-sm); color: inherit; cursor: pointer; display: inline-grid; place-items: center; }
.icon-btn:hover { background: var(--surface-2); }
.icon-btn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }

@media (max-width: 900px) {
  #app { grid-template-columns: 1fr; grid-template-areas: "top" "main" "foot"; }
  .topbar { display: flex; align-items: center; gap: .5rem; position: sticky; top: 0; z-index: 20; background: var(--surface); border-bottom: 1px solid var(--border); padding: .5rem .8rem; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: 280px; z-index: 30; transform: translateX(-100%); transition: transform .2s; box-shadow: var(--shadow); }
  .sidebar.open { transform: none; }
  .main { padding: 1.2rem 1rem; }
  .footer { padding-bottom: calc(5rem + env(safe-area-inset-bottom)); }
}

/* Barre de navigation basse (mobile et tablette) */
.bottomnav { display: none; position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; grid-template-columns: repeat(5, 1fr);
  background: var(--surface); border-top: 1px solid var(--border); box-shadow: 0 -2px 10px rgba(16, 24, 40, .06);
  padding: .3rem .25rem calc(.3rem + env(safe-area-inset-bottom)); }
.bottomnav a, .bottomnav button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .15rem;
  min-height: 52px; padding: .25rem .1rem; border: 0; border-radius: var(--radius-sm); background: none; color: var(--muted);
  font: inherit; font-size: .72rem; font-weight: 600; text-decoration: none; cursor: pointer; }
.bottomnav svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.bottomnav [data-more] svg { stroke-width: 3.2; }
.bottomnav .active { color: var(--accent); background: var(--accent-soft); }
.bottomnav a:hover, .bottomnav button:hover { color: var(--text); }
.drawer-backdrop { position: fixed; inset: 0; z-index: 28; background: rgba(10, 15, 25, .45); }
@media (max-width: 900px) { .bottomnav { display: grid; } }
@media (min-width: 901px) { .drawer-backdrop { display: none; } }

/* Composants */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.3rem 1.4rem; box-shadow: var(--shadow); margin-bottom: 1.2rem; }
.card h2:first-child { margin-top: 0; }
.grid { display: grid; gap: 1.2rem; margin-bottom: 1.2rem; }
.grid > .card { margin-bottom: 0; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr)); }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.4rem; }
.page-head p { margin: 0; }
.eyebrow { text-transform: uppercase; letter-spacing: .06em; font-size: .75rem; font-weight: 700; color: var(--accent); margin-bottom: .3rem; }
.loading { padding: 3rem; text-align: center; color: var(--muted); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; border: 1px solid transparent; border-radius: var(--radius-sm); padding: .6rem 1.1rem; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; line-height: 1.2; transition: background .15s, border-color .15s; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: var(--primary-ink); }
.btn-primary:hover:not(:disabled) { background: var(--primary-hover); color: var(--primary-ink); }
.btn-ghost { background: var(--surface); border-color: var(--border); color: var(--text); }
.btn-ghost:hover:not(:disabled) { background: var(--surface-2); color: var(--text); }
.btn-danger { background: var(--ko); color: #fff; }
.btn-danger:hover { filter: brightness(1.08); color: #fff; }
.btn-sm { padding: .38rem .7rem; font-size: .875rem; }
.btn-block { width: 100%; }
.btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.link-btn { background: none; border: 0; padding: 0; color: var(--primary); text-decoration: underline; cursor: pointer; font: inherit; }
.card-actions { display: flex; gap: .6rem; flex-wrap: wrap; margin-top: 1rem; }
.tag { display: inline-block; font-size: .75rem; font-weight: 600; padding: .15rem .5rem; border-radius: 999px; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.tag-ok { background: var(--ok-soft); color: var(--ok); }
.tag-ko { background: var(--ko-soft); color: var(--ko); }
.tag-level { background: var(--accent-soft); color: var(--accent); }
.pill { display: inline-block; background: var(--accent-soft); color: var(--accent); border-radius: 999px; padding: .25rem .8rem; font-weight: 600; font-size: .85rem; }
.banner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; padding: .9rem 1.1rem; border-radius: var(--radius); background: var(--accent-soft); border: 1px solid var(--border); margin-bottom: 1.2rem; }
.banner-warn { background: var(--warn-soft); }
.banner-actions { display: flex; gap: .5rem; }
.bar { position: relative; height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; flex: 1; }
.bar-fill { position: absolute; inset: 0 auto 0 0; width: 0; background: var(--primary); border-radius: 999px; transition: width .4s; }
.bar-fill.ok { background: var(--ok); }
.bar-fill.warn { background: var(--warn); }
.bar-target { position: absolute; top: -2px; bottom: -2px; width: 0; border-right: 2px dashed var(--text); opacity: .55; }
.progress { height: 4px; background: var(--surface-2); position: relative; border-radius: 999px; overflow: hidden; margin: .6rem 0 1rem; }
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th, .table td { text-align: left; padding: .55rem .6rem; border-bottom: 1px solid var(--border); vertical-align: top; }
.table th { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.table td.msg { min-width: 220px; }
.row-warn td { background: var(--warn-soft); }
.list-plain { list-style: none; padding: 0; margin: 0; }
.tabs { display: flex; gap: .3rem; border-bottom: 1px solid var(--border); margin-bottom: 1.2rem; flex-wrap: wrap; }
.tab { background: none; border: 0; border-bottom: 3px solid transparent; padding: .6rem 1rem; font: inherit; font-weight: 600; color: var(--muted); cursor: pointer; }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.stat { display: flex; flex-direction: column; gap: .2rem; }
.stat-label { font-size: .8rem; color: var(--muted); }
.stat-value { font-size: 1.8rem; font-weight: 700; }
.filters { display: flex; gap: 1rem; flex-wrap: wrap; margin-bottom: .8rem; }
.filters select { margin-left: .4rem; }

/* Formulaires */
.field { display: grid; gap: .3rem; margin-bottom: 1rem; }
.field > span { font-weight: 600; font-size: .9rem; }
input, select, textarea { font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: .6rem .7rem; width: 100%; }
input[type=checkbox], input[type=radio] { width: auto; accent-color: var(--primary); }
textarea { resize: vertical; }
.field-inline { max-width: 240px; }
.check { display: flex; gap: .55rem; align-items: flex-start; margin-bottom: .6rem; cursor: pointer; }
.check input { margin-top: .3rem; flex: none; }
.form-error { color: var(--ko); background: var(--ko-soft); padding: .6rem .8rem; border-radius: var(--radius-sm); }
.form-grid { display: grid; gap: 1.2rem; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
legend { font-weight: 700; margin-bottom: .6rem; padding: 0; }
.seg { display: inline-flex; flex-wrap: wrap; gap: .4rem; }
.seg label { cursor: pointer; }
.seg input { position: absolute; opacity: 0; }
.seg label span, .seg-btn { display: inline-block; padding: .5rem .95rem; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); font-weight: 600; font-size: .9rem; color: var(--text); cursor: pointer; font-family: inherit; }
.seg input:checked + span, .seg-btn.active { background: var(--primary); color: var(--primary-ink); border-color: var(--primary); }
.seg input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }
.seg-sm .seg-btn { padding: .35rem .75rem; font-size: .85rem; }
.choice-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr)); gap: .8rem; }
.choice-cards-3 { grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr)); }
.choice { display: flex; gap: .7rem; border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; cursor: pointer; }
.choice:has(input:checked) { border-color: var(--primary); background: var(--accent-soft); }
.choice small { display: block; color: var(--muted); margin-top: .25rem; }
.checks-inline { display: grid; gap: .2rem; margin-bottom: .8rem; }
.sec-picker { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: .5rem .8rem; margin-bottom: .5rem; }
.sec-picker summary { cursor: pointer; list-style-position: outside; }
.sec-picker summary .check { display: inline-flex; margin: 0; }
.topic-picks { display: grid; padding: .6rem 0 .2rem 1.5rem; }
.topic-picks .check { margin-bottom: .3rem; font-size: .92rem; }
.rules { background: var(--surface-2); border-radius: var(--radius); padding: 1rem 1.2rem; }
.rules ul { margin: 0 0 .8rem; padding-left: 1.2rem; }
.search input { max-width: 520px; }
.copy-field { font-family: ui-monospace, monospace; font-size: .85rem; }

/* Authentification */
.auth-layout { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.auth-hero { background: linear-gradient(160deg, #1f3a5f, #0f2440); color: #fff; padding: clamp(2rem, 6vw, 5rem); display: flex; flex-direction: column; justify-content: center; }
.auth-hero .brand { color: #fff; margin-bottom: 2.5rem; }
.auth-hero h1 { font-size: clamp(1.8rem, 3.5vw, 2.6rem); }
.auth-hero p { color: #d6e0ee; max-width: 560px; }
.auth-hero .muted { color: #a9b9cf; }
.hero-list { padding-left: 1.2rem; color: #e7eef8; max-width: 560px; }
.hero-list li { margin-bottom: .5rem; }
.auth-panel { display: grid; place-items: center; padding: 2rem 1rem; }
.auth-card { width: 100%; max-width: 420px; }
@media (max-width: 900px) {
  .auth-layout { grid-template-columns: 1fr; }
  .auth-hero { padding: 2rem 1.2rem; }
  .auth-hero .brand { margin-bottom: 1rem; }
}
.narrow { max-width: 780px; margin: 2rem auto; }
.main-bare .narrow { margin: 2rem auto; }

/* Tableau de bord */
.head-stats { display: flex; gap: 1.5rem; }
.head-stats div { display: flex; flex-direction: column; align-items: flex-end; }
.head-stats strong { font-size: 1.5rem; }
.head-stats span { font-size: .78rem; color: var(--muted); }
.part-card h2 { font-size: 1.05rem; min-height: 2.6em; }
.metric-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; margin: .5rem 0 1rem; }
.metric-label { display: block; font-size: .75rem; color: var(--muted); }
.metric { font-size: 1.35rem; font-weight: 700; }
.sections-mini { display: grid; gap: .45rem; }
.sec-row { display: flex; align-items: center; gap: .6rem; font-size: .85rem; }
.sec-id { width: 1.2rem; font-weight: 700; color: var(--muted); }
.sec-val { width: 3rem; text-align: right; color: var(--muted); }
.weak-row { display: flex; justify-content: space-between; gap: 1rem; padding: .45rem 0; border-bottom: 1px solid var(--border); }
.weak-row:last-child { border-bottom: 0; }
.weak-row a { text-decoration: none; color: var(--text); }
.weak-row > span { white-space: nowrap; }
.activity { width: 100%; height: 80px; }
.activity .act { fill: var(--accent); }
.activity .act-empty { fill: var(--border); }
.chart { width: 100%; height: auto; }
.chart .grid { stroke: var(--border); stroke-width: 1; }
.chart .axis { fill: var(--muted); font-size: 11px; }
.chart .line { fill: none; stroke: var(--primary); stroke-width: 2.5; }
.chart .dot { fill: var(--surface); stroke: var(--primary); stroke-width: 2.5; }
.chart .target { stroke: var(--ok); stroke-dasharray: 5 5; stroke-width: 1.5; }
.chart .target-label { fill: var(--ok); }

/* Programme et cours */
.part-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.syl-section { border-top: 1px solid var(--border); padding-top: 1rem; margin-top: 1rem; }
.syl-section h3 { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.sec-badge { display: inline-grid; place-items: center; width: 1.8rem; height: 1.8rem; border-radius: 50%; background: var(--primary); color: var(--primary-ink); font-size: .9rem; }
.weight { font-size: .85rem; color: var(--accent); background: var(--accent-soft); padding: .1rem .55rem; border-radius: 999px; }
.topic-list { list-style: none; padding: 0; margin: .4rem 0 0; display: grid; gap: .3rem; }
.topic-group { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: .6rem .7rem .1rem; }
.topic-link { display: grid; grid-template-columns: 2.6rem 1fr auto 1.6rem; gap: .6rem; align-items: center; padding: .55rem .7rem; border-radius: var(--radius-sm); text-decoration: none; color: var(--text); border: 1px solid transparent; }
.topic-link:hover { background: var(--surface-2); border-color: var(--border); }
.topic-code { font-weight: 700; color: var(--muted); }
.topic-meta { font-size: .8rem; color: var(--muted); }
.done-badge { color: var(--ok); font-weight: 700; text-align: center; }
.todo-badge { width: 12px; height: 12px; border: 2px solid var(--border); border-radius: 50%; justify-self: center; }
.breadcrumb { font-size: .875rem; color: var(--muted); margin-bottom: .8rem; }
.prose { max-width: 860px; }
.prose ul { padding-left: 1.3rem; }
.prose li { margin-bottom: .35rem; }
.lead { font-size: 1.1rem; color: var(--muted); }
.list-title { font-weight: 700; margin-bottom: .3rem; }
.callout { border-radius: var(--radius-sm); padding: .9rem 1.1rem; margin: 1.1rem 0; border-left: 4px solid; }
.callout p:last-child { margin: 0; }
.callout-title { font-weight: 700; margin-bottom: .25rem; }
.callout-key { background: var(--accent-soft); border-color: var(--accent); }
.callout-trap { background: var(--warn-soft); border-color: var(--warn); }
.lesson .table { margin: .6rem 0 1rem; }
.lesson-refs { border-top: 1px solid var(--border); margin-top: 1.5rem; padding-top: 1rem; font-size: .9rem; color: var(--muted); }
.lesson-actions { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; max-width: 860px; margin-bottom: 1rem; }
.pager { display: flex; justify-content: space-between; gap: .6rem; max-width: 860px; flex-wrap: wrap; }

/* Questions */
.runner { max-width: 860px; }
.runner-head { display: flex; align-items: center; gap: 1rem; }
.runner-title { font-weight: 700; flex: 1; }
.runner-progress { color: var(--muted); font-size: .9rem; }
.q-meta { display: flex; gap: .4rem; align-items: center; margin-bottom: .8rem; flex-wrap: wrap; }
.star { margin-left: auto; color: var(--muted); }
.star.on { color: #d49b00; }
.star.on svg { fill: currentColor; }
.stem { font-size: 1.08rem; font-weight: 500; margin-bottom: 1.1rem; white-space: pre-line; }
.options { display: grid; gap: .55rem; }
.option { display: flex; gap: .8rem; align-items: flex-start; width: 100%; text-align: left; background: var(--surface); border: 2px solid var(--border); border-radius: var(--radius-sm); padding: .75rem .9rem; font: inherit; color: var(--text); cursor: pointer; transition: border-color .12s, background .12s; }
.option:hover:not(:disabled) { border-color: var(--primary); }
.option.selected { border-color: var(--primary); background: var(--accent-soft); }
.option.correct { border-color: var(--ok); background: var(--ok-soft); }
.option.wrong { border-color: var(--ko); background: var(--ko-soft); }
.option.dim { opacity: .75; }
.option:disabled { cursor: default; }
.opt-letter { flex: none; display: inline-grid; place-items: center; width: 1.7rem; height: 1.7rem; border-radius: 50%; background: var(--surface-2); font-weight: 700; font-size: .85rem; }
.option.selected .opt-letter, .option.correct .opt-letter { background: var(--primary); color: var(--primary-ink); }
.option.correct .opt-letter { background: var(--ok); color: #fff; }
.option.wrong .opt-letter { background: var(--ko); color: #fff; }
.rationale { font-size: .9rem; color: var(--muted); margin: -.2rem 0 .3rem 2.6rem; }
.rationale.ok { color: var(--ok); }
.feedback { display: flex; flex-direction: column; gap: .2rem; padding: .8rem 1rem; border-radius: var(--radius-sm); margin-top: 1rem; }
.fb-ok { background: var(--ok-soft); color: var(--ok); }
.fb-ko { background: var(--ko-soft); color: var(--ko); }
.feedback .small { color: var(--text); }
.q-actions { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-top: 1.2rem; flex-wrap: wrap; }
.kbd-help { margin: .8rem 0 0; }
.boxes { display: grid; grid-template-columns: repeat(auto-fit, minmax(56px, 1fr)); gap: .6rem; margin-bottom: 1rem; }
.box { background: var(--surface-2); border-radius: var(--radius-sm); padding: .7rem; text-align: center; }
.box-n { display: block; font-size: 1.4rem; font-weight: 700; }
.box-l { font-size: .78rem; color: var(--muted); }

/* Examen en conditions réelles */
.exam { min-height: 100vh; display: grid; grid-template-rows: auto 1fr auto; background: var(--bg); }
.exam-bar { display: grid; grid-template-columns: 1fr auto auto auto; gap: 1.2rem; align-items: center; padding: .7rem 1.2rem; background: var(--primary); color: var(--primary-ink); position: sticky; top: 0; z-index: 10; }
.exam-title span { display: block; font-size: .8rem; opacity: .85; }
.exam-count { font-size: .95rem; }
.exam-timer { font-variant-numeric: tabular-nums; font-size: 1.35rem; font-weight: 700; background: rgba(255, 255, 255, .14); padding: .2rem .8rem; border-radius: var(--radius-sm); }
.timer-low { color: #ffd3cf; animation: pulse 1.5s infinite; }
@keyframes pulse { 50% { opacity: .65; } }
.exam-tools { display: flex; gap: .4rem; }
.exam-bar .btn-ghost { background: transparent; color: var(--primary-ink); border-color: rgba(255, 255, 255, .45); }
.exam-bar .btn-ghost:hover { background: rgba(255, 255, 255, .12); color: var(--primary-ink); }
.exam-body { padding: 1.5rem clamp(1rem, 4vw, 3rem); }
.exam-question, .exam-review { max-width: 900px; margin: 0 auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.5rem; box-shadow: var(--shadow); }
.exam-q-head { display: flex; justify-content: flex-end; margin-bottom: .8rem; }
.btn-flag.on { background: var(--warn-soft); color: var(--warn); border-color: var(--warn); }
.exam-opt { display: flex; gap: .4rem; align-items: stretch; }
.exam-opt .option { flex: 1; }
.strike-btn { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--muted); cursor: pointer; padding: 0 .55rem; }
.strike-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.strike-btn[aria-pressed="true"] { color: var(--ko); border-color: var(--ko); }
.exam-opt.struck .opt-text { text-decoration: line-through; opacity: .55; }
.exam-foot { display: flex; justify-content: space-between; align-items: center; gap: .8rem; padding: .8rem 1.2rem; background: var(--surface); border-top: 1px solid var(--border); position: sticky; bottom: 0; flex-wrap: wrap; }
.exam-foot-right { display: flex; gap: .5rem; }
.save-status { font-size: .82rem; color: var(--muted); }
.save-status.warn { color: var(--warn); font-weight: 600; }
.review-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(48px, 1fr)); gap: .45rem; margin: 1rem 0; }
.rv { position: relative; display: inline-grid; place-items: center; min-width: 40px; height: 40px; border-radius: var(--radius-sm); border: 2px solid var(--border); background: var(--surface); font: inherit; font-weight: 600; color: var(--text); cursor: pointer; }
.rv-ans { background: var(--accent-soft); border-color: var(--accent); }
.rv-empty { background: var(--surface); border-style: dashed; }
.rv-flag::after { content: ""; position: absolute; top: -5px; right: -5px; width: 12px; height: 12px; border-radius: 50%; background: var(--warn); border: 2px solid var(--surface); }
.legend .rv { min-width: 26px; height: 26px; font-size: .75rem; margin: 0 .2rem 0 .6rem; cursor: default; }
@media (max-width: 700px) {
  .exam-bar { grid-template-columns: 1fr auto; gap: .5rem; }
  .exam-count { order: 3; }
  .exam-tools { order: 4; justify-self: end; }
  .exam-foot .save-status { order: 3; width: 100%; }
}

/* Calculatrice */
.calc { position: fixed; right: 1.2rem; bottom: 5rem; z-index: 60; width: 260px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: none; padding: .7rem; }
.calc-head { display: flex; justify-content: space-between; align-items: center; font-weight: 700; margin-bottom: .4rem; }
.calc-display { display: block; text-align: right; font-size: 1.6rem; font-variant-numeric: tabular-nums; background: var(--surface-2); border-radius: var(--radius-sm); padding: .4rem .6rem; margin-bottom: .5rem; overflow: hidden; }
.calc-keys { display: grid; grid-template-columns: repeat(4, 1fr); gap: .35rem; }
.calc-keys button { font: inherit; font-size: 1.05rem; padding: .6rem 0; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer; }
.calc-keys button.op { background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.calc-keys button:hover { filter: brightness(.96); }

/* Résultats */
.score-ring { width: 120px; height: 120px; border-radius: 50%; display: grid; place-items: center; border: 10px solid var(--ok); font-size: 1.6rem; font-weight: 800; }
.score-ring.warn { border-color: var(--warn); }
.facts li { padding: .3rem 0; }
.sec-result { margin-bottom: .9rem; }
.sec-result-head { display: flex; justify-content: space-between; gap: 1rem; font-size: .92rem; margin-bottom: .3rem; }
.sec-result-head > span:last-child { white-space: nowrap; }
.corr { border: 1px solid var(--border); border-left: 4px solid var(--ok); border-radius: var(--radius-sm); margin-bottom: .5rem; }
.corr-ko { border-left-color: var(--ko); }
.corr summary { display: flex; gap: .7rem; align-items: baseline; padding: .7rem .9rem; cursor: pointer; }
.corr-n { font-weight: 700; color: var(--muted); min-width: 2rem; }
.corr-stem { flex: 1; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.corr[open] .corr-stem { display: block; }
.corr-body { padding: 0 1rem 1rem 3.6rem; }
.corr-opt { border-radius: var(--radius-sm); padding: .5rem .7rem; margin-bottom: .35rem; }
.corr-opt p { margin: 0; }
.corr-opt .rationale { margin: .2rem 0 0 2.4rem; }
.corr-opt.correct { background: var(--ok-soft); }
.corr-opt.wrong { background: var(--ko-soft); }
.corr-opt .opt-letter { margin-right: .5rem; }

/* Glossaire */
.glossary { display: grid; gap: .6rem; margin: 0; }
.g-item { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: .8rem 1rem; }
.g-item dt { font-weight: 700; }
.g-item .en { font-weight: 400; font-style: italic; color: var(--muted); margin-left: .4rem; }
.g-item dd { margin: .3rem 0 0; }
.flash-wrap { display: grid; gap: 1rem; max-width: 640px; }
.flashcard { min-height: 240px; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: .8rem; text-align: center; padding: 2rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); cursor: pointer; font: inherit; color: var(--text); position: relative; }
.flashcard.revealed { background: var(--accent-soft); }
.fc-count { position: absolute; top: .8rem; right: 1rem; font-size: .8rem; color: var(--muted); }
.fc-front { font-size: 1.4rem; font-weight: 700; }
.fc-hint { color: var(--muted); font-size: .85rem; }

/* Plan de révision */
.tasks { list-style: none; margin: 0 0 1rem; padding: 0; display: grid; gap: .5rem; }
.task { display: flex; align-items: center; gap: .8rem; padding: .7rem .8rem; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); }
.task > svg { width: 22px; height: 22px; flex: none; fill: none; stroke: var(--accent); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.task-text { flex: 1; min-width: 0; }
.task-text small { display: block; color: var(--muted); font-size: .82rem; margin-top: .1rem; }
.task .btn { flex: none; }
.task-mock { border-color: var(--accent); background: var(--accent-soft); }
.today-progress { margin-top: .4rem; }
.timeline { list-style: none; margin: 0; padding: 0 0 0 1.1rem; border-left: 2px solid var(--border); display: grid; gap: 1rem; }
.timeline li { position: relative; display: grid; gap: .15rem; }
.timeline li::before { content: ''; position: absolute; left: calc(-1.1rem - 7px); top: .35rem; width: 12px; height: 12px; border-radius: 50%; background: var(--surface); border: 2px solid var(--border); }
.timeline li.current::before { background: var(--accent); border-color: var(--accent); }
.timeline li.exam-day::before { background: var(--primary); border-color: var(--primary); }
.timeline small { color: var(--muted); }
.timeline-dates { font-size: .8rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.inline-fields { display: flex; flex-wrap: wrap; gap: .8rem 1rem; align-items: flex-end; }
.inline-fields .field { margin-bottom: .4rem; min-width: 180px; }
.form-inline-card h2 { margin-bottom: .8rem; }

/* Analyses */
.table-center td, .table-center th { text-align: center; }
.table-center td:first-child, .table-center th:first-child { text-align: left; }
.table tfoot th, .table tfoot td { border-top: 2px solid var(--border); border-bottom: 0; font-weight: 600; }
.buckets { display: grid; gap: .7rem; margin-bottom: 1rem; }

/* Espace formateur et groupes */
.code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-weight: 700; letter-spacing: .12em; background: var(--surface-2); padding: .15rem .45rem; border-radius: var(--radius-sm); }
.code-lg { font-size: 1.35rem; padding: .3rem .7rem; }
.join-box { display: grid; justify-items: end; gap: .35rem; }
.join-actions { display: flex; gap: .4rem; }
.check-inline { display: inline-flex; margin: 0; }
.check-inline input { margin-top: 0; }
.join-form { margin-top: 1rem; }
@media (max-width: 600px) {
  .join-box { justify-items: start; }
  .task { flex-wrap: wrap; }
  .task-text { flex-basis: calc(100% - 22px - .8rem); }
  .task .btn { margin-left: calc(22px + .8rem); }
}

/* Modales et notifications */
.modal-backdrop { position: fixed; inset: 0; background: rgba(10, 15, 25, .55); display: grid; place-items: center; padding: 1rem; z-index: 50; }
.modal { background: var(--surface); border-radius: var(--radius); padding: 1.4rem; width: 100%; max-width: 520px; max-height: 90vh; overflow-y: auto; box-shadow: none; }
.modal-wide { max-width: 820px; }
.modal-actions { display: flex; justify-content: flex-end; gap: .5rem; margin-top: 1rem; flex-wrap: wrap; }
#toasts { position: fixed; bottom: 1rem; left: 50%; transform: translateX(-50%); display: grid; gap: .5rem; z-index: 70; width: min(92vw, 460px); }
@media (max-width: 900px) { #toasts { bottom: calc(5rem + env(safe-area-inset-bottom)); } }
.toast { padding: .75rem 1rem; border-radius: var(--radius-sm); background: var(--text); color: var(--surface); box-shadow: var(--shadow); transition: opacity .4s; font-size: .92rem; }
.toast-success { background: var(--ok); color: #fff; }
.toast-error { background: var(--ko); color: #fff; }
.toast-warn { background: var(--warn); color: #fff; }
.toast.out { opacity: 0; }
.error-card { border-color: var(--ko); }
.summary h1 { font-size: 1.5rem; }

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

/* Impression des résultats */
@media print {
  .sidebar, .topbar, .footer, .bottomnav, .drawer-backdrop, .no-print, .seg, .link-btn, .skip-link, #toasts { display: none !important; }
  #app { display: block; }
  body, .card, .corr { background: #fff !important; color: #000 !important; box-shadow: none !important; }
  .main { padding: 0; max-width: none; }
  .corr { break-inside: avoid; }
}

/* Parcours guidé */
.next-step { border-left: 4px solid var(--primary); }
.next-step.ok { border-left-color: var(--ok); }
.next-step h2 { margin: .2rem 0 .4rem; }
.next-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin: .8rem 0 0; }
.stage > summary { display: flex; align-items: center; justify-content: space-between; gap: 1rem; cursor: pointer; list-style: none; }
.stage > summary::-webkit-details-marker { display: none; }
.stage > summary h2 { margin: 0; font-size: 1.1rem; }
.stage[open] > summary { margin-bottom: .8rem; }
.path-items { list-style: none; padding: 0; margin: .8rem 0; display: grid; gap: .35rem; }
.path-items li { display: flex; align-items: center; gap: .7rem; padding: .5rem .6rem; border-radius: var(--radius-sm); border: 1px solid var(--border); }
.path-text { flex: 1; min-width: 0; display: grid; gap: .1rem; }
.path-text small { color: var(--muted); }
.path-links { display: flex; gap: .8rem; white-space: nowrap; }
.st-dot { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--border); flex: none; }
.st-progress .st-dot { border-color: var(--accent); background: linear-gradient(90deg, var(--accent) 50%, transparent 50%); }
.st-done .st-dot { border-color: var(--ok); background: var(--ok); }
.st-done { background: var(--ok-soft); }
.checkpoint { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; padding: .7rem .8rem; border-radius: var(--radius-sm); background: var(--surface-2); }
.checkpoint.ok { background: var(--ok-soft); }
.method { margin: .3rem 0 0; padding-left: 1.2rem; display: grid; gap: .3rem; }
.form-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
@media (max-width: 600px) {
  .path-items li { flex-wrap: wrap; }
  .path-text { flex-basis: calc(100% - 14px - .7rem); }
  .path-links { margin-left: calc(14px + .7rem); }
}

/* ====== Couche de design moderne (surcharge les composants de base) ====== */
.btn { border-radius: 12px; padding: .65rem 1.15rem; transition: transform .15s, box-shadow .15s, background .15s, border-color .15s; }
.btn-primary { background: var(--grad); color: #fff; box-shadow: none; }
.btn-primary:hover:not(:disabled) { background: var(--grad); color: #fff;  box-shadow: none; }
.btn-ghost { box-shadow: 0 1px 2px rgba(15, 23, 42, .04); }
.btn-ghost:hover:not(:disabled) { border-color: var(--primary); color: var(--primary); }
.btn-lg { padding: .85rem 1.5rem; font-size: 1.05rem; }
.btn-white { background: #fff; color: #1e1b4b; }
.btn-white:hover { color: #1e1b4b;  }
.btn-outline-light { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .45); }
.btn-outline-light:hover { background: rgba(255, 255, 255, .1); color: #fff; }
.card { border-color: var(--border); }
.eyebrow { color: var(--primary); letter-spacing: .08em; }
input, select, textarea { border-radius: 10px; transition: border-color .15s, box-shadow .15s; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 18%, transparent); }
.tabs { border-bottom: 0; background: var(--surface-2); padding: .3rem; border-radius: 12px; display: inline-flex; gap: .2rem; }
.tab { border: 0; border-radius: 9px; padding: .45rem 1rem; }
.tab.active { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(15, 23, 42, .1); border: 0; }
.seg input:checked + span, .seg-btn.active { background: var(--grad); border-color: transparent; color: #fff; }
.choice { transition: border-color .15s, box-shadow .15s; }
.choice:hover { border-color: color-mix(in srgb, var(--primary) 50%, var(--border)); }
.choice:has(input:checked) { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 7%, var(--surface)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 15%, transparent); }
.banner { border: 0; background: color-mix(in srgb, var(--primary) 8%, var(--surface)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--primary) 18%, transparent); }
.banner-warn { background: var(--warn-soft); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--warn) 25%, transparent); }
.bar { height: 10px; }
.bar-fill { background: var(--grad); }
.bar-fill.ok { background: linear-gradient(90deg, #10b981, #22c55e); }
.pill, .weight { background: color-mix(in srgb, var(--primary) 10%, transparent); color: var(--primary); }
.tag-level { background: color-mix(in srgb, var(--primary) 10%, transparent); color: var(--primary); }
.sec-badge { background: var(--grad); color: #fff; }
.table th { font-weight: 700; }
.table tbody tr:hover td { background: color-mix(in srgb, var(--primary) 3%, transparent); }

/* Gabarit : barre supérieure + navigation latérale claire, regroupée par usage */
@media (min-width: 901px) { #app { grid-template-columns: 252px 1fr; } }
.sidebar { background: var(--surface); border-right: 1px solid var(--border); padding: 1rem .75rem 1.2rem; gap: .2rem; }
.brand-side { padding: .3rem .6rem 1rem; font-size: 1.15rem; }
.nav-group { margin-top: .6rem; }
.nav-title { margin: 0 0 .3rem; padding: 0 .7rem; font-size: .7rem; font-weight: 800; text-transform: uppercase; letter-spacing: .09em; color: var(--muted); opacity: .8; }
.sidebar a { gap: .65rem; padding: .5rem .7rem; font-size: .93rem; color: var(--text); border-radius: 10px; }
.sidebar a svg { width: 19px; height: 19px; color: var(--muted); }
.sidebar a:hover { background: var(--surface-2); color: var(--text); }
.sidebar a.active { background: color-mix(in srgb, var(--primary) 10%, transparent); color: var(--primary); font-weight: 650; box-shadow: none; }
.sidebar a.active svg { color: var(--primary); }
.side-plan { margin-top: auto; display: grid; gap: .35rem; padding: 1rem; border-radius: 16px; background: var(--grad-hero); color: #fff; text-decoration: none; font-size: .84rem; line-height: 1.4; }
.sidebar a.side-plan, .sidebar a.side-plan:hover { color: #fff; background: var(--grad-hero); }
.side-plan strong { font-size: 1rem; }
.side-plan span { color: #c7d2fe; }
.side-plan .side-plan-cta { color: #fff; font-weight: 700; }
.appbar { display: flex; align-items: center; gap: .8rem; position: sticky; top: 0; z-index: 20; padding: .7rem clamp(1rem, 3vw, 2.5rem); border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg) 82%, transparent); }
.appbar .menu-btn, .appbar .brand-top { display: none; }
.appbar-right { margin-left: auto; display: flex; align-items: center; gap: .6rem; }
.menu-wrap { position: relative; }
.cert-picker { display: flex; align-items: center; gap: .6rem; padding: .35rem .7rem .35rem .4rem; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); color: var(--text); font: inherit; cursor: pointer; }
.cert-picker:hover { border-color: var(--primary); }
.cert-picker svg { width: 16px; height: 16px; fill: none; stroke: var(--muted); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.cert-picker-text { display: grid; text-align: left; line-height: 1.15; }
.cert-picker-text small { font-size: .68rem; color: var(--muted); font-weight: 600; }
.cert-picker-text strong { font-size: .92rem; }
.cert-dot { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; background: var(--grad); color: #fff; font-size: .72rem; font-weight: 800; letter-spacing: .02em; flex: none; }
.avatar-btn { border: 0; background: none; padding: 0; cursor: pointer; border-radius: 50%; }
.avatar-btn .avatar { width: 38px; height: 38px; font-size: .95rem; box-shadow: 0 0 0 3px var(--surface), 0 0 0 4px var(--border); }
.btn-premium { background: linear-gradient(135deg, #f59e0b, #d97706); color: #fff; box-shadow: none; }
.btn-premium:hover { color: #fff;  }
.btn-premium svg { width: 16px; height: 16px; fill: currentColor; stroke: none; }
.menu { position: absolute; top: calc(100% + 8px); left: 0; z-index: 40; min-width: 280px; padding: .4rem; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-lg); display: grid; gap: .1rem; }
.menu-right { left: auto; right: 0; min-width: 240px; }
.menu-item { display: flex; align-items: center; gap: .7rem; width: 100%; padding: .55rem .7rem; border: 0; border-radius: 10px; background: none; color: var(--text); font: inherit; font-size: .92rem; text-align: left; text-decoration: none; cursor: pointer; }
.menu-item:hover { background: var(--surface-2); color: var(--text); }
.menu-item.on { background: color-mix(in srgb, var(--primary) 9%, transparent); }
.menu-item span { display: grid; line-height: 1.25; }
.menu-item small { color: var(--muted); font-size: .78rem; }
.menu-foot { border-top: 1px solid var(--border); border-radius: 0 0 10px 10px; margin-top: .2rem; color: var(--primary); font-weight: 600; }
.menu-danger { color: var(--ko); }
.menu-head { display: grid; gap: .15rem; padding: .6rem .7rem .7rem; border-bottom: 1px solid var(--border); margin-bottom: .2rem; }
.menu-head small { color: var(--muted); font-size: .8rem; }
.menu-head .tag { justify-self: start; margin-top: .3rem; }
.avatar { background: var(--grad); color: #fff; }
.main { padding-top: 1.6rem; }
@media (max-width: 900px) {
  .appbar { padding: .55rem .8rem; }
  .appbar .menu-btn, .appbar .brand-top { display: inline-flex; }
  .cert-picker-text small, .btn-premium span { display: none; }
  .brand-side { display: none; }
  .menu { position: fixed; top: 60px; left: .8rem; right: .8rem; min-width: 0; }
}
.cert-chip { background: color-mix(in srgb, var(--primary) 12%, transparent); color: var(--primary); }

/* En-tête du tableau de bord */
.hero-head { position: relative; overflow: hidden; border-radius: 20px; padding: clamp(1.3rem, 3vw, 2rem); margin-bottom: 1.4rem; color: #fff; background: var(--grad-hero); box-shadow: var(--shadow-lg); display: flex; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap; align-items: center; }
.hero-head h1 { color: #fff; margin-bottom: .3rem; }
.hero-head p { color: #c7d2fe; margin: 0; max-width: 620px; }
.hero-head a { color: #fff; }
.hero-chips { display: flex; gap: .7rem; flex-wrap: wrap; }
.chip-stat { display: flex; align-items: center; gap: .6rem; padding: .6rem .9rem; border-radius: 14px; background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .14); }
.chip-stat svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.chip-stat strong { display: block; font-size: 1.25rem; line-height: 1.1; }
.chip-stat span { font-size: .75rem; color: #c7d2fe; }
.chip-stat.flame svg { color: #fbbf24; }
.ring { --v: 0; width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: conic-gradient(#a5b4fc calc(var(--v) * 1%), rgba(255, 255, 255, .15) 0); }
.ring > span { width: 50px; height: 50px; border-radius: 50%; display: grid; place-items: center; background: #1e1b4b; font-weight: 800; font-size: .85rem; color: #fff; }
.motto { font-style: italic; color: #a5b4fc; font-size: .9rem; margin-top: .6rem !important; }
.next-step { border: 0; border-left: 0; position: relative; box-shadow: var(--shadow), inset 0 0 0 1px color-mix(in srgb, var(--primary) 25%, transparent); background: linear-gradient(135deg, color-mix(in srgb, var(--primary) 6%, var(--surface)), var(--surface) 60%); }
.next-step::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 5px; border-radius: 16px 0 0 16px; background: var(--grad); }
.next-step.ok::before { background: linear-gradient(180deg, #10b981, #22c55e); }
.part-card { transition: transform .15s, box-shadow .15s; }
.part-card:hover {  box-shadow: var(--shadow-lg); }
.stat-value { letter-spacing: -.02em; }

/* Authentification */
.auth-hero { background: var(--grad-hero); }
.auth-hero .brand { color: #fff; }

/* Examen */
.exam-bar { background: linear-gradient(135deg, #1e1b4b, #312e81); color: #fff; }
.exam-bar .btn-ghost { color: #fff; }
.score-ring { box-shadow: var(--shadow); }

/* Verrous Premium */
.lock { display: inline-flex; align-items: center; gap: .3rem; font-size: .75rem; font-weight: 700; color: var(--gold); white-space: nowrap; }
.lock svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.badge-premium { display: inline-flex; align-items: center; gap: .3rem; padding: .15rem .55rem; border-radius: 999px; font-size: .72rem; font-weight: 800; letter-spacing: .03em; color: #fff; background: linear-gradient(135deg, #f59e0b, #d97706); }
.quota { display: flex; align-items: center; gap: .6rem; font-size: .85rem; color: var(--muted); }
.quota .bar { max-width: 160px; }

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

/* ====== Page d'accueil publique ====== */
.landing { background: var(--bg); }
.lp-nav { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .8rem clamp(1rem, 4vw, 3rem);
  background: color-mix(in srgb, var(--surface) 80%, transparent); border-bottom: 1px solid var(--border); }
.lp-nav nav { display: flex; gap: 1.4rem; }
.lp-nav nav a { color: var(--muted); text-decoration: none; font-weight: 600; font-size: .92rem; }
.lp-nav nav a:hover { color: var(--text); }
.lp-nav-actions { display: flex; gap: .5rem; }
.lp-hero { display: grid; grid-template-columns: 1.15fr 1fr; gap: clamp(1.5rem, 4vw, 4rem); align-items: center; padding: clamp(3rem, 8vw, 6rem) clamp(1rem, 5vw, 4rem);
  background: var(--grad-hero); color: #fff; }
.lp-kicker { display: inline-block; padding: .3rem .8rem; border-radius: 999px; background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .18); font-size: .82rem; font-weight: 600; color: #e0e7ff; }
.lp-hero h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); line-height: 1.05; letter-spacing: -.035em; margin: 1rem 0; color: #fff; }
.grad-text { background: linear-gradient(90deg, #a5b4fc, #67e8f9); color: transparent; }
.lp-lead { font-size: clamp(1.05rem, 1.6vw, 1.2rem); color: #c7d2fe; max-width: 600px; }
.lp-cta { display: flex; gap: .8rem; flex-wrap: wrap; margin: 1.6rem 0 .6rem; }
.lp-note { font-size: .85rem; color: #a5b4fc; }
.lp-mock { display: grid; gap: .9rem; max-width: 460px; justify-self: center; width: 100%; transform: none; }
.mock-card { background: rgba(255, 255, 255, .96); color: #0f172a; border-radius: 18px; padding: 1rem 1.1rem; box-shadow: none; display: grid; gap: .45rem; }
.mock-eyebrow { font-size: .7rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: #4f46e5; }
.mock-next strong { font-size: .98rem; line-height: 1.3; }
.mock-btn { justify-self: start; padding: .4rem .9rem; border-radius: 10px; background: var(--grad); color: #fff; font-weight: 700; font-size: .85rem; }
.mock-row { display: grid; grid-template-columns: 1.3fr 1fr; gap: .9rem; }
.mock-ring { grid-template-columns: auto 1fr; align-items: center; font-weight: 700; font-size: .9rem; }
.ring.big > span { background: #fff; color: #1e1b4b; }
.mock-ring .ring { background: conic-gradient(#6366f1 calc(var(--v) * 1%), #e0e7ff 0); }
.mock-streak { align-content: center; text-align: center; }
.mock-streak strong { font-size: 2rem; color: #d97706; line-height: 1; }
.mock-streak span { font-size: .8rem; color: #475569; }
.mock-q p { margin: 0 0 .2rem; font-weight: 600; font-size: .92rem; }
.mock-opt { padding: .45rem .7rem; border-radius: 10px; border: 1.5px solid #e2e8f0; font-size: .85rem; }
.mock-opt.ok { border-color: #16a34a; background: #ecfdf3; color: #166534; font-weight: 600; }
.lp-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; max-width: 1100px; margin: -2.2rem auto 0; padding: 0 1rem; position: relative; }
.lp-stats div { background: var(--surface); border-radius: 16px; padding: 1.1rem; box-shadow: var(--shadow-lg); text-align: center; display: grid; gap: .1rem; }
.lp-stats strong { font-size: 1.8rem; letter-spacing: -.03em; background: var(--grad); color: transparent; }
.lp-stats span { color: var(--muted); font-size: .88rem; }
.lp-section { max-width: 1140px; margin: 0 auto; padding: clamp(3rem, 7vw, 5rem) clamp(1rem, 4vw, 2rem); }
.lp-section h2 { font-size: clamp(1.6rem, 3vw, 2.3rem); letter-spacing: -.03em; margin-bottom: 2rem; }
.lp-features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.2rem; }
.lp-feature { background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 1.4rem; box-shadow: var(--shadow); transition: transform .15s, box-shadow .15s; }
.lp-feature:hover {  box-shadow: var(--shadow-lg); }
.lp-feature h3 { margin: .8rem 0 .4rem; }
.lp-feature p { color: var(--muted); margin: 0; }
.lp-icon { display: inline-grid; place-items: center; width: 46px; height: 46px; border-radius: 14px; background: var(--grad); color: #fff; box-shadow: none; }
.lp-icon svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.lp-icon-xl { width: 96px; height: 96px; border-radius: 28px; }
.lp-icon-xl svg { width: 48px; height: 48px; }
.lp-steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.2rem; counter-reset: s; }
.lp-steps li { background: var(--surface); border-radius: 18px; padding: 1.4rem; border: 1px solid var(--border); }
.lp-steps li > span { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: color-mix(in srgb, var(--primary) 12%, transparent); color: var(--primary); font-weight: 800; }
.lp-steps h3 { margin: .8rem 0 .3rem; }
.lp-steps p { color: var(--muted); margin: 0; }
.lp-certs { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr)); gap: 1.2rem; }
.lp-cert { background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 1.4rem; box-shadow: var(--shadow); }
.lp-cert h3 { font-size: 1.6rem; margin: .2rem 0; }
.lp-cert ul { padding-left: 1.1rem; margin: .8rem 0 0; color: var(--muted); }
.lp-cert-soon { background: transparent; border-style: dashed; box-shadow: none; }
.lp-trainers { display: flex; align-items: center; justify-content: space-between; gap: 2rem; background: var(--surface); border-radius: 24px; border: 1px solid var(--border); box-shadow: var(--shadow); max-width: 1100px; margin: 0 auto; }
.lp-trainers h2 { margin-bottom: .8rem; }
.lp-trainers p:last-child { color: var(--muted); max-width: 640px; }
.lp-faq details { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 1rem 1.2rem; margin: 0 auto .7rem; max-width: 820px; }
.lp-faq summary { font-weight: 700; cursor: pointer; }
.lp-faq details p { margin: .7rem 0 0; color: var(--muted); }
.lp-final { text-align: center; padding: clamp(3rem, 7vw, 5rem) 1rem; background: var(--grad-hero); color: #fff; }
.lp-final h2 { color: #fff; font-size: clamp(1.6rem, 3vw, 2.4rem); margin-bottom: 1.4rem; }
.lp-footer { padding: 2rem clamp(1rem, 4vw, 3rem); color: var(--muted); font-size: .85rem; text-align: center; }

/* Grille tarifaire */
.currency-switch { display: flex; justify-content: center; gap: .3rem; margin: -1rem auto 1.6rem; width: fit-content; background: var(--surface-2); padding: .3rem; border-radius: 999px; }
.currency-switch .seg-btn { border: 0; background: transparent; }
.currency-switch .seg-btn.active { background: var(--grad); color: #fff; }
.price-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.2rem; align-items: stretch; margin-bottom: 1rem; }
.price-card { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: 1.6rem; box-shadow: var(--shadow); display: flex; flex-direction: column; }
.price-featured { border: 2px solid transparent; background: linear-gradient(var(--surface), var(--surface)) padding-box, var(--grad) border-box; box-shadow: var(--shadow-lg);  }
.price-flag { position: absolute; top: -.8rem; left: 50%; transform: translateX(-50%); padding: .25rem .8rem; border-radius: 999px; background: var(--grad); color: #fff; font-size: .75rem; font-weight: 800; white-space: nowrap; }
.price-card h3 { font-size: 1.3rem; margin: 0; }
.price { margin: 1rem 0 .3rem; display: flex; align-items: baseline; gap: .4rem; flex-wrap: wrap; }
.price strong { font-size: 2.1rem; letter-spacing: -.03em; }
.price span { color: var(--muted); font-size: .9rem; }
.price-periods { list-style: none; padding: 0; margin: 0 0 1rem; color: var(--muted); font-size: .88rem; display: grid; gap: .15rem; min-height: 2.6em; }
.price-features { list-style: none; padding: 0; margin: 0 0 1.4rem; display: grid; gap: .55rem; }
.price-features li { display: flex; gap: .55rem; align-items: flex-start; font-size: .94rem; }
.price-features svg { width: 20px; height: 20px; flex: none; fill: none; stroke: var(--ok); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.price-cta { margin-top: auto; }

@media (max-width: 960px) {
  .lp-hero { grid-template-columns: 1fr; }
  .lp-mock { transform: none; max-width: 420px; }
  .lp-features, .lp-steps, .price-grid { grid-template-columns: 1fr; }
  .price-featured { transform: none; }
  .lp-stats { grid-template-columns: repeat(2, 1fr); }
  .lp-nav nav { display: none; }
  .lp-trainers { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 480px) {
  .lp-nav-actions .btn-ghost { display: none; }
  .lp-mock { display: none; }
}
/* Pages sans gabarit (accueil, connexion, examen) : pleine largeur à toutes les tailles d'écran. */
.main.main-bare { padding: 0; }

/* ====== Tableau de bord en mosaïque ====== */
.dash-head { margin-bottom: 1.4rem; }
.dash-head h1 { font-size: clamp(1.8rem, 3vw, 2.3rem); margin: .1rem 0 .3rem; }
.dash-head .eyebrow { text-transform: none; letter-spacing: 0; font-size: .9rem; color: var(--muted); font-weight: 600; }
.dash-head .eyebrow::first-letter { text-transform: uppercase; }
.bento { display: grid; grid-template-columns: repeat(12, 1fr); gap: 1.1rem; }
.b-3 { grid-column: span 3; } .b-4 { grid-column: span 4; } .b-6 { grid-column: span 6; } .b-8 { grid-column: span 8; }
.tile { background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: 1.3rem 1.4rem; box-shadow: var(--shadow); min-width: 0; }
.tile h3 { font-size: 1.02rem; margin: 0 0 .3rem; }
.tile-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; margin-bottom: .9rem; }
.tile-head h3 { margin: 0; }
.tile-resume { position: relative; overflow: hidden; background: var(--grad-hero); color: #fff; border: 0; padding: clamp(1.4rem, 3vw, 2rem); display: flex; flex-direction: column; min-height: 220px; }
.tile-eyebrow { font-size: .75rem; font-weight: 800; text-transform: uppercase; letter-spacing: .1em; color: #a5b4fc; margin: 0 0 .5rem; }
.tile-resume h2 { color: #fff; font-size: clamp(1.25rem, 2.2vw, 1.6rem); max-width: 620px; }
.tile-resume p { color: #c7d2fe; max-width: 620px; }
.resume-foot { margin-top: auto; display: flex; align-items: center; gap: 1.2rem; flex-wrap: wrap; position: relative; z-index: 1; }
.resume-foot .btn svg { width: 16px; height: 16px; fill: currentColor; stroke: none; }
.resume-progress { flex: 1; min-width: 180px; display: grid; gap: .35rem; font-size: .82rem; color: #c7d2fe; }
.bar-light { background: rgba(255, 255, 255, .15); }
.bar-light .bar-fill { background: linear-gradient(90deg, #a5b4fc, #67e8f9); }
.tile-goal { display: flex; align-items: center; gap: 1.2rem; }
.ring-xl { width: 116px; height: 116px; background: conic-gradient(var(--primary) calc(var(--v) * 1%), var(--surface-2) 0); }
.ring-xl > span { width: 94px; height: 94px; background: var(--surface); color: var(--text); display: grid; align-content: center; text-align: center; line-height: 1.05; }
.ring-xl strong { font-size: 1.8rem; letter-spacing: -.03em; }
.ring-xl small { font-size: .75rem; color: var(--muted); font-weight: 600; }
.tile-kpi { display: grid; gap: .1rem; align-content: start; }
.tile-kpi strong { font-size: 1.9rem; letter-spacing: -.03em; line-height: 1.1; margin-top: .5rem; }
.tile-kpi > span:last-child { color: var(--muted); font-size: .86rem; }
.kpi-icon { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: color-mix(in srgb, var(--primary) 12%, transparent); color: var(--primary); }
.kpi-icon svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.kpi-flame { background: color-mix(in srgb, #f59e0b 16%, transparent); color: #d97706; }
.kpi-ok { background: color-mix(in srgb, #16a34a 14%, transparent); color: var(--ok); }
.kpi-cal { background: color-mix(in srgb, #0ea5e9 14%, transparent); color: #0284c7; }
.mastery { display: grid; gap: .65rem; margin-bottom: .8rem; }
.mastery-part { font-weight: 700; margin: .8rem 0 .4rem; font-size: .92rem; }
.mastery-row { display: grid; grid-template-columns: 2rem minmax(0, 1.4fr) minmax(80px, 1fr) 3rem; gap: .7rem; align-items: center; font-size: .9rem; }
.mastery-id { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: var(--surface-2); font-weight: 800; font-size: .8rem; color: var(--muted); }
.mastery-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mastery-val { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.tile-review { display: flex; flex-direction: column; gap: .3rem; align-items: flex-start; }
.tile-review h3 { margin-top: .6rem; }
.review-n { margin: 0; color: var(--muted); }
.review-n strong { font-size: 2.2rem; color: var(--text); letter-spacing: -.03em; margin-right: .3rem; }
.tile-review .btn, .tile-review .tag { margin-top: auto; }
.heatmap { display: grid; grid-template-rows: repeat(7, 1fr); grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; margin-bottom: .6rem; }
.hm-cell { display: block; aspect-ratio: 1; min-width: 10px; border-radius: 3px; background: var(--surface-2); }
.hm-1 { background: color-mix(in srgb, var(--primary) 25%, var(--surface-2)); }
.hm-2 { background: color-mix(in srgb, var(--primary) 50%, var(--surface-2)); }
.hm-3 { background: color-mix(in srgb, var(--primary) 75%, var(--surface-2)); }
.hm-4 { background: var(--primary); }
.hm-legend { display: flex; align-items: center; gap: 4px; justify-content: flex-end; font-size: .72rem; color: var(--muted); margin-bottom: .4rem; }
.hm-legend .hm-cell { width: 11px; min-width: 11px; }
.weak-list, .exam-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .45rem; }
.weak-list li { display: flex; align-items: center; justify-content: space-between; gap: .8rem; }
.weak-list a { display: flex; align-items: center; gap: .6rem; color: var(--text); text-decoration: none; min-width: 0; }
.weak-list a span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.code-chip { flex: none; font-size: .75rem; font-weight: 800; padding: .2rem .45rem; border-radius: 7px; background: var(--surface-2); color: var(--muted); }
.weak-rate { font-weight: 800; font-variant-numeric: tabular-nums; }
.exam-list a { display: flex; align-items: center; gap: .8rem; padding: .45rem; border-radius: 12px; color: var(--text); text-decoration: none; }
.exam-list a:hover { background: var(--surface-2); }
.exam-list a > span:last-child { display: grid; }
.exam-list small { color: var(--muted); }
.exam-score { display: inline-grid; place-items: center; width: 52px; height: 52px; border-radius: 14px; font-weight: 800; background: var(--surface-2); flex: none; }
.exam-score.ok { color: var(--ok); background: var(--ok-soft); }
.exam-score.warn { color: var(--warn); background: var(--warn-soft); }
@media (max-width: 1100px) { .b-3 { grid-column: span 6; } .b-4, .b-8 { grid-column: span 12; } }
@media (max-width: 700px) { .b-6 { grid-column: span 12; } .tile-goal { flex-direction: row; } .mastery-row { grid-template-columns: 1.8rem minmax(0, 1fr) 3rem; } .mastery-row .bar { grid-column: 2 / 4; grid-row: 2; } }
.sidebar a.side-plan { display: grid; gap: .35rem; align-items: start; }

/* ====== Mode étude (questions) ====== */
.study { min-height: 100vh; display: grid; grid-template-rows: auto 1fr auto; background: var(--bg); }
.main:not(.main-bare) .study { min-height: auto; margin: -1rem 0; }
.study-bar { position: sticky; top: 0; z-index: 15; display: flex; align-items: center; gap: 1rem; padding: .8rem clamp(1rem, 4vw, 2.5rem); background: color-mix(in srgb, var(--bg) 85%, transparent); border-bottom: 1px solid var(--border); }
.study-close { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; color: var(--muted); border: 1px solid var(--border); background: var(--surface); flex: none; }
.study-close:hover { color: var(--text); border-color: var(--text); }
.study-close svg, .study-score svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.study-track { flex: 1; display: flex; gap: 4px; min-width: 0; }
.seg-cell { flex: 1; height: 8px; border-radius: 999px; background: var(--surface-2); transition: background .25s; }
.seg-cell.now { background: color-mix(in srgb, var(--primary) 45%, var(--surface-2)); }
.seg-cell.ok { background: #22c55e; }
.seg-cell.ko { background: #ef4444; }
.study-count { font-weight: 800; font-variant-numeric: tabular-nums; }
.study-count small { color: var(--muted); font-weight: 600; }
.study-score { display: inline-flex; align-items: center; gap: .3rem; padding: .3rem .65rem; border-radius: 999px; background: var(--ok-soft); color: var(--ok); font-weight: 800; }
.study-body { width: 100%; max-width: 820px; margin: 0 auto; padding: clamp(1.2rem, 4vw, 2.5rem) 1rem 7rem; }
.study-card { background: var(--surface); border: 1px solid var(--border); border-radius: 24px; padding: clamp(1.3rem, 4vw, 2.2rem); box-shadow: var(--shadow); }
.study-stem { font-size: clamp(1.15rem, 2vw, 1.4rem); font-weight: 650; line-height: 1.45; letter-spacing: -.01em; margin: .6rem 0 1.4rem; white-space: pre-line; }
.study-options { display: grid; gap: .7rem; }
.study-opt { position: relative; display: flex; align-items: center; gap: 1rem; width: 100%; text-align: left; padding: 1rem 1.1rem; border-radius: 16px; border: 2px solid var(--border); background: var(--surface); color: var(--text); font: inherit; font-size: 1rem; cursor: pointer; transition: border-color .15s, background .15s, transform .1s, box-shadow .15s; }
.study-opt:hover:not(:disabled) { border-color: color-mix(in srgb, var(--primary) 60%, var(--border));  box-shadow: var(--shadow); }
.study-opt kbd { flex: none; display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); font: 800 .85rem var(--font); color: var(--muted); }
.study-opt.selected { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 7%, var(--surface)); box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 14%, transparent); }
.study-opt.selected kbd { background: var(--grad); color: #fff; border-color: transparent; }
.study-opt.correct { border-color: #22c55e; background: var(--ok-soft); }
.study-opt.correct kbd { background: #22c55e; color: #fff; border-color: transparent; }
.study-opt.wrong { border-color: #ef4444; background: var(--ko-soft); }
.study-opt.wrong kbd { background: #ef4444; color: #fff; border-color: transparent; }
.study-opt.dim { opacity: .7; }
.study-opt:disabled { cursor: default; }
.opt-mark { margin-left: auto; width: 22px; height: 22px; flex: none; fill: none; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.correct .opt-mark { stroke: var(--ok); }
.wrong .opt-mark { stroke: var(--ko); }
.study-why { margin: .4rem .4rem .2rem 3.4rem; font-size: .92rem; color: var(--muted); }
.study-why.ok { color: var(--ok); }
.study-verdict { display: flex; gap: 1rem; margin-top: 1.2rem; padding: 1.2rem 1.3rem; border-radius: 20px; animation: rise .25s ease-out; }
.study-verdict.ok { background: var(--ok-soft); }
.study-verdict.ko { background: var(--ko-soft); }
.study-verdict strong { font-size: 1.1rem; }
.study-verdict p { margin: .3rem 0 0; }
.verdict-icon { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; flex: none; color: #fff; }
.ok .verdict-icon { background: #22c55e; }
.ko .verdict-icon { background: #ef4444; }
.verdict-icon svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }
.study-foot { position: sticky; bottom: 0; z-index: 15; display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .8rem clamp(1rem, 4vw, 2.5rem) calc(.8rem + env(safe-area-inset-bottom)); background: color-mix(in srgb, var(--surface) 92%, transparent); border-top: 1px solid var(--border); }
.study-tools { display: flex; align-items: center; gap: .6rem; min-width: 0; }
.study-foot .btn-lg { min-width: 200px; }
.kbd-help kbd { font: 700 .72rem var(--font); padding: .05rem .3rem; border: 1px solid var(--border); border-radius: 5px; background: var(--surface-2); }
.tag-streak { background: color-mix(in srgb, #f59e0b 16%, transparent); color: #b45309; }
.study-done { max-width: 720px; margin: 2rem auto; text-align: center; display: grid; justify-items: center; gap: .3rem; padding: 0 1rem; }
.ring-result { width: 150px; height: 150px; margin-bottom: 1rem; }
.ring-result > span { width: 122px; height: 122px; }
.ring-result strong { font-size: 2.2rem; }
.done-topics { list-style: none; padding: 0; margin: 1.2rem 0; width: 100%; display: grid; gap: .5rem; text-align: left; }
.done-topics li { display: grid; grid-template-columns: auto 1fr auto auto; gap: .8rem; align-items: center; padding: .7rem 1rem; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); }
.center-actions { justify-content: center; }
@media (max-width: 700px) {
  .kbd-help { display: none; }
  .study-foot .btn-lg { min-width: 0; flex: 1; }
  .study-why { margin-left: .4rem; }
  .done-topics li { grid-template-columns: auto 1fr auto; }
  .done-topics li a { grid-column: 1 / -1; }
}

/* ====== Programme et leçons ====== */
.syl-hero { display: flex; align-items: center; gap: 1.5rem; background: var(--surface); border: 1px solid var(--border); border-radius: 22px; padding: 1.4rem 1.6rem; box-shadow: var(--shadow); margin-bottom: 1.2rem; flex-wrap: wrap; }
.syl-hero h2 { margin-bottom: .2rem; }
.sec-cards { display: grid; gap: .9rem; }
.sec-card { background: var(--surface); border: 1px solid var(--border); border-radius: 20px; box-shadow: var(--shadow); overflow: hidden; }
.sec-card > summary { display: grid; grid-template-columns: auto 1fr auto auto; gap: 1rem; align-items: center; padding: 1.1rem 1.3rem; cursor: pointer; list-style: none; }
.sec-card > summary::-webkit-details-marker { display: none; }
.sec-card[open] > summary { border-bottom: 1px solid var(--border); }
.sec-num { display: inline-grid; place-items: center; width: 46px; height: 46px; border-radius: 14px; background: var(--grad); color: #fff; font-weight: 800; font-size: 1.1rem; }
.sec-text { display: grid; min-width: 0; }
.sec-text small { color: var(--muted); }
.sec-side { display: grid; gap: .35rem; justify-items: end; }
.sec-progress { display: flex; align-items: center; gap: .5rem; width: 160px; font-size: .8rem; color: var(--muted); }
.topic-grid { list-style: none; margin: 0; padding: 1rem 1.3rem 1.3rem; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(240px, 100%), 1fr)); gap: .7rem; }
.topic-grid .topic-group { grid-column: 1 / -1; padding: .4rem 0 0; }
.topic-tile { height: 100%; display: flex; flex-direction: column; gap: .5rem; padding: .9rem 1rem; border-radius: 14px; border: 1px solid var(--border); background: var(--bg); color: var(--text); text-decoration: none; transition: border-color .15s, transform .15s, box-shadow .15s; }
.topic-tile:hover { border-color: var(--primary);  box-shadow: var(--shadow); }
.topic-tile .code-chip { align-self: flex-start; }
.topic-tile .topic-title { font-weight: 650; line-height: 1.35; }
.topic-foot { margin-top: auto; display: flex; justify-content: space-between; align-items: center; font-size: .8rem; color: var(--muted); }
.topic-tile.is-done { background: color-mix(in srgb, var(--ok) 6%, var(--surface)); border-color: color-mix(in srgb, var(--ok) 30%, var(--border)); }
.done-pill { color: var(--ok); font-weight: 800; }
@media (max-width: 760px) {
  .sec-card > summary { grid-template-columns: auto 1fr; }
  .sec-side { grid-column: 1 / -1; justify-items: start; }
}

.lesson-hero { padding: .5rem 0 1.4rem; border-bottom: 1px solid var(--border); margin-bottom: 1.6rem; }
.lesson-hero h1 { font-size: clamp(1.7rem, 3vw, 2.4rem); margin: .6rem 0 .3rem; max-width: 900px; }
.lesson-hero-meta { display: flex; align-items: center; gap: .7rem; color: var(--muted); font-weight: 600; font-size: .9rem; margin-top: .6rem; }
.code-chip-lg { font-size: .9rem; padding: .3rem .6rem; background: var(--grad); color: #fff; }
.lesson-facts { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: .8rem; }
.lesson-facts span { padding: .3rem .7rem; border-radius: 999px; background: var(--surface-2); font-size: .82rem; font-weight: 600; color: var(--muted); }
.lesson-facts span.ok { background: var(--ok-soft); color: var(--ok); }
.lesson-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 2.5rem; align-items: start; }
.lesson { max-width: 72ch; font-size: 1.05rem; line-height: 1.75; }
.lesson .lead { font-size: 1.2rem; line-height: 1.6; color: var(--text); font-weight: 500; padding-left: 1rem; border-left: 4px solid; border-image: var(--grad) 1; }
.lesson p, .lesson li { color: color-mix(in srgb, var(--text) 88%, var(--muted)); }
.lesson strong { color: var(--text); }
.lesson .table { font-size: .95rem; }
.callout { display: flex; gap: .9rem; border: 0; border-radius: 16px; padding: 1rem 1.2rem; }
.callout-icon { display: inline-grid; place-items: center; flex: none; width: 30px; height: 30px; border-radius: 50%; font-weight: 900; color: #fff; }
.callout-key { background: color-mix(in srgb, var(--primary) 8%, var(--surface)); }
.callout-key .callout-icon { background: var(--grad); }
.callout-trap { background: var(--warn-soft); }
.callout-trap .callout-icon { background: #f59e0b; }
.lesson-pager { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 2rem; }
.lesson-pager a { display: grid; gap: .2rem; padding: 1rem 1.1rem; border-radius: 16px; border: 1px solid var(--border); background: var(--surface); color: var(--text); text-decoration: none; }
.lesson-pager a:hover { border-color: var(--primary); }
.lesson-pager a.next { text-align: right; }
.lesson-pager small { color: var(--muted); font-weight: 700; }
.lesson-side { position: sticky; top: 90px; display: grid; gap: 1rem; }
.side-card { background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 1.1rem; box-shadow: var(--shadow); display: grid; gap: .6rem; }
.btn-done { background: var(--ok-soft); color: var(--ok); border-color: color-mix(in srgb, var(--ok) 35%, transparent); }
.side-topics { list-style: none; margin: .4rem 0 0; padding: 0; display: grid; gap: .1rem; max-height: 46vh; overflow: auto; }
.side-topics a { display: flex; gap: .55rem; align-items: flex-start; padding: .4rem .5rem; border-radius: 9px; color: var(--muted); text-decoration: none; font-size: .86rem; line-height: 1.35; }
.side-topics a:hover { background: var(--surface-2); color: var(--text); }
.side-topics .here a { background: color-mix(in srgb, var(--primary) 9%, transparent); color: var(--primary); font-weight: 650; }
.side-dot { flex: none; width: 10px; height: 10px; margin-top: .3rem; border-radius: 50%; border: 2px solid var(--border); }
.side-topics .is-done .side-dot { background: var(--ok); border-color: var(--ok); }
@media (max-width: 1000px) {
  .lesson-layout { grid-template-columns: 1fr; }
  .lesson-side { position: static; order: -1; }
  .side-topics { display: none; }
}

/* ====== Connexion et inscription ====== */
.auth-layout { grid-template-columns: 1fr 1fr; background: var(--bg); }
.auth-hero { position: relative; overflow: hidden; justify-content: space-between; gap: 2rem; }
.auth-hero .brand { margin-bottom: 0; }
.auth-pitch { position: relative; z-index: 1; max-width: 540px; }
.auth-pitch h1 { font-size: clamp(2rem, 3.6vw, 3rem); letter-spacing: -.035em; line-height: 1.05; color: #fff; }
.auth-pitch > p { color: #c7d2fe; font-size: 1.08rem; }
.auth-points { list-style: none; padding: 0; margin: 2rem 0 0; display: grid; gap: 1rem; }
.auth-points li { display: flex; gap: .9rem; align-items: flex-start; }
.auth-points li > span { display: inline-grid; place-items: center; flex: none; width: 34px; height: 34px; border-radius: 10px; background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .2); font-weight: 800; }
.auth-points strong { display: block; color: #fff; }
.auth-points small { color: #a5b4fc; }
.auth-legal { color: #8b93c9 !important; position: relative; z-index: 1; }
.auth-panel { background: var(--bg); }
.auth-card { width: 100%; max-width: 420px; display: grid; gap: .2rem; background: var(--surface); border: 1px solid var(--border); border-radius: 24px; padding: 2rem; box-shadow: var(--shadow-lg); }
.auth-card h2 { font-size: 1.6rem; margin-bottom: .1rem; }
.auth-card > .muted { margin-bottom: 1rem; }
.auth-card input { padding: .75rem .85rem; }
.auth-card .btn-block { padding: .8rem; font-size: 1rem; margin: .4rem 0 .6rem; }
.auth-brand-mobile { display: none; margin-bottom: 1rem; }
@media (max-width: 900px) {
  .auth-layout { grid-template-columns: 1fr; }
  .auth-hero { display: none; }
  .auth-panel { min-height: 100vh; background: var(--grad-hero); }
  .auth-brand-mobile { display: flex; }
}

/* ====== Examen blanc : options et question au même style que le mode étude ====== */
.exam-question, .exam-review { border-radius: 24px; padding: clamp(1.3rem, 4vw, 2.2rem); }
.exam .stem { font-size: clamp(1.1rem, 1.9vw, 1.35rem); font-weight: 650; line-height: 1.45; }
.exam .option { border-radius: 16px; padding: 1rem 1.1rem; align-items: center; gap: 1rem; }
.exam .option:hover:not(:disabled) { border-color: color-mix(in srgb, var(--primary) 60%, var(--border)); box-shadow: var(--shadow); }
.exam .opt-letter { width: 34px; height: 34px; border-radius: 10px; border: 1px solid var(--border); }
.exam .option.selected { box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 14%, transparent); }
.exam .option.selected .opt-letter { background: var(--grad); color: #fff; border-color: transparent; }
.exam-bar { padding: .8rem clamp(1rem, 3vw, 2rem); }
.exam-timer { border-radius: 12px; background: rgba(255, 255, 255, .12); }
.exam-foot { padding: .9rem clamp(1rem, 3vw, 2rem); }
.rv { border-radius: 10px; }
.exam .option.selected { background: color-mix(in srgb, var(--primary) 7%, var(--surface)); border-color: var(--primary); }
.bento { grid-template-columns: repeat(12, minmax(0, 1fr)); }
@media (max-width: 520px) {
  .appbar .btn-premium, .appbar .brand-top span { display: none; }
  .cert-picker { padding: .3rem .5rem .3rem .3rem; }
  .tile-goal .ring-xl { width: 96px; height: 96px; }
  .tile-goal .ring-xl > span { width: 78px; height: 78px; }
}
@media (max-width: 1000px) { .lesson-side .side-card + .side-card, .lesson-side > p { display: none; } }

/* ======================================================================
   Registre éditorial (couche finale) : typographie serif pour les titres,
   aplats d'encre, filets fins, coins droits. Neutralise les effets décoratifs.
   ====================================================================== */
h1, h2, h3, .lp-hero h1, .auth-pitch h1, .dash-head h1, .lesson-hero h1 { font-family: var(--serif); font-weight: 600; letter-spacing: -.01em; }
h1 { font-size: clamp(1.75rem, 2.6vw, 2.25rem); }
h2 { font-size: 1.3rem; }
h3 { font-size: 1.08rem; }
body { line-height: 1.6; }
a { color: var(--text); text-decoration-color: color-mix(in srgb, var(--text) 35%, transparent); text-decoration-thickness: 1px; }
a:hover { color: var(--accent); text-decoration-color: currentColor; }
.eyebrow, .tile-eyebrow, .nav-title, .mock-eyebrow { color: var(--muted); font-weight: 700; letter-spacing: .12em; font-size: .7rem; }
.tile-eyebrow { color: var(--ink-block-muted); }

/* Boutons : aplats, coins nets, sans ombre ni déplacement. */
.btn { border-radius: var(--radius-sm); box-shadow: none; transform: none; font-weight: 600; letter-spacing: .01em; }
.btn-primary, .btn-primary:hover:not(:disabled) { background: var(--primary); color: var(--primary-ink); box-shadow: none; }
.btn-primary:hover:not(:disabled) { background: var(--primary-hover); }
.btn-ghost { background: transparent; border-color: var(--rule); color: var(--text); box-shadow: none; }
.btn-ghost:hover:not(:disabled) { background: var(--surface-2); color: var(--text); border-color: var(--rule); }
.btn-white { background: var(--ink-block-text); color: var(--ink-block); }
.btn-white:hover { background: #fff; color: var(--ink-block); }
.btn-outline-light { border-color: var(--ink-block-muted); color: var(--ink-block-text); }
.btn-premium { background: transparent; color: var(--accent); border: 1px solid var(--accent); box-shadow: none; }
.btn-premium:hover { background: var(--accent); color: #fff; }
.btn-premium svg { fill: currentColor; }
.btn-done { background: var(--ok-soft); color: var(--ok); border-color: var(--ok); }
input, select, textarea { border-radius: var(--radius-sm); border-color: var(--border); background: var(--surface); }
input:focus, select:focus, textarea:focus { border-color: var(--text); box-shadow: 0 0 0 2px color-mix(in srgb, var(--text) 15%, transparent); }

/* Surfaces : blanc sur papier, filet fin, coins nets. */
.card, .tile, .sec-card, .side-card, .syl-hero, .study-card, .price-card, .lp-feature, .lp-cert, .lp-steps li, .lp-trainers, .lp-faq details, .auth-card, .menu, .exam-question, .exam-review, .lp-stats div, .lesson-pager a, .topic-tile, .done-topics li, .stage { border-radius: var(--radius); box-shadow: none; border-color: var(--border); }
.tile, .card { background: var(--surface); }
.banner, .banner-warn { border-radius: var(--radius); box-shadow: none; background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--accent); }
.banner-warn { border-left-color: var(--warn); }
.tag, .pill, .weight, .code-chip, .tag-level, .lesson-facts span { border-radius: 2px; }
.tag-level, .pill, .weight { background: var(--surface-2); color: var(--text); }
.code-chip { background: transparent; border: 1px solid var(--border); color: var(--muted); font-family: ui-monospace, "SF Mono", Menlo, monospace; font-weight: 600; }
.code-chip-lg { background: transparent; color: var(--text); border-color: var(--rule); }
.tabs { background: transparent; border-bottom: 1px solid var(--border); border-radius: 0; padding: 0; gap: 1.2rem; }
.tab { border-radius: 0; padding: .55rem 0; border-bottom: 2px solid transparent; }
.tab.active { background: transparent; box-shadow: none; border-bottom: 2px solid var(--rule); color: var(--text); }
.seg label span, .seg-btn { border-radius: var(--radius-sm); }
.seg input:checked + span, .seg-btn.active { background: var(--primary); color: var(--primary-ink); border-color: var(--primary); }
.choice { border-radius: var(--radius); }
.choice:has(input:checked) { background: var(--surface); border-color: var(--rule); box-shadow: inset 3px 0 0 var(--rule); }
.bar { height: 6px; border-radius: 0; background: var(--surface-2); }
.bar-fill { background: var(--primary); border-radius: 0; }
.bar-fill.ok { background: var(--ok); }
.bar-light { background: rgba(255, 255, 255, .18); }
.bar-light .bar-fill { background: var(--ink-block-text); }
.table th { color: var(--muted); border-bottom: 1px solid var(--rule); }
.table tbody tr:hover td { background: transparent; }

/* Structure : barre latérale papier, lien actif marqué d'un filet d'encre. */
.sidebar { background: var(--bg); border-right: 1px solid var(--border); }
.brand, .brand span { font-family: var(--serif); font-weight: 600; letter-spacing: -.01em; }
.sidebar a { border-radius: 0; color: var(--text); }
.sidebar a svg { color: var(--muted); }
.sidebar a:hover { background: transparent; text-decoration: underline; }
.sidebar a.active { background: transparent; color: var(--text); font-weight: 700; box-shadow: inset 2px 0 0 var(--rule); }
.sidebar a.active svg { color: var(--text); }
.side-plan, .sidebar a.side-plan, .sidebar a.side-plan:hover { background: var(--surface); color: var(--text); border: 1px solid var(--border); border-top: 3px solid var(--accent); border-radius: var(--radius); }
.side-plan span { color: var(--muted); }
.side-plan .side-plan-cta { color: var(--accent); }
.appbar { background: var(--bg); }
.cert-picker { border-radius: var(--radius-sm); border-color: var(--border); }
.cert-dot, .avatar { background: var(--primary); color: var(--primary-ink); border-radius: 2px; }
.avatar-btn .avatar { border-radius: 50%; box-shadow: none; }
.menu { border-radius: var(--radius); }
.menu-item { border-radius: 2px; }
.menu-item.on { background: var(--surface-2); }
.bottomnav { background: var(--bg); }
.bottomnav .active { background: transparent; color: var(--text); box-shadow: inset 0 2px 0 var(--rule); border-radius: 0; }

/* Tableau de bord : aplat d'encre pour « Reprendre », chiffres en serif. */
.tile-resume { background: var(--ink-block); color: var(--ink-block-text); border-radius: var(--radius); }
.tile-resume h2 { color: var(--ink-block-text); font-size: clamp(1.35rem, 2.4vw, 1.75rem); }
.tile-resume p { color: var(--ink-block-muted); }
.resume-progress { color: var(--ink-block-muted); }
.tile-kpi strong, .ring-xl strong, .review-n strong, .lp-stats strong, .price strong, .exam-score, .stat-value, .metric { font-family: var(--serif); font-weight: 600; letter-spacing: -.01em; }
.kpi-icon, .kpi-flame, .kpi-ok, .kpi-cal { background: transparent; color: var(--muted); width: auto; height: auto; justify-content: start; }
.kpi-icon svg { width: 20px; height: 20px; }
.ring, .ring-xl { background: conic-gradient(var(--primary) calc(var(--v) * 1%), var(--surface-2) 0); }
.ring-xl > span { background: var(--surface); }
.hm-cell { border-radius: 1px; }
.hm-1 { background: color-mix(in srgb, var(--primary) 22%, var(--surface-2)); }
.hm-2 { background: color-mix(in srgb, var(--primary) 45%, var(--surface-2)); }
.hm-3 { background: color-mix(in srgb, var(--primary) 70%, var(--surface-2)); }
.mastery-id { border-radius: 2px; background: transparent; border: 1px solid var(--border); }
.exam-score { border-radius: var(--radius-sm); }
.next-step { background: var(--surface); box-shadow: none; border: 1px solid var(--border); border-left: 3px solid var(--rule); }
.next-step::before, .next-step.ok::before { display: none; }
.next-step.ok { border-left-color: var(--ok); }
.dash-head .eyebrow { letter-spacing: 0; font-size: .9rem; }

/* Mode étude, examen, leçons. */
.study-card { border-radius: var(--radius); }
.study-stem, .exam .stem { font-family: var(--serif); font-weight: 600; }
.study-opt, .exam .option { border-radius: var(--radius); border-width: 1px; }
.study-opt:hover:not(:disabled), .exam .option:hover:not(:disabled) { box-shadow: none; border-color: var(--rule); }
.study-opt kbd, .exam .opt-letter { border-radius: 2px; }
.study-opt.selected, .exam .option.selected { background: var(--surface); border-color: var(--rule); box-shadow: inset 3px 0 0 var(--rule); }
.study-opt.selected kbd, .exam .option.selected .opt-letter { background: var(--primary); color: var(--primary-ink); }
.study-opt.correct { border-color: var(--ok); box-shadow: inset 3px 0 0 var(--ok); }
.study-opt.correct kbd { background: var(--ok); }
.study-opt.wrong { border-color: var(--ko); box-shadow: inset 3px 0 0 var(--ko); }
.study-opt.wrong kbd { background: var(--ko); }
.seg-cell { border-radius: 0; height: 4px; }
.seg-cell.ok { background: var(--ok); }
.seg-cell.ko { background: var(--ko); }
.seg-cell.now { background: var(--rule); }
.study-score { border-radius: 2px; }
.study-verdict { border-radius: var(--radius); border-left: 3px solid; }
.study-verdict.ok { border-color: var(--ok); }
.study-verdict.ko { border-color: var(--ko); }
.verdict-icon { border-radius: 2px; }
.ok .verdict-icon { background: var(--ok); }
.ko .verdict-icon { background: var(--ko); }
.study-close { border-radius: var(--radius-sm); }
.exam-bar { background: var(--ink-block); }
.exam-timer { border-radius: 2px; }
.lesson .lead { border-image: none; border-left: 3px solid var(--rule); font-family: var(--serif); font-size: 1.25rem; }
.callout { border-radius: 0; background: transparent; border-left: 3px solid var(--rule); padding: .2rem 0 .2rem 1.1rem; }
.callout-key { background: transparent; }
.callout-trap { background: transparent; border-left-color: var(--warn); }
.callout-icon { display: none; }
.callout-title { font-size: .72rem; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); }
.lesson-hero { border-bottom: 1px solid var(--rule); }
.sec-num { background: transparent; color: var(--text); border: 1px solid var(--rule); border-radius: 2px; font-family: var(--serif); }
.sec-badge { background: transparent; color: var(--text); border: 1px solid var(--rule); border-radius: 2px; }
.topic-tile { background: var(--surface); }
.topic-tile:hover { border-color: var(--rule); box-shadow: none; }
.topic-tile.is-done { background: var(--surface); box-shadow: inset 3px 0 0 var(--ok); }
.side-topics .here a { background: transparent; color: var(--text); font-weight: 700; box-shadow: inset 2px 0 0 var(--rule); border-radius: 0; }
.st-progress .st-dot { background: var(--accent); }

/* Connexion. */
.auth-hero { background: var(--ink-block); }
.auth-pitch > p, .auth-points small { color: var(--ink-block-muted); }
.auth-points li > span { border-radius: 2px; background: transparent; border-color: var(--ink-block-muted); font-family: var(--serif); }
.auth-panel { background: var(--bg); }
@media (max-width: 900px) { .auth-panel { background: var(--bg); } }

/* Page d'accueil : papier, serif, filets ; aplat d'encre pour l'ouverture. */
.lp-nav { background: var(--bg); }
.lp-hero { background: var(--ink-block); color: var(--ink-block-text); }
.lp-hero h1 { font-size: clamp(2.3rem, 5vw, 3.8rem); line-height: 1.05; color: var(--ink-block-text); }
.lp-kicker { border-radius: 2px; background: transparent; border-color: var(--ink-block-muted); color: var(--ink-block-muted); }
.lp-lead, .lp-note { color: var(--ink-block-muted); }
.grad-text { background: none; color: var(--ink-block-text); font-style: italic; }
.lp-stats { margin-top: 0; padding: 0 1rem; grid-template-columns: repeat(4, 1fr); gap: 0; border-bottom: 1px solid var(--border); max-width: none; background: var(--bg); }
.lp-stats div { background: transparent; border: 0; border-right: 1px solid var(--border); border-radius: 0; padding: 1.6rem 1rem; }
.lp-stats div:last-child { border-right: 0; }
.lp-stats strong { color: var(--text); font-size: 2.2rem; }
.lp-section h2 { font-family: var(--serif); }
.lp-feature, .lp-cert, .lp-steps li { box-shadow: none; }
.lp-icon { background: transparent; color: var(--text); width: auto; height: auto; box-shadow: none; justify-content: start; }
.lp-icon svg { width: 26px; height: 26px; stroke-width: 1.6; }
.lp-steps li > span { border-radius: 0; background: transparent; color: var(--accent); font-family: var(--serif); font-size: 1.6rem; width: auto; height: auto; }
.lp-trainers { border-radius: var(--radius); }
.lp-final { background: var(--ink-block); }
.lp-final h2 { font-family: var(--serif); color: var(--ink-block-text); }
.currency-switch { border-radius: var(--radius-sm); background: transparent; border: 1px solid var(--border); }
.currency-switch .seg-btn.active { background: var(--primary); color: var(--primary-ink); }
.price-featured { border: 1px solid var(--rule); background: var(--surface); box-shadow: inset 0 3px 0 var(--accent); transform: none; }
.price-flag { border-radius: 2px; background: var(--accent); }
.price-features svg { stroke: var(--text); }
.excerpt { background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.4rem; max-width: 460px; justify-self: center; width: 100%; }
.excerpt-label { font-size: .7rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.excerpt-q { font-family: var(--serif); font-size: 1.12rem; font-weight: 600; margin: .5rem 0 1rem; color: var(--text); }
.excerpt ol { list-style: none; margin: 0; padding: 0; display: grid; gap: .45rem; }
.excerpt li { display: flex; gap: .7rem; padding: .55rem .7rem; border: 1px solid var(--border); font-size: .93rem; }
.excerpt li b { font-family: ui-monospace, Menlo, monospace; color: var(--muted); }
.excerpt li.ok { border-color: var(--ok); box-shadow: inset 3px 0 0 var(--ok); }
.excerpt-why { margin: .9rem 0 0; font-size: .88rem; color: var(--muted); }
.excerpt-why strong { color: var(--ok); }
.lp-stats strong { background: none; }
/* Logo : nom en deux tons ; sur les aplats d'encre, couleurs adaptées au fond sombre. */
.brand-name { font-family: var(--serif); font-weight: 600; letter-spacing: -.01em; }
.brand-accent { color: var(--accent); }
.auth-hero .brand-name, .lp-hero .brand-name { color: var(--ink-block-text); }
.auth-hero .brand-accent { color: #d98a64; }

/* Garde-fous responsive : aucun contenu ne doit élargir son cadre. */
img, svg, video { max-width: 100%; }
p, li, td, dd, dt, h1, h2, h3, .stem, .study-stem, .rationale, .study-why, .menu-head small { overflow-wrap: anywhere; }
.card, .tile, .grid > *, .bento > *, .price-card, .sec-card, .side-card { min-width: 0; }
@media (max-width: 600px) {
  .corr-body { padding: 0 .6rem .8rem; }
  .corr-opt .rationale, .rationale { margin-left: 0; }
  .card { padding: 1.1rem 1rem; }
  .tile { padding: 1.1rem 1rem; }
  .page-head h1 { font-size: 1.6rem; }
}
@media (max-width: 960px) {
  .lp-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lp-stats div:nth-child(2) { border-right: 0; }
  .lp-stats div:nth-child(-n+2) { border-bottom: 1px solid var(--border); }
}

/* Chargement : le symbole du logo se trace en boucle (public/img/loader.svg). */
.loading { display: grid; place-items: center; align-content: center; gap: .9rem; min-height: 46vh; padding: 2rem; color: var(--muted); font-size: .78rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
.loading::before { content: ""; width: 52px; height: 52px; background: url("/img/loader.svg") center / contain no-repeat; }
.loading-boot { min-height: 100vh; }
.boot-msg { position: fixed; left: 0; right: 0; bottom: 2rem; text-align: center; padding: 0 1.5rem; font-size: .9rem; }
.loading-inline { min-height: 0; padding: 1rem 0; grid-auto-flow: column; justify-content: start; }
.loading-inline::before { width: 28px; height: 28px; }
#app > .loading, #app > .boot-msg { grid-column: 1 / -1; grid-row: 1 / -1; }

/* Coach du parcours guidé */
.tag-warn { background: var(--warn-soft); color: var(--warn); }
.plain-list { list-style: none; padding: 0; margin: .4rem 0 0; display: grid; gap: .3rem; }
.proj-head { display: flex; align-items: baseline; gap: 1rem; flex-wrap: wrap; margin: .2rem 0 .9rem; }
.proj-score { font-family: var(--serif); font-size: 3rem; line-height: 1; font-weight: 600; }
.proj-head .muted { font-size: .85rem; line-height: 1.35; }
.gauge { position: relative; height: 12px; border-radius: 6px; background: var(--surface-2); margin: 1.6rem 0 .3rem; }
.gauge-band { position: absolute; top: 0; bottom: 0; border-radius: 6px; background: var(--accent-soft); border: 1px solid var(--accent); }
.gauge-mark { position: absolute; top: -4px; width: 4px; height: 20px; margin-left: -2px; border-radius: 2px; background: var(--text); }
.gauge-target { position: absolute; top: -8px; bottom: -8px; width: 0; border-left: 2px dashed var(--ok); }
.gauge-target small { position: absolute; bottom: 100%; transform: translateX(-50%); white-space: nowrap; color: var(--ok); font-weight: 700; font-size: .72rem; }
.gauge-scale { display: flex; justify-content: space-between; font-size: .72rem; }
.proj-prob { margin: .9rem 0; }
.proj-prob.ok strong { color: var(--ok); }
.proj-prob.warn strong { color: var(--warn); }
.proj-sections { display: grid; gap: .45rem; margin-bottom: .8rem; }
.proj-row { display: grid; grid-template-columns: minmax(0, 8.5rem) 1fr 3rem; align-items: center; gap: .7rem; font-size: .9rem; }
.proj-row .bar { margin: 0; }
.proj-label { white-space: nowrap; }
.proj-val { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.pace-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin: .2rem 0 .8rem; }
.pace-cols > div { display: grid; gap: .1rem; }
.pace-num { font-family: var(--serif); font-size: 2.2rem; line-height: 1.1; font-weight: 600; }
.insights { list-style: none; padding: 0; margin: 0; display: grid; gap: .6rem; }
.insight { display: grid; grid-template-columns: auto 1fr; gap: .8rem; align-items: start; padding: .8rem .9rem; border-radius: var(--radius-sm); border: 1px solid var(--border); border-left: 4px solid var(--accent); }
.insight-alert { border-left-color: var(--warn); background: var(--warn-soft); }
.insight-good { border-left-color: var(--ok); }
.insight p { margin: .2rem 0 .3rem; }
.insight a, .insight .link-btn { font-size: .9rem; margin-right: 1rem; }
.prio { list-style: none; padding: 0; margin: .6rem 0 0; display: grid; gap: .5rem; counter-reset: prio; }
.prio li { display: grid; grid-template-columns: 4rem minmax(0, 1fr) auto; gap: .9rem; align-items: center; padding: .6rem .7rem; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.prio-gain { display: grid; text-align: center; color: var(--accent); line-height: 1.1; }
.prio-gain strong { font-family: var(--serif); font-size: 1.35rem; }
.prio-gain small { font-size: .72rem; }
.prio-text { display: grid; gap: .15rem; }
.prio-text small { color: var(--muted); }
.week { list-style: none; padding: 0; margin: .6rem 0 0; display: grid; }
.week li { display: grid; grid-template-columns: 6.5rem minmax(0, 1fr) auto; gap: .9rem; align-items: start; padding: .7rem 0; border-top: 1px solid var(--border); }
.week li.rest { opacity: .65; }
.week li.today .week-day strong { color: var(--accent); }
.week-day { display: grid; }
.week-day small { color: var(--muted); }
.week-tasks { display: grid; gap: .35rem; }
.week-task { display: grid; grid-template-columns: 7rem minmax(0, 1fr) auto; gap: .6rem; align-items: baseline; padding: .4rem .6rem; border-radius: var(--radius-sm); background: var(--surface-2); color: var(--text); text-decoration: none; font-size: .9rem; }
a.week-task[href]:hover { background: var(--accent-soft); }
.week-kind { font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.task-mock .week-kind, .task-checkpoint .week-kind { color: var(--accent); }
.week-min { color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.week-total { padding-top: .45rem; white-space: nowrap; }
.sim input[type="range"] { width: 100%; accent-color: var(--accent); margin: .4rem 0; }
.sim-row { margin-bottom: .2rem; }
.sim-out { border-top: 1px solid var(--border); margin-top: .6rem; padding-top: .6rem; }
.sim-out p { margin: .3rem 0; }
@media (max-width: 600px) {
  .week li { grid-template-columns: 1fr; gap: .4rem; }
  .week-day { grid-auto-flow: column; justify-content: start; gap: .5rem; align-items: baseline; }
  .week-total { display: none; }
  .week-task { grid-template-columns: 1fr auto; }
  .week-kind { grid-column: 1 / -1; }
  .prio li { grid-template-columns: 3.2rem minmax(0, 1fr); }
  .prio li .btn { grid-column: 2; justify-self: start; }
  .proj-row { grid-template-columns: 7.2rem 1fr 2.6rem; gap: .5rem; }
}

/* Séance du jour */
.session-bar { position: fixed; z-index: 40; right: 1rem; bottom: 1rem; left: auto; max-width: min(520px, calc(100vw - 2rem)); display: grid; grid-template-columns: 1fr auto; gap: .2rem .9rem; align-items: center; padding: .75rem .9rem; background: var(--surface); border: 1px solid var(--rule); border-left: 4px solid var(--accent); border-radius: var(--radius-sm); box-shadow: 0 8px 24px rgba(27, 42, 65, .14); }
.session-step { grid-column: 1; font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.session-title { grid-column: 1; font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.session-actions { grid-column: 2; grid-row: 1 / span 2; display: flex; align-items: center; gap: .8rem; }
body.has-session .main { padding-bottom: 7rem; }
@media (max-width: 900px) {
  .session-bar { left: .75rem; right: .75rem; bottom: calc(72px + env(safe-area-inset-bottom, 0px)); max-width: none; }
}
@media (max-width: 480px) {
  .session-bar { grid-template-columns: 1fr; }
  .session-actions { grid-column: 1; grid-row: auto; justify-content: space-between; }
}
.session-list { list-style: none; padding: 0; margin: 1rem 0; display: grid; gap: .5rem; counter-reset: s; }
.session-list li { display: grid; grid-template-columns: 7rem minmax(0, 1fr) auto; gap: .8rem; align-items: baseline; padding: .75rem .9rem; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); }
.session-list li.done { background: var(--ok-soft); }
.session-list li.done strong { text-decoration: line-through; color: var(--muted); }
.session-list li.current { border-color: var(--accent); box-shadow: inset 3px 0 0 var(--accent); }
@media (max-width: 600px) { .session-list li { grid-template-columns: 1fr auto; } .session-list .week-kind { grid-column: 1 / -1; } }
.proj-chart { margin: .4rem 0; }
.calib { width: 100%; }
/* Pages nues (entraînement en cours) : la barre de séance passe au-dessus de la barre d'actions du bas. */
body.has-session.bare-route .session-bar { bottom: calc(84px + env(safe-area-inset-bottom, 0px)); }
body.has-session.bare-route .main-bare { padding-bottom: 10rem; }
/* Les libellés masqués (.sr-only, en position absolue) restent dans la zone de défilement du tableau. */
.table-wrap { position: relative; }

/* Questions à réponses multiples */
.multi-hint { margin: -.2rem 0 .8rem; font-weight: 600; color: var(--accent); font-size: .92rem; }
.options-multi .option .opt-letter, .options-multi .study-opt kbd { border-radius: 4px; }
