/* ============================================================
   Palier — feuille de style unique
   Mobile-first, thème clair/sombre, zones sûres iOS
   ============================================================ */

:root {
  --bg: #f5f6fb;
  --bg-elev: #ffffff;
  --bg-soft: #eef0f8;
  --text: #14161f;
  --text-soft: #5b6076;
  --line: #e2e5f0;
  --brand: #5b5bd6;
  --brand-2: #8b5cf6;
  --brand-ink: #ffffff;
  --ok: #16a34a;
  --ok-soft: #dcfce7;
  --warn: #d97706;
  --warn-soft: #fef3c7;
  --ko: #dc2626;
  --ko-soft: #fee2e2;
  --info: #0284c7;
  --shadow: 0 1px 2px rgba(16,18,40,.06), 0 8px 24px rgba(16,18,40,.08);
  --shadow-lg: 0 12px 40px rgba(16,18,40,.16);
  --r: 18px;
  --r-sm: 12px;
  --tab-h: 62px;
  --bar-h: 54px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b0d17;
    --bg-elev: #151827;
    --bg-soft: #1d2133;
    --text: #eef0f8;
    --text-soft: #9aa1bd;
    --line: #262b40;
    --brand: #7c7cf0;
    --brand-2: #a78bfa;
    --ok: #4ade80;
    --ok-soft: #12331f;
    --warn: #fbbf24;
    --warn-soft: #3a2c0a;
    --ko: #f87171;
    --ko-soft: #3a1414;
    --info: #38bdf8;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.35);
    --shadow-lg: 0 12px 40px rgba(0,0,0,.55);
  }
}

:root[data-theme="dark"] {
  --bg: #0b0d17;
  --bg-elev: #151827;
  --bg-soft: #1d2133;
  --text: #eef0f8;
  --text-soft: #9aa1bd;
  --line: #262b40;
  --brand: #7c7cf0;
  --brand-2: #a78bfa;
  --ok: #4ade80;
  --ok-soft: #12331f;
  --warn: #fbbf24;
  --warn-soft: #3a2c0a;
  --ko: #f87171;
  --ko-soft: #3a1414;
  --info: #38bdf8;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.35);
  --shadow-lg: 0 12px 40px rgba(0,0,0,.55);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }

html, body {
  margin: 0; padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}

body { min-height: 100dvh; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; font-weight: 700; letter-spacing: -.01em; }
p { margin: 0 0 .5rem; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: none; background: none; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .9em; background: var(--bg-soft); padding: .1em .35em; border-radius: 6px; }
.muted { color: var(--text-soft); }
.small { font-size: .86rem; }
.center { text-align: center; display: flex; justify-content: center; }

/* ---------- Écran de démarrage ---------- */
.splash {
  position: fixed; inset: 0; z-index: 999;
  display: grid; place-content: center; gap: .4rem; text-align: center;
  background: linear-gradient(150deg, var(--brand), var(--brand-2));
  color: #fff; transition: opacity .4s ease;
}
.splash__logo { font-size: 2.6rem; font-weight: 800; letter-spacing: -.03em; }
.splash__sub { opacity: .85; }
.splash.is-out { opacity: 0; pointer-events: none; }

/* ---------- Barre supérieure ---------- */
.appbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: .5rem;
  height: calc(var(--bar-h) + var(--safe-t));
  padding: var(--safe-t) .75rem 0;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.appbar h1 { font-size: 1.05rem; flex: 1; }
.appbar__right { display: flex; gap: .35rem; }
.pill {
  font-size: .8rem; font-weight: 700; padding: .25rem .55rem;
  background: var(--bg-soft); border-radius: 999px; white-space: nowrap;
}
.icon-btn {
  width: 36px; height: 36px; display: grid; place-content: center;
  border-radius: 50%; font-size: 1.15rem; color: var(--text-soft);
  transition: background .15s;
}
.icon-btn:hover, .icon-btn:active { background: var(--bg-soft); }
#backBtn { font-size: 1.9rem; line-height: 1; margin-top: -4px; }

/* ---------- Zone principale ---------- */
.app {
  padding: .9rem .9rem calc(var(--tab-h) + var(--safe-b) + 1.5rem);
  max-width: 780px; margin: 0 auto; outline: none;
}
.app.is-enter { animation: fade-up .28s ease both; }
@keyframes fade-up { from { opacity: 0; transform: translateY(8px); } }

.screen { display: flex; flex-direction: column; gap: .85rem; }
.screen--session { gap: .6rem; }
.liste-puces { margin: .2rem 0 .4rem; padding-left: 1.1rem; display: flex; flex-direction: column; gap: .45rem; }
.liste-puces li { font-size: .88rem; line-height: 1.5; color: var(--text-soft); }
.liste-puces strong { color: var(--text); }
.section-title { font-size: .82rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text-soft); margin-top: .4rem; }

/* ---------- Onglets ---------- */
.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 60;
  display: grid; grid-template-columns: repeat(5, 1fr);
  height: calc(var(--tab-h) + var(--safe-b));
  padding-bottom: var(--safe-b);
  background: color-mix(in srgb, var(--bg-elev) 92%, transparent);
  backdrop-filter: saturate(180%) blur(16px);
  border-top: 1px solid var(--line);
}
.tab {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  text-decoration: none; color: var(--text-soft); font-size: .66rem; font-weight: 600;
  transition: color .15s;
}
.tab__i { font-size: 1.25rem; line-height: 1; transition: transform .2s; }
.tab.is-active { color: var(--brand); }
.tab.is-active .tab__i { transform: translateY(-2px) scale(1.12); }

/* ---------- Cartes ---------- */
.card {
  background: var(--bg-elev); border-radius: var(--r); padding: 1rem;
  box-shadow: var(--shadow); border: 1px solid var(--line);
  display: flex; flex-direction: column; gap: .6rem;
}
.card__head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.card__head h3 { font-size: 1rem; }
.card--tip { background: linear-gradient(140deg, color-mix(in srgb, var(--brand) 12%, var(--bg-elev)), var(--bg-elev)); }
.tip__label { font-weight: 700; font-size: .84rem; color: var(--brand); }
.card--warn { border-color: color-mix(in srgb, var(--warn) 45%, var(--line)); background: color-mix(in srgb, var(--warn-soft) 60%, var(--bg-elev)); }
.card--install { border-style: dashed; }
.install__head { display: flex; align-items: center; gap: .5rem; font-size: 1.05rem; }

/* ---------- Accueil ---------- */
.hello__hi { color: var(--text-soft); margin: 0; font-size: .92rem; }
.hello__title { font-size: 1.45rem; }

.card--hero { flex-direction: row; align-items: center; gap: 1rem; }
.hero__side { flex: 1; display: flex; flex-direction: column; gap: .5rem; min-width: 0; }
.hero__stat { display: flex; align-items: center; gap: .5rem; }
.hero__stat-i { font-size: 1.2rem; }
.hero__stat strong { display: block; font-size: 1rem; line-height: 1.1; }
.hero__stat small { color: var(--text-soft); font-size: .74rem; }
.hero__lvl small { color: var(--text-soft); font-size: .72rem; }

.cta-row { display: grid; gap: .6rem; grid-template-columns: 1fr 1fr; }
@media (max-width: 420px) { .cta-row { grid-template-columns: 1fr; } }

.spark { display: flex; align-items: flex-end; justify-content: space-between; gap: .35rem; height: 92px; }
.spark__col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: .3rem; justify-content: flex-end; }
.spark__col i {
  width: 100%; max-width: 26px; border-radius: 6px 6px 3px 3px;
  background: color-mix(in srgb, var(--brand) 35%, var(--bg-soft));
  transition: height .4s cubic-bezier(.2,.8,.2,1);
}
.spark__col i.is-goal { background: linear-gradient(180deg, var(--brand-2), var(--brand)); }
.spark__col span { font-size: .66rem; color: var(--text-soft); text-transform: uppercase; }

.memory { display: flex; flex-direction: column; gap: .45rem; }
.memory__row { display: grid; grid-template-columns: 82px 1fr 34px; align-items: center; gap: .5rem; font-size: .82rem; }
.memory__label { color: var(--text-soft); }
.memory__val { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }

/* ---------- Grille de modules ---------- */
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
@media (min-width: 620px) { .grid { grid-template-columns: repeat(4, 1fr); } .grid--2 { grid-template-columns: repeat(3, 1fr); } }

.tile {
  display: flex; flex-direction: column; align-items: flex-start; gap: .15rem;
  padding: .85rem; border-radius: var(--r); text-align: left;
  background: var(--bg-elev); border: 1px solid var(--line); box-shadow: var(--shadow);
  transition: transform .12s, box-shadow .2s;
}
.tile:active { transform: scale(.97); }
.tile strong { font-size: .92rem; }
.tile small { color: var(--text-soft); font-size: .74rem; line-height: 1.3; }
.tile__icon { font-size: 1.6rem; margin-bottom: .2rem; }
.tile__icon--ipa { font-size: 1.35rem; font-weight: 700; color: var(--brand); }
.tile--indigo  { background: linear-gradient(150deg, color-mix(in srgb, #6366f1 14%, var(--bg-elev)), var(--bg-elev)); }
.tile--rose    { background: linear-gradient(150deg, color-mix(in srgb, #f43f5e 14%, var(--bg-elev)), var(--bg-elev)); }
.tile--amber   { background: linear-gradient(150deg, color-mix(in srgb, #f59e0b 14%, var(--bg-elev)), var(--bg-elev)); }
.tile--emerald { background: linear-gradient(150deg, color-mix(in srgb, #10b981 14%, var(--bg-elev)), var(--bg-elev)); }
.tile--cyan    { background: linear-gradient(150deg, color-mix(in srgb, #06b6d4 14%, var(--bg-elev)), var(--bg-elev)); }
.tile--violet  { background: linear-gradient(150deg, color-mix(in srgb, #8b5cf6 14%, var(--bg-elev)), var(--bg-elev)); }
.tile--orange  { background: linear-gradient(150deg, color-mix(in srgb, #fb923c 14%, var(--bg-elev)), var(--bg-elev)); }
.tile--sky     { background: linear-gradient(150deg, color-mix(in srgb, #0ea5e9 14%, var(--bg-elev)), var(--bg-elev)); }

/* ---------- Listes / lignes cliquables ---------- */
.list { display: flex; flex-direction: column; gap: .5rem; }
.row-btn {
  display: flex; align-items: center; gap: .75rem; width: 100%; text-align: left;
  padding: .8rem .9rem; border-radius: var(--r); background: var(--bg-elev);
  border: 1px solid var(--line); box-shadow: var(--shadow); transition: transform .12s;
}
.row-btn:active { transform: scale(.985); }
.row-btn--big { padding: .95rem; }
.row-btn__icon { font-size: 1.3rem; flex: none; }
.row-btn__icon--xl { font-size: 1.7rem; width: 2.2rem; text-align: center; }
.row-btn__text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .1rem; }
.row-btn__text strong { font-size: .95rem; }
.row-btn__text small { color: var(--text-soft); font-size: .78rem; line-height: 1.35; }
.row-btn__chev { color: var(--text-soft); font-size: 1.4rem; }

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: .1rem;
  padding: .75rem 1.1rem; border-radius: 14px; font-weight: 700; font-size: .95rem;
  transition: transform .12s, filter .2s, opacity .2s;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .5; pointer-events: none; }
.btn small { font-weight: 500; font-size: .74rem; opacity: .8; }
.btn--primary { background: linear-gradient(140deg, var(--brand-2), var(--brand)); color: #fff; box-shadow: 0 6px 18px color-mix(in srgb, var(--brand) 35%, transparent); }
.btn--ghost { background: var(--bg-elev); color: var(--text); border: 1px solid var(--line); box-shadow: var(--shadow); }
.btn--danger { background: var(--ko-soft); color: var(--ko); border: 1px solid color-mix(in srgb, var(--ko) 35%, transparent); }
.btn--block { width: 100%; }
.btn--xl { padding: 1rem; font-size: 1rem; }
.btn-row { display: flex; gap: .5rem; flex-wrap: wrap; }
.btn-row .btn { flex: 1; min-width: 120px; }
.link-btn { color: var(--brand); font-weight: 600; font-size: .85rem; text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Puces, barres, anneaux ---------- */
.chip {
  display: inline-flex; align-items: center; gap: .25rem;
  padding: .15rem .5rem; border-radius: 999px; font-size: .72rem; font-weight: 700;
  background: var(--bg-soft); color: var(--text-soft); white-space: nowrap;
}
.chip--soft { background: var(--bg-soft); }
.chip--ok { background: var(--ok-soft); color: var(--ok); }
.chip--warn { background: var(--warn-soft); color: var(--warn); }
.chip--ko { background: var(--ko-soft); color: var(--ko); }
.chip--info { background: color-mix(in srgb, var(--info) 15%, transparent); color: var(--info); }
.chip--neutral { background: var(--bg-soft); }
.chip--level { color: #fff; }
.chip--a1 { background: #10b981; } .chip--a2 { background: #22c55e; }
.chip--b1 { background: #f59e0b; } .chip--b2 { background: #f97316; }
.chip--c1 { background: #ef4444; }
.chip--btn { padding: .35rem .7rem; font-size: .8rem; border: 1px solid var(--line); background: var(--bg-elev); color: var(--text); }
.chip--btn.is-on { background: var(--brand); color: #fff; border-color: transparent; }

.bar { height: 8px; background: var(--bg-soft); border-radius: 999px; overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--brand-2), var(--brand)); transition: width .45s cubic-bezier(.2,.8,.2,1); }
.bar--slim { height: 5px; margin-top: .35rem; }
.bar--head { flex: 1; }
.bar--ok i { background: var(--ok); }
.bar--warn i { background: var(--warn); }
.bar--neutral i { background: var(--text-soft); }

.ring { position: relative; flex: none; }
.ring__bg { stroke: var(--bg-soft); }
.ring__fg { stroke: url(#g); stroke: var(--brand); transition: stroke-dashoffset .6s cubic-bezier(.2,.8,.2,1); }
.ring__label { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.ring__label strong { display: block; font-size: 1.5rem; line-height: 1; }
.ring__label span { font-size: .7rem; color: var(--text-soft); }

.stat-row { display: flex; gap: .5rem; }
.stat { flex: 1; text-align: center; padding: .55rem; border-radius: var(--r-sm); background: var(--bg-soft); }
.stat strong { display: block; font-size: 1.3rem; line-height: 1.1; }
.stat small { font-size: .72rem; color: var(--text-soft); }
.stat--ok strong { color: var(--ok); }
.stat--warn strong { color: var(--warn); }

/* ---------- En-tête de session ---------- */
.session-head { display: flex; align-items: center; gap: .6rem; padding: .1rem 0 .3rem; }
.session-head__score { font-size: .82rem; font-weight: 700; color: var(--brand); min-width: 52px; text-align: right; font-variant-numeric: tabular-nums; }
.session-body { display: flex; flex-direction: column; gap: .7rem; }

/* ---------- Cartes mémoire ---------- */
.flash { perspective: 1400px; }
.flash__card {
  position: relative; min-height: 300px; transform-style: preserve-3d;
  transition: transform .55s cubic-bezier(.2,.8,.2,1); cursor: pointer;
}
.flash__card.is-flipped { transform: rotateY(180deg); }
.flash__face {
  position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .55rem;
  padding: 1.4rem; text-align: center;
  background: var(--bg-elev); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow);
}
.flash__face--back { transform: rotateY(180deg); background: linear-gradient(150deg, color-mix(in srgb, var(--brand) 8%, var(--bg-elev)), var(--bg-elev)); }
/* L'indice de retournement : discret au repos, net au survol. Il est présent
   des deux côtés — la carte se retourne dans les deux sens. */
.flash__indice { opacity: .55; font-size: .78rem; margin: .5rem 0 0; transition: opacity .2s; }
.flash__card:hover .flash__indice,
.flash__card:focus-visible .flash__indice { opacity: 1; }

.flash__word { font-size: 1.9rem; }
.flash__ipa { color: var(--text-soft); font-size: .95rem; margin: 0; }
.flash__ex { margin-top: .4rem; display: flex; flex-direction: column; align-items: center; gap: .25rem; }
.flash__ex-en { font-style: italic; }
.flash__ex-fr { color: var(--text-soft); font-size: .86rem; }
.flash__meta { display: flex; gap: .35rem; }

.grades { display: grid; grid-template-columns: repeat(4, 1fr); gap: .4rem; margin-top: .6rem; }
.grade { padding: .8rem .2rem; border-radius: 14px; font-weight: 700; font-size: .82rem; color: #fff; transition: transform .12s; }
.grade:active { transform: scale(.95); }
.grade--again { background: #ef4444; }
.grade--hard  { background: #f59e0b; }
.grade--good  { background: #3b82f6; }
.grade--easy  { background: #22c55e; }

/* ---------- Quiz ---------- */
.quiz { display: flex; flex-direction: column; gap: .7rem; }
.quiz__prompt {
  display: flex; flex-direction: column; align-items: center; gap: .45rem; text-align: center;
  padding: 1.3rem 1rem; background: var(--bg-elev); border: 1px solid var(--line);
  border-radius: var(--r); box-shadow: var(--shadow);
}
.quiz__prompt h2 { font-size: 1.7rem; }
.quiz__q { font-size: 1.1rem; font-weight: 600; }
.quiz__wrong { color: var(--ko); text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--ko) 50%, transparent); }

.options { display: flex; flex-direction: column; gap: .5rem; }
.options--2 { display: grid; grid-template-columns: 1fr 1fr; }
.option {
  padding: .9rem 1rem; border-radius: 14px; text-align: left; font-weight: 600;
  background: var(--bg-elev); border: 2px solid var(--line); box-shadow: var(--shadow);
  transition: transform .12s, border-color .2s, background .2s;
}
.option:active { transform: scale(.98); }
.option:disabled { opacity: .55; }
.option.is-ok { border-color: var(--ok); background: var(--ok-soft); color: var(--ok); opacity: 1; }
.option.is-ko { border-color: var(--ko); background: var(--ko-soft); color: var(--ko); opacity: 1; }
.option--tall { display: flex; flex-direction: column; align-items: flex-start; gap: .2rem; }
.option--tall small { font-weight: 500; color: var(--text-soft); }
.option--pair { display: flex; flex-direction: column; align-items: center; gap: .1rem; padding: 1.1rem .5rem; }
.option--pair strong { font-size: 1.15rem; }
.option--pair small { color: var(--text-soft); font-size: .78rem; }

.play-big {
  width: 76px; height: 76px; border-radius: 50%; font-size: 1.7rem; color: #fff;
  background: linear-gradient(140deg, var(--brand-2), var(--brand));
  box-shadow: 0 8px 24px color-mix(in srgb, var(--brand) 40%, transparent);
  transition: transform .15s;
}
.play-big:active { transform: scale(.92); }
.speeds { display: flex; gap: .4rem; justify-content: center; }

/* ---------- Retour / correction ---------- */
.feedback {
  display: flex; flex-direction: column; gap: .5rem; padding: .9rem;
  border-radius: var(--r); border: 1px solid; animation: fade-up .25s ease both;
}
.feedback--ok { background: var(--ok-soft); border-color: color-mix(in srgb, var(--ok) 40%, transparent); }
.feedback--ko { background: var(--ko-soft); border-color: color-mix(in srgb, var(--ko) 40%, transparent); }
.feedback__top { display: flex; align-items: center; gap: .5rem; }
.feedback__icon { width: 24px; height: 24px; border-radius: 50%; display: grid; place-content: center; font-size: .85rem; color: #fff; }
.feedback--ok .feedback__icon { background: var(--ok); }
.feedback--ko .feedback__icon { background: var(--ko); }
.feedback__detail { font-size: .88rem; margin: 0; }

/* ---------- Saisie ---------- */
.input {
  width: 100%; padding: .8rem .9rem; border-radius: 14px;
  background: var(--bg-elev); border: 2px solid var(--line); color: var(--text);
  outline: none; transition: border-color .2s;
}
.input:focus { border-color: var(--brand); }
.input--big { font-size: 1.1rem; text-align: center; }
.input--area { resize: vertical; min-height: 84px; text-align: left; }
.input--write { min-height: 200px; font-size: .98rem; line-height: 1.6; }
.input--inline { max-width: 60%; padding: .45rem .6rem; }
.input.is-ok { border-color: var(--ok); background: var(--ok-soft); }
.input.is-ko { border-color: var(--ko); background: var(--ko-soft); }

.select {
  padding: .5rem .7rem; border-radius: 12px; background: var(--bg-elev);
  border: 1px solid var(--line); color: var(--text);
}
.filters { display: flex; flex-direction: column; gap: .5rem; }
.filters__row { display: flex; gap: .5rem; }
.filters__row .select { flex: 1; min-width: 0; }
.form { display: flex; flex-direction: column; gap: .6rem; }

/* ---------- Remise en ordre ---------- */
.order__line {
  min-height: 62px; padding: .6rem; border-radius: var(--r-sm);
  border: 2px dashed var(--line); display: flex; flex-wrap: wrap; gap: .35rem; align-items: center;
}
.order__line.is-ok { border-color: var(--ok); border-style: solid; background: var(--ok-soft); }
.order__line.is-ko { border-color: var(--ko); border-style: solid; background: var(--ko-soft); }
.order__bank { display: flex; flex-wrap: wrap; gap: .35rem; }
.token {
  padding: .45rem .75rem; border-radius: 10px; font-weight: 600; font-size: .92rem;
  background: var(--bg-elev); border: 1px solid var(--line); box-shadow: var(--shadow);
}
.token:disabled { opacity: .3; }
.token--placed { background: color-mix(in srgb, var(--brand) 14%, var(--bg-elev)); border-color: var(--brand); }

/* ---------- Micro / prononciation ---------- */
.mic {
  display: flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .8rem 1.1rem; border-radius: 999px; font-weight: 700; color: #fff;
  background: linear-gradient(140deg, #f43f5e, #e11d48);
  box-shadow: 0 6px 18px rgba(244,63,94,.35); transition: transform .12s;
}
.mic--wide { width: 100%; }
.mic:active { transform: scale(.97); }
.mic.is-live { animation: pulse 1.2s infinite; background: linear-gradient(140deg, #ef4444, #b91c1c); }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(239,68,68,.5); } 50% { box-shadow: 0 0 0 14px rgba(239,68,68,0); } }
.mic__icon { font-size: 1.1rem; }

.speak-btn {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .45rem .75rem; border-radius: 999px; font-size: .84rem; font-weight: 600;
  background: var(--bg-soft); color: var(--text); transition: transform .12s, background .2s;
}
.speak-btn:active { transform: scale(.94); }
.speak-btn--sm { padding: .3rem .55rem; font-size: .78rem; }
.speak-btn.is-playing { background: var(--brand); color: #fff; }
.speak-btn:disabled { opacity: .4; }

.drill { gap: .5rem; }
.drill__text { font-size: 1.05rem; font-weight: 600; margin: 0; }
.drill__fr { color: var(--text-soft); font-size: .85rem; margin: 0; }
.drill__actions { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.drill__heard { font-size: .86rem; color: var(--text-soft); font-style: italic; min-height: 1.2em; margin: 0; }
.drill__words { display: flex; flex-wrap: wrap; font-size: 1rem; margin: 0; line-height: 1.8; }
.w { padding: 0 .1rem; border-radius: 4px; }
.w--ok { color: var(--ok); font-weight: 600; }
.w--close { color: var(--warn); background: var(--warn-soft); font-weight: 600; }
.w--missing { color: var(--ko); background: var(--ko-soft); text-decoration: underline wavy; }

.score { display: flex; align-items: baseline; gap: .6rem; padding: .6rem .8rem; border-radius: var(--r-sm); }
.score strong { font-size: 1.6rem; }
.score span { font-size: .85rem; }
.score--ok { background: var(--ok-soft); color: var(--ok); }
.score--warn { background: var(--warn-soft); color: var(--warn); }
.score--ko { background: var(--ko-soft); color: var(--ko); }
.audio { width: 100%; margin-top: .4rem; }

.sound__head { display: flex; align-items: center; gap: .8rem; }
.sound__symbol {
  width: 58px; height: 58px; flex: none; display: grid; place-content: center;
  border-radius: 16px; font-size: 1.3rem; font-weight: 700; color: #fff;
  background: linear-gradient(140deg, var(--brand-2), var(--brand));
}
.ex-line { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .4rem 0; border-bottom: 1px solid var(--line); }
.ex-line:last-child { border-bottom: none; }
.ex-line p { margin: 0; font-size: .92rem; }

/* ---------- Conversation ---------- */
.screen--chat { gap: .5rem; }
.convo-intro { text-align: center; padding: 1rem; display: flex; flex-direction: column; gap: .3rem; }
.convo-intro__icon { font-size: 2.4rem; }
.thread { display: flex; flex-direction: column; gap: .55rem; padding-bottom: .5rem; }
.bubble {
  max-width: 86%; padding: .7rem .9rem; border-radius: 18px;
  box-shadow: var(--shadow); opacity: 0; transform: translateY(6px); transition: .25s ease;
}
.bubble.is-in { opacity: 1; transform: none; }
.bubble p { margin: 0; }
.bubble__fr { font-size: .8rem; color: var(--text-soft); margin-top: .2rem !important; }
.bubble__fr.is-hidden { display: none; }
.bubble--them { align-self: flex-start; background: var(--bg-elev); border: 1px solid var(--line); border-bottom-left-radius: 6px; }
.bubble--you { align-self: flex-end; background: linear-gradient(140deg, var(--brand-2), var(--brand)); color: #fff; border-bottom-right-radius: 6px; }
.bubble--you .bubble__fr { color: rgba(255,255,255,.75); }
.bubble--coach { align-self: center; background: var(--warn-soft); color: var(--warn); font-size: .85rem; max-width: 94%; }

.dock {
  position: sticky; bottom: calc(var(--tab-h) + var(--safe-b) + .4rem); z-index: 20;
  background: var(--bg-elev); border: 1px solid var(--line); border-radius: var(--r);
  padding: .75rem; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; gap: .5rem;
}
.dock:empty { display: none; }
.dock__line { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.dock__tag { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--brand); }
.dock__tag--think { color: var(--warn); text-transform: none; font-size: .85rem; letter-spacing: 0; }
.dock__say { font-size: 1.05rem; font-weight: 600; margin: 0; }
.dock__fr { font-size: .82rem; color: var(--text-soft); margin: 0; }
.dock__heard { font-size: .84rem; font-style: italic; color: var(--text-soft); margin: 0; min-height: 1em; }
.dock__wait { text-align: center; color: var(--text-soft); }
.dots { letter-spacing: .2em; animation: blink 1.2s infinite; }
@keyframes blink { 0%,100% { opacity: .3; } 50% { opacity: 1; } }

/* ---------- Vocabulaire : liste ---------- */
.wordlist { display: flex; flex-direction: column; gap: .5rem; }
.word {
  display: flex; gap: .6rem; padding: .75rem .85rem; border-radius: var(--r);
  background: var(--bg-elev); border: 1px solid var(--line); box-shadow: var(--shadow);
}
.word__main { flex: 1; min-width: 0; }
.word__top { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; }
.word__top strong { font-size: 1rem; }
.word__fr { margin: .15rem 0 .1rem; font-size: .9rem; }
.word__ipa { color: var(--text-soft); font-size: .82rem; }
.word__ex { font-size: .82rem; font-style: italic; color: var(--text-soft); margin: 0; }
.word__exfr { font-size: .78rem; color: var(--text-soft); opacity: .8; margin: 0; }
.word__side { display: flex; flex-direction: column; gap: .3rem; align-items: center; }

/* ---------- Verbes ---------- */
.verbtable { display: flex; flex-direction: column; gap: 1px; background: var(--line); border-radius: var(--r); overflow: hidden; border: 1px solid var(--line); }
.verbtable__head, .verbrow {
  display: grid; grid-template-columns: 1fr 1fr 1fr 44px; gap: .4rem;
  padding: .6rem .7rem; background: var(--bg-elev); align-items: center; font-size: .88rem;
}
.verbtable__head { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--text-soft); font-weight: 700; background: var(--bg-soft); border-radius: var(--r) var(--r) 0 0; }
.verbrow__base { font-weight: 700; }
.verbrow__fr { grid-column: 1 / -1; color: var(--text-soft); font-size: .74rem; }
.verbrow.is-known { background: color-mix(in srgb, var(--ok) 8%, var(--bg-elev)); }
.verbrow__side { display: flex; justify-content: flex-end; }

/* ---------- Parcours guidé ---------- */
.parcours-head { display: flex; flex-direction: column; gap: .3rem; }
.parcours-head__top { display: flex; gap: .35rem; }
.parcours-head h2 { font-size: 1.45rem; }

.card--parcours { background: linear-gradient(140deg, color-mix(in srgb, var(--brand) 10%, var(--bg-elev)), var(--bg-elev)); }
.parcours-next {
  display: flex; align-items: center; gap: .7rem; width: 100%; text-align: left;
  padding: .7rem .8rem; border-radius: var(--r-sm); background: var(--bg-soft);
  border: 2px solid color-mix(in srgb, var(--brand) 35%, transparent); transition: transform .12s;
}
.parcours-next:active { transform: scale(.985); }
.parcours-next__i { font-size: 1.5rem; }
.parcours-next__t { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.parcours-next__t small { color: var(--text-soft); font-size: .72rem; }
.parcours-next__t strong { font-size: .95rem; }

.unite {
  display: flex; align-items: center; gap: .75rem; width: 100%; text-align: left;
  padding: .8rem .9rem; border-radius: var(--r); background: var(--bg-elev);
  border: 1px solid var(--line); box-shadow: var(--shadow); transition: transform .12s;
}
.unite:active { transform: scale(.985); }
.unite.is-done { border-color: color-mix(in srgb, var(--ok) 45%, var(--line)); background: color-mix(in srgb, var(--ok) 6%, var(--bg-elev)); }
.unite.is-locked { opacity: .55; }
.unite__num {
  width: 40px; height: 40px; flex: none; border-radius: 12px; display: grid; place-content: center;
  font-size: 1.2rem; background: var(--bg-soft);
}
.unite.is-done .unite__num { background: var(--ok); color: #fff; }
.unite__text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .2rem; }
.unite__text strong { font-size: .95rem; }
.unite__text small { color: var(--text-soft); font-size: .78rem; line-height: 1.35; }

.etape {
  display: flex; align-items: center; gap: .7rem; width: 100%; text-align: left;
  padding: .7rem .85rem; border-radius: var(--r-sm); background: var(--bg-elev);
  border: 1px solid var(--line); transition: transform .12s;
}
.etape:active { transform: scale(.985); }
.etape.is-done { background: color-mix(in srgb, var(--ok) 8%, var(--bg-elev)); border-color: color-mix(in srgb, var(--ok) 35%, var(--line)); }
.etape__icone {
  width: 34px; height: 34px; flex: none; border-radius: 10px; display: grid; place-content: center;
  font-size: 1.05rem; background: var(--bg-soft);
}
.etape.is-done .etape__icone { background: var(--ok); color: #fff; }
.etape__text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .15rem; }
.etape__text strong { font-size: .92rem; }
.etape__text small { color: var(--text-soft); font-size: .76rem; line-height: 1.3; }
.etape__dose { display: flex; align-items: center; gap: .4rem; margin-top: .2rem; }
.etape__dose .bar { flex: 1; }
.etape__dose small { font-variant-numeric: tabular-nums; }
.card--ok { border-color: color-mix(in srgb, var(--ok) 45%, var(--line)); background: color-mix(in srgb, var(--ok) 8%, var(--bg-elev)); }

/* ---------- Duel en direct ---------- */
.room-code {
  font-size: 2.4rem; font-weight: 800; letter-spacing: .25em; text-align: center;
  padding: .8rem; border-radius: var(--r-sm); margin: .2rem 0;
  background: color-mix(in srgb, var(--brand) 12%, var(--bg-soft)); color: var(--brand);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.lobby { display: flex; align-items: center; gap: .6rem; }
.lobby__joueur {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: .25rem;
  padding: .9rem .4rem; border-radius: var(--r-sm); background: var(--bg-soft);
  border: 2px solid transparent;
}
.lobby__joueur.is-attente { opacity: .55; border-style: dashed; border-color: var(--line); }
.lobby__avatar { font-size: 2rem; }
.countdown {
  font-size: 5rem; font-weight: 800; color: var(--brand); line-height: 1;
  animation: pop .4s cubic-bezier(.2,1.4,.4,1) both;
}
.adversaire {
  display: flex; align-items: center; gap: .5rem; padding: .5rem .7rem;
  border-radius: 999px; background: var(--bg-soft); margin-bottom: .5rem;
}
.adversaire .bar { flex: 1; }
.adversaire__avatar { font-size: 1.1rem; }
.adversaire__nom { font-size: .8rem; font-weight: 600; max-width: 8ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.adversaire__pts { font-size: .82rem; color: var(--brand); font-variant-numeric: tabular-nums; }
.steps { margin: .6rem 0 0; padding-left: 1.2rem; display: flex; flex-direction: column; gap: .4rem; font-size: .88rem; }

/* ---------- Bienvenue / création de compte ---------- */
.screen--welcome { gap: 0; min-height: 100dvh; }
.wel-top { padding: .4rem 0 1rem; }
.wel-body { display: flex; flex-direction: column; }
.wel-step { display: flex; flex-direction: column; gap: .8rem; animation: fade-up .3s ease both; }
.wel-step h1 { font-size: 1.6rem; letter-spacing: -.02em; }
.wel-lead { color: var(--text-soft); font-size: .95rem; line-height: 1.5; margin: 0; }
.wel-logo {
  font-size: 2rem; font-weight: 800; letter-spacing: -.03em; text-align: center;
  background: linear-gradient(140deg, var(--brand-2), var(--brand));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  margin-bottom: .5rem;
}
.wel-points { list-style: none; margin: .4rem 0; padding: 0; display: flex; flex-direction: column; gap: .6rem; }
.wel-points li { display: flex; gap: .6rem; align-items: flex-start; font-size: .9rem; color: var(--text-soft); }
/* minmax(0,1fr) et min-width:0 : sans eux, la largeur du glyphe emoji impose
   celle de la colonne et la grille deborde de l'ecran sur un telephone. */
.wel-avatars { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: .35rem; }
.wel-avatar {
  aspect-ratio: 1; min-width: 0; display: grid; place-content: center; font-size: 1.25rem;
  border-radius: 12px; background: var(--bg-soft); border: 2px solid transparent; transition: .15s;
}
.wel-avatar.is-on { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 15%, var(--bg-soft)); transform: scale(1.06); }
.wel-badge {
  width: 84px; height: 84px; margin: 0 auto; border-radius: 50%;
  display: grid; place-content: center; font-size: 2.4rem;
  background: linear-gradient(140deg, color-mix(in srgb, var(--brand) 20%, var(--bg-elev)), var(--bg-elev));
  border: 2px solid var(--line);
  animation: pop .5s cubic-bezier(.2,1.4,.4,1) both;
}
.wel-recap { display: flex; flex-direction: column; gap: .35rem; margin: .3rem 0; }
.wel-recap > div { display: flex; justify-content: space-between; padding: .55rem .8rem; border-radius: var(--r-sm); background: var(--bg-soft); font-size: .9rem; }
.wel-back { align-self: center; margin-top: .3rem; }
.row-btn.is-on { border-color: var(--brand); }

/* ---------- Formulaire de compte ---------- */
.wel-champ { display: flex; flex-direction: column; gap: .35rem; }
.wel-champ > span { font-size: .82rem; font-weight: 600; color: var(--text-soft); }
.wel-champ small { font-size: .74rem; }
.mdp-ligne { position: relative; display: flex; align-items: center; }
.mdp-ligne .input { padding-right: 3rem; }
.mdp-oeil {
  position: absolute; right: .35rem; width: 2.4rem; height: 2.4rem;
  display: grid; place-items: center; border-radius: 10px; font-size: 1.05rem;
}
.mdp-force { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .25rem; }
.mdp-force i { height: 4px; border-radius: 99px; background: var(--line); transition: background .2s; }
.mdp-force i.is-on { background: var(--warn); }
.mdp-force i.is-on.niveau-3 { background: var(--brand); }
.mdp-force i.is-on.niveau-4 { background: var(--ok); }
.wel-erreur:empty { display: none; }
.wel-erreur {
  margin: 0; font-size: .85rem; line-height: 1.4; color: var(--ko);
  background: var(--ko-soft); border-radius: var(--r-sm); padding: .55rem .7rem;
}
.wel-erreur .link-btn { color: inherit; }
.center { text-align: center; }
/* Le numero de paiement est une cible tactile, pas un lien de bas de page :
   c'est le geste central de la recharge, et un doigt qui rate le manque. */
.numero-copier {
  min-height: 44px; padding: .5rem .7rem; border-radius: var(--r-sm);
  background: var(--bg-soft); border: 1px solid var(--line);
  font-variant-numeric: tabular-nums; text-decoration: none;
}
.numero-copier:hover { background: var(--bg-elev); }

/* Une entree fermee reste lisible : on la grise, on ne la cache pas. */
.row-btn--ferme { opacity: .62; }
.row-btn--ferme .row-btn__chev { font-size: .9rem; }

/* -------------------------------------------------------------- Abonnement
   Trois durees cote a cote, la plus avantageuse mise en avant. On montre ce
   qui s'ouvre, jamais ce qui est ferme : pas de fonctionnalite barree. */
.recharges { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .5rem; margin: .5rem 0 .2rem; }
.recharge {
  display: flex; flex-direction: column; align-items: center; gap: .15rem;
  cursor: pointer; min-height: 112px;
  padding: .8rem .4rem; text-align: center;
  background: var(--bg-soft); border: 1px solid var(--line); border-radius: var(--r-sm);
}
.recharge:hover { border-color: color-mix(in srgb, var(--brand) 55%, var(--line)); }
.recharge:active { transform: scale(.98); }
.recharge--vedette {
  background: color-mix(in srgb, var(--brand) 8%, var(--bg-elev));
  border-color: color-mix(in srgb, var(--brand) 40%, var(--line));
}
/* La recharge d'essai : visiblement a part, pour qu'on ne la confonde jamais
   avec une vraie offre. */
.recharge--essai {
  grid-column: 1 / -1; margin-top: .1rem;
  background: var(--bg-soft); border-style: dashed;
  border-color: color-mix(in srgb, var(--warn) 45%, var(--line));
}
.recharge__duree { font-size: .78rem; color: var(--text-soft); }
.recharge__prix  { font-size: 1.15rem; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.recharge__unite { font-size: .7rem; color: var(--text-soft); }
.recharge .chip  { margin-top: .3rem; font-size: .64rem; }

.ouvre { display: flex; flex-direction: column; gap: .7rem; margin-top: .3rem; }
.ouvre__ligne { display: grid; grid-template-columns: 1.6rem 1fr; gap: .6rem; align-items: start; }
.ouvre__i { font-size: 1.05rem; line-height: 1.4; }
.ouvre__ligne strong { font-size: .92rem; }
.ouvre__ligne p { margin: .1rem 0 0; }

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

/* ------------------------------------------------------------------- Avis
   Un message et sa réponse forment un bloc : la réponse est décalée et
   soulignée d'un trait de couleur, pour qu'on voie d'un coup d'œil que
   quelqu'un a répondu — sans avoir à lire. */
.avis-liste { display: flex; flex-direction: column; gap: .6rem; }
.avis {
  background: var(--bg-elev); border: 1px solid var(--line);
  border-radius: var(--r-sm); padding: .8rem .9rem; margin-bottom: .55rem;
}
.avis:last-child { margin-bottom: 0; }
.avis--repondu { border-color: color-mix(in srgb, var(--ok) 38%, var(--line)); }
.avis__entete { display: flex; align-items: flex-start; gap: .5rem; flex-wrap: wrap; margin-bottom: .4rem; }
.avis__qui { flex: 1; min-width: 0; }
.avis__qui strong { display: block; font-size: .92rem; }
.avis__qui small { color: var(--text-soft); font-size: .76rem; word-break: break-all; }
.avis__texte { margin: 0; font-size: .9rem; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.avis__reponse {
  margin-top: .6rem; padding: .55rem .7rem;
  border-left: 3px solid var(--ok); border-radius: 0 var(--r-sm) var(--r-sm) 0;
  background: var(--bg-soft);
}
.avis__reponse p { margin: .2rem 0 0; font-size: .88rem; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.avis__repondre { margin-top: .6rem; display: flex; flex-direction: column; gap: .45rem; }
.avis__pied { display: flex; align-items: center; justify-content: space-between; gap: .6rem; flex-wrap: wrap; }
.avis-pied { display: flex; align-items: center; justify-content: space-between; gap: .6rem; flex-wrap: wrap; margin: .3rem 0 .6rem; }

/* Le pouce est un interrupteur, pas un compteur : il est éteint ou allumé. */
.avis__aime {
  /* Un pouce se tape avec le pouce : 26 px de haut ne suffisaient pas. */
  flex: none; min-height: 40px; min-width: 44px; padding: .45rem .7rem;
  border-radius: 999px; font-size: 1rem; line-height: 1;
  background: var(--bg-soft); border: 1px solid var(--line); filter: grayscale(1); opacity: .55;
  transition: filter .15s, opacity .15s, background .15s;
}
.avis__aime.is-on { filter: none; opacity: 1; background: color-mix(in srgb, var(--ok) 16%, var(--bg-elev)); border-color: color-mix(in srgb, var(--ok) 45%, var(--line)); }
.avis__aime:disabled { opacity: .35; }

/* Cible tactile confortable : le texte seul ne faisait que 22 px de haut. */
.avis__retirer { min-height: 44px; padding: .6rem .2rem; }
.avis__retirer.is-arme { color: var(--ko); font-weight: 700; }

/* Pastille de compte, sur un bouton. */
.pastille {
  display: inline-block; min-width: 1.25rem; padding: 0 .35rem;
  border-radius: 999px; background: var(--ko); color: #fff;
  font-size: .72rem; font-weight: 700; line-height: 1.25rem; text-align: center;
}

.abonnes { display: flex; flex-direction: column; gap: .45rem; margin: .6rem 0; }
.abonne {
  display: grid; gap: .35rem .8rem;
  background: var(--bg-elev); border: 1px solid var(--line);
  border-radius: var(--r-sm); padding: .75rem .9rem;
}
.abonne__qui strong { display: block; font-size: .95rem; }
.abonne__qui small { color: var(--text-soft); font-size: .78rem; word-break: break-all; }
.abonne__chiffres { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; font-size: .8rem; color: var(--text-soft); font-variant-numeric: tabular-nums; }
.abonne__dates { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.abonne__dates small { color: var(--text-soft); font-size: .74rem; }
@media (min-width: 700px) {
  .abonne { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1.3fr) auto; align-items: center; }
}

.sync-ligne {
  margin: .1rem 0 .3rem; padding: .45rem .65rem; border-radius: var(--r-sm);
  background: var(--bg-soft); color: var(--text-soft);
}
.sync-ligne.is-ko { background: var(--ko-soft); color: var(--ko); }
.compte-ligne {
  display: flex; justify-content: space-between; gap: .8rem; align-items: baseline;
  padding: .5rem 0; border-bottom: 1px solid var(--line); font-size: .9rem;
}
.compte-ligne > span { color: var(--text-soft); flex: none; }
.compte-ligne > strong { text-align: right; word-break: break-word; min-width: 0; }

/* ---------- Comptes locaux ---------- */
.accounts { display: flex; flex-direction: column; gap: .4rem; }
.account {
  display: flex; align-items: center; gap: .7rem; width: 100%; text-align: left;
  padding: .6rem .75rem; border-radius: var(--r-sm);
  background: var(--bg-soft); border: 2px solid transparent; transition: .15s;
}
.account.is-current { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 12%, var(--bg-soft)); }
.account__avatar { font-size: 1.5rem; flex: none; }
.account__text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.account__text strong { font-size: .95rem; }
.account__text small { color: var(--text-soft); font-size: .76rem; }

.emoji-grid { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: .3rem; }
.emoji-opt {
  aspect-ratio: 1; min-width: 0; display: grid; place-content: center; font-size: 1.2rem;
  border-radius: 10px; background: var(--bg-soft); border: 2px solid transparent;
}
.emoji-opt.is-on { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 15%, var(--bg-soft)); }

.diag { display: flex; flex-direction: column; gap: .3rem; margin-top: .5rem; }
.diag__line { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .72rem; word-break: break-word; }

/* ---------- Génie en herbe ---------- */
.quiz-top { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; }
.quiz-top__pts { margin-left: auto; font-weight: 800; color: var(--brand); font-variant-numeric: tabular-nums; }

.chrono-wrap { display: flex; align-items: center; gap: .5rem; }
.chrono { flex: 1; height: 8px; border-radius: 999px; background: var(--bg-soft); overflow: hidden; }
.chrono i { display: block; height: 100%; background: linear-gradient(90deg, var(--brand-2), var(--brand)); transition: width .1s linear; }
.chrono.is-urgent i { background: linear-gradient(90deg, #f97316, #ef4444); }
.chrono__n { font-weight: 800; font-variant-numeric: tabular-nums; min-width: 2ch; text-align: right; color: var(--text-soft); }
.chrono.is-urgent + .chrono__n { color: var(--ko); }

.score-big { font-size: 2.8rem; font-weight: 800; line-height: 1; color: var(--brand); display: flex; align-items: baseline; gap: .4rem; justify-content: center; }
.score-big small { font-size: .9rem; font-weight: 600; color: var(--text-soft); }

.versus { display: flex; align-items: center; gap: .6rem; width: 100%; margin: .6rem 0; }
.versus__side {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: .15rem;
  padding: .7rem .4rem; border-radius: var(--r-sm); background: var(--bg-soft); border: 2px solid transparent;
}
.versus__side.is-win { border-color: var(--ok); background: var(--ok-soft); color: var(--ok); }
.versus__side strong { font-size: .9rem; }
.versus__vs { font-weight: 800; color: var(--text-soft); font-size: .8rem; }

.share { width: 100%; display: flex; flex-direction: column; gap: .4rem; margin: .5rem 0; }
.share__link { font-size: .72rem; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; word-break: break-all; }

.quiz-hist { display: flex; align-items: center; gap: .6rem; padding: .55rem .75rem; border-radius: var(--r-sm); background: var(--bg-elev); border: 1px solid var(--line); }
.quiz-hist__i { font-size: 1.15rem; }
.quiz-hist__t { flex: 1; display: flex; flex-direction: column; }
.quiz-hist__t small { color: var(--text-soft); font-size: .74rem; }

.duel-head { display: flex; align-items: center; gap: .8rem; }
.duel-head__i { font-size: 2.2rem; }
.duel-head h2 { font-size: 1.25rem; }

.relay { display: flex; flex-direction: column; align-items: center; gap: .5rem; text-align: center; padding: 2rem 1rem; }
.relay__i { font-size: 3rem; }
.relay__name { font-size: 1.8rem; font-weight: 800; color: var(--brand); margin: 0; }

.podium { width: 100%; display: flex; flex-direction: column; gap: .4rem; margin: .5rem 0; }
.podium__row { display: flex; align-items: center; gap: .6rem; padding: .6rem .8rem; border-radius: var(--r-sm); background: var(--bg-soft); }
.podium__row.is-first { background: color-mix(in srgb, var(--brand) 15%, var(--bg-soft)); }
.podium__rank { font-size: 1.15rem; min-width: 1.8rem; }
.podium__name { flex: 1; text-align: left; font-weight: 600; }

/* ---------- Lecture guidée ---------- */
.screen--read { gap: .7rem; }
.read-head { display: flex; flex-direction: column; gap: .25rem; }
.read-head__top { display: flex; gap: .35rem; flex-wrap: wrap; }
.read-head h2 { font-size: 1.5rem; }

.read-tools {
  position: sticky; top: calc(var(--bar-h) + var(--safe-t)); z-index: 30;
  display: flex; gap: .35rem; flex-wrap: wrap; align-items: center;
  padding: .5rem; border-radius: var(--r);
  background: color-mix(in srgb, var(--bg-elev) 94%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  border: 1px solid var(--line); box-shadow: var(--shadow);
}
.tool {
  display: inline-flex; align-items: center; gap: .3rem;
  padding: .4rem .6rem; border-radius: 999px; font-size: .78rem; font-weight: 600;
  background: var(--bg-soft); color: var(--text-soft); transition: .15s;
}
.tool.is-on { background: var(--brand); color: #fff; }
.tool--play { background: linear-gradient(140deg, var(--brand-2), var(--brand)); color: #fff; }
.tool__i { font-size: .95rem; }
.read-speeds { display: flex; gap: .25rem; margin-left: auto; }

.read-body { display: flex; flex-direction: column; gap: 1rem; }
.read-body--petit .para__en { font-size: .95rem; }
.read-body--normal .para__en { font-size: 1.08rem; }
.read-body--grand .para__en { font-size: 1.3rem; }

.para {
  padding: .8rem .9rem; border-radius: var(--r);
  background: var(--bg-elev); border: 1px solid var(--line); box-shadow: var(--shadow);
  transition: border-color .25s, background .25s;
}
.para.is-reading { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 6%, var(--bg-elev)); }
.para__row { display: flex; gap: .5rem; align-items: flex-start; }
.para__en { line-height: 1.85; margin: 0; flex: 1; }
.para__fr {
  margin: .5rem 0 0; padding-top: .5rem; border-top: 1px dashed var(--line);
  font-size: .88rem; color: var(--text-soft); font-style: italic;
}
.para__fr.is-hidden { display: none; }
.para__actions { display: flex; gap: .4rem; flex-wrap: wrap; margin-top: .6rem; }
.para__score:empty { display: none; }
.para__score { margin-top: .5rem; display: flex; flex-direction: column; gap: .3rem; }

.sent { display: flex; gap: .5rem; align-items: flex-start; padding: .35rem 0; border-bottom: 1px dashed var(--line); }
.sent:last-child { border-bottom: none; }
.sent > div { flex: 1; min-width: 0; }
.sent__play {
  flex: none; width: 30px; height: 30px; border-radius: 50%; font-size: .72rem;
  background: var(--bg-soft); color: var(--brand); display: grid; place-content: center;
  transition: transform .12s;
}
.sent__play:active { transform: scale(.9); }

/* Mot touchable */
.tok { border-radius: 4px; cursor: pointer; transition: background .12s, color .12s; padding: 0 1px; }
.tok:hover { background: color-mix(in srgb, var(--brand) 18%, transparent); }
.tok:active { background: var(--brand); color: #fff; }
.tok.is-spoken { background: var(--brand); color: #fff; }

.mini-btn {
  padding: .35rem .65rem; border-radius: 999px; font-size: .76rem; font-weight: 600;
  background: var(--bg-soft); color: var(--text-soft);
}
.mini-btn:active { transform: scale(.95); }

.keywords { margin: .6rem 0 0; padding-left: 1.1rem; display: flex; flex-direction: column; gap: .35rem; }
.keywords li { display: flex; align-items: center; justify-content: space-between; gap: .5rem; font-size: .9rem; }

.wordsheet { display: flex; flex-direction: column; gap: .45rem; }
.wordsheet__head { display: flex; align-items: center; gap: .6rem; }
.wordsheet__head h2 { font-size: 1.6rem; }
.wordsheet__fr { font-size: 1.15rem; font-weight: 600; color: var(--brand); margin: 0; }
.wordsheet__ex { font-style: italic; color: var(--text-soft); font-size: .9rem; margin: 0; }

.voice-warn { color: var(--warn); font-weight: 600; }

/* ---------- Conjugaison ---------- */
.conj-formula {
  font-size: 1.05rem; font-weight: 700; text-align: center; padding: .7rem;
  border-radius: var(--r-sm); background: color-mix(in srgb, var(--brand) 12%, var(--bg-soft)); color: var(--brand);
}
.conj-formula strong { color: inherit; text-decoration: underline; text-underline-offset: 3px; }
.conj-trap { font-size: .88rem; padding: .6rem .7rem; border-radius: var(--r-sm); background: var(--warn-soft); color: var(--warn); margin: 0; }
.conj-trap strong { color: inherit; }
.conj-table { display: flex; flex-direction: column; gap: 1px; background: var(--line); border-radius: var(--r-sm); overflow: hidden; }
.conj-row { display: flex; align-items: center; gap: .6rem; padding: .55rem .7rem; background: var(--bg-elev); }
.conj-row__p { width: 46px; flex: none; font-size: .8rem; font-weight: 700; color: var(--text-soft); text-transform: capitalize; }
.conj-row__t { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.conj-row__t strong { font-size: .95rem; font-weight: 600; }
.conj-row__t small { font-size: .76rem; color: var(--text-soft); font-style: italic; }
.conj-tags { display: flex; gap: .35rem; }

/* ---------- Expressions ---------- */
.segmented { display: flex; gap: .25rem; padding: .25rem; background: var(--bg-soft); border-radius: 14px; }
.segmented__btn { flex: 1; padding: .5rem; border-radius: 11px; font-size: .84rem; font-weight: 600; color: var(--text-soft); }
.segmented__btn.is-on { background: var(--bg-elev); color: var(--text); box-shadow: var(--shadow); }
.group-title { font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--text-soft); margin: .6rem 0 .1rem; }
.phrase {
  display: flex; align-items: center; gap: .6rem; padding: .7rem .85rem; border-radius: var(--r);
  background: var(--bg-elev); border: 1px solid var(--line); box-shadow: var(--shadow);
}
.phrase > div { flex: 1; min-width: 0; }
.phrase strong { font-size: .95rem; }
.phrase__fr { margin: .1rem 0; font-size: .86rem; color: var(--text-soft); }
.phrase__ex { margin: 0; font-size: .8rem; font-style: italic; color: var(--text-soft); opacity: .85; }
.phrase.is-known { border-color: color-mix(in srgb, var(--ok) 40%, var(--line)); }

/* ---------- Écriture ---------- */
.helper { background: var(--bg-elev); border: 1px solid var(--line); border-radius: var(--r); padding: .7rem .9rem; box-shadow: var(--shadow); }
.helper summary, .transcript summary, .model-summary { cursor: pointer; font-weight: 700; font-size: .9rem; }
.helper ul { margin: .6rem 0 0; padding-left: 1.1rem; display: flex; flex-direction: column; gap: .35rem; }
.helper li { display: flex; align-items: center; justify-content: space-between; gap: .5rem; font-size: .88rem; }
.write__bar { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.write__stats { display: flex; flex-wrap: wrap; gap: .5rem; font-size: .8rem; color: var(--text-soft); }
.write__stats span { background: var(--bg-soft); padding: .2rem .5rem; border-radius: 999px; }
.write__highlight { font-size: .95rem; line-height: 1.7; background: var(--bg-soft); padding: .8rem; border-radius: var(--r-sm); white-space: pre-wrap; }
.mk { padding: .05em .15em; border-radius: 4px; }
.mk--error { background: var(--ko-soft); color: var(--ko); text-decoration: underline wavy var(--ko); }
.mk--warn { background: var(--warn-soft); color: var(--warn); }
.mk--info { background: color-mix(in srgb, var(--info) 18%, transparent); color: var(--info); }
.issues { display: flex; flex-direction: column; gap: .5rem; }
.issue { padding: .6rem .75rem; border-radius: var(--r-sm); background: var(--bg-soft); border-left: 3px solid var(--line); }
.issue--error { border-left-color: var(--ko); }
.issue--warn { border-left-color: var(--warn); }
.issue--info { border-left-color: var(--info); }
.issue__top { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: .25rem; }
.issue p { margin: 0; font-size: .86rem; }
.issue__fix { color: var(--ok) !important; font-weight: 600; margin-top: .2rem !important; }
.model pre, .saved-text {
  white-space: pre-wrap; font-family: inherit; font-size: .92rem; line-height: 1.65;
  background: var(--bg-soft); padding: .8rem; border-radius: var(--r-sm); margin: .6rem 0;
}
.transcript p { font-size: .9rem; line-height: 1.7; margin-top: .5rem; }
.dictation__diff { display: flex; flex-direction: column; gap: .35rem; padding: .7rem; background: var(--bg-soft); border-radius: var(--r-sm); }
.dictation__target { font-weight: 600; margin: 0; }

/* ---------- Profil ---------- */
.profile-head { display: flex; align-items: center; gap: .9rem; padding: .3rem 0; }
.profile-head > div:not(.avatar) { flex: 1; min-width: 0; }
.avatar {
  width: 62px; height: 62px; flex: none; border-radius: 50%; display: grid; place-content: center;
  font-size: 1.6rem; font-weight: 800; color: #fff;
  background: linear-gradient(140deg, var(--brand-2), var(--brand));
}
.kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; }
.kpis--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 520px) { .kpis--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* ---------- Tableau de bord d'administration ---------- */
.admin-attente { padding: 2rem 0; text-align: center; color: var(--text-soft); font-size: .9rem; }
.admin-table { display: flex; flex-direction: column; }
.admin-table > div {
  display: flex; justify-content: space-between; gap: .8rem; align-items: baseline;
  padding: .45rem 0; border-bottom: 1px solid var(--line); font-size: .88rem;
}
.admin-table > div:last-child { border-bottom: 0; }
.admin-table span { color: var(--text-soft); }
.admin-table strong { text-align: right; font-variant-numeric: tabular-nums; }

.admin-barres { display: flex; flex-direction: column; gap: .4rem; }
.admin-barre { display: grid; grid-template-columns: minmax(0, 8.5rem) minmax(2.5rem, 1fr) auto; align-items: center; gap: .5rem; font-size: .82rem; }
/* Le libellé passe à la ligne plutôt que d'être coupé : « Rat de
   bibliothèque » tronqué en « Rat de biblio… » ne renseigne plus personne. */
.admin-barre__nom { color: var(--text-soft); min-width: 0; line-height: 1.25; overflow-wrap: anywhere; }
@media (min-width: 520px) { .admin-barre { grid-template-columns: minmax(0, 11rem) minmax(3rem, 1fr) auto; } }
.admin-barre__piste { height: 8px; border-radius: 99px; background: var(--bg-soft); overflow: hidden; min-width: 0; }
.admin-barre__piste i { display: block; height: 100%; border-radius: 99px; background: var(--brand); }
.admin-barre__val { font-variant-numeric: tabular-nums; color: var(--text); white-space: nowrap; }

.admin-histo-bloc { margin: .4rem 0 .2rem; }
.admin-histo { width: 100%; height: 74px; display: block; }
.admin-histo rect { fill: var(--brand); }
.admin-histo.bar--xp rect { fill: var(--ok); }
.admin-histo-axe { display: flex; justify-content: space-between; font-size: .7rem; color: var(--text-soft); margin-top: .1rem; }

.kpi { text-align: center; padding: .7rem .3rem; border-radius: var(--r-sm); background: var(--bg-elev); border: 1px solid var(--line); box-shadow: var(--shadow); }
.kpi__i { font-size: 1.1rem; }
.kpi strong { display: block; font-size: 1.15rem; line-height: 1.2; }
.kpi small { font-size: .7rem; color: var(--text-soft); }

.heatmap { display: flex; gap: 3px; overflow-x: auto; padding-bottom: .2rem; }
.heatmap__col { display: flex; flex-direction: column; gap: 3px; }
.heat { width: 13px; height: 13px; border-radius: 3px; background: var(--bg-soft); display: block; }
.heat--1 { background: color-mix(in srgb, var(--brand) 28%, var(--bg-soft)); }
.heat--2 { background: color-mix(in srgb, var(--brand) 50%, var(--bg-soft)); }
.heat--3 { background: color-mix(in srgb, var(--brand) 72%, var(--bg-soft)); }
.heat--4 { background: var(--brand); }
.heat-legend { display: flex; align-items: center; gap: 4px; font-size: .7rem; color: var(--text-soft); }

.badges { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .5rem; }
.badge {
  display: flex; flex-direction: column; align-items: center; gap: .2rem; text-align: center;
  padding: .6rem .2rem; border-radius: var(--r-sm); background: var(--bg-soft);
  filter: grayscale(1); opacity: .45; cursor: pointer; transition: .2s;
}
.badge span { font-size: 1.5rem; }
.badge small { font-size: .62rem; line-height: 1.2; }
.badge.is-owned { filter: none; opacity: 1; background: color-mix(in srgb, var(--brand) 12%, var(--bg-soft)); }

.goal-opts, .levels { display: grid; gap: .45rem; }
.goal-opts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.levels { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.goal-opt, .level-opt {
  padding: .6rem .4rem; border-radius: var(--r-sm); text-align: center; font-weight: 700;
  background: var(--bg-soft); border: 2px solid transparent; transition: .2s;
}
.goal-opt small { display: block; font-weight: 500; font-size: .7rem; color: var(--text-soft); }
.goal-opt.is-on, .level-opt.is-on { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 14%, var(--bg-soft)); color: var(--brand); }

.settings { display: flex; flex-direction: column; }
.setting {
  display: flex; align-items: center; justify-content: space-between; gap: .8rem;
  padding: .65rem 0; border-bottom: 1px solid var(--line); font-size: .92rem;
}
.setting:last-child { border-bottom: none; }
.setting--col { flex-direction: column; align-items: stretch; gap: .4rem; }
.setting--col > span { display: flex; justify-content: space-between; }
.setting__val { color: var(--text-soft); font-variant-numeric: tabular-nums; }
.range { width: 100%; accent-color: var(--brand); }
.switch { position: relative; width: 48px; height: 28px; flex: none; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 2; }
.switch i { position: absolute; inset: 0; background: var(--bg-soft); border-radius: 999px; transition: background .2s; }
.switch i::after { content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: transform .2s; }
.switch input:checked + i { background: var(--brand); }
.switch input:checked + i::after { transform: translateX(20px); }
.foot { text-align: center; font-size: .75rem; color: var(--text-soft); padding: .5rem 0 1rem; }

/* ---------- Récapitulatif ---------- */
.summary {
  display: flex; flex-direction: column; align-items: center; gap: .7rem; text-align: center;
  padding: 1.5rem 1rem; background: var(--bg-elev); border: 1px solid var(--line);
  border-radius: var(--r); box-shadow: var(--shadow); animation: fade-up .35s ease both;
}
.summary__medal { font-size: 3rem; animation: pop .5s cubic-bezier(.2,1.4,.4,1) both; }
@keyframes pop { from { transform: scale(0) rotate(-25deg); } }
.summary__lines { width: 100%; display: flex; flex-direction: column; gap: .3rem; margin: .3rem 0; }
.summary__line { display: flex; justify-content: space-between; padding: .45rem .7rem; background: var(--bg-soft); border-radius: 10px; font-size: .9rem; }
.summary__actions { width: 100%; display: flex; flex-direction: column; gap: .45rem; }

.task-tag {
  display: inline-flex; align-self: center; align-items: center; gap: .35rem;
  padding: .25rem .7rem; border-radius: 999px; font-size: .75rem; font-weight: 700;
  background: var(--bg-soft); color: var(--text-soft);
}

/* ---------- État vide ---------- */
.empty { text-align: center; padding: 2.5rem 1rem; color: var(--text-soft); }
.empty__icon { font-size: 2.6rem; margin-bottom: .4rem; }
.empty h3 { margin-bottom: .3rem; color: var(--text); }

/* ---------- Notifications ---------- */
#toasts {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(var(--tab-h) + var(--safe-b) + 1rem); z-index: 200;
  display: flex; flex-direction: column; gap: .4rem; align-items: center;
  width: min(92vw, 420px); pointer-events: none;
}
.toast {
  padding: .65rem .9rem; border-radius: 14px; font-size: .88rem; font-weight: 600;
  background: #1f2333; color: #fff; box-shadow: var(--shadow-lg);
  opacity: 0; transform: translateY(12px); transition: .25s ease; max-width: 100%;
}
.toast.is-in { opacity: 1; transform: none; }
.toast--ok { background: var(--ok); }
.toast--warn { background: var(--warn); color: #1a1206; }
.toast--badge { display: flex; align-items: center; gap: .7rem; background: linear-gradient(140deg, var(--brand-2), var(--brand)); }
.toast__icon { font-size: 1.7rem; }
.toast__sub { font-weight: 500; font-size: .8rem; opacity: .9; }

/* ---------- Feuille modale ---------- */
.sheet-back {
  position: fixed; inset: 0; z-index: 300; background: rgba(8,10,20,.5);
  display: flex; align-items: flex-end; justify-content: center;
  opacity: 0; transition: opacity .25s; backdrop-filter: blur(2px);
}
.sheet-back.is-in { opacity: 1; }
.sheet {
  width: min(100%, 560px); max-height: 88dvh; overflow-y: auto;
  background: var(--bg-elev); border-radius: 22px 22px 0 0;
  padding: .6rem 1rem calc(1.2rem + var(--safe-b));
  transform: translateY(30px); transition: transform .3s cubic-bezier(.2,.9,.3,1);
}
.sheet-back.is-in .sheet { transform: none; }
.sheet--wide { max-width: 720px; }
.sheet__grip { width: 38px; height: 4px; border-radius: 99px; background: var(--line); margin: .2rem auto .6rem; }
.sheet__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: .5rem; }
.sheet__body { display: flex; flex-direction: column; gap: .6rem; }

/* ---------- Confettis ---------- */
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 400; overflow: hidden; }
.confetti i {
  position: absolute; top: -12px; width: 9px; height: 14px; border-radius: 2px;
  animation: fall linear forwards;
}
@keyframes fall {
  to { transform: translateY(105vh) rotate(760deg); opacity: .1; }
}

/* ---------- Leçon ---------- */
.lesson-head { display: flex; flex-direction: column; gap: .3rem; align-items: flex-start; }
.lesson-head h2 { font-size: 1.4rem; }
.lesson-p { font-size: .95rem; line-height: 1.65; margin: 0; }
.lesson-p strong { color: var(--brand); }

/* ---------- Accessibilité ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand) 60%, transparent); outline-offset: 2px; }

/* ---------- Écran large ---------- */
/* Bande étroite : trop large pour une barre pleine largeur, pas encore assez
   pour la colonne latérale qui prend le relais à 900 px. */
@media (min-width: 860px) and (max-width: 899.98px) {
  .tabbar { grid-template-columns: repeat(5, 140px); justify-content: center; }
  .app { padding-left: 1.5rem; padding-right: 1.5rem; }
}

/* ============================================================
   Mise en page ordinateur
   ------------------------------------------------------------
   Une barre d'onglets collée en bas d'un écran de 27 pouces n'a
   aucun sens : le pouce n'y est pas. Au-delà de 900 px, la même
   navigation devient une colonne latérale, et la zone de travail
   respire. Rien de tout cela ne touche au téléphone.
   ============================================================ */

/* Le logo, la ou l'application se presente : ecran de demarrage, en-tete du
   telephone (quand aucune fleche de retour ne l'occupe), barre laterale. */
.splash__marque { display: block; margin: 0 auto .6rem; border-radius: 22%; }
.appbar__logo { flex: none; width: 26px; height: 26px; border-radius: 28%; }
.tabbar__pied { display: none; }

.tabbar__marque { display: none; }

@media (min-width: 900px) {

  /* :not(.page-accueil) est indispensable. La page de presentation partage
     cette feuille de style pour garder les memes couleurs et les memes
     boutons, mais elle n'a ni barre d'application ni onglets : sans cette
     exclusion, son en-tete et son pied de page se retrouvaient pousses dans
     la colonne laterale de l'application, et la page paraissait tassee au
     milieu de l'ecran. */
  body:not(.page-accueil) {
    display: grid;
    /* Colonne « auto » : quand la navigation est masquée (accueil,
       création de compte), elle occupe zéro et le contenu prend tout. */
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
  }

  .tabbar {
    grid-column: 1; grid-row: 1 / -1;
    position: sticky; top: 0; inset-inline: auto;
    width: 15rem; height: 100dvh;
    display: flex; flex-direction: column; justify-content: flex-start; gap: .2rem;
    padding: 1.1rem .7rem;
    background: var(--bg-soft);
    border-top: 0; border-right: 1px solid var(--line);
    backdrop-filter: none;
  }

  .tabbar__marque {
    display: flex; align-items: center; gap: .55rem;
    padding: .3rem .9rem 1rem;
    font-size: 1.3rem; font-weight: 800; letter-spacing: -.02em;
    color: var(--text);
  }
  .tabbar__marque img { border-radius: 26%; }

  /* Sur ordinateur, la barre laterale porte deja la marque : deux logos dans
     le meme coin de l'ecran feraient doublon. */
  .appbar__logo { display: none; }

  /* margin-top:auto pousse le pied tout en bas de la colonne — c'est la place
     ou l'on cherche « se deconnecter » sans y penser. */
  .tabbar__pied {
    display: flex; flex-direction: column; gap: .2rem;
    margin-top: auto; padding-top: .8rem;
    border-top: 1px solid var(--line);
  }
  .tab--pied { font-size: .82rem; color: var(--text-soft); width: 100%; text-align: left; }
  .tab--pied:hover { color: var(--text); }

  .tab {
    flex-direction: row; justify-content: flex-start; gap: .75rem;
    padding: .65rem .9rem; border-radius: var(--r-sm);
    font-size: .92rem; font-weight: 600;
    transition: background .15s, color .15s;
  }
  .tab__i { font-size: 1.15rem; }
  .tab:hover { background: var(--bg-elev); color: var(--text); }
  .tab.is-active { background: color-mix(in srgb, var(--brand) 14%, transparent); }
  .tab.is-active .tab__i { transform: none; }

  .appbar { grid-column: 2; grid-row: 1; }
  .app {
    grid-column: 2; grid-row: 2;
    /* Largeur DÉFINIE, pas un simple plafond. Un élément de grille auquel on
       donne des marges automatiques se rétracte sur son contenu au lieu de
       remplir sa colonne : sur les écrans faits de petites cartes — les
       expressions, les verbes — la zone de travail tombait à 531 px au
       milieu d'un écran de 1920, et max-width ne servait à rien. */
    width: min(56rem, 100%);
    max-width: none;
    margin-inline: auto;
    padding: 1.4rem 1.6rem 3rem;
  }

  /* Les messages passent au-dessus du contenu, plus au-dessus d'onglets
     qui n'existent plus. */
  #toasts { bottom: 1.5rem; left: calc(50% + 7.5rem); }

  /* Un formulaire de connexion étalé sur 56 rem est illisible : on garde
     l'accueil dans une colonne à hauteur de regard. */
  .screen--welcome { max-width: 30rem; margin-inline: auto; width: 100%; }

  /* Le survol n'existe pas au doigt ; sur un ordinateur, il renseigne. */
  .row-btn:hover, .account:hover, .option:not(:disabled):hover {
    border-color: color-mix(in srgb, var(--brand) 45%, var(--line));
  }
}

@media (min-width: 1200px) {
  .app { width: min(62rem, 100%); }
  #toasts { left: calc(50% + 7.5rem); }
}

/* Au-delà, on continue d'élargir : sur un 24 pouces, 62 rem laissent deux
   marges vides plus larges que le contenu. Les écrans de l'application sont
   faits de cartes autonomes, pas de longs paragraphes — les élargir ne nuit
   pas à la lecture. */
@media (min-width: 1600px) {
  .app { width: min(72rem, 100%); }
}
