/* Chwiya Darija — V2 « Atay »
   Le rituel du thé à la menthe : vert menthe profond, ambre du thé, fond menthe très clair.
   Bricolage Grotesque pour les titres et le darija, Readex Pro pour le texte et l'arabe.
   Un seul élément mémorable : le verre de thé qui se remplit au fil de la séance. */

:root {
  color-scheme: light dark;
  --bg: #E8F3EE;
  --surface: #FFFFFF;
  --surface-2: #F2F8F5;
  --ink: #0F2A23;
  --mut: #4B6158;
  --line: #D2E3DA;
  --chip: #E1EEE8;
  --primary: #0B5C49;
  --on-primary: #FFFFFF;
  --tea: #E0952B;
  --tea-deep: #975000;
  --tea-soft: #FBE6C2;
  --on-tea-soft: #422600;
  --ok: #0B5C49;
  --ok-soft: #DDF0E7;
  --good: var(--ok);
  --bad: #B3261E;
  --bad-soft: #FBE3E1;
  --me-bg: #0B5C49;
  --me-ink: #FFFFFF;
  --glass-rim: #9DB3AA;
  --glass-band: #C8A24A;
  --leaf: #2E8B62;
  --foam: #F6D9A4;
  --bar-bg: rgba(232, 243, 238, .88);
  --shadow: 0 1px 0 rgba(15, 42, 35, .04), 0 8px 20px -14px rgba(11, 92, 73, .35);
  --shadow-lg: 0 18px 40px -22px rgba(11, 92, 73, .55);
  --r: 20px;
  --r-btn: 16px;
  --display: 'Bricolage Grotesque', system-ui, sans-serif;
  --body: 'Readex Pro', system-ui, -apple-system, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0B1D18;
    --surface: #132A23;
    --surface-2: #10241E;
    --ink: #E6F2EC;
    --mut: #9DB8AD;
    --line: #234239;
    --chip: #1B362E;
    --primary: #4CC29E;
    --on-primary: #05201A;
    --tea: #F0A93B;
    --tea-deep: #F4B85C;
    --tea-soft: #3A2A12;
    --on-tea-soft: #FBE6C2;
    --ok: #4CC29E;
    --ok-soft: #173B30;
    --bad: #F2867E;
    --bad-soft: #3B1A18;
    --me-bg: #1E5D4C;
    --me-ink: #FFFFFF;
    --glass-rim: #6E8A80;
    --glass-band: #B8933F;
    --leaf: #57B98B;
    --foam: #F6D9A4;
    --bar-bg: rgba(11, 29, 24, .86);
    --shadow: 0 1px 0 rgba(0, 0, 0, .3), 0 10px 24px -16px rgba(0, 0, 0, .7);
    --shadow-lg: 0 22px 44px -24px rgba(0, 0, 0, .9);
  }
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--bg); }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--body); font-size: 17px; line-height: 1.5;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}
main { max-width: 560px; margin: 0 auto; padding: 8px 20px calc(48px + env(safe-area-inset-bottom)); }
h1, h2, h3 { font-family: var(--display); line-height: 1.1; letter-spacing: -.02em; }
h1 { font-size: 34px; font-weight: 700; margin: 12px 0 8px; }
h2 { font-size: 23px; font-weight: 700; margin: 40px 0 12px; }
h3 { font-size: 20px; font-weight: 700; margin: 0 0 6px; }
p { margin: 0 0 12px; }
a { color: var(--primary); text-underline-offset: 3px; }
strong, b { font-weight: 600; }
::selection { background: var(--tea-soft); color: var(--ink); }
:focus-visible { outline: 3px solid var(--tea); outline-offset: 2px; border-radius: 8px; }
svg { flex: none; }
.lede { color: var(--mut); font-size: 17px; }
.muted, .note { color: var(--mut); font-size: 14.5px; }
.small { font-size: 14px; color: var(--mut); }
[hidden] { display: none !important; }
code { font-size: .9em; background: var(--chip); padding: 1px 6px; border-radius: 6px; }

/* darija et arabe */
.dj { font-family: var(--display); font-weight: 700; color: var(--primary); }
.ar { font-family: 'Readex Pro', sans-serif; color: var(--mut); direction: rtl; unicode-bidi: isolate; }
.ph { display: block; font-size: 15px; color: var(--ink); }
.snd { font-style: normal; font-weight: 700; color: var(--tea-deep); text-decoration: underline dotted; text-underline-offset: 3px; cursor: help; }

/* ---------- Boutons ---------- */
button { font: inherit; color: inherit; cursor: pointer; touch-action: manipulation; -webkit-user-select: none; user-select: none; }
.btn, button.primary {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 52px; padding: 10px 22px; line-height: 1.25; border-radius: var(--r-btn); border: 0;
  font-weight: 600; font-size: 17px; text-decoration: none; text-align: center;
  background: var(--surface); color: var(--ink); box-shadow: inset 0 0 0 2px var(--line);
  transition: transform .12s ease-out, background-color .15s;
}
.btn:active, button:active { transform: scale(.97); }
.btn.primary, button.primary { background: var(--primary); color: var(--on-primary); box-shadow: none; }
.btn.tea { background: var(--tea); color: #2B1700; box-shadow: none; }
.btn.ghost { background: transparent; }
.btn.danger { background: transparent; color: var(--bad); }
.btn.wide { display: flex; width: 100%; }
button:disabled { opacity: .5; cursor: default; }
@media (hover: hover) {
  .btn:hover { filter: brightness(1.04); }
  .btn.ghost:hover, .btn:not(.primary):not(.tea):hover { box-shadow: inset 0 0 0 2px var(--primary); }
}

/* ---------- Barre du haut + menu ---------- */
.appbar { position: sticky; top: 0; z-index: 50; background: var(--bar-bg); -webkit-backdrop-filter: saturate(1.3) blur(12px); backdrop-filter: saturate(1.3) blur(12px); padding-top: env(safe-area-inset-top); }
.appbar-in { max-width: 560px; margin: 0 auto; padding: 6px 10px 6px 20px; display: flex; align-items: center; gap: 10px; min-height: 52px; }
.appbar-title { display: inline-flex; align-items: center; gap: 10px; font-family: var(--display); font-weight: 700; font-size: 20px; color: var(--ink); text-decoration: none; }
.appbar-title img { width: 32px; height: 32px; border-radius: 9px; }
.appbar-back { display: inline-flex; align-items: center; gap: 2px; margin-left: -8px; padding: 8px 6px; font-weight: 600; font-size: 16px; color: var(--primary); text-decoration: none; }
.appbar-back span { font-size: 28px; line-height: 0; margin-top: -3px; }
.appbar-spacer { margin-left: auto; }

/* ---------- Verre de thé ---------- */
.glass .gl-tea { fill: var(--tea); }
.glass .gl-foam { fill: var(--foam); }
.glass .gl-leaf path { fill: var(--leaf); }
.glass .gl-rim { stroke: var(--glass-rim); stroke-width: 3.5; stroke-linejoin: round; }
.glass .gl-band { stroke: var(--glass-band); stroke-width: 2.5; stroke-dasharray: 3 4; }
.glass .gl-shine { stroke: rgba(255, 255, 255, .7); stroke-width: 4; stroke-linecap: round; }
.glass.pour { animation: pour .9s cubic-bezier(.2, .8, .2, 1); }
@keyframes pour { from { transform: translateY(10px) scale(.92); opacity: .3; } to { transform: none; opacity: 1; } }

/* ---------- Accueil ---------- */
.hero { display: grid; grid-template-columns: auto 1fr; gap: 18px; align-items: center; margin-top: 10px; }
.hero-glass { padding: 4px; background: radial-gradient(closest-side, var(--surface) 35%, transparent 72%); }
.hero-glass { display: flex; flex-direction: column; align-items: center; }
.glass-cap { margin: 4px 0 0; white-space: nowrap; font-size: 13.5px; font-weight: 600; line-height: 1.25; text-align: center; color: var(--tea-deep); }
.hello { margin: 0; font-family: var(--display); font-weight: 700; font-size: 20px; color: var(--tea-deep); }
.hero h1 { font-size: 34px; line-height: 1.02; margin: 2px 0 10px; letter-spacing: -.03em; }
.streak { display: flex; align-items: center; gap: 6px; margin: 0; color: var(--mut); font-size: 15px; }
.streak svg { width: 22px; height: 22px; color: var(--tea); }
.streak b { color: var(--ink); font-size: 18px; }
.steps { list-style: none; padding: 0; margin: 22px 0 0; display: grid; gap: 8px; }
.steps a { display: flex; align-items: center; gap: 14px; min-height: 64px; padding: 10px 14px; background: var(--surface); border-radius: 16px; color: var(--ink); text-decoration: none; box-shadow: var(--shadow); }
.steps .dot { width: 30px; height: 30px; border-radius: 50%; box-shadow: inset 0 0 0 2.5px var(--line); display: grid; place-items: center; flex: none; }
.steps .dot svg { width: 17px; height: 17px; }
.steps .tx { flex: 1; display: grid; }
.steps b { font-size: 16px; }
.steps small { color: var(--mut); font-size: 13.5px; }
.steps .chev { width: 18px; height: 18px; color: var(--mut); }
.steps .ok .dot { background: var(--tea); box-shadow: none; color: #fff; }
.steps .ok b { color: var(--mut); text-decoration: line-through; text-decoration-color: var(--tea); text-decoration-thickness: 2px; }
.steps .next a { box-shadow: inset 0 0 0 2.5px var(--primary), var(--shadow); }
.steps .bonus a { background: transparent; box-shadow: inset 0 0 0 2px var(--line); }
.steps .bonus .dot { box-shadow: none; color: var(--tea-deep); font-weight: 700; }
.cta { margin-top: 14px; }
.track { display: flex; align-items: center; gap: 6px; margin-bottom: 14px; }
.tk { flex: 1; height: 10px; border-radius: 99px; background: var(--line); }
.tk.done { background: var(--tea); }
.tk.today { background: var(--primary); }

.lessons { list-style: none; margin: 0; padding: 0; border-radius: var(--r); overflow: hidden; background: var(--surface); box-shadow: var(--shadow); }
.lessons li + li { border-top: 1px solid var(--line); }
.lrow { display: flex; align-items: center; gap: 14px; min-height: 66px; padding: 10px 16px; color: var(--ink); text-decoration: none; }
.lnum { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-weight: 600; flex: none; background: transparent; box-shadow: inset 0 0 0 2px var(--line); color: var(--mut); }
.lnum svg { width: 18px; height: 18px; }
.ltx { flex: 1; display: grid; }
.ltx b { font-size: 16px; }
.ltx small { color: var(--mut); font-size: 13.5px; }
.lrow.done .lnum { background: var(--tea); color: #fff; box-shadow: none; }
.lrow.today .lnum { background: var(--primary); color: var(--on-primary); box-shadow: none; }
.lrow.later .ltx b { color: var(--mut); }
.lrow .locked { margin-left: auto; flex: none; width: 44px; display: grid; place-items: center; color: var(--mut); }
.lrow .locked svg { width: 20px; height: 20px; }
.now { font-size: 13px; font-weight: 600; color: var(--on-tea-soft); background: var(--tea-soft); padding: 4px 10px; border-radius: 99px; }
.install { margin-top: 28px; padding: 16px 18px; border-radius: var(--r); background: var(--tea-soft); color: var(--on-tea-soft); font-size: 15px; }
.install b { display: block; margin-bottom: 2px; }
footer { margin-top: 40px; font-size: 13.5px; color: var(--mut); }
footer ol { padding-left: 20px; }

/* ---------- Leçon ---------- */
.l-head { padding-top: 6px; }
.l-theme { margin: 0; color: var(--mut); font-size: 15px; }
.l-head h1 { font-size: 38px; line-height: 1.04; margin: 4px 0 8px; letter-spacing: -.03em; }
.l-done { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; color: var(--on-tea-soft); background: var(--tea-soft); padding: 4px 10px; border-radius: 99px; margin-bottom: 8px; }
.l-done svg { width: 16px; height: 16px; }
.l-steps { display: flex; gap: 6px; list-style: none; padding: 0; margin: 20px 0 0; }
.l-steps li { flex: 1; }
.l-steps a { display: block; padding-top: 10px; font-size: 13.5px; font-weight: 600; color: var(--mut); text-decoration: none; background: linear-gradient(var(--line), var(--line)) top / 100% 4px no-repeat; }
.l-steps a.on { color: var(--ink); background: linear-gradient(var(--tea), var(--tea)) top / 100% 4px no-repeat; }
.intro { color: var(--mut); }

.words { display: grid; gap: 12px; }
.word { background: var(--surface); border-radius: var(--r); padding: 16px 18px; box-shadow: var(--shadow); }
.word p { margin: 0; }
.w-fr { font-size: 14.5px; color: var(--mut); }
.w-dj { font-family: var(--display); font-size: 28px; line-height: 1.15; font-weight: 700; color: var(--primary); margin: 2px 0 4px !important; letter-spacing: -.01em; overflow-wrap: anywhere; }
.w-ph { font-size: 16px; }
.w-row { display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.w-ar { margin-left: auto; font-size: 19px; color: var(--mut); text-align: right; line-height: 1.5; font-family: 'Readex Pro', sans-serif; }
.w-note { font-size: 14px; color: var(--mut); margin-top: 10px !important; padding-top: 10px; border-top: 1px solid var(--line); }
.legend { margin: 14px 0 0; padding: 12px 14px; border-radius: 14px; background: var(--surface-2); font-size: 13.5px; line-height: 1.55; color: var(--mut); display: flex; flex-wrap: wrap; gap: 3px 14px; }
.legend strong { width: 100%; color: var(--ink); font-weight: 600; }
.legend b { color: var(--tea-deep); }
.legend a { flex-basis: 100%; }
.tip { margin: 14px 0 0; padding: 14px 16px; border-radius: 16px; background: var(--surface); box-shadow: inset 0 0 0 2px var(--line); font-size: 15.5px; }
.tip h3 { font-size: 16px; font-family: var(--body); font-weight: 600; margin: 0 0 4px; letter-spacing: 0; }
.tip .dj { font-size: 1em; }

/* scène : conversation */
.hide-toggle { margin: 0 0 12px; min-height: 44px; padding: 0 16px; font-size: 15px; border: 0; border-radius: 12px; background: var(--surface); box-shadow: inset 0 0 0 2px var(--line); font-weight: 600; }
.dialogue { display: grid; gap: 10px; }
.dialogue .line { display: grid; justify-items: start; gap: 3px; }
.dialogue .line.me { justify-items: end; }
.dialogue .who { font-size: 12.5px; color: var(--mut); padding: 0 8px; }
.dialogue .say { max-width: 88%; background: var(--surface); border-radius: 18px 18px 18px 6px; padding: 10px 14px; box-shadow: var(--shadow); display: grid; gap: 1px; }
.dialogue .me .say { background: var(--me-bg); color: var(--me-ink); border-radius: 18px 18px 6px 18px; }
.dialogue .say .dj { display: block; font-size: 18px; color: var(--primary); }
.dialogue .me .say .dj { color: inherit; }
.dialogue .say .ph { font-size: 14px; color: inherit; opacity: .9; }
.dialogue .say .fr { display: block; font-size: 14px; opacity: .75; }
.dialogue .me .snd { color: #FFD48A; }
.dialogue .say .snd-btns { margin-top: 6px; }
.dialogue.hide-dj .say { cursor: pointer; }
.dialogue.hide-dj .say .dj, .dialogue.hide-dj .say .ph, .dialogue.hide-dj .say .snd { color: transparent !important; }
.dialogue.hide-dj .say .dj, .dialogue.hide-dj .say .ph { background: var(--line); border-radius: 6px; user-select: none; }
.dialogue.hide-dj .me .say .dj, .dialogue.hide-dj .me .say .ph { background: rgba(255, 255, 255, .2); }
.dialogue.hide-dj .say:not(.peek) .snd-btns { visibility: hidden; }
.dialogue.hide-dj .say.peek .dj, .dialogue.hide-dj .say.peek .ph { background: none; color: inherit !important; }
.dialogue.hide-dj .line:not(.me) .say.peek .dj { color: var(--primary) !important; }
.dialogue.hide-dj .say.peek .snd { color: var(--tea-deep) !important; }

/* quiz */
.quiz-intro { color: var(--mut); margin-top: 24px; }
.quiz { display: grid; gap: 12px; margin: 0; }
.q { background: var(--surface); border-radius: var(--r); padding: 16px; box-shadow: var(--shadow); }
.q .prompt { margin: 0 0 12px; font-weight: 600; }
.q .n { display: block; font-weight: 400; font-size: 13px; color: var(--mut); margin-bottom: 2px; }
.q .opts { display: grid; gap: 8px; }
.q .opts button { text-align: left; min-height: 50px; padding: 8px 16px; border-radius: 14px; border: 2px solid var(--line); background: var(--surface-2); font-size: 16px; font-weight: 500; }
.q .opts button.right { border-color: var(--ok); background: var(--ok-soft); }
.q .opts button.wrong { border-color: var(--bad); background: var(--bad-soft); }
.q .fb { margin-top: 10px; font-size: 15px; }
.q .fb.ok { color: var(--ok); }
.q .fb.ko { color: var(--bad); }
.q .fb .ph { display: inline; font-size: 15px; }
.q .typein { display: flex; gap: 8px; flex-wrap: wrap; }
.q input[type=text] { flex: 1 1 200px; min-height: 50px; font: inherit; font-size: 17px; padding: 10px 14px; border-radius: 14px; border: 2px solid var(--line); background: var(--surface-2); color: var(--ink); }
.q input[type=text]:focus { border-color: var(--primary); outline: none; }
.q .typein button { min-height: 50px; padding: 0 16px; border-radius: 14px; border: 0; background: var(--chip); font-weight: 600; }
.q .typein button.primary { background: var(--primary); color: var(--on-primary); }
.quiz .next { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 4px; }
.quiz .next button { min-height: 44px; padding: 0 16px; border-radius: 12px; border: 0; background: transparent; box-shadow: inset 0 0 0 2px var(--line); font-weight: 600; font-size: 15px; }
.score { margin: 0; color: var(--mut); font-size: 15px; }

/* mission */
.mission { margin-top: 32px; border-radius: var(--r); padding: 18px; background: var(--tea-soft); color: var(--on-tea-soft); }
.mission h3 { margin: 0 0 6px; }
.mission p { margin: 0; }
.mission .dj { color: inherit; text-decoration: underline; text-decoration-color: var(--tea); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.mission .btn { margin-top: 14px; min-height: 46px; background: var(--surface); color: var(--ink); box-shadow: none; }
.mission .btn.on { background: var(--primary); color: var(--on-primary); }
.mission .btn svg { width: 18px; height: 18px; }

/* fin de leçon */
.finish-card { margin-top: 20px; border-radius: var(--r); padding: 22px 18px; background: var(--surface); box-shadow: var(--shadow); display: grid; gap: 10px; text-align: center; }
.finish-card h3 { font-size: 22px; }
.finish-card p { margin: 0; color: var(--mut); }
.finish-card .meter { height: 8px; border-radius: 99px; background: var(--line); overflow: hidden; }
.finish-card .meter i { display: block; height: 100%; background: var(--tea); border-radius: 99px; transform-origin: left; transition: transform .4s; }
.finish-card.done { background: linear-gradient(var(--surface), var(--surface-2)); }
.fin-art { display: grid; place-items: center; }
.fin-big { font-family: var(--display); font-weight: 800; font-size: 42px; line-height: 1; color: var(--tea-deep) !important; letter-spacing: -.02em; }
.fin-track { display: flex; gap: 5px; margin: 4px 0; }
.fin-track .tk { height: 8px; }
.fin-track.many { gap: 2px; }
.fin-track.many .tk { min-width: 0; }
.finish-actions { display: grid; gap: 8px; margin-top: 6px; }
.box { margin-top: 24px; padding: 16px 18px; border-radius: var(--r); background: var(--surface); box-shadow: inset 0 0 0 2px var(--line); font-size: 15.5px; }
.box h3 { font-size: 17px; }
.lnav { display: grid; gap: 8px; margin-top: 28px; }
.lnav a { display: flex; align-items: center; gap: 8px; min-height: 52px; padding: 0 16px; border-radius: 16px; background: var(--surface); box-shadow: var(--shadow); color: var(--ink); text-decoration: none; font-weight: 500; }
.lnav a svg { width: 18px; height: 18px; color: var(--mut); }
.lnav a.nx { justify-content: space-between; }

/* sons */
.snd-btns { display: flex; flex-wrap: wrap; gap: 6px; }
.snd-pair { display: inline-flex; }
.snd-btns button { white-space: nowrap; border: 0; min-height: 40px; padding: 0 14px; font-size: 14px; font-weight: 600; background: var(--primary); color: var(--on-primary); border-radius: 99px 0 0 99px; }
.snd-pair button.slow { border-radius: 0 99px 99px 0; padding: 0 12px; margin-left: 2px; }
/* darija (de droite à gauche) : Écouter est à droite, la tortue à gauche → les arrondis s'inversent */
html[dir="rtl"] .snd-pair button:first-child { border-radius: 0 99px 99px 0; }
html[dir="rtl"] .snd-pair button.slow { border-radius: 99px 0 0 99px; margin-left: 0; margin-right: 2px; }
.snd-btns .said { font-weight: 500; }
.snd-btns button.playing { background: var(--tea); color: #2B1700; }
.snd-btns button.rec { border-radius: 99px; min-height: 36px; font-size: 13px; padding: 0 12px; background: transparent; box-shadow: inset 0 0 0 2px var(--line); color: var(--mut); }
.snd-btns button.rec.recording { box-shadow: inset 0 0 0 2px var(--bad); color: var(--bad); }
.snd-btns button.mine { background: var(--tea); color: #2B1700; }
.snd-btns button.del { background: transparent; color: var(--mut); padding: 0 8px; border-radius: 99px; }
.dialogue .me .snd-btns button:not(.rec) { background: rgba(255, 255, 255, .2); color: #fff; }
.credit { font-size: 12.5px; margin-top: 12px; }

/* ---------- Révision ---------- */
.rv-head h1 { margin: 6px 0 4px; font-size: 30px; }
.rv-stats { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 14px; color: var(--mut); margin: 2px 0 12px; }
.rv-stats span { white-space: nowrap; }
.rv-stats b { color: var(--ink); }
.rv-prog { height: 8px; border-radius: 99px; background: var(--line); overflow: hidden; margin-bottom: 14px; }
.rv-prog i { display: block; height: 100%; width: 100%; background: var(--primary); border-radius: 99px; transform-origin: left; transform: scaleX(0); transition: transform .3s; }
.card3d { position: relative; height: clamp(290px, calc(100svh - 320px - env(safe-area-inset-top) - env(safe-area-inset-bottom)), 400px); perspective: 1200px; cursor: pointer; -webkit-user-select: none; user-select: none; }
.card3d .face { position: absolute; inset: 0; border-radius: 28px; padding: 20px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 6px; backface-visibility: hidden; -webkit-backface-visibility: hidden; transition: transform .55s cubic-bezier(.2, .8, .2, 1); box-shadow: var(--shadow-lg); }
.card3d .face p { margin: 0; }
.card3d .front { background: var(--primary); color: var(--on-primary); }
.card3d .back { background: var(--surface); color: var(--ink); transform: rotateY(180deg); }
/* Révision : doigt blanc en diagonale en bas à droite du recto ; il appuie et une onde part du bout du doigt (on touche la carte pour la retourner) */
.card3d .tap-hint { position: absolute; right: 40px; bottom: 36px; width: 0; height: 0; pointer-events: none; }
.card3d .tap-hint i { position: absolute; border-radius: 50%; opacity: 0; }
.card3d .th-dot { left: -5px; top: -5px; width: 10px; height: 10px; background: rgba(255, 255, 255, .35); animation: thDot 2.4s ease-out infinite; }
.card3d .th-ring { left: -12px; top: -12px; width: 24px; height: 24px; border: 1.5px solid rgba(255, 255, 255, .85); animation: thRing 2.4s ease-out infinite; }
.card3d .th-r2 { animation-delay: .18s; }
.card3d .th-hand { position: absolute; left: -10.5px; top: -3.3px; width: 26px; height: 26px; transform-origin: 10.5px 3.3px; animation: thPress 2.4s cubic-bezier(.3, .7, .3, 1) infinite; }
.card3d .th-hand path { fill: var(--primary); stroke: var(--on-primary); stroke-width: 1.3; stroke-linecap: round; stroke-linejoin: round; }
@keyframes thPress { 0%, 22% { transform: translate(6px, 8px) rotate(-22deg); } 34%, 44% { transform: translate(0, 0) rotate(-22deg) scale(.9); } 60%, 100% { transform: translate(6px, 8px) rotate(-22deg); } }
@keyframes thRing { 0%, 33% { opacity: 0; transform: scale(.3); } 36% { opacity: .9; transform: scale(.4); } 80%, 100% { opacity: 0; transform: scale(2.6); } }
@keyframes thDot { 0%, 33% { opacity: 0; } 36% { opacity: 1; } 55%, 100% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .card3d .th-hand, .card3d .tap-hint i { animation: none; } .card3d .th-hand { transform: rotate(-22deg); } }
.card3d.flipped .front { transform: rotateY(-180deg); }
.card3d.flipped .back { transform: rotateY(0); }
.card3d .dir { font-size: 15px; opacity: .8; }
.card3d .big { font-family: var(--display); font-size: 38px; line-height: 1.1; font-weight: 700; letter-spacing: -.02em; margin: 8px 0 !important; overflow-wrap: anywhere; }
.card3d .back .big.dj { color: var(--primary); }
.card3d .big.long { font-size: 28px; line-height: 1.15; }
.card3d .tap { font-size: 14px; opacity: .75; margin-top: 18px !important; }
.card3d .new { font-size: 12.5px; font-weight: 600; background: var(--tea); color: #2B1700; padding: 3px 10px; border-radius: 99px; }
.card3d .back .ph { font-size: 16px; }
.card3d .back .ar { font-size: 20px; }
.card3d .back .note { font-size: 14px; color: var(--mut); max-width: 32ch; }
.card3d .back .snd-btns { justify-content: center; margin-top: 8px; }
@media (max-height: 700px) {   /* petits iPhone : la carte rétrécit, le texte aussi */
  .card3d .face { padding: 14px 16px; gap: 4px; }
  .card3d .big { font-size: 32px; }
  .card3d .big.long { font-size: 24px; }
  .card3d .back .note { font-size: 13.5px; }
}
.grades { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 14px; transition: opacity .2s; }
.grades.off { opacity: .35; pointer-events: none; }
.grades .g-ask { grid-column: 1 / -1; margin: 0; text-align: center; font-weight: 600; font-size: 16px; }
.grades button { border: 0; min-height: 66px; border-radius: 18px; font-weight: 600; font-size: 16px; display: grid; place-content: center; gap: 2px; }
.grades small { font-weight: 400; font-size: 13px; opacity: .85; white-space: nowrap; }
.g-again { background: var(--bad-soft); color: var(--bad); }
.g-hard { background: var(--tea-soft); color: var(--on-tea-soft); }
.g-good { background: var(--primary); color: var(--on-primary); }
.rv-done { text-align: center; padding: 4px 10px 8px; display: grid; justify-items: center; gap: 10px; }
.rv-done > .btn.wide + * { margin-top: 2px; }
.rv-done .report { margin: 4px 0 0; }
.rv-write[hidden] { display: none; }
.rv-done h2 { margin: 6px 0 0; }
.rv-done p { margin: 0; color: var(--mut); }
.added { margin: 0 0 14px; padding: 12px 14px; border-radius: 14px; background: var(--ok-soft); font-size: 15px; }
details.more { margin-top: 36px; font-size: 14px; color: var(--mut); }
details.more summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; }
details.more button { min-height: 44px; padding: 0 14px; border-radius: 12px; border: 0; box-shadow: inset 0 0 0 2px var(--line); background: var(--surface); margin: 4px 6px 4px 0; }

/* ---------- Connexion ---------- */
.auth { max-width: 420px; margin: 0 auto; padding-top: calc(24px + env(safe-area-inset-top)); }
.auth-art { display: grid; place-items: center; margin: 4px 0 8px; }
.auth h1 { text-align: center; font-size: 32px; margin: 4px 0 6px; }
.auth .lede { text-align: center; }
.tabs { display: flex; gap: 6px; margin: 20px 0 4px; padding: 4px; border-radius: 16px; background: var(--chip); }
.tabs button { flex: 1; min-height: 44px; border: 0; border-radius: 12px; background: transparent; font-weight: 600; font-size: 15px; color: var(--mut); }
.tabs button[aria-selected=true] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.field { display: grid; gap: 6px; margin: 14px 0; font-size: 15px; font-weight: 500; }
.field input { font: inherit; font-size: 17px; min-height: 52px; padding: 12px 14px; border-radius: 14px; border: 2px solid var(--line); background: var(--surface); color: var(--ink); width: 100%; }
.field input:focus { border-color: var(--primary); outline: none; }
.msg { font-size: 15px; margin: 10px 0; min-height: 1px; }
.msg.ok { color: var(--ok); } .msg.ko { color: var(--bad); }
.linklike { background: none; border: 0; padding: 8px 0; color: var(--primary); text-decoration: underline; font-weight: 500; font-size: 15px; }

/* ---------- Réglages ---------- */
.settings h1 { font-size: 34px; margin-top: 10px; }
.settings h2.group { font-family: var(--display); font-size: 21px; margin: 30px 2px 10px; }
.settings .panel { background: var(--surface); border-radius: var(--r); overflow: hidden; box-shadow: var(--shadow); }
.settings .item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; min-height: 56px; font-size: 16px; }
.settings .item + .item { border-top: 1px solid var(--line); }
.settings .item .v { color: var(--mut); text-align: right; }
.settings .item input[type=time] { font: inherit; font-size: 17px; padding: 6px 10px; border-radius: 10px; border: 2px solid var(--line); background: var(--surface-2); color: var(--ink); }
.settings .note { margin: 8px 4px 0; font-size: 13.5px; line-height: 1.45; }
.settings .actions { display: flex; flex-wrap: wrap; gap: 10px; padding: 14px 16px; border-top: 1px solid var(--line); }
.settings .actions button { min-height: 46px; padding: 0 16px; border-radius: 14px; border: 0; font-weight: 600; background: var(--chip); }
.settings .actions button.primary { background: var(--primary); color: var(--on-primary); }
.settings .danger { width: 100%; color: var(--bad) !important; background: transparent !important; box-shadow: inset 0 0 0 2px var(--line); }
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); text-align: center; }
.stat-grid div { padding: 16px 6px; }
.stat-grid div + div { border-left: 1px solid var(--line); }
.stat-grid b { display: block; font-family: var(--display); font-size: 28px; color: var(--ink); }
.stat-grid b small { font-size: 15px; color: var(--mut); }
.stat-grid span { font-size: 13px; color: var(--mut); }
.toggle { position: relative; width: 51px; height: 31px; flex: none; }
.toggle input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 1; }
.toggle span { position: absolute; inset: 0; border-radius: 99px; background: var(--line); transition: background .15s; }
.toggle span::after { content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .15s; }
.toggle input:checked + span { background: var(--primary); }
.toggle input:checked + span::after { transform: translateX(20px); }
.toggle input:focus-visible + span { outline: 3px solid var(--tea); outline-offset: 2px; }

/* ---------- Références (programme, lexique, prononciation) ---------- */
.ref h1 { font-size: 34px; }
.routine { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 16px 0; }
.routine div { background: var(--surface); border-radius: 16px; padding: 14px; box-shadow: var(--shadow); }
.routine b { display: block; font-family: var(--display); font-size: 26px; color: var(--primary); }
.routine span { font-size: 13px; color: var(--mut); }
.routine p { margin: 6px 0 0; font-size: 14.5px; }
@media (max-width: 480px) { .routine { grid-template-columns: 1fr; } }
.week { background: var(--surface); border-radius: var(--r); padding: 14px 16px; margin: 12px 0; box-shadow: var(--shadow); }
.week.now { box-shadow: inset 0 0 0 2.5px var(--tea), var(--shadow); }
.week h3 { margin: 0; font-size: 18px; }
.week h3 small { font-family: var(--body); font-weight: 400; font-size: 13px; color: var(--mut); margin-left: 6px; letter-spacing: 0; }
.week ol { margin: 8px 0 0; padding-left: 20px; }
.week li { margin: 3px 0; }
table.days, table.vocab { width: 100%; border-collapse: collapse; background: var(--surface); border-radius: var(--r); overflow: hidden; box-shadow: var(--shadow); }
table.days td, table.vocab td, table.vocab th { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: top; text-align: left; }
table.days tr:last-child td, table.vocab tr:last-child td { border-bottom: 0; }
table.days td:first-child { font-weight: 600; width: 110px; }
table.vocab th { font-size: 13px; font-weight: 600; color: var(--mut); }
table.pron td:first-child { font-family: var(--display); font-weight: 700; color: var(--tea-deep); font-size: 1.4em; width: 60px; text-align: center; }
table.pron td.ar { font-size: 1.4em; width: 56px; text-align: center; }

.src { font-size: 12.5px; color: var(--mut); margin-top: 8px; }

/* ---------- Mouvement réduit, impression ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
@media print {
  .appbar, button, .snd-btns, .quiz, .finish-card, .lnav { display: none !important; }
  body { background: #fff; color: #000; }
  .word, .q, .box { box-shadow: none; border: 1px solid #ccc; }
}

/* encadrés des pages de référence */
.box .label { display: block; font-family: var(--display); font-weight: 700; font-size: 17px; margin-bottom: 4px; color: var(--ink); }
.box.tip { background: var(--surface); }
.box.tip > p:first-child { margin-top: 0; }
.box.tip > p:last-child { margin-bottom: 0; }
.box.tip + .fwords { margin-top: 12px; }   /* encadré d'explication puis liste de mots (Dire l'heure, Compter) : un petit espace */
.box.mission { background: var(--tea-soft); color: var(--on-tea-soft); box-shadow: none; }
.box.mission .label { color: inherit; }
.play-demo { display: inline-block; min-width: 26px; padding: 0 7px; border-radius: 99px; background: var(--primary); color: var(--on-primary); font-weight: 600; font-size: 12px; text-align: center; }

/* menu : pas d'anneau à l'ouverture ; anneau intérieur pour la navigation au clavier */

/* liens des réglages */
.settings a.item.link { color: var(--ink); text-decoration: none; }
.settings a.item.link .k { display: grid; gap: 2px; }
.settings a.item.link small { font-size: 13.5px; color: var(--mut); }
.settings a.item.link .v { font-size: 22px; }

/* sources (réglages), repliées par défaut */
.settings .item.stack { display: block; font-size: 14.5px; color: var(--mut); }
.settings .item.stack p { margin: 0 0 8px; }
.settings .item.stack p:last-child { margin: 0; }
.settings details.src-lesson { display: block; padding: 0; }
.settings details.src-lesson summary { list-style: none; cursor: pointer; min-height: 52px; display: flex; align-items: center; justify-content: space-between; padding: 0 16px; font-size: 15.5px; }
.settings details.src-lesson summary::-webkit-details-marker { display: none; }
.settings details.src-lesson summary::after { content: "›"; color: var(--mut); font-size: 22px; transition: transform .2s; }
.settings details.src-lesson[open] summary::after { transform: rotate(90deg); }
.settings details.src-lesson ol { margin: 0; padding: 0 16px 14px 34px; font-size: 13.5px; color: var(--mut); line-height: 1.5; }
.settings details.src-lesson li + li { margin-top: 6px; }

/* accueil : afficher plus, accès rapides */

.quick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.quick-tile { display: grid; gap: 2px; align-content: start; min-height: 112px; padding: 16px; border-radius: var(--r); background: var(--surface); box-shadow: var(--shadow); color: var(--ink); text-decoration: none; }
.quick-tile svg { width: 28px; height: 28px; color: var(--primary); margin-bottom: 8px; }
.quick-tile b { font-family: var(--display); font-size: 18px; font-weight: 700; }
.quick-tile small { font-size: 13.5px; color: var(--mut); }

/* « À retenir » : les points de grammaire, mis en avant */
.tips { margin: 22px 0 6px; padding: 16px; border-radius: var(--r); background: var(--ok-soft); }
.tips-h { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; font-family: var(--display); font-weight: 700; font-size: 19px; color: var(--primary); }
.tips .tip { margin: 10px 0 0; background: var(--surface); box-shadow: var(--shadow); border-radius: 16px; padding: 14px 16px; font-size: 16px; line-height: 1.55; }
.tips .tip:first-of-type { margin-top: 0; }
.tips .tip h3 { font-family: var(--display); font-size: 17px; font-weight: 700; margin: 0 0 4px; color: var(--ink); }
.tips .tip .dj { font-size: 1.05em; }

/* note du quiz */
.score-badge { display: flex; align-items: center; justify-content: center; gap: 12px; margin: 2px auto 4px; padding: 10px 18px; border-radius: 99px; width: fit-content; }
.score-badge .emo { font-size: 34px; line-height: 1; }
.score-badge b { display: block; font-family: var(--display); font-size: 26px; line-height: 1; }
.score-badge small { display: block; font-size: 13.5px; margin-top: 2px; }
.score-badge > span:last-child { text-align: left; }
.s-green { background: #DDF0E7; color: #0B5C49; }
.s-yellow { background: #FFF2BF; color: #5C4600; }
.s-orange { background: #FFE0C2; color: #7A3900; }
.s-red { background: #FBE3E1; color: #9A1F18; }
@media (prefers-color-scheme: dark) {
  .s-green { background: #173B30; color: #7FD9B8; }
  .s-yellow { background: #3A3210; color: #F5D76E; }
  .s-orange { background: #3E2510; color: #F7B37A; }
  .s-red { background: #3B1A18; color: #F2A39C; }
}

/* ---------- Fiches vocabulaire ---------- */
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.fsearch { position: relative; display: block; margin: 18px 0 6px; }
.fsearch > svg { position: absolute; left: 14px; top: 50%; width: 20px; height: 20px; transform: translateY(-50%); color: var(--mut); pointer-events: none; }
.fsearch input { width: 100%; min-height: 50px; padding: 0 52px 0 44px; border: 0; border-radius: var(--r-btn); background: var(--surface); color: var(--ink); font: inherit; font-size: 16px; box-shadow: inset 0 0 0 2px var(--line); -webkit-appearance: none; appearance: none; }
.fsearch input::placeholder { color: var(--mut); }
.fsearch input:focus-visible { outline: none; box-shadow: inset 0 0 0 2px var(--primary); }
.fcount { color: var(--mut); font-size: 14.5px; margin: 14px 0 10px; }
.sheets { list-style: none; margin: 0; padding: 0; border-radius: var(--r); overflow: hidden; background: var(--surface); box-shadow: var(--shadow); }
.sheets li + li { border-top: 1px solid var(--line); }
.srow { display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 10px 14px 10px 18px; color: var(--ink); text-decoration: none; }
.stx { display: grid; gap: 1px; flex: 1; min-width: 0; }
.stx b { font-weight: 600; font-size: 16.5px; }
.stx small { font-size: 13.5px; color: var(--mut); display: flex; align-items: center; flex-wrap: wrap; gap: 4px 10px; }
.stx .in { display: inline-flex; align-items: center; gap: 3px; color: var(--primary); font-weight: 600; }
.stx .in svg { width: 15px; height: 15px; }
.srow .chev { width: 20px; height: 20px; flex: none; color: var(--mut); }
.fiche .l-theme { margin-bottom: 4px; }
.fiche-actions { display: grid; gap: 10px; margin: 18px 0 14px; }
.fiche-actions .btn.on { background: var(--ok-soft); color: var(--primary); opacity: 1; }
.fiche-actions .btn svg { margin-right: 6px; }
.fiche-hint { margin: 8px 2px 0; font-size: 14px; color: var(--mut); }
.fsub { font-size: 19px; margin: 26px 0 10px; }
.fwords { display: grid; border-radius: var(--r); overflow: hidden; background: var(--surface); box-shadow: var(--shadow); }
.fw { display: flex; align-items: flex-start; gap: 12px; padding: 13px 16px; scroll-margin-top: 90px; }
.fw + .fw { border-top: 1px solid var(--line); }
.fw p { margin: 0; }
.fw-tx { flex: 1; min-width: 0; }
.fw-fr { font-size: 14.5px; color: var(--mut); }
.fw-dj { font-family: var(--display); font-size: 21px; font-weight: 700; line-height: 1.2; color: var(--primary); overflow-wrap: anywhere; margin: 1px 0 2px !important; }
.fw-ph { font-size: 15px; }
.fw-note { font-size: 13.5px; color: var(--mut); margin-top: 6px !important; }
.fw-from { display: inline-block; margin-top: 6px; font-size: 13.5px; color: var(--primary); }
.fw-side { flex: none; display: grid; justify-items: end; gap: 8px; max-width: 46%; }
.fw-ar { font-size: 17px; line-height: 1.5; color: var(--mut); text-align: right; font-family: 'Readex Pro', sans-serif; }
.fw .snd-btns button { min-height: 40px; padding: 0 12px; }
.fw.flash { animation: fwflash 1.6s ease-out; }
@keyframes fwflash { 0%, 40% { background: var(--tea-soft); } 100% { background: transparent; } }
.hide-dj .fw:not(.peek) .fw-dj, .hide-dj .fw:not(.peek) .fw-ph, .hide-dj .fw:not(.peek) .fw-ar, .hide-dj .fw:not(.peek) .fw-note { visibility: hidden; }
.hide-dj .fw:not(.peek) .snd-btns { visibility: hidden; }
.hide-dj .fw { cursor: pointer; }

.lesson-fiche { display: flex; align-items: center; gap: 14px; margin: 16px 0 0; padding: 14px 16px; border-radius: var(--r); background: var(--surface); box-shadow: var(--shadow); color: var(--ink); text-decoration: none; }
.lesson-fiche svg.bk { width: 28px; height: 28px; flex: none; color: var(--primary); }
.lesson-fiche span { flex: 1; display: grid; gap: 1px; }
.lesson-fiche b { font-weight: 600; }
.lesson-fiche small { font-size: 13.5px; color: var(--mut); }
.lesson-fiche .chev { width: 20px; height: 20px; flex: none; color: var(--mut); }
.quick-tile.wide { grid-column: 1 / -1; min-height: 0; }
.track.many { gap: 2px; }
.track.many .tk { height: 8px; min-width: 0; }

/* ---------- Traduire ---------- */
.traduire .tool { margin-top: 28px; }
.tool-row { display: grid; gap: 8px; margin: 0 0 10px; }
.tool-row.two { grid-template-columns: 1fr 1fr; }
.sel select { width: 100%; min-height: 48px; padding: 0 36px 0 14px; border: 0; border-radius: var(--r-btn); background: var(--surface); color: var(--ink); font: inherit; font-size: 16px; box-shadow: inset 0 0 0 2px var(--line); -webkit-appearance: none; appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--mut) 50%), linear-gradient(135deg, var(--mut) 50%, transparent 50%); background-position: calc(100% - 20px) 21px, calc(100% - 15px) 21px; background-size: 5px 5px; background-repeat: no-repeat; }
.sel select:focus-visible { outline: none; box-shadow: inset 0 0 0 2px var(--primary); }
.seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 4px; margin: 0 0 12px; border-radius: var(--r-btn); background: var(--chip); }
.seg button { min-height: 40px; border: 0; border-radius: 12px; background: transparent; color: var(--mut); font: inherit; font-size: 15px; font-weight: 600; }
.seg button[aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.src-chip { display: inline-block; margin-top: 6px; padding: 2px 10px; border: 0; border-radius: 99px; background: var(--chip); color: var(--mut); font: inherit; font-size: 12.5px; text-decoration: none; }
a.src-chip, button.src-chip { color: var(--primary); }
.addbtn { width: 40px; height: 40px; display: grid; place-items: center; border: 0; border-radius: 50%; background: var(--chip); color: var(--primary); }
.addbtn svg { width: 20px; height: 20px; }
.addbtn.on { background: var(--primary); color: var(--on-primary); }
.fw-side .addbtn { justify-self: center; }

/* ---------- Exercices (écoute, quiz des fiches) ---------- */
.field-l { display: block; font-size: 14px; color: var(--mut); margin: 0 0 6px 2px; }
#exo, #quiz { margin-top: 18px; scroll-margin-top: 80px; }
.exo { display: grid; gap: 4px; }
.exo-top { display: grid; gap: 6px; margin-bottom: 8px; }
.exo-top .n { font-size: 13px; color: var(--mut); }
.exo .prompt { margin: 4px 0 8px; }
.exo-play { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 64px; width: 100%; margin: 0 0 12px; border: 0; border-radius: var(--r-btn); background: var(--primary); color: var(--on-primary); font: inherit; font-size: 18px; font-weight: 600; }
.exo-play svg { width: 28px; height: 28px; }
.exo-dj { font-family: var(--display); font-size: 30px; font-weight: 700; color: var(--primary); margin: 0 0 2px; line-height: 1.15; overflow-wrap: anywhere; }
.exo-ar { font-size: 20px; color: var(--mut); margin: 0 0 12px; }
.exo-fr { font-size: 22px; font-weight: 600; margin: 0 0 12px; }
.exo .opts button[lang="ary"] { font-family: var(--display); font-weight: 700; color: var(--primary); }
.exo-ans b { font-family: var(--display); }
.exo-ans [lang="ar"] { color: var(--mut); }
.exo-next { display: grid; gap: 8px; margin-top: 12px; }
.exo-next:empty { display: none; }
.exo-next .btn svg, .exo-hear svg { width: 20px; height: 20px; margin-right: 6px; }
.exo-end { text-align: center; }
.exo-end p { margin: 6px 0; }
.exo-missed { text-align: left; margin: 14px 0 6px; padding-top: 12px; border-top: 1px solid var(--line); }
.exo-missed p { margin: 4px 0; }
.exo-missed .btn { margin-top: 10px; }

/* ---------- Conversations ---------- */
.seg.two { grid-template-columns: 1fr 1fr; }
.seg button[aria-checked="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.convo .sheets { margin-top: 18px; }
.chat { display: grid; gap: 10px; margin: 18px 0 14px; }
.bub { max-width: 88%; padding: 12px 14px; border-radius: 18px; background: var(--surface); box-shadow: var(--shadow); }
.bub.npc { border-top-left-radius: 6px; }
.bub.me { justify-self: end; border-top-right-radius: 6px; background: var(--me-bg); color: var(--me-ink); }
.bub .who { font-size: 12.5px; color: var(--mut); margin-bottom: 2px; }
.bub.me .who, .bub.me .b-fr { color: inherit; opacity: .85; }
.bub p { margin: 0; }
.b-dj { display: block; font-family: var(--display); font-size: 20px; font-weight: 700; line-height: 1.25; color: var(--primary); overflow-wrap: anywhere; }
.bub.me .b-dj { color: inherit; }
.b-ph { display: block; font-size: 14.5px; margin-top: 2px; }
.b-fr { font-size: 14.5px; color: var(--mut); margin-top: 6px !important; }
.b-row { display: flex; align-items: center; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.b-tr { min-height: 40px; padding: 0 14px; border: 0; border-radius: 99px; background: var(--chip); color: var(--ink); font: inherit; font-size: 14px; font-weight: 600; }
.ch-list { display: grid; gap: 8px; }
.ch { display: grid; gap: 2px; text-align: left; min-height: 56px; padding: 10px 14px; border-radius: 16px; border: 2px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; }
.ch .b-dj { font-size: 18px; }
.ch.wrong { border-color: var(--bad); background: var(--bad-soft); opacity: .8; }
#choices .fb { margin: 10px 2px; font-size: 15px; }
#choices .fb.ok { color: var(--ok); }
#choices .fb.ko { color: var(--bad); }
#choices .fb.meh { color: var(--tea-deep); }
#choices .btn { margin-top: 4px; }
.exo .opts button:disabled, .ch:disabled { opacity: 1; cursor: default; }
.exo .opts button:disabled:not(.right):not(.wrong) { color: var(--mut); }

/* Situations */
.situ-total { display: grid; gap: 6px; margin: 4px 0 6px; font-size: 14.5px; color: var(--mut); }
.situ-total .meter { height: 6px; border-radius: 99px; background: var(--line); overflow: hidden; }
.situ-total .meter i { display: block; height: 100%; background: var(--tea); border-radius: 99px; transform-origin: left; }

.situ .srow .stx small { display: block; }

.situ .seg { grid-template-columns: repeat(3, 1fr); }
.situ .seg button { font-size: 14px; padding: 0 6px; line-height: 1.2; }
.situ-chat .bub { transition: box-shadow .2s, transform .2s; }
.situ-chat .bub.speaking { box-shadow: 0 0 0 3px var(--tea), var(--shadow); }
.b-ar { font-family: 'Readex Pro', sans-serif; font-size: 16px; line-height: 1.5; color: var(--mut); text-align: right; margin-top: 4px !important; }
.bub.me .b-ar, .bub.me .b-ph { color: inherit; opacity: .85; }
.bub.me .snd-btns button { background: rgba(255,255,255,.16); color: inherit; }
.hidden-line { background: var(--surface) !important; color: var(--ink) !important; border: 2px dashed var(--tea); box-shadow: none; }
.hidden-line .who { color: var(--mut) !important; opacity: 1 !important; }
.reveal { display: block; width: 100%; min-height: 48px; margin-top: 4px; padding: 8px 12px; border: 0; border-radius: 12px; background: var(--chip); color: var(--ink); font: inherit; font-size: 15px; font-weight: 600; text-align: left; }
.b-hint { margin-top: 8px !important; font-size: 14.5px; color: var(--mut); }
.situ .fwords { border-radius: var(--r); background: var(--surface); box-shadow: var(--shadow); overflow: hidden; }
.situ .fiche-actions { display: grid; gap: 8px; }
/* Proverbes */
.pv { padding: 18px 18px 16px; margin: 0 0 12px; border-radius: var(--r); background: var(--surface); box-shadow: var(--shadow); }
.pv p { margin: 0; }
.pv-day { margin-top: 18px; border: 2px solid var(--tea); }
.pv-day .l-theme { margin-bottom: 6px; }
.pv-dj { font-family: var(--display); font-size: 22px; font-weight: 700; line-height: 1.25; color: var(--primary); overflow-wrap: anywhere; }
.pv-day .pv-dj { font-size: 26px; }
.pv-ph { font-size: 15px; margin-top: 3px !important; }
.pv-ar { font-family: 'Readex Pro', sans-serif; font-size: 18px; line-height: 1.6; color: var(--mut); text-align: right; margin-top: 4px !important; }
.pv-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 10px 0 12px; flex-wrap: wrap; }
.pv-add { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 14px; border: 0; border-radius: 99px; background: var(--chip); color: var(--primary); font: inherit; font-size: 14px; font-weight: 600; }
.pv-add svg { width: 18px; height: 18px; }
.pv-add.on { background: var(--ok-soft); opacity: 1; }
.pv-lit, .pv-quand { font-size: 14.5px; color: var(--mut); }
.pv-lit span, .pv-quand span { display: block; font-size: 12.5px; font-weight: 600; color: var(--ink); opacity: .7; }
.pv-sens { font-size: 17px; font-weight: 600; margin: 10px 0 !important; }
.prov .fsearch { margin-top: 26px; }
.seg.four { grid-template-columns: repeat(4, 1fr); }
.seg.four button { font-size: 14px; padding: 0 4px; }
/* Conjugaison */
.conj .conj-h { margin-top: 22px; font-size: 18px; }
.vchips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.vchip { min-height: 40px; padding: 0 14px; border: 2px solid var(--line); border-radius: 99px; background: var(--surface); color: var(--ink); font: inherit; font-size: 15px; font-weight: 600; }
.vchip[aria-pressed="true"] { border-color: var(--primary); background: var(--primary); color: var(--surface); }
.conj-sel { display: grid; gap: 4px; margin: 0 0 16px; }
.conj-rule { margin: 4px 2px 12px; font-size: 14.5px; line-height: 1.5; color: var(--ink); }
.conj .fwords { border-radius: var(--r); background: var(--surface); box-shadow: var(--shadow); overflow: hidden; }
.fw-dj .pron { font-family: inherit; font-size: 15px; font-weight: 500; color: var(--mut); }
.conj .hide-toggle { margin-top: 0; }
/* Écoute mains libres */
.ml .seg { margin-bottom: 14px; }
.ml-opt { display: flex; align-items: center; gap: 10px; min-height: 44px; font-size: 15px; }
.ml-opt input { width: 20px; height: 20px; accent-color: var(--primary); }
.ml-player { margin: 18px 0 8px; padding: 22px 18px 18px; border-radius: var(--r); background: var(--surface); box-shadow: var(--shadow); text-align: center; }
.ml-player p { margin: 0; }
.ml-pos { font-size: 13.5px; color: var(--mut); }
.ml-fr { font-size: 19px; font-weight: 600; line-height: 1.35; margin: 12px 0 6px !important; min-height: 2.7em; display: grid; place-items: center; }
.ml-dj { font-family: var(--display); font-size: 26px; font-weight: 700; line-height: 1.2; color: var(--primary); min-height: 1.3em; overflow-wrap: anywhere; }
.ml-ph { font-size: 15px; min-height: 1.4em; margin-top: 4px !important; }
.ml-ctrl { display: flex; justify-content: center; align-items: center; gap: 22px; margin: 18px 0 12px; }
.ml-btn { width: 56px; height: 56px; display: grid; place-items: center; border: 0; border-radius: 50%; background: var(--chip); color: var(--ink); }
.ml-btn svg { width: 24px; height: 24px; }
.ml-main { width: 76px; height: 76px; background: var(--primary); color: var(--surface); }
.ml-main svg { width: 32px; height: 32px; }
/* Fêtes */
.fete { margin: 0 0 10px; border-radius: var(--r); background: var(--surface); box-shadow: var(--shadow); overflow: hidden; }
.fete summary { display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 10px 16px 10px 18px; cursor: pointer; list-style: none; }
.fete summary::-webkit-details-marker { display: none; }
.fete .ft-tx { flex: 1; display: grid; gap: 2px; }
.fete .ft-tx small { color: var(--mut); font-size: 14px; }
.fete.hot { border: 2px solid var(--tea); }
.fete .chev { width: 20px; height: 20px; color: var(--mut); transition: transform .2s; flex: none; }
.fete[open] .chev { transform: rotate(90deg); }
.ft-intro { margin: 0 18px 10px; font-size: 15px; line-height: 1.5; }
.fete .fwords { border-top: 1px solid var(--line); }
.fete .ft-add { margin: 12px 16px 16px; width: calc(100% - 32px); }
.fete-banner { display: flex; align-items: center; gap: 12px; margin: 22px 0 0; padding: 14px 16px; border-radius: var(--r); background: var(--surface); box-shadow: var(--shadow); border: 2px solid var(--tea); color: var(--ink); text-decoration: none; }
.fete-banner svg { width: 26px; height: 26px; flex: none; color: var(--tea-deep); }
.fete-banner b { display: block; }
.fete-banner small { color: var(--mut); font-size: 14px; }
.fete-banner .chev { width: 20px; height: 20px; margin-left: auto; color: var(--mut); }
@media (prefers-reduced-motion: reduce) { .fete .chev { transition: none; } }
.fete .fwords { box-shadow: none; border-radius: 0; background: transparent; }
.fs-clear { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; display: grid; place-items: center; border: 0; border-radius: 50%; background: transparent; color: var(--mut); }
.fs-clear svg { width: 20px; height: 20px; }
.fs-clear[hidden] { display: none; }
.fsearch input::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; display: none; }
/* Progression */
.pstats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 16px 0 6px; }
.ps { padding: 14px 14px 12px; border-radius: var(--r); background: var(--surface); box-shadow: var(--shadow); }
.ps b { display: block; font-family: var(--display); font-size: 28px; line-height: 1.1; color: var(--primary); }
.ps span { font-size: 14px; color: var(--mut); }
.ps.big { grid-column: 1 / -1; }
.ps.big b { font-size: 44px; }
.cal { display: grid; grid-template-rows: repeat(7, 1fr); grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; padding: 14px; border-radius: var(--r); background: var(--surface); box-shadow: var(--shadow); }
.cal-d { display: inline-block; aspect-ratio: 1; min-width: 12px; border-radius: 3px; background: var(--line); }
.cal-d.l1 { background: color-mix(in srgb, var(--primary) 35%, var(--line)); }
.cal-d.l2 { background: color-mix(in srgb, var(--primary) 65%, var(--line)); }
.cal-d.l3 { background: var(--primary); }
.cal-d.today { outline: 2px solid var(--tea); outline-offset: 1px; }
.cal-key { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 13.5px; color: var(--mut); margin: 8px 2px 0; }
.cal-key .cal-d { width: 12px; }
.punits { display: grid; gap: 10px; }
.pu { padding: 12px 14px; border-radius: var(--r); background: var(--surface); box-shadow: var(--shadow); }
.pu-h { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 8px; font-size: 15px; }
.pu-h span { color: var(--mut); }
.pu .meter { height: 8px; border-radius: 99px; background: var(--line); overflow: hidden; }
.pu .meter i { display: block; height: 100%; background: var(--tea); border-radius: 99px; transform-origin: left; }
/* Mémo de grammaire */
.gram-toc { margin-top: 16px; }
.gram-toc .vchip { display: inline-flex; align-items: center; text-decoration: none; }
.gsec { scroll-margin-top: 80px; }
.g-rule { font-size: 16px; line-height: 1.6; margin: 0 0 12px; }
.gram .fwords { border-radius: var(--r); background: var(--surface); box-shadow: var(--shadow); overflow: hidden; }
.g-see { margin: 10px 2px 0; font-size: 14px; color: var(--mut); line-height: 1.5; }
.g-see a { color: var(--primary); }
/* M'enregistrer et comparer */
.snd-btns button.me-rec, .snd-btns button.me-play { border-radius: 99px; background: transparent; color: var(--primary); box-shadow: inset 0 0 0 2px var(--line); padding: 0 12px; }
.snd-btns button.me-rec { min-width: 44px; padding: 0; }
.snd-btns button.me-rec.recording { box-shadow: inset 0 0 0 2px var(--bad); color: var(--bad); animation: recpulse 1s ease-in-out infinite; }
.snd-btns button.me-play.playing { background: var(--tea); color: #2B1700; box-shadow: none; }
.snd-btns button.me-play[hidden] { display: none; }
@keyframes recpulse { 50% { box-shadow: inset 0 0 0 2px var(--bad), 0 0 0 4px color-mix(in srgb, var(--bad) 25%, transparent); } }
@media (prefers-reduced-motion: reduce) { .snd-btns button.me-rec.recording { animation: none; } }
.dialogue .me .snd-btns button.me-rec, .dialogue .me .snd-btns button.me-play, .bub.me .snd-btns button.me-rec, .bub.me .snd-btns button.me-play { background: transparent; color: inherit; box-shadow: inset 0 0 0 2px rgba(255,255,255,.35); }
/* Histoires */
.hlines { display: grid; gap: 10px; margin: 8px 0 6px; }
.hl { padding: 14px 16px; border-radius: var(--r); background: var(--surface); box-shadow: var(--shadow); cursor: pointer; transition: box-shadow .2s; }
.hl p { margin: 0; }
.hl.speaking { box-shadow: 0 0 0 3px var(--tea), var(--shadow); }
.hl-dj { font-family: var(--display); font-size: 20px; font-weight: 700; line-height: 1.3; color: var(--primary); overflow-wrap: anywhere; }
.hl-ph { font-size: 14.5px; margin-top: 2px !important; }
.hl-ar { font-family: 'Readex Pro', sans-serif; font-size: 16px; line-height: 1.6; color: var(--mut); text-align: right; margin-top: 4px !important; }
.hl-row { margin-top: 8px; }
.hl-fr { margin-top: 8px !important; padding-top: 8px; border-top: 1px solid var(--line); font-size: 15px; }
.hwords { border-radius: var(--r); background: var(--surface); box-shadow: var(--shadow); overflow: hidden; }
.hist #quiz .q { margin-top: 4px; }
.cal-total { margin: 10px 2px 0; font-size: 15px; }
.glass .gl-sugar rect { fill: #FFFDF6; stroke: rgba(80, 50, 10, .18); stroke-width: 1; }
/* Barre d'onglets en bas */
/* Barre d'onglets plus basse : elle descend dans la zone du bas de l'iPhone, en restant au-dessus du trait d'accueil */
:root { --tab-b: max(4px, calc(env(safe-area-inset-bottom, 0px) - 18px)); }
body.has-tabs { padding-bottom: calc(72px + var(--tab-b)); }
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; display: grid; grid-template-columns: repeat(5, 1fr); padding: 6px 4px var(--tab-b); background: var(--bar-bg); -webkit-backdrop-filter: saturate(1.3) blur(14px); backdrop-filter: saturate(1.3) blur(14px); border-top: 1px solid var(--line); }
.tab { display: grid; justify-items: center; align-content: start; gap: 2px; min-height: 52px; padding-top: 2px; color: var(--mut); text-decoration: none; font-size: 11.5px; font-weight: 500; -webkit-tap-highlight-color: transparent; }
.tab-ic { position: relative; width: 56px; height: 30px; display: grid; place-items: center; border-radius: 99px; transition: background .2s; }
.tab-ic svg { width: 24px; height: 24px; }
.tab.on { color: var(--primary); font-weight: 700; }
.tab.on .tab-ic { background: color-mix(in srgb, var(--primary) 16%, transparent); }
.tab-badge { position: absolute; top: -3px; left: calc(50% + 7px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px; background: var(--tea); color: #2B1700; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; }
.tab-badge[hidden] { display: none; }
@media (min-width: 620px) { .tabbar { left: 50%; right: auto; width: 560px; transform: translateX(-50%); border: 1px solid var(--line); border-bottom: 0; border-radius: 20px 20px 0 0; } }
@media print { .tabbar { display: none !important; } body.has-tabs { padding-bottom: 0; } }
/* Accueil : le proverbe du jour */
.pv-day-card { display: block; margin: 12px 0 0; padding: 14px 16px; border-radius: var(--r); background: var(--surface); box-shadow: var(--shadow); color: var(--ink); text-decoration: none; }
.pv-day-card p { margin: 0; }
.pv-day-card .lbl { font-size: 13.5px; color: var(--mut); }
.pv-day-card .pv-dj { font-family: var(--display); font-size: 21px; font-weight: 700; color: var(--primary); margin: 2px 0 !important; }
.pv-day-card .pv-sens { font-size: 15px; font-weight: 500; }
/* Outils : liste de liens */
.olist { list-style: none; margin: 0 0 14px; padding: 0; border-radius: var(--r); background: var(--surface); box-shadow: var(--shadow); overflow: hidden; }
.olist li + li { border-top: 1px solid var(--line); }
.olist a { display: flex; align-items: center; gap: 14px; min-height: 60px; padding: 10px 16px; color: var(--ink); text-decoration: none; }
.olist svg.oi { width: 24px; height: 24px; flex: none; color: var(--primary); }
.olist .ot { flex: 1; display: grid; gap: 1px; }
.olist .ot small { color: var(--mut); font-size: 13.5px; }
.olist .chev { width: 20px; height: 20px; color: var(--mut); flex: none; }
.ohead { margin: 22px 4px 8px; font-size: 14px; font-weight: 600; color: var(--mut); }
/* Parcours */
.punit { margin: 0 0 10px; border-radius: var(--r); background: var(--surface); box-shadow: var(--shadow); overflow: hidden; }
.punit.now { box-shadow: inset 0 0 0 2px var(--tea), var(--shadow); }
.punit summary { list-style: none; cursor: pointer; padding: 14px 16px; }
.punit summary::-webkit-details-marker { display: none; }
.punit .pu-h { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 16px; margin-bottom: 8px; }
.punit .pu-h span { color: var(--mut); font-size: 14px; }
.punit .meter { height: 7px; border-radius: 99px; background: var(--line); overflow: hidden; }
.punit .meter i { display: block; height: 100%; background: var(--tea); border-radius: 99px; transform-origin: left; }
.punit .lessons { margin: 0; padding: 0 8px 8px; }
/* Test de niveau */
.card-note { padding: 14px 16px; border-radius: var(--r); background: var(--surface); box-shadow: var(--shadow); }
.card-note p { margin: 0; line-height: 1.5; }
.card-note p + p { margin-top: 8px; }
.niv-skip { margin-top: 10px; }
.niv-start { margin: 16px 0 4px; padding: 16px 18px; border-radius: var(--r); background: var(--surface); box-shadow: inset 0 0 0 2px var(--tea), var(--shadow); }
.niv-start p { margin: 0; }
.niv-start .lbl { font-size: 13.5px; color: var(--mut); }
.niv-t { font-family: var(--display); font-size: 22px; font-weight: 700; margin: 2px 0 !important; }
.niv-u { font-size: 14.5px; color: var(--mut); }
.parc-test { display: block; margin: 10px 0 0; text-align: center; font-size: 15px; color: var(--primary); }
/* Lire l'arabe */
.alpha-rules p b { color: var(--primary); }
.alpha-fam { margin: 22px 2px 10px; font-size: 16px; color: var(--mut); font-weight: 600; }
.alpha-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.alet { padding: 12px; border-radius: var(--r); background: var(--surface); box-shadow: var(--shadow); display: grid; gap: 8px; align-content: start; }
.alet p { margin: 0; }
.alet-top { display: flex; align-items: center; gap: 10px; }
.alet-ch { font-family: 'Readex Pro', sans-serif; font-size: 44px; line-height: 1; color: var(--primary); min-width: 44px; text-align: center; }
.alet-name { display: grid; gap: 1px; }
.alet-name b { font-size: 16px; }
.alet-name small { font-size: 12.5px; color: var(--mut); line-height: 1.3; }
.alet-forms { display: flex; justify-content: space-around; font-family: 'Readex Pro', sans-serif; font-size: 24px; padding: 4px 0; border-radius: 10px; background: var(--chip); }
.alet-lat { font-size: 12.5px; color: var(--mut); }
.alet-ex { display: grid; gap: 2px; font-size: 13.5px; }
.alet-ar { font-family: 'Readex Pro', sans-serif; font-size: 20px; text-align: right; }
.alet .snd-btns button { min-height: 36px; }
.alpha-signs { border-radius: var(--r); background: var(--surface); box-shadow: var(--shadow); overflow: hidden; }
.sign-ar { font-family: 'Readex Pro', sans-serif; font-size: 24px; line-height: 1.4; text-align: right; }
.quiz-ar { font-family: 'Readex Pro', sans-serif; font-size: 48px; line-height: 1.3; text-align: center; color: var(--primary); margin: 8px 0 14px !important; }
.alpha .seg { margin-top: 4px; }
/* Accueil : la phrase du jour */
.pd-card { margin: 14px 0 0; padding: 14px 16px; border-radius: var(--r); background: var(--surface); box-shadow: var(--shadow); }
.pd-card p { margin: 0; }
.pd-card .lbl { font-size: 13.5px; color: var(--mut); }
.pd-dj { font-family: var(--display); font-size: 22px; font-weight: 700; line-height: 1.25; color: var(--primary); margin: 2px 0 !important; overflow-wrap: anywhere; }
.pd-ph { font-size: 14.5px; }
.pd-fr { font-size: 15.5px; font-weight: 500; margin-top: 4px !important; }
.pd-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
/* Culture */
.csec { scroll-margin-top: 80px; }
.cpoints { margin: 0 0 12px; padding-left: 20px; display: grid; gap: 8px; line-height: 1.55; }
.culture .fwords { border-radius: var(--r); background: var(--surface); box-shadow: var(--shadow); overflow: hidden; }
.c-add { margin-top: 10px; }
/* Révision : les boutons Non / Presque / Oui toujours visibles, fixés au-dessus de la barre d'onglets */
.grades { position: fixed; z-index: 55; left: 0; right: 0; bottom: calc(59px + var(--tab-b)); margin: 0; padding: 8px 16px 10px; gap: 8px 10px; background: var(--bar-bg); -webkit-backdrop-filter: saturate(1.3) blur(14px); backdrop-filter: saturate(1.3) blur(14px); border-top: 1px solid var(--line); }
.grades button { min-height: 58px; }
.grades .g-ask { font-size: 15px; }
@media (min-width: 620px) { .grades { left: 50%; right: auto; width: 560px; transform: translateX(-50%); } }
body:has(.grades) { padding-bottom: calc(59px + 120px + var(--tab-b)); }
.rv-head h1 { font-size: 26px; margin: 2px 0 2px; }
.rv-stats { margin-bottom: 8px; }
.rv-prog { margin-bottom: 10px; }
.card3d { height: clamp(230px, calc(100svh - 430px - env(safe-area-inset-top) - env(safe-area-inset-bottom)), 400px); }
/* Réglages d'affichage */
.no-ph .w-ph, .no-ph .fw-ph, .no-ph .b-ph, .no-ph .say .ph, .no-ph .card3d .ph, .no-ph .hl-ph, .no-ph .pv-ph, .no-ph .pd-ph, .no-ph .ml-ph { display: none !important; }
.no-ar main:not(.alpha) [lang="ar"], .no-ar main:not(.alpha) .fw-ar, .no-ar main:not(.alpha) .b-ar, .no-ar main:not(.alpha) .hl-ar, .no-ar main:not(.alpha) .pv-ar, .no-ar .card3d .ar { display: none !important; }
.no-ar .wl-ic .wl-ar[lang="ar"] { display: inline !important; }
.txt-l main { zoom: 1.1; }
.txt-xl main { zoom: 1.22; }
.rg-row { padding: 14px 16px; border-radius: var(--r); background: var(--surface); box-shadow: var(--shadow); margin-bottom: 10px; }
.rg-row > p { margin: 0 0 10px; font-weight: 600; }
.rg-row .seg { margin: 0; }
.rg-row small { display: block; margin-top: 8px; color: var(--mut); font-size: 13.5px; }
.rg-sw { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.rg-sw p { margin: 0; font-weight: 600; }
.rg-sw small { font-weight: 400; }
.rg-sw input { width: 52px; height: 30px; accent-color: var(--primary); }
.rg-demo { margin-top: 18px; }
/* Exercices de grammaire */
.exg #modes { margin: 14px 0 12px; }
.exg-rule { display: block; margin-top: 8px; font-size: 14px; color: var(--ink); opacity: .85; }
/* La barre des boutons de révision est opaque : le texte dessous ne transparaît plus */
.grades { background: var(--bg); -webkit-backdrop-filter: none; backdrop-filter: none; box-shadow: 0 -8px 16px -12px rgba(0, 0, 0, .35); }
/* Mots des leçons : une leçon = une ligne qui se déplie */
.lexl { margin: 0 0 8px; border-radius: var(--r); background: var(--surface); box-shadow: var(--shadow); overflow: hidden; }
.lexl summary { display: flex; align-items: center; gap: 12px; min-height: 58px; padding: 10px 16px; cursor: pointer; list-style: none; }
.lexl summary::-webkit-details-marker { display: none; }
.lexl summary span { flex: 1; display: grid; gap: 1px; }
.lexl summary small { color: var(--mut); font-size: 13.5px; }
.lexl .chev { width: 20px; height: 20px; color: var(--mut); transition: transform .2s; flex: none; }
.lexl[open] .chev { transform: rotate(90deg); }
.lexl .lex-words { padding: 0 8px 8px; }
.lex h2 { margin-top: 26px; }
/* Révision active */
.rv-write { display: inline-flex; align-items: center; min-height: 36px; margin: -2px 0 10px; padding: 0 12px; border: 0; border-radius: 99px; background: var(--chip); color: var(--ink); font: inherit; font-size: 14px; font-weight: 600; }
.rv-write[aria-pressed="true"] { background: var(--primary); color: var(--on-primary); }
.rv-type { display: flex; gap: 8px; margin: 10px 0 0; }
.rv-type input { flex: 1; min-width: 0; min-height: 48px; padding: 0 14px; border: 0; border-radius: var(--r-btn); background: var(--surface); color: var(--ink); font: inherit; font-size: 17px; box-shadow: inset 0 0 0 2px var(--line); }
.rv-type input:focus { outline: none; box-shadow: inset 0 0 0 2px var(--primary); }
.rv-type button { min-height: 48px; padding: 0 16px; border-radius: var(--r-btn); }
.with-type .card3d { height: clamp(200px, calc(100svh - 500px - env(safe-area-inset-top) - env(safe-area-inset-bottom)), 360px); }
.rv-verdict { font-weight: 700; font-size: 15px; }
.rv-verdict.ok { color: var(--ok); } .rv-verdict.meh { color: var(--tea-deep); } .rv-verdict.ko { color: var(--bad); }
.grades button.suggest { box-shadow: 0 0 0 3px var(--tea); }
.diff-list { border-radius: var(--r); background: var(--surface); box-shadow: var(--shadow); overflow: hidden; }
/* Le contenu long d'une carte défile dans la carte au lieu de déborder */
.card3d .face { overflow-y: auto; justify-content: safe center; }
/* Accueil : les mots difficiles */
.hard-card { display: flex; align-items: center; gap: 12px; margin: 14px 0 0; padding: 14px 16px; border-radius: var(--r); background: var(--surface); box-shadow: inset 0 0 0 2px var(--primary), var(--shadow); color: var(--ink); text-decoration: none; }
.hard-card .hc-emo { font-size: 26px; flex: none; }
.hard-card b { display: block; }
.hard-card small { color: var(--mut); font-size: 14px; }
.hard-card .chev { width: 20px; height: 20px; margin-left: auto; color: var(--mut); flex: none; }

/* ---------- Icônes des boutons son (à la place des emojis) ---------- */
.snd-btns button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.snd-btns .ic { width: 18px; height: 18px; flex: none; }
.snd-pair button.slow .ic { width: 21px; height: 21px; }
.play-demo { display: inline-flex; align-items: center; justify-content: center; vertical-align: -3px; height: 20px; }
.play-demo .ic { width: 13px; height: 13px; }

/* ---------- Passage d'une page à l'autre : un fondu court (navigateurs récents, iOS 18.2+) ---------- */
/* Transition douce entre les pages, sauf sur iPhone / iPad (-webkit-touch-callout n'existe que là) :
   Safari iOS peut y laisser une couche invisible qui bloque les touchers (champs de saisie inactifs). */
@supports not (-webkit-touch-callout: none) { @view-transition { navigation: auto; } }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .18s; animation-timing-function: ease-out; }
.tabbar { view-transition-name: tabbar; }
@media (prefers-reduced-motion: reduce) { @view-transition { navigation: none; } }
.rg-row > p small { font-weight: 400; }
#off-go { gap: 8px; }

/* Légende de prononciation repliée par défaut */
details.legend:not([open]) { display: block; }
details.legend summary { width: 100%; list-style: none; cursor: pointer; color: var(--ink); font-weight: 600; display: flex; align-items: center; justify-content: space-between; min-height: 28px; }
details.legend summary::-webkit-details-marker { display: none; }
details.legend summary::after { content: "+"; font-size: 18px; font-weight: 500; color: var(--mut); }
details.legend[open] summary::after { content: "–"; }
details.legend strong { font-weight: 500; color: var(--mut); }

/* ---------- Barre d'actions commune (situations, histoires, fiches) ---------- */
.actbar { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 16px 0 6px; }
.actbar .ab { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 66px; padding: 8px 4px; border: 0; border-radius: 16px; background: var(--surface); box-shadow: var(--shadow); color: var(--ink); font: inherit; font-size: 13.5px; font-weight: 600; line-height: 1.2; text-align: center; -webkit-tap-highlight-color: transparent; }
.actbar .ab svg { width: 22px; height: 22px; color: var(--primary); }
.actbar .ab .ab-emo { font-size: 20px; line-height: 22px; }
.actbar .ab.playing { background: var(--tea); color: #2B1700; }
.actbar .ab.playing svg { color: #2B1700; }
.actbar .ab.on { color: var(--primary); opacity: 1; }
.actbar .ab:active { transform: scale(.97); }
/* Interrupteur (Masquer le darija, Afficher le français) */
.sw-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; margin: 4px 0 10px; padding: 0 4px; font-weight: 600; color: var(--ink); cursor: pointer; }
.sw { appearance: none; -webkit-appearance: none; flex: none; width: 48px; height: 30px; margin: 0; border-radius: 99px; background: var(--line); position: relative; cursor: pointer; transition: background .2s; }
.sw::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .2s; }
.sw:checked { background: var(--primary); }
.sw:checked::after { transform: translateX(18px); }
.sw:focus-visible { outline: 3px solid var(--tea); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { .sw, .sw::after { transition: none; } }
.fw.speaking { box-shadow: inset 0 0 0 2px var(--tea); border-radius: 12px; }
/* Bouton « À réviser » des sections (culture, fêtes) */
.c-add, .ft-add { margin-top: 10px; }
.pv-add.on svg { color: var(--primary); }
/* Listes dépliables (mémo de grammaire, culture) */
.acc .acc-body { padding: 0 8px 12px; }
.acc .acc-body > p, .acc .acc-body > ul, .acc .acc-body > .pv-add { margin-left: 8px; margin-right: 8px; }
.acc .acc-body .fwords { margin: 12px -8px 0; border-radius: 0; box-shadow: none; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.acc summary b { font-size: 16.5px; }

/* Écouter, tortue et micro toujours sur une seule ligne dans les listes de mots */
.fw-side { max-width: 62%; }
.fw-side .snd-btns { flex-wrap: nowrap; }
.fw-side .fw-ar { max-width: 100%; }

/* ---------- Quiz : bonne réponse bien visible (vert plein + coche), mauvaise en rouge plein + croix ---------- */
:root { --win: #17803C; --lose: #C62828; }
.q .opts button:disabled { opacity: 1; }
.q .opts button:disabled:not(.right):not(.wrong) { color: var(--mut); }
.q .opts button.right, .q .opts button.wrong { position: relative; padding-right: 50px; color: #fff; font-weight: 700; }
.q .opts button.right { background: var(--win); border-color: var(--win); }
.q .opts button.wrong { background: var(--lose); border-color: var(--lose); }
.q .opts button.right::after, .q .opts button.wrong::after { content: ""; position: absolute; right: 16px; top: 50%; width: 24px; height: 24px; margin-top: -12px; background: #fff;
  -webkit-mask: var(--qic) center / contain no-repeat; mask: var(--qic) center / contain no-repeat; }
.q .opts button.right { --qic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4.5 12.5l5 5L19.5 7' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.q .opts button.wrong { --qic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 6l12 12M18 6L6 18' fill='none' stroke='black' stroke-width='3' stroke-linecap='round'/%3E%3C/svg%3E"); }
.q .opts button.right .ph, .q .opts button.wrong .ph { color: rgba(255, 255, 255, .85); }
.q .fb.ok, .q .fb.ko, #choices .fb.ok, #choices .fb.ko { font-weight: 700; }
.ch.wrong { background: var(--lose); border-color: var(--lose); color: #fff; opacity: 1; }
/* En-tête du quiz : « Question 1/10 » et le bouton Arrêter */
.exo-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 4px; }
.exo-head .n { margin: 0; }
.exo-stop { min-height: 36px; padding: 0 14px; border: 0; border-radius: 99px; background: #FDE3E1; color: #A3241C; font: inherit; font-size: 14px; font-weight: 700; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .exo-stop { background: #4A1D1A; color: #FFB4AB; } }

/* ---------- Verdicts bien visibles partout : encadré vert = juste, rouge = faux, ambre = presque ---------- */
:root { --win-soft: #DDF3E4; --win-ink: #0F5C2B; --lose-soft: #FCE4E2; --lose-ink: #8E1F17; --meh-soft: #FFF0D6; --meh-ink: #6B4100; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --win-soft: #12351F; --win-ink: #9BE3B4; --lose-soft: #3D1614; --lose-ink: #FFB4AB; --meh-soft: #3A2A0E; --meh-ink: #FFD48A; } }
.fb.ok, .fb.ko, .fb.meh, .rv-verdict.ok, .rv-verdict.ko, .rv-verdict.meh { display: block; padding: 10px 14px; border-radius: 12px; border: 2px solid; font-weight: 700; line-height: 1.45; }
.fb.ok, .rv-verdict.ok { background: var(--win-soft); border-color: var(--win); color: var(--win-ink) !important; }
.fb.ko, .rv-verdict.ko { background: var(--lose-soft); border-color: var(--lose); color: var(--lose-ink) !important; }
.fb.meh, .rv-verdict.meh { background: var(--meh-soft); border-color: var(--tea); color: var(--meh-ink) !important; }
.fb.ok .dj, .fb.ko .dj, .fb.meh .dj { color: inherit !important; }

/* ---------- Immersion : épisodes avec sous-titres ---------- */
.im-lines { display: grid; gap: 8px; margin: 8px 0 20px; }
.im-line { display: grid; gap: 3px; width: 100%; text-align: left; padding: 12px 14px; border: 0; border-radius: 16px; background: var(--surface); box-shadow: var(--shadow); color: var(--ink); font: inherit; cursor: pointer; transition: background .2s, transform .2s; scroll-margin: 120px 0 160px; -webkit-tap-highlight-color: transparent; }
.im-line.im-g { background: var(--surface-2); }
.im-who { font-size: 12.5px; font-weight: 700; color: var(--mut); letter-spacing: .01em; }
.im-dj { font-family: var(--display); font-size: 19px; font-weight: 700; line-height: 1.3; color: var(--primary); }
.im-ar { font-family: 'Readex Pro', sans-serif; font-size: 17px; line-height: 1.6; color: var(--mut); text-align: right; }
.im-fr { font-size: 15px; color: var(--mut); }
.im-lines.no-fr .im-fr, .im-lines.no-arab .im-ar, .no-ar .im-ar { display: none; }
.im-line.on { background: var(--tea); outline: 3px solid var(--tea); outline-offset: 0; }
.im-line.on .im-dj, .im-line.on .im-who, .im-line.on .im-fr, .im-line.on .im-ar { color: #2B1700; }
@media (prefers-reduced-motion: reduce) { .im-line { transition: none; } }
.im-bar { position: fixed; z-index: 55; left: 0; right: 0; bottom: calc(59px + var(--tab-b)); display: flex; align-items: center; gap: 12px; padding: 10px 16px; background: var(--bar-bg); -webkit-backdrop-filter: saturate(1.3) blur(14px); backdrop-filter: saturate(1.3) blur(14px); border-top: 1px solid var(--line); }
@media (min-width: 620px) { .im-bar { left: 50%; right: auto; width: 560px; transform: translateX(-50%); } }
.im-play { position: relative; flex: none; width: 52px; height: 52px; padding: 0; border: 0; border-radius: 50%; background: var(--primary); color: var(--on-primary); }
/* l'icône est posée pile au centre du rond (sans dépendre des marges internes que Safari iPhone donne aux boutons) */
.im-play svg { position: absolute; left: 50%; top: 50%; width: 26px; height: 26px; transform: translate(-50%, -50%); }
.im-prog { flex: 1; min-width: 0; display: grid; gap: 6px; font-size: 13.5px; font-weight: 600; color: var(--mut); }
.im-prog .meter { height: 6px; border-radius: 99px; background: var(--line); overflow: hidden; }
.im-prog .meter i { display: block; height: 100%; background: var(--tea); transform-origin: left; transition: transform .3s; }
.im-speed { flex: none; min-height: 40px; padding: 0 14px; border: 0; border-radius: 99px; background: var(--chip); color: var(--ink); font: inherit; font-size: 14px; font-weight: 700; }
.im-speed.on { background: var(--tea); color: #2B1700; }
/* trois vitesses, trois couleurs : normal (vert), rapide (orange), lent (bleu) */
.im-speed.s-n { background: var(--primary); color: var(--on-primary); }
.im-speed.s-r { background: var(--tea); color: #2B1700; }
.im-speed.s-l { background: #2F6FB5; color: #fff; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .im-speed.s-l { background: #7FB2EC; color: #0B1D2E; } }
body.im-playing { padding-bottom: calc(59px + 76px + var(--tab-b)); }
.imm .pv-add#add { margin-top: 10px; }

/* ---------- Pages légales (confidentialité, mentions légales) ---------- */
.legal h2 { margin-top: 26px; }
.legal p, .legal li { line-height: 1.6; }
.legal ul { padding-left: 20px; display: grid; gap: 8px; }
.legal-date { font-size: 14px; color: var(--mut); margin-top: -6px; }
.legal-links { margin-top: 28px; font-weight: 600; }
.auth-legal { margin-top: 12px; font-size: 13.5px; color: var(--mut); text-align: center; }
.danger-zone { margin-top: 10px; }

/* ---------- Récompenses : passeport, paliers, théière de la semaine, bilan ---------- */
.stamp { display: grid; place-content: center; justify-items: center; gap: 1px; aspect-ratio: 1; width: 100%; max-width: 132px; margin: 0 auto; border-radius: 50%; border: 2px dashed var(--line); color: var(--mut); text-align: center; padding: 10px; }
.stamp b { font-family: var(--display); font-size: 15px; line-height: 1.1; }
.stamp small { font-size: 11px; line-height: 1.2; }
.stamp i { font-style: normal; font-size: 10.5px; margin-top: 3px; opacity: .85; }
.stamp.on { border: 3px double var(--primary); color: var(--primary); background: color-mix(in srgb, var(--primary) 9%, var(--surface)); transform: rotate(-7deg); box-shadow: inset 0 0 0 4px color-mix(in srgb, var(--primary) 9%, var(--surface)), inset 0 0 0 5px color-mix(in srgb, var(--primary) 45%, transparent); }
.stamp.on:nth-child(3n+2) { transform: rotate(5deg); }
.stamp.on:nth-child(3n) { transform: rotate(-2deg); }
.stamp.bonus.on { border-color: var(--tea-deep); color: var(--tea-deep); background: color-mix(in srgb, var(--tea) 14%, var(--surface)); box-shadow: inset 0 0 0 4px color-mix(in srgb, var(--tea) 14%, var(--surface)), inset 0 0 0 5px color-mix(in srgb, var(--tea-deep) 45%, transparent); }
.pp-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 14px; margin: 16px 0 8px; }
.pp-cell { display: grid; gap: 6px; text-align: center; }
.pp-cell p { margin: 0; font-size: 13px; color: var(--mut); }
.pp-cell .meter { height: 6px; border-radius: 99px; background: var(--line); overflow: hidden; width: 70%; margin: 0 auto; }
.pp-cell .meter i { display: block; height: 100%; background: var(--tea); transform-origin: left; }
.pp-count { font-weight: 700; color: var(--primary); }
@media (min-width: 520px) { .pp-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
/* Carte de fête */
.rw-overlay { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 20px; background: rgba(5, 20, 15, .55); animation: rwin .25s ease-out; }
.rw-card { width: min(380px, 100%); max-height: calc(100svh - 40px); overflow-y: auto; display: grid; gap: 10px; justify-items: center; text-align: center; padding: 24px 20px 18px; border-radius: 24px; background: var(--surface); box-shadow: 0 20px 50px rgba(0, 0, 0, .3); }
.rw-card h2 { margin: 2px 0 0; font-size: 24px; }
.rw-card p { margin: 0; }
.rw-card .stamp { max-width: 140px; animation: rwstamp .4s cubic-bezier(.22, 1, .36, 1) both; }
.rw-card .btn { margin: 0; }
.rw-k { font-size: 13px; font-weight: 700; color: var(--tea-deep); }
.rw-big { font-family: var(--display); font-size: 64px; font-weight: 800; line-height: 1; color: var(--primary); }
.rw-can-h { color: var(--mut); font-size: 14.5px; }
.rw-can { margin: 0; padding: 0 0 0 18px; text-align: left; display: grid; gap: 4px; font-weight: 600; }
.rw-stamps { display: grid; grid-template-columns: repeat(2, 96px); gap: 10px; }
.rw-stamps .stamp b { font-size: 13px; }
@keyframes rwin { from { opacity: 0; } }
@keyframes rwstamp { from { opacity: 0; transform: scale(1.6) rotate(-20deg); } }
@media (prefers-reduced-motion: reduce) { .rw-overlay, .rw-card .stamp { animation: none; } }
/* Fenêtre « Tu aimes Chwiya Darija ? » (assets/lesson.js › reviewAsk) */
.rv-card { gap: 12px; }
.rv-step { display: none; width: 100%; gap: 12px; justify-items: center; }
.rv-step.on { display: grid; }
.rv-emoji { font-size: 44px; line-height: 1; }
.rv-card textarea, .rv-card input[type=text] { width: 100%; box-sizing: border-box; font: 16px/1.4 var(--body); padding: 12px 14px; border-radius: 14px; border: 2px solid var(--line); background: var(--bg); color: var(--ink); }
.rv-card textarea { min-height: 96px; resize: vertical; }
.rv-card textarea:focus, .rv-card input[type=text]:focus { outline: none; border-color: var(--primary); }
.rv-ok { display: flex; gap: 10px; align-items: flex-start; text-align: start; font-size: 14px; color: var(--mut); min-height: 44px; cursor: pointer; }
.rv-ok input { width: 22px; height: 22px; margin-top: 1px; flex: none; accent-color: var(--primary); }
.rv-small { font-size: 13px; color: var(--mut); }
.rv-later { background: none; border: 0; color: var(--mut); font: 600 15px var(--body); min-height: 44px; padding: 0 12px; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.rv-card .btn.wide { width: 100%; }
/* Théière de la semaine (accueil) */
.wk { display: flex; align-items: flex-end; gap: 6px; margin-top: 10px; }
.wk-d { display: grid; justify-items: center; gap: 3px; font-size: 10.5px; font-weight: 600; color: var(--mut); }
.wk-cup { position: relative; width: 16px; height: 21px; border: 1.6px solid color-mix(in srgb, var(--ink) 35%, transparent); border-radius: 2px 2px 5px 5px; overflow: hidden; }
.wk-cup i { position: absolute; left: 0; right: 0; bottom: 0; background: var(--tea); }
.wk-d.rest .wk-cup { border-style: dashed; }
.wk-d.today { color: var(--primary); }
.wk-txt { font-size: 13px; color: var(--mut); margin: 6px 0 0; }
.wk-txt b { color: var(--ink); }
/* Bilan de la semaine (accueil, dimanche et lundi) */
.recap-card { position: relative; margin: 14px 0 0; padding: 16px; border-radius: var(--r); background: var(--surface); box-shadow: var(--shadow); }
.recap-card h2 { margin: 0 0 10px; font-size: 19px; }
.recap-k { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.recap-k div { display: grid; justify-items: center; padding: 10px 4px; border-radius: 14px; background: var(--surface-2); }
.recap-k b { font-family: var(--display); font-size: 22px; color: var(--primary); }
.recap-k span { font-size: 12px; color: var(--mut); text-align: center; }
.recap-w { margin: 12px 0 0; padding: 10px 12px; background: var(--tea-soft); border-radius: 12px; font-size: 14.5px; }
.recap-x { position: absolute; top: 8px; right: 8px; width: 36px; height: 36px; border: 0; border-radius: 50%; background: transparent; color: var(--mut); font-size: 18px; }
.recap-card .recap-a { display: inline-block; margin-top: 12px; font-weight: 700; }

/* ---------- Vitesse réelle ---------- */
.vit .seg { margin: 6px 0 14px; }
.vit-tips { margin-bottom: 8px; }
.vit-step { display: grid; justify-items: center; gap: 12px; margin: 8px 0 18px; padding: 18px 16px; border-radius: var(--r); background: var(--surface); box-shadow: var(--shadow); text-align: center; }
.vit-step h2 { margin: 0; font-size: 18px; }
.im-play.vit-big { width: 76px; height: 76px; }
.im-play.vit-big svg { width: 34px; height: 34px; }
.vit-who { margin: 0; min-height: 1.5em; color: var(--mut); font-weight: 600; }
.vit-replay { display: flex; gap: 8px; margin: 0 0 12px; }
.vit-replay .btn { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 8px; margin: 0; }
.vit-replay svg { width: 20px; height: 20px; }
#read { display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
#read svg { width: 20px; height: 20px; }
/* Micro : réaction immédiate pendant que l'iPhone ouvre le micro (orange), puis rouge quand ça enregistre */
.snd-btns button.me-rec.arming, .snd-btns button.rec.arming { box-shadow: inset 0 0 0 2px var(--tea); color: var(--tea-deep); animation: micarm .6s ease-in-out infinite alternate; }
@keyframes micarm { to { background: color-mix(in srgb, var(--tea) 22%, transparent); } }
@media (prefers-reduced-motion: reduce) { .snd-btns button.arming { animation: none; } }
/* Conversations : traduction française visible (interrupteur « Afficher le français ») */
.no-fr .b-fr { display: none; }
.ch .ch-fr { font-size: 14px; color: var(--mut); }

/* ---------- Espace minimal autour des boutons (règle générale) ---------- */
* + .btn.wide, * + button.primary.wide, * + .pv-add, * + .lesson-fiche, * + .hard-card { margin-top: 12px; }
.btn.wide + *, button.primary.wide + *, .pv-add + * { margin-top: 12px; }
/* Dans les conteneurs qui gèrent déjà l'espace (grille, rangée), pas de marge en plus */
:is(.fiche-actions, .finish-actions, .actbar, .vit-replay, .exo-next, .ch-list, .opts, .seg, .tabbar, .snd-btns, .typein, .rw-card, .situ-total, .vit-step, .pd-row, .pv-row, .b-row, .hl-row, .rg-row, .im-bar, .actions) > * { margin-top: 0; }
:is(.fiche-actions, .finish-actions, .exo-next) { margin-top: 14px; }

/* Apprendre à lire (reference/lire.html) */
.lire-num { flex: none; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--chip); color: var(--primary); font-weight: 700; font-size: 15px; }
.lire-num svg { width: 18px; height: 18px; }
.lire-lets { font-family: 'Readex Pro', sans-serif; font-size: 17px; color: var(--ink); letter-spacing: 2px; }
.lire-words .fw { align-items: center; }
.lire-ar { flex: none; min-width: 84px; font-family: 'Readex Pro', sans-serif; font-size: 30px; line-height: 1.3; color: var(--primary); text-align: right; }
.lire-words .fw-tx { flex: 1; min-width: 0; }
.lire-words.no-lat .fw-dj, .lire-words.no-lat .fw-fr { visibility: hidden; }
.lire-hear { display: flex; justify-content: center; margin: 6px 0 14px; }
.lire-hear .btn { display: inline-flex; align-items: center; gap: 8px; min-height: 52px; padding: 0 22px; }
.lire-hear svg { width: 22px; height: 22px; color: var(--primary); }
.q .opts.lire-opts-ar button { font-family: 'Readex Pro', sans-serif; font-size: 26px; line-height: 1.4; text-align: center; justify-content: center; }
.lire-ans [lang="ar"] { font-family: 'Readex Pro', sans-serif; font-size: 18px; }

/* Icône Mon compte, en haut à droite de chaque page */
.appbar-me { display: grid; place-items: center; width: 40px; height: 40px; flex: none; border-radius: 50%; background: var(--chip); color: var(--primary); -webkit-tap-highlight-color: transparent; }
.appbar-me svg { width: 22px; height: 22px; }
.appbar-me.on { background: var(--primary); color: var(--on-primary, #fff); }
.appbar-out { margin-left: 2px; border: 0; padding: 0; color: var(--mut); }
.appbar-out svg { width: 21px; height: 21px; }
.src-all { margin-top: 12px; }
.src-all > summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: center; min-height: 48px; border-radius: 14px; background: var(--surface); box-shadow: var(--shadow); font-weight: 600; color: var(--primary); }
.src-all > summary::-webkit-details-marker { display: none; }
.src-all[open] > summary { margin-bottom: 12px; }
.pr-group { font-family: var(--display); font-size: 19px; margin: 22px 2px 10px; }
.pr-group:first-child { margin-top: 6px; }
.moi-ver { margin: 14px 0 0; text-align: center; font-size: 13px; color: var(--mut); }
.moi-out { margin-top: 20px; color: var(--bad); background: var(--surface); box-shadow: var(--shadow); }
/* Fenêtre de confirmation (Nav.ask) */
.ask-card { gap: 12px; padding: 26px 20px 20px; }
.ask-card p { color: var(--mut); line-height: 1.45; }
.ask-btns { display: grid; gap: 12px; width: 100%; margin-top: 6px; }
.ask-btns .btn { margin: 0; }
.btn.bad-fill { background: var(--bad); color: #fff; box-shadow: none; }
.settings .actions.center { justify-content: center; }

/* Zones à toucher d'au moins 44 px (recommandation Apple), sans changer l'aspect */
.l-steps a { padding-bottom: 14px; min-height: 44px; }
details.legend summary { min-height: 44px; }
.snd-btns button, .fw .snd-btns button { min-height: 44px; }
.alet .snd-btns button { min-height: 44px; }
.addbtn { width: 44px; height: 44px; }
.appbar-me { width: 44px; height: 44px; }
.ml-opt input { width: 24px; height: 24px; flex: none; }
a.cite { padding: 12px 10px; margin: -12px -10px; }
.prog-list a { display: inline-block; padding: 11px 0; }
.prog-list li { margin: 0; }
a.legend-more { display: inline-block; padding: 12px 0; }
/* Connexion : le logo de l'appli en haut */
.auth-brand { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 0 0 6px; font-family: var(--display); font-weight: 700; font-size: 22px; color: var(--ink); }
.auth-brand img { width: 40px; height: 40px; border-radius: 11px; }
/* Robustesse du mot de passe : 3 barres rouge / orange / vert */
.pw-meter { display: grid; gap: 6px; margin: -6px 0 14px; }
.pw-bar { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.pw-bar i { height: 6px; border-radius: 3px; background: var(--line); }
.pw-meter[data-lv="1"] .pw-bar i:nth-child(-n+1) { background: var(--bad); }
.pw-meter[data-lv="2"] .pw-bar i:nth-child(-n+2) { background: var(--tea); }
.pw-meter[data-lv="3"] .pw-bar i { background: #2E9E5B; }
.pw-t { font-size: 13.5px; color: var(--mut); }
.pw-meter[data-lv="1"] .pw-t { color: var(--bad); }
.pw-meter[data-lv="2"] .pw-t { color: var(--tea-deep); }
.pw-meter[data-lv="3"] .pw-t { color: var(--ok); font-weight: 600; }

/* Adresse e-mail : faute de frappe repérée */
.mail-hint { margin: -6px 0 14px; padding: 12px 14px; border-radius: 14px; font-size: 15px; line-height: 1.4; }
.mail-hint p { margin: 0; }
.mail-hint.ko { background: var(--bad-soft, #FBE9E7); color: var(--bad); }
.mail-hint.ask { background: var(--surface); box-shadow: var(--shadow); }
.mail-hint .mh-btns { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.mail-hint .mh-btns .btn { flex: 1 1 auto; min-height: 44px; padding: 8px 14px; font-size: 15px; margin: 0; }
/* Petit œil pour afficher le mot de passe */
.pw-wrap { position: relative; display: block; }
.pw-wrap input { padding-right: 52px; }
.pw-eye { position: absolute; top: 50%; right: 4px; transform: translateY(-50%); display: grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 12px; background: transparent; color: var(--mut); -webkit-tap-highlight-color: transparent; }
.pw-eye svg { width: 22px; height: 22px; }
.pw-eye[aria-pressed="true"] { color: var(--primary); }
.pw-eye:active { transform: translateY(-50%) scale(.94); }
/* Inviter un ami (Mon compte) */
.invite { display: grid; gap: 12px; margin: 4px 0 6px; padding: 16px; border-radius: var(--r); background: var(--surface); box-shadow: var(--shadow); }
.invite .btn { margin: 0; }
.inv-t { margin: 0; display: grid; gap: 2px; color: var(--mut); font-size: 14.5px; line-height: 1.4; }
.inv-t b { color: var(--ink); font-family: var(--display); font-size: 18px; }
.inv-msg { margin: 0; font-size: 14.5px; }
.inv-msg.ok { color: var(--ok); font-weight: 600; }
.inv-msg.ko { color: var(--ink); overflow-wrap: anywhere; }
.inv-ic { width: 22px; height: 22px; flex: none; }
/* Panneaux rangés par lieu (alphabet, Apprendre à lire) */
.sign-place .acc-body { padding: 0; }
.sign-place .fwords { border-radius: 0; box-shadow: none; border-top: 1px solid var(--line); }
.sign-place .acc-body .fwords { margin: 0; border-bottom: 0; }
.known-card { box-shadow: inset 0 0 0 2px var(--tea), var(--shadow); }
/* Proverbe du jour (accueil) : prononciation, son, et lien vers « quand le dire » */
.pv-day-card .pd-ph { margin: 2px 0 0 !important; }
.pv-more { display: inline-flex; align-items: center; min-height: 44px; padding: 0 4px; font-size: 15px; font-weight: 600; color: var(--primary); text-decoration: none; }
/* Accueil : la prochaine ville du passeport */
.pp-strip { display: flex; align-items: center; gap: 12px; margin: 14px 0 0; padding: 12px 16px; min-height: 64px; border-radius: var(--r); background: var(--surface); box-shadow: var(--shadow); color: var(--ink); text-decoration: none; }
.pp-strip .pp-ic { font-size: 24px; flex: none; }
.pp-strip .pp-tx { flex: 1; min-width: 0; display: grid; gap: 3px; }
.pp-strip b { font-size: 16px; }
.pp-strip small { font-size: 13.5px; color: var(--mut); }
.pp-bar { display: block; height: 6px; margin-top: 3px; border-radius: 99px; background: var(--line); overflow: hidden; }
.pp-bar i { display: block; height: 100%; background: var(--tea); border-radius: 99px; transform-origin: left; }
.pp-strip .chev { width: 20px; height: 20px; flex: none; color: var(--mut); }
/* Page de bienvenue (compte.html, avant la connexion) */
.welcome h1 { font-size: 32px; line-height: 1.12; }
.auth-brand + h1 { margin-top: 28px; }
.wl-list { list-style: none; margin: 18px 0 6px; padding: 0; display: grid; gap: 10px; }
.wl-list li { display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; border-radius: var(--r); background: var(--surface); box-shadow: var(--shadow); }
.wl-ic { flex: none; display: grid; place-items: center; width: 48px; height: 48px; border-radius: 15px; background: var(--ok-soft); color: var(--primary); }
.wl-list li:nth-child(even) .wl-ic { background: var(--tea-soft); color: var(--tea-deep); }
.wl-list li { align-items: center; }
.wl-ar { font-family: 'Readex Pro', sans-serif; font-size: 21px; font-weight: 600; line-height: 1; margin-top: -2px; }
.wl-list b { display: block; font-size: 16px; }
.wl-list small { display: block; margin-top: 2px; font-size: 14px; color: var(--mut); line-height: 1.4; }
.wl-btns { display: grid; gap: 12px; margin-top: 18px; }
.wl-btns .btn { margin: 0; }
.auth-back { display: inline-flex; align-items: center; min-height: 44px; margin: 0 0 12px -4px; padding: 0 4px; font-weight: 600; color: var(--primary); text-decoration: none; }
/* Premiers écrans (sans barre du haut) : le bouton retour est à la même place et a la même allure que « ‹ Retour »
   de la barre du haut (.appbar-back) : texte centré à 26 px sous le haut, flèche de 28 px. main (8 px) + .auth (24 px)
   = 32 px au-dessus, d'où -28 px pour un bouton de 44 px ; la marge du bas compense, le reste de l'écran ne bouge pas. */
.auth > .auth-back { display: flex; width: fit-content; min-height: 44px; gap: 2px; margin: -28px 0 40px -8px; padding: 0 6px; font-size: 16px; }
.auth-back > span[aria-hidden] { font-size: 28px; line-height: 0; margin-top: -3px; }
/* Choix de la langue (compte.html, avant la bienvenue) */
.lg-sub span[lang="ar"] { font-family: 'Readex Pro', sans-serif; }
.lg-list { display: grid; gap: 12px; margin: 22px 0 8px; }
.lg-opt { display: flex; align-items: center; gap: 14px; width: 100%; min-height: 72px; margin: 0; padding: 14px 16px; border-radius: var(--r); background: var(--surface); box-shadow: var(--shadow); border: 2px solid transparent; color: var(--ink); font: inherit; text-align: start; }
.lg-opt.on { border-color: var(--primary); cursor: pointer; }
.lg-opt.soon { background: transparent; box-shadow: none; border: 2px dashed var(--line); }
.lg-opt.soon .lg-flags { opacity: .55; }
.lg-flags { flex: none; display: inline-flex; align-items: center; gap: 6px; color: var(--mut); }
.lg-flags .flag { width: 30px; height: 20px; border-radius: 4px; box-shadow: 0 0 0 1px rgba(15, 42, 35, .12); }
.lg-opt[dir="rtl"] .lg-arw { transform: scaleX(-1); }
.lg-tx { flex: 1; min-width: 0; display: grid; gap: 2px; }
.lg-tx b { font-size: 16.5px; line-height: 1.3; }
.lg-tx[lang="ar"] b { font-family: 'Readex Pro', sans-serif; font-size: 18px; }
.lg-tx small { font-size: 13.5px; color: var(--mut); }
.lg-soon { justify-self: start; margin-top: 3px; padding: 2px 10px; border-radius: 99px; background: var(--tea-soft); color: var(--on-tea-soft) !important; font-weight: 600; }
.lg-go { flex: none; font-size: 26px; line-height: 1; color: var(--primary); }

/* Choix de la langue / bienvenue : les liens Confidentialité · Mentions légales tout en bas de l'écran */
.auth.welcome { display: flex; flex-direction: column; min-height: calc(100svh - 56px - env(safe-area-inset-bottom)); box-sizing: border-box; }
.auth.welcome > .auth-back { align-self: flex-start; }
.auth.welcome > .auth-legal { margin-top: auto; padding-top: 24px; margin-bottom: 0; }
/* Ma langue (reference/langue.html) et sa ligne dans Mon compte */
.lg-opt[aria-pressed="true"] { border-color: var(--primary); }
.lg-opt.on:not([aria-pressed="true"]):not(:has(.lg-go)) { border-color: var(--line); }
.lg-ok { flex: none; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--primary); color: var(--on-primary); font-weight: 700; font-size: 15px; }
.lg-note { min-height: 1.5em; margin: 4px 4px 0; color: var(--primary); font-weight: 600; }
.olist .lg-flags .flag { width: 26px; height: 17px; }
/* Test de niveau : barre en 10 étapes, et le détail du résultat */
.niv-steps { display: grid; grid-template-columns: repeat(10, 1fr); gap: 4px; margin: 4px 0 10px; }
.niv-steps span { height: 8px; border-radius: 99px; background: var(--line); overflow: hidden; }
.niv-steps i { display: block; height: 100%; background: var(--primary); transform-origin: left; }
html[dir="rtl"] .niv-steps i { transform-origin: right; }
.niv-res { list-style: none; margin: 12px 0 14px; padding: 0; display: grid; gap: 6px; }
.niv-res li { display: flex; align-items: center; gap: 10px; font-size: 15px; }
.niv-res li span { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; font-size: 13px; font-weight: 700; color: #fff; background: var(--ok); flex: none; }
.niv-res li.ko span { background: var(--bad); }
.niv-res li.ko { color: var(--mut); }
/* Premier écran : « J'ai déjà un compte » sous les langues, liens légaux tout en bas */
.lg-login { display: grid; gap: 6px; justify-items: center; margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--line); }
.lg-login .btn { margin: 0; }
.lg-login small { font-size: 13px; color: var(--mut); }
/* Écran du choix des langues : tout doit tenir sur un écran de téléphone, sans défiler (barre d'accueil iOS comprise) */
.lg-page { padding-top: calc(10px + env(safe-area-inset-top)); }
.lg-page .auth-brand { margin-bottom: 0; }
.lg-page h1 { margin: 14px 0 2px; font-size: 30px; }
.lg-page .lg-sub { margin: 0; font-size: 15px; }
.lg-page .lg-list { gap: 10px; margin: 16px 0 0; }
.lg-page .lg-opt { min-height: 62px; padding: 10px 14px; }
.lg-page .lg-login { margin-top: 14px; padding-top: 14px; gap: 4px; }
.lg-page > .auth-legal { padding-top: 12px; margin-bottom: 0; }
/* petits écrans (iPhone SE…) : encore un peu plus serré */
@media (max-height: 720px) {
  .lg-page h1 { margin-top: 8px; font-size: 26px; }
  .lg-page .lg-list { gap: 8px; margin-top: 12px; }
  .lg-page .lg-opt { min-height: 56px; padding: 8px 12px; }
  .lg-page .lg-login { margin-top: 10px; padding-top: 10px; }
}
/* écran du choix des langues : pas de grande marge sous les liens légaux (sinon on peut défiler dans le vide) */
main:has(.lg-page) { padding-bottom: calc(2px + env(safe-area-inset-bottom) * .55); }   /* les liens légaux un peu dans la marge de la barre iOS, au-dessus du trait */
.auth.welcome.lg-page { min-height: calc(100svh - 10px - env(safe-area-inset-bottom) * .55); }

/* Choix des langues : 4 blocs (en-tête, langues, compte, liens légaux) répartis également sur la hauteur de l'écran */
.auth.welcome.lg-page { justify-content: space-evenly; }
.lg-page > .lg-head h1 { margin: 16px 0 4px; font-size: 32px; }
.lg-page > .lg-list { margin: 0; gap: 12px; }
.lg-page .lg-opt { min-height: 66px; padding: 12px 14px; }
.lg-page > .lg-login { margin: 0; padding-top: 18px; }
.auth.welcome.lg-page > .auth-legal { margin: 0; padding: 0; }
@media (max-height: 720px) {
  .lg-page > .lg-head h1 { margin-top: 8px; font-size: 26px; }
  .lg-page > .lg-list { gap: 8px; }
  .lg-page .lg-opt { min-height: 56px; padding: 8px 12px; }
  .lg-page > .lg-login { padding-top: 10px; }
}
/* Découverte sans compte : question de niveau, et proposition de compte en fin de leçon / de test */
.lv-list { display: grid; gap: 12px; margin: 20px 0 8px; }
.lv-opt { display: flex; align-items: center; gap: 14px; width: 100%; min-height: 64px; margin: 0; padding: 10px 14px; border: 2px solid transparent; border-radius: var(--r); background: var(--surface); box-shadow: var(--shadow); color: var(--ink); font: inherit; text-align: start; cursor: pointer; }
.lv-opt:active { border-color: var(--primary); }
.lv-opt b { display: block; font-size: 16.5px; }
.lv-opt small { display: block; font-size: 14px; color: var(--mut); }
.lv-note { margin: 4px 0 0; text-align: center; font-size: 14px; color: var(--mut); }
.guest-box { display: grid; gap: 12px; margin: 16px 0 4px; padding: 16px; border-radius: var(--r); background: var(--ok-soft); text-align: start; }
.guest-box p { margin: 0; }
.guest-box b { display: block; font-size: 17px; }
.guest-box small { display: block; margin-top: 4px; font-size: 14px; color: var(--mut); }
.guest-box .btn { margin: 0; }
.guest-later { justify-self: center; min-height: 44px; display: inline-flex; align-items: center; }
/* Découverte sans compte : pas de liens vers les pages réservées aux comptes */
.is-guest .lnav { display: none; }
.guest-guide { display: grid; gap: 12px; margin: 14px 0 0; padding: 14px 16px; border-radius: var(--r); background: var(--tea-soft); color: var(--on-tea-soft); text-align: start; }
.guest-guide p { margin: 0; font-weight: 600; }
.guest-guide .btn { margin: 0; }
.pp-express { margin: 8px 0 0; min-height: 44px; font-size: 14px; }
/* Ma progression : calendrier en blocs mensuels */
.cal-months { display: grid; gap: 12px; }
.cal-m { padding: 14px; border-radius: var(--r); background: var(--surface); box-shadow: var(--shadow); }
.cal-mt { margin: 0 0 8px; font-weight: 600; text-transform: capitalize; }
.cal-g { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.cal-g .cal-d { width: 100%; min-width: 0; }
.cal-wd { font-size: 11px; color: var(--mut); text-align: center; }
.cal-months { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.cal-m { padding: 10px; }
.cal-mt { font-size: 14px; margin-bottom: 6px; }
.cal-g { gap: 3px; }
.cal-wd { font-size: 10px; }
/* Découverte sans compte : pas de « mission dans la vraie vie » (la personne teste l'appli) */
.is-guest #mission { display: none; }
.quiz-h { margin: 22px 0 4px; font-size: 18px; }
.l-steps a > span[aria-hidden], .l-steps + * h2 > span[aria-hidden] { margin-inline-end: 4px; }
/* Mot rappelé d'une leçon précédente (en tête du vocabulaire) */
.w-tag { display: inline-block; margin: 0 8px 0 0; padding: 1px 8px; border-radius: 99px; background: var(--tea-soft); color: var(--on-tea-soft); font-size: 12px; font-weight: 700; vertical-align: 2px; }
/* Page « Compter jusqu'à 100 » : l'explication sous chaque nombre prend toute la largeur ; nombres longs sur deux étages */
:is(#compter, #heure) .fw { flex-wrap: wrap; }
:is(#compter, #heure) .fw > .fw-note { flex-basis: 100%; margin-top: 0 !important; }
:is(#compter, #heure) .fw-long .fw-tx { flex-basis: 100%; }
:is(#compter, #heure) .fw-long .fw-side { max-width: none; width: 100%; grid-auto-flow: column; justify-content: space-between; align-items: center; }
/* Mémo de grammaire : thèmes repliables, et dans chacun ses fiches (cartes plus légères, sans ombre) */
.gtheme > .acc-body { padding: 0 12px 12px; }
.gtheme .gsec { margin: 0 0 8px; box-shadow: none; border: 1px solid var(--line); }
.gtheme .gsec:last-child { margin-bottom: 0; }
/* Accueil : carte « Niveau » (un niveau tous les 25 mots appris) */
.lvl-card { display: flex; align-items: center; gap: 14px; margin: 14px 0 0; padding: 12px 16px; min-height: 64px; border-radius: var(--r); background: var(--surface); box-shadow: var(--shadow); color: var(--ink); text-decoration: none; }
.lvl-badge { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--tea-soft); color: var(--on-tea-soft); font-weight: 800; font-size: 19px; box-shadow: inset 0 0 0 3px var(--tea); }
.lvl-tx { flex: 1; min-width: 0; display: grid; gap: 3px; }
.lvl-tx b { font-size: 16px; }
.lvl-tx small { font-size: 13.5px; color: var(--mut); }
.lvl-card .chev { width: 20px; height: 20px; flex: none; color: var(--mut); }
.lvl-card.up { box-shadow: inset 0 0 0 2px var(--tea), var(--shadow); }
.lvl-card.up .lvl-badge { background: var(--tea); color: var(--on-tea-soft); box-shadow: none; }
/* Conversations : l'explication d'une bonne réponse reste sous ta bulle */
.bub .b-fb { margin: 6px 0 0; font-size: 13.5px; font-weight: 600; }
.bub .b-fb.ok { color: var(--ok); }
.bub .b-fb.meh { color: var(--on-tea-soft); }
/* Cartes d'exercice en grille : la colonne ne doit jamais dépasser la carte (sinon boutons et réponses sortent de l'écran) */
.q { grid-template-columns: minmax(0, 1fr); }
.vit-replay .btn { min-width: 0; padding-left: 12px; padding-right: 12px; }
/* Exercices de grammaire : découpage « mot + fin » sous la réponse */
.fb .exg-how { display: block; margin-top: 8px; font-weight: 500; }
.fb .exg-how b { font-weight: 800; }
.fb .nw { white-space: nowrap; }
.fb .exg-mine { color: var(--ink); }
.fb .exg-rule { display: block; margin-top: 8px; }
/* Exercices de grammaire : un bouton son à côté de chaque réponse (et du mot de la question) */
.q .opts .opt-row { display: flex; gap: 8px; align-items: stretch; }
.q .opts .opt-row > button[data-o] { flex: 1; min-width: 0; }
.q .opts .opt-snd, .q .prompt .opt-snd { flex: none; width: 50px; min-height: 50px; padding: 0; display: inline-grid; place-items: center; border-radius: 14px; border: 2px solid var(--line); background: var(--surface); color: var(--primary); }
.q .prompt .opt-snd { width: 44px; min-height: 44px; vertical-align: middle; margin-left: 4px; }
.opt-snd svg { width: 22px; height: 22px; }
/* Leçon de rattrapage */
.rat-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 12px; }
.rat-bar .btn { display: inline-flex; align-items: center; gap: 8px; margin: 0; }
.rat-bar .btn svg { width: 18px; height: 18px; }
.rat-time { color: var(--mut); font-size: 14px; }
.rat-skip { align-self: center; min-height: 44px; padding: 0 12px; }
/* Premier écran : le haut animé (assets/intro.js) */
.lg-page { position: relative; }
.intro { text-align: center; }
.intro .auth-brand { justify-content: center; margin: 0; }
a.auth-brand { width: fit-content; min-height: 44px; margin-top: -1px !important; margin-bottom: -1px !important; margin-left: auto !important; margin-right: auto !important; text-decoration: none; -webkit-tap-highlight-color: transparent; }   /* premier écran : le logo ramène à la page d'accueil du site (la vitrine) */
.intro-greet { height: 26px; margin: 10px auto 0; width: max-content; min-width: 110px; font-size: 18px; font-weight: 700; color: var(--tea); transition: opacity .25s; }
.intro-greet.intro-fade { opacity: 0; }
.lg-page .intro-h { color: var(--ink); margin: 4px 0 0; font-size: 28px; line-height: 1.18; letter-spacing: -.4px; }
.intro-w { display: inline-block; }
.intro-mark { position: relative; color: var(--primary); }
.intro-mark::after { content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 4px; border-radius: 2px; background: var(--tea); }
.intro-sub { margin: 10px 0 0; color: var(--mut); font-size: 15px; }
.intro-stats { display: flex; justify-content: center; gap: 8px; margin-top: 30px; }
.intro-stat { display: grid; gap: 1px; width: 94px; padding: 6px 8px; border-radius: 12px; background: var(--surface); }
.intro-stat b { font-size: 17px; color: var(--primary); }
.intro-stat span { font-size: 11.5px; line-height: 1.25; color: var(--mut); }
.intro-pick { margin: 10px 2px 0; text-align: start; font-size: 13px; color: var(--mut); }
.lg-page:has(.intro) .lg-list { margin-top: 6px; }
.intro-layer { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 1; }
.intro-chip { position: absolute; padding: 4px 10px; border-radius: 99px; background: var(--surface); border: 1px solid var(--line); color: var(--primary); font-size: 12px; white-space: nowrap; animation: introPop .6s cubic-bezier(.2, .7, .3, 1) forwards; }
.intro-chip.bye { animation: introOut .9s ease forwards; }
@keyframes introPop { 0% { opacity: 0; transform: scale(.85) translateY(4px); } 100% { opacity: 1; transform: none; } }   /* apparition douce, sans rebond */
@keyframes introOut { to { opacity: 0; transform: translateY(-4px); } }
@keyframes introUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes introLogo { 0% { opacity: 0; transform: scale(.6); } 70% { transform: scale(1.08); } 100% { opacity: 1; transform: scale(1); } }
@keyframes introSweep { from { transform: scaleX(0); } to { transform: scaleX(1); } }
/* toute première ouverture : chaque élément arrive à son tour */
.intro-anim .intro-logo { opacity: 0; animation: introLogo .6s .1s forwards; }
.intro-anim .intro-greet { opacity: 0; animation: introUp .4s .45s forwards; }
.intro-anim .intro-w, .intro-anim .intro-sub, .intro-anim .intro-stat, .intro-anim .intro-pick { opacity: 0; animation-name: introUp; animation-duration: .5s; animation-fill-mode: forwards; animation-timing-function: cubic-bezier(.2,.7,.2,1); }
.intro-anim .intro-mark::after { transform: scaleX(0); transform-origin: left; animation: introSweep .5s 2s forwards; }
html[dir="rtl"] .intro-anim .intro-mark::after { transform-origin: right; }
/* les 4 cours montent depuis le bas, l'un après l'autre (à chaque ouverture ; après l'accroche à la toute première) */
@keyframes courseUp { from { opacity: 0; transform: translateY(48px); } to { opacity: 1; transform: none; } }
.lg-page:has(.intro) .lg-opt { animation: courseUp .7s cubic-bezier(.16, .84, .3, 1) both; }
.lg-page:has(.intro) .lg-opt:nth-child(1) { animation-delay: .1s; }
.lg-page:has(.intro) .lg-opt:nth-child(2) { animation-delay: .22s; }
.lg-page:has(.intro) .lg-opt:nth-child(3) { animation-delay: .34s; }
.lg-page:has(.intro) .lg-opt:nth-child(4) { animation-delay: .46s; }
@media (prefers-reduced-motion: reduce) { .lg-page:has(.intro) .lg-opt { animation: none; } }
.lg-page:has(.intro-anim) .lg-login, .lg-page:has(.intro-anim) > .auth-legal { opacity: 0; animation: introUp .5s forwards; }
.lg-page:has(.intro-anim) .lg-opt:nth-child(1) { animation-delay: 4.05s; }
.lg-page:has(.intro-anim) .lg-opt:nth-child(2) { animation-delay: 4.2s; }
.lg-page:has(.intro-anim) .lg-opt:nth-child(3) { animation-delay: 4.35s; }
.lg-page:has(.intro-anim) .lg-opt:nth-child(4) { animation-delay: 4.5s; }
.lg-page:has(.intro-anim) .lg-login { animation-delay: 4.7s; }
.lg-page:has(.intro-anim) > .auth-legal { animation-delay: 4.8s; }
/* petits écrans : tout tient sans défiler */
/* avec le haut animé, les cours et la connexion se resserrent pour que tout tienne sur un écran */
.lg-page:has(.intro) .lg-opt { min-height: 54px; padding: 7px 12px; }
.lg-page:has(.intro) .lg-list { gap: 8px; }
.lg-page:has(.intro) .lg-login { margin-top: 10px; padding-top: 10px; }
.lg-page:has(.intro) > .auth-legal { padding-top: 6px; }
/* sur iPhone, l'encoche et la barre du bas prennent ~80 px : version resserrée dès 880 px de haut */
@media (max-height: 880px) {
  .lg-page .intro-h { font-size: 24px; }
  .intro-greet { margin-top: 4px; }
  .intro-stats { margin-top: 16px; }
  .intro-pick { margin-top: 8px; }
}
@media (max-height: 760px) { .intro-stats { display: none; } .intro-sub { margin-top: 6px; } }
/* Premier écran : logo plus haut et plus grand, « Choisis ta langue » collé aux cours, liens légaux tout en bas ; l'espace libre va entre les blocs */
.auth.welcome.lg-page:has(.intro) { justify-content: flex-start; padding-top: calc(2px + env(safe-area-inset-top)); }
.intro .auth-brand { font-size: 27px; gap: 12px; }
.intro .auth-brand img { width: 50px; height: 50px; border-radius: 13px; }
.intro-greet { margin-top: 20px; }
.lg-page > .lg-choose { margin-top: auto; padding-top: 24px; }
.lg-page:has(.intro-anim) .lg-choose .intro-pick { opacity: 0; animation: introUp .5s 3.9s forwards; }
/* réglage fin demandé : l'accroche (avec la phrase et les chiffres) et le bloc langues + compte descendus de 5 px */
.lg-page .intro-h, .lg-page .intro-sub, .lg-page .intro-stats, .lg-page > .lg-choose, .lg-page:has(.intro) > .lg-login { position: relative; top: 5px; }
.lg-choose .intro-pick { margin: 0 2px 8px; }
.lg-page:has(.intro) .lg-choose .lg-list { margin: 0; gap: 10px; }
.lg-page:has(.intro) .lg-opt { min-height: 58px; padding: 9px 12px; }
.lg-page:has(.intro) > .lg-login { margin-top: 34px; padding-top: 18px; }
.auth.welcome.lg-page:has(.intro) > .auth-legal { margin-top: auto; padding-top: 10px; }
@media (max-height: 760px) {
  .intro-greet { margin-top: 12px; }
  .lg-page > .lg-choose { padding-top: 14px; }
  .lg-page:has(.intro) .lg-choose .lg-list { gap: 8px; }
  .lg-page:has(.intro) > .lg-login { margin-top: 26px; padding-top: 14px; }
}
@media (max-height: 700px) {   /* iPhone SE */
  .intro .auth-brand { font-size: 23px; }
  .intro .auth-brand img { width: 42px; height: 42px; border-radius: 11px; }
  .intro-greet { margin-top: 6px; }
  .lg-page > .lg-choose { padding-top: 8px; }
  .lg-page:has(.intro) .lg-opt { min-height: 52px; padding: 6px 12px; }
  .lg-page:has(.intro) > .lg-login { margin-top: 18px; padding-top: 10px; }
  .auth.welcome.lg-page:has(.intro) > .auth-legal { padding-top: 10px; }
}
@media (prefers-reduced-motion: reduce) { .intro-anim *, .lg-page:has(.intro-anim) * { animation: none !important; opacity: 1 !important; transform: none !important; } }
/* Bulles vertes (tes répliques) : le bouton en lecture passe aussi en orange, comme dans les bulles blanches */
.bub.me .snd-btns button.playing, .bub.me .snd-btns button.me-play.playing,
.dialogue .me .snd-btns button.playing, .dialogue .me .snd-btns button.me-play.playing { background: var(--tea); color: #2B1700; box-shadow: none; }
/* Ma langue : refaire le test de niveau */
.lg-niv-h { margin: 28px 0 4px; font-size: 18px; }
.lg-niv-p { margin: 0 0 12px; color: var(--mut); font-size: 15px; }

/* Fin de leçon : petit avis anonyme (trop facile / bien / trop dur) */
.avis { margin: 18px 0 6px; }
.avis-q { margin: 0 0 12px; font-weight: 600; }
.avis-btns { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.avis-btns button { min-height: 64px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 8px 6px; border: 0; border-radius: 14px; background: var(--surface); box-shadow: inset 0 0 0 2px var(--line); color: var(--ink); font: inherit; font-size: 14px; cursor: pointer; }
.avis-btns button:active { transform: scale(.97); }
.avis-emo { font-size: 22px; line-height: 1; }
.avis-merci { margin: 18px 0 6px; font-weight: 600; color: var(--primary); }

/* ===== Abonnement (assets/abo.js) : cadenas, carte « verrouillé », Mon abonnement, mode bêta, page des offres ===== */
.lock-badge { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--tea); color: #2B1700; flex: none; }
.lock-badge svg, a.is-locked .lock-badge svg, .quick-tile .lock-badge svg { display: block; width: 15px; height: 15px; margin: 0; color: inherit; }
a.is-locked { position: relative; }
a.is-locked .lock-badge.corner { position: absolute; top: 10px; right: 10px; }
a.is-locked .lock-badge.in-row { margin-left: auto; }
a.is-locked .lock-badge.in-text { width: 19px; height: 19px; margin-left: 5px; vertical-align: -3px; }
a.is-locked .lock-badge.in-text svg { width: 12px; height: 12px; }
a.is-locked.lk-text { color: var(--mut); text-decoration-color: color-mix(in srgb, var(--mut) 45%, transparent); }
a.is-locked .lock-badge.in-btn { width: 24px; height: 24px; margin-right: 10px; }
a.is-locked:not(.btn) > :not(.lock-badge) { opacity: .42; filter: grayscale(1); }
.punit.shut .pu-h b, .punit.shut .meter { opacity: .42; }
.punit.shut .lock-badge.in-head { margin-left: auto; }
.abo-lock { display: grid; justify-items: center; gap: 12px; margin: 24px 0; padding: 26px 18px 18px; border-radius: var(--r); background: var(--surface); box-shadow: var(--shadow); text-align: center; }
.abo-lock .al-ic { display: grid; place-items: center; width: 58px; height: 58px; border-radius: 50%; background: var(--tea); color: #2B1700; }
.abo-lock .al-ic svg { width: 30px; height: 30px; }
.abo-lock h2 { margin: 0; font-size: 22px; }
.abo-lock p { margin: 0; color: var(--mut); max-width: 32ch; }
.abo-lock > .btn.wide { margin-top: 4px; }
.abo-card { margin-bottom: 14px; }
.abo-card, .abo-beta { display: grid; gap: 12px; padding: 16px; border-radius: var(--r); background: var(--surface); box-shadow: var(--shadow); }
.abo-card > *, .abo-card > .btn.wide + *, .abo-beta > * { margin: 0; }
.abo-state { display: flex; align-items: center; gap: 14px; }
.abo-ic { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; background: var(--ok-soft); color: var(--ok); flex: none; }
.abo-ic.free { background: var(--tea); color: #2B1700; }
.abo-ic svg { width: 22px; height: 22px; }
.abo-tx { display: grid; gap: 2px; }
.abo-tx small { color: var(--mut); font-size: 14px; }
.abo-beta { margin-bottom: 8px; }
.ab-t { color: var(--mut); font-size: 14.5px; }
.ab-seg { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.ab-seg.ab-form { grid-template-columns: 1fr 1fr 1fr; }
.ab-seg[hidden], .ab-t[hidden] { display: none; }
.ab-seg button { min-height: 48px; padding: 6px 10px; border: 2px solid var(--line); border-radius: var(--r-btn); background: transparent; font-weight: 600; font-size: 15px; }
.ab-seg button[aria-pressed="true"] { border-color: var(--primary); background: var(--primary); color: var(--on-primary); }
.offres .of-list { list-style: none; display: grid; gap: 10px; margin: 18px 0 22px; padding: 0; }
.offres .of-list li { position: relative; padding-left: 34px; font-size: 16.5px; line-height: 1.4; }
.offres .of-list li::before { content: "✓"; position: absolute; left: 0; top: 0; display: grid; place-items: center; width: 23px; height: 23px; border-radius: 50%; background: var(--ok-soft); color: var(--ok); font-size: 13px; font-weight: 800; }
.of-plans { display: grid; gap: 12px; margin: 26px 0 18px; }
.of-plan.best { position: relative; padding-top: 22px; padding-right: 62px; }
.op-best { position: absolute; top: -12px; left: 14px; padding: 3px 11px; border-radius: 999px; background: var(--primary); color: var(--on-primary); font-size: 13px; font-weight: 700; }
.op-burst { position: absolute; top: -18px; right: -8px; display: grid; place-items: center; width: 60px; height: 60px; border-radius: 50%; background: var(--tea); color: #2B1700; font-family: var(--display); font-size: 17px; font-weight: 800; letter-spacing: -.02em; transform: rotate(12deg); box-shadow: 0 4px 10px -6px rgba(0, 0, 0, .35); }
.op-price { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 6px; margin: 2px 0 1px; }
.op-big { font-family: var(--display); font-size: 26px; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; }
.op-unit { color: var(--mut); font-size: 14px; }
.op-was { color: var(--mut); font-size: 15px; text-decoration-thickness: 2px; }
.op-trial { color: var(--tea-deep) !important; font-weight: 600; }
.of-plan { display: flex; align-items: center; gap: 14px; width: 100%; min-height: 76px; padding: 14px 16px; border: 2px solid var(--line); border-radius: var(--r); background: var(--surface); text-align: left; }
.of-plan.on { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 7%, var(--surface)); }
.op-dot { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--mut); flex: none; }
.of-plan.on .op-dot { border-color: var(--primary); background: radial-gradient(circle, var(--primary) 0 5px, transparent 5.5px); }
.op-tx { flex: 1; display: grid; gap: 2px; }
.op-tx b { font-size: 17px; }
.op-tx small { color: var(--mut); font-size: 14px; }
.op-tags { display: grid; gap: 6px; justify-items: end; }
.op-tag { padding: 3px 9px; border-radius: 999px; background: var(--surface-2); font-size: 13px; font-weight: 700; white-space: nowrap; }
.op-tag.trial { background: var(--tea); color: #2B1700; }
.of-go + .of-msg { margin-top: 12px; }
.of-fine { margin: 14px 0 0; color: var(--mut); font-size: 13.5px; line-height: 1.45; }
.of-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 0 12px; margin: 12px 0 8px; }
.of-link { display: inline-flex; align-items: center; min-height: 44px; padding: 0 6px; border: 0; background: none; color: var(--mut); font-size: 14px; text-decoration: underline; }
/* Résilier (reference/resilier.html) : raison, offre pour rester, confirmation */
.resil .rs-list { margin: 18px 0 14px; }
.resil .rs-list .of-plan { min-height: 56px; }
.rs-more { display: grid; gap: 6px; margin: 0 0 14px; font-size: 14.5px; color: var(--mut); }
.rs-more textarea { width: 100%; padding: 10px 12px; border: 2px solid var(--line); border-radius: var(--r-btn); background: var(--surface); color: var(--ink); font: inherit; resize: vertical; }
.rs-more + .inv-msg, .rs-list + .inv-msg { margin: 0 0 12px; }
.rs-tip { margin: 16px 0 0; display: grid; gap: 12px; }
.rs-tip > .btn.wide { margin: 0; }
.rs-offer { position: relative; margin: 30px 0 14px; padding: 22px 70px 18px 18px; border: 2px solid var(--primary); border-radius: var(--r); background: color-mix(in srgb, var(--primary) 7%, var(--surface)); }
.rs-offer p { margin: 0; }
.rs-offer .op-burst { top: -20px; right: -6px; }
.rs-offer .op-burst.ob-word { font-size: 14px; }
.ro-what { color: var(--mut); font-size: 14.5px; }
.ro-price { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 6px; margin: 4px 0 2px !important; }
.ro-price .op-big { font-size: 30px; }
.ro-was { color: var(--mut); font-size: 15px; }
.ro-was s { text-decoration-thickness: 2px; }
.ro-save { margin-top: 8px !important; color: var(--tea-deep); font-weight: 600; font-size: 14.5px; }
.rs-note { margin: 0 0 16px; color: var(--mut); font-size: 14.5px; line-height: 1.45; }
.rs-note + .inv-msg { margin: 0 0 12px; }
.rs-lose { margin-top: 14px; }
.btn.rs-cancel { color: var(--bad); background: transparent; box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--bad) 35%, transparent); }
.rs-top { margin-top: 16px; }
.offres .rs-lose li::before { content: "✕"; background: var(--bad-soft); color: var(--bad); }
/* Prononciation : une carte par son, avec des mots à écouter */
.snd-list { display: grid; gap: 22px; margin: 22px 0 8px; }
.snd-card .sc-head { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; }
.sc-key { display: grid; place-items: center; min-width: 52px; height: 52px; padding: 0 10px; border-radius: 16px; background: var(--primary); color: var(--on-primary); font-family: var(--display); font-size: 26px; font-weight: 800; letter-spacing: -.02em; }
.sc-ar { font-size: 34px; line-height: 1; color: var(--ink); transform: translateY(-7px); }
.sc-how { margin: 0 0 12px; font-size: 15.5px; line-height: 1.45; }
.sc-hl { color: var(--tea-deep); background: var(--tea-soft); border-radius: 5px; padding: 0 2px; font-weight: inherit; }
/* Signaler une erreur (assets/signaler.js) : lien discret en bas de section, panneau qui monte du bas */
.report { display: flex; justify-content: center; margin: 22px 0 6px; }
.report-link { display: inline-flex; align-items: center; gap: 7px; min-height: 44px; padding: 0 12px; border: 0; background: none; color: var(--mut); font-size: 14px; text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--mut) 40%, transparent); text-underline-offset: 3px; }
.report-link svg { width: 16px; height: 16px; flex: none; }
body.rp-open { overflow: hidden; }
.rp-overlay { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: flex-end; justify-content: center; background: rgba(8, 24, 20, .45); }
.rp-sheet { display: grid; gap: 12px; width: 100%; max-width: 560px; max-height: 92svh; overflow-y: auto; padding: 10px 18px calc(18px + env(safe-area-inset-bottom)); border-radius: 22px 22px 0 0; background: var(--bg); animation: rpUp .25s ease-out; }
.rp-sheet > *, .rp-sheet > .btn.wide + * { margin: 0; }
.rp-grip { justify-self: center; width: 40px; height: 5px; border-radius: 5px; background: var(--line); }
.rp-sheet h2 { font-size: 22px; }
.rp-f { display: grid; gap: 6px; font-size: 14.5px; color: var(--mut); }
.rp-f select, .rp-f textarea { width: 100%; min-height: 48px; padding: 10px 12px; border: 2px solid var(--line); border-radius: var(--r-btn); background: var(--surface); color: var(--ink); font: inherit; font-size: 16px; }
.rp-reasons { display: grid; gap: 12px; }
.rp-reasons .of-plan { min-height: 50px; padding: 10px 14px; }
.rp-reasons .op-tx b { font-size: 15px; }
.rp-thanks { color: var(--mut); }
@keyframes rpUp { from { transform: translateY(40px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .rp-sheet { animation: none; } }
/* Feuilles de menthe et classements (assets/points.js, reference/classement.html) */
.pt-toast { position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom)); z-index: 900; transform: translateX(-50%); padding: 8px 16px; border-radius: 999px; background: var(--ok-soft); color: var(--ok); font-weight: 700; font-size: 15px; box-shadow: 0 6px 16px -10px rgba(0, 0, 0, .4); animation: ptIn .3s ease-out; transition: opacity .4s, transform .4s; }
.pt-toast.out { opacity: 0; transform: translate(-50%, -8px); }
@keyframes ptIn { from { opacity: 0; transform: translate(-50%, 8px); } }
@media (prefers-reduced-motion: reduce) { .pt-toast { animation: none; transition: none; } }
.pt-line { display: inline-flex; align-items: center; gap: 5px; max-width: 100%; margin: 6px 0 0; padding: 4px 10px; border-radius: 14px; background: var(--ok-soft); color: var(--ok); font-size: 13.5px; line-height: 1.3; }
.st-pts { flex: none; padding: 2px 8px; border-radius: 999px; background: var(--ok-soft); color: var(--ok); font-size: 13px; font-weight: 700; }
.fin-pts { margin: 12px auto 4px; max-width: 280px; text-align: left; }
.fin-pts .fp-big { display: flex; justify-content: center; align-items: baseline; gap: 6px; margin: 0 auto 8px; width: fit-content; padding: 8px 18px; border-radius: 16px; background: var(--ok-soft); color: var(--ok); font-family: var(--display); font-size: 28px; font-weight: 800; }
.fin-pts .fp-big span:last-child { font-family: var(--body); font-size: 14px; font-weight: 600; }
.fp-list { list-style: none; margin: 0; padding: 0; font-size: 14.5px; }
.fp-list li { display: flex; justify-content: space-between; padding: 3px 0; }
.fp-list li.fp-hint { color: var(--mut); }
.fp-week { margin: 6px 0 0; padding-top: 6px; border-top: 1px solid var(--line); font-size: 14.5px; display: flex; justify-content: space-between; }
.pt-board { display: flex; align-items: center; gap: 14px; margin: 16px 0 0; padding: 14px 16px; border-radius: var(--r); background: var(--surface); box-shadow: var(--shadow); color: var(--ink); text-decoration: none; }
.pt-board .pb-ic { font-size: 24px; }
.pt-board .pb-tx { flex: 1; display: grid; gap: 2px; }
.pt-board .pb-tx small { color: var(--mut); font-size: 13.5px; }
.pt-board .chev { width: 20px; height: 20px; color: var(--mut); }
.classement .cl-tabs { margin: 16px 0 14px; }
.cl-list { list-style: none; margin: 0 0 14px; padding: 4px; border-radius: var(--r); background: var(--surface); box-shadow: var(--shadow); }
.cl-row { display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 6px 10px; border-radius: 12px; }
.cl-row + .cl-row { border-top: 1px solid var(--line); }
.cl-row.me { background: color-mix(in srgb, var(--primary) 9%, var(--surface)); box-shadow: inset 0 0 0 2px var(--primary); border-top-color: transparent; }
.cl-rk { width: 26px; text-align: center; color: var(--mut); font-weight: 700; }
.cl-av { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; color: #fff; font-weight: 700; flex: none; }
.cl-ps { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.cl-ps small { color: var(--mut); font-weight: 400; }
.cl-pts { font-weight: 700; white-space: nowrap; }
.cl-zone { padding: 6px 10px 2px; font-size: 13px; font-weight: 700; }
.cl-zone.up { color: var(--ok); }
.cl-zone.down { color: var(--bad); border-top: 1px solid var(--line); }
/* Zones de montée (vert) et de descente (rouge) dans le groupe de ligue */
.cl-row.z-up { background: color-mix(in srgb, #1F9D63 15%, var(--surface)); }
.cl-row.z-down { background: color-mix(in srgb, var(--bad) 12%, var(--surface)); }
.cl-row.z-up .cl-rk { color: #13784A; } .cl-row.z-down .cl-rk { color: var(--bad); }
.cl-row.me.z-up, .cl-row.me.z-down { box-shadow: inset 0 0 0 2px var(--primary); }
.cl-city { margin: 0 0 12px; padding: 14px 16px; border-radius: var(--r); background: var(--surface); box-shadow: var(--shadow); }
.cl-city p { margin: 4px 0 0; color: var(--mut); font-size: 14.5px; }
/* Message du lundi (assets/points.js › leagueNews) */
.lg-news-ic { font-size: 44px; line-height: 1; }
.lg-news-sub { color: var(--mut); }
.lg-city { width: 100%; box-sizing: border-box; text-align: start; padding: 14px 16px; border-radius: 16px; background: var(--bg); }
.lg-city p { margin: 4px 0 0; font-size: 14.5px; color: var(--mut); }
.cl-hint, .cl-wait { color: var(--mut); font-size: 14.5px; }
.cl-lg { display: flex; align-items: center; gap: 12px; margin: 0 0 12px; }
.cl-lg-ic { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; background: var(--primary); font-size: 22px; }
.cl-lg div { display: grid; gap: 2px; }
.cl-lg small { color: var(--mut); }
.cl-code { display: grid; gap: 12px; margin: 8px 0 0; padding: 16px; border-radius: var(--r); background: var(--surface); box-shadow: var(--shadow); }
.cl-code > *, .cl-code > .btn.wide + * { margin: 0; }
.cl-code b { font-family: var(--display); font-size: 20px; letter-spacing: .08em; }
.rp-f input { width: 100%; min-height: 48px; padding: 10px 12px; border: 2px solid var(--line); border-radius: var(--r-btn); background: var(--surface); color: var(--ink); font: inherit; font-size: 16px; }
.cl-lab { margin: 16px 0 8px; font-size: 14.5px; color: var(--mut); }
.cl-colors { display: flex; flex-wrap: wrap; gap: 12px; margin: 0 0 18px; }
.cl-colors button { width: 44px; height: 44px; border-radius: 50%; border: 3px solid transparent; }
.cl-colors button[aria-checked="true"] { border-color: var(--ink); box-shadow: inset 0 0 0 3px var(--bg); }
.classement .rp-f { margin-top: 16px; }
.cl-set { display: grid; gap: 12px; margin-top: 22px; }
.cl-set > .btn.wide + * { margin: 0; }
.field-hint { color: var(--mut); font-size: 13px; font-weight: 400; }
.pseudo-card { display: grid; gap: 12px; margin: 16px 0 0; padding: 16px; border-radius: var(--r); background: var(--surface); box-shadow: var(--shadow); }
.pseudo-card > *, .pseudo-card > .btn.wide + * { margin: 0; }
.pseudo-card .pc-t { display: grid; gap: 4px; color: var(--mut); font-size: 14.5px; }
.pseudo-card .pc-t b { color: var(--ink); font-size: 16px; }
.pseudo-card input { width: 100%; min-height: 48px; padding: 10px 12px; border: 2px solid var(--line); border-radius: var(--r-btn); background: var(--surface); color: var(--ink); font: inherit; font-size: 16px; }
.finish-card .fin-err { color: var(--bad); font-weight: 600; }
/* Carte de fin de leçon : « Leçon suivante → » puis le titre en dessous */
.btn.fin-next { flex-direction: column; gap: 2px; padding-top: 12px; padding-bottom: 12px; line-height: 1.25; }
.fin-next .fn-top { display: inline-flex; align-items: center; gap: 8px; font-size: 17px; }
.fin-next .fn-top svg { width: 20px; height: 20px; }
.fin-next .fn-title { font-size: 14.5px; font-weight: 500; opacity: .9; text-align: center; }
.lnav .nx[hidden] { display: none; }
.cl-add { margin-top: 4px; }
.cl-add[aria-expanded="true"] { background: color-mix(in srgb, var(--primary) 8%, var(--surface)); }
.cl-code[hidden] { display: none; }
.cl-add + .cl-code { margin-top: 12px; }
@media (max-height: 700px) {   /* iPhone SE : le verre un peu plus petit pour que la fin de révision tienne sur un écran */
  .rv-done > svg:first-child { width: 60px; height: auto; }
  .rv-done { gap: 8px; }
}
.ps-card .ps-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.ps-card .ps-name { font-weight: 700; font-size: 17px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ps-card .ps-row .btn { flex: none; min-height: 44px; padding: 0 18px; }
.ps-card input { width: 100%; min-height: 48px; padding: 10px 12px; border: 2px solid var(--line); border-radius: var(--r-btn); background: var(--surface); color: var(--ink); font: inherit; font-size: 16px; }
.ps-card .field { margin: 0; }
/* Offre à la fin de la dernière leçon gratuite (assets/lesson.js, paywall) */
.paywall { margin: 14px 0 0; padding: 18px 16px 16px; border-radius: var(--r); background: color-mix(in srgb, var(--primary) 7%, var(--surface)); border: 2px solid var(--primary); text-align: left; }
.paywall .pw-kicker { margin: 0; color: var(--tea-deep); font-weight: 700; font-size: 14.5px; }
.paywall h3 { margin: 4px 0 10px; font-size: 22px; }
.paywall .pw-list { margin: 0 0 12px; }
.paywall .pw-price { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; margin: 0 0 14px; }
.paywall .pw-price b { font-family: var(--display); font-size: 26px; font-weight: 800; }
.paywall .pw-price span { color: var(--mut); font-size: 14.5px; }
.paywall .pw-price s { color: var(--mut); font-size: 14.5px; }
.paywall .finish-actions { margin: 0; }
.paywall .pw-list { list-style: none; display: grid; gap: 8px; padding: 0; }
.paywall .pw-list li { position: relative; padding-left: 32px; font-size: 15.5px; line-height: 1.4; }
.paywall .pw-list li::before { content: "✓"; position: absolute; left: 0; top: 0; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--ok-soft); color: var(--ok); font-size: 12px; font-weight: 800; }
.paywall .pw-kicker { display: flex; align-items: center; gap: 6px; }
.pw-plans { margin: 22px 0 14px; }
.pw-plans .of-plan.best { padding-right: 16px; }
.pw-plans .of-plan { min-height: 64px; background: var(--surface); }
.pw-plans .of-plan.on { background: color-mix(in srgb, var(--primary) 7%, var(--surface)); }
.paywall { padding-left: 12px; padding-right: 12px; }
.pw-plans .of-plan { padding: 12px; gap: 10px; }
.pw-plans .op-tx small { white-space: nowrap; font-size: 13.5px; }

/* Contrôle parental (assets/parental.js) */
.pc-card .pc-lead { margin-top: 0 !important; }
.pc-card .pc-btn, .pc-card .pc-actions { margin-top: 14px; }
.pc-actions { display: grid; gap: 12px; }
.pc-state { display: flex; align-items: center; gap: 12px; }
.pc-state .pc-ic { font-size: 28px; }
.pc-state b { display: block; }
.pc-state small { margin-top: 2px !important; }
.pc-bar { height: 10px; border-radius: 99px; background: var(--chip); overflow: hidden; margin-top: 10px; }
.pc-bar i { display: block; height: 100%; background: var(--tea); border-radius: 99px; transform-origin: left; }
.pc-lab { margin: 16px 0 8px; font-weight: 600; }
.pc-seg { grid-template-columns: repeat(4, 1fr); }
.pc-seg button { min-height: 44px; }
.pc-off { color: var(--bad); background: color-mix(in srgb, var(--bad) 8%, var(--surface)); box-shadow: inset 0 0 0 2px var(--bad); }   /* « Désactiver » en rouge */
.pc-ovl, .pc-lock { position: fixed; inset: 0; z-index: 1000; overflow-y: auto; background: var(--bg); display: grid; place-items: center; padding: 24px 20px calc(24px + env(safe-area-inset-bottom)); }
.pc-pin, .pc-lock-in { display: grid; justify-items: center; gap: 14px; text-align: center; max-width: 360px; width: 100%; }
.pc-pin h2 { margin: 0; font-size: 24px; }
.pc-pin p, .pc-lock-in p { margin: 0; color: var(--mut); }
.pc-pin .pc-err { color: var(--bad); font-weight: 600; min-height: 1.4em; }
.pc-emo { font-size: 40px; line-height: 1; }
.pc-dots { display: flex; gap: 16px; }
.pc-dots i { width: 18px; height: 18px; border-radius: 50%; box-shadow: inset 0 0 0 2.5px var(--primary); }
.pc-dots i.f { background: var(--primary); }
.pc-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.pc-keys { display: grid; grid-template-columns: repeat(3, 72px); gap: 14px; }
.pc-keys button { height: 72px; border-radius: 50%; border: 0; background: var(--surface); box-shadow: var(--shadow); font: 600 26px var(--display); color: var(--ink); cursor: pointer; }
.pc-keys button:active { transform: scale(.94); }
.pc-keys .pc-ghost { background: transparent; box-shadow: none; font: 600 15px var(--body); color: var(--mut); }
.pc-foot, .pc-small { font-size: 14px; }
.pc-big { font-size: 72px; line-height: 1; }
.pc-lock-in h1 { margin: 0; font-size: 32px; }
.pc-lock-in .btn { width: 100%; margin: 0; }
html.pc-locked, html.pc-locked body { overflow: hidden; }

/* Écran d'ouverture de l'appli (index.html) */
.splash { position: fixed; inset: 0; z-index: 2000; display: grid; place-items: center; text-align: center; padding: 24px;
  background: radial-gradient(120% 90% at 50% 25%, #13735C 0%, #0B5C49 45%, #083F33 100%); color: #fff;
  transition: opacity .45s cubic-bezier(.23,1,.32,1), visibility .45s; }
.splash.out { opacity: 0; visibility: hidden; }
.sp-in { display: grid; justify-items: center; gap: 18px; }
.sp-logo { width: 104px; height: 104px; border-radius: 26px; box-shadow: 0 18px 40px -16px rgba(0,0,0,.55); animation: sp-pop .6s cubic-bezier(.23,1,.32,1) both; }
.sp-name { margin: 0; font: 800 44px/1 var(--display); letter-spacing: -0.03em; color: #fff; animation: sp-up .6s .15s cubic-bezier(.23,1,.32,1) both; }
.sp-tag { margin: 0; max-width: 18em; font: 500 18px/1.4 var(--body); color: #C6E4D8; animation: sp-up .6s .3s cubic-bezier(.23,1,.32,1) both; }
.sp-dots { display: flex; gap: 8px; margin-top: 8px; animation: sp-up .6s .45s both; }
.sp-dots i { width: 8px; height: 8px; border-radius: 50%; background: #FBE6C2; opacity: .35; animation: sp-dot 1.2s infinite; }
.sp-dots i:nth-child(2) { animation-delay: .2s; } .sp-dots i:nth-child(3) { animation-delay: .4s; }
@keyframes sp-pop { from { opacity: 0; transform: scale(.8); } to { opacity: 1; transform: none; } }
@keyframes sp-up { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes sp-dot { 0%, 100% { opacity: .35; } 50% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .sp-logo, .sp-name, .sp-tag, .sp-dots, .sp-dots i { animation: none; } }

/* Mon compte simplifié (reference/moi.html) */
.mc-hero { display: flex; align-items: center; gap: 14px; padding: 16px; border-radius: var(--r); background: var(--surface); box-shadow: var(--shadow); margin: 6px 0 12px; }
.mc-hero[hidden] { display: none; }
.mc-av { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; color: #fff; font: 800 24px var(--display); flex: none; }
.mc-id { flex: 1; min-width: 0; display: grid; gap: 6px; }
.mc-id b { font: 700 20px/1.1 var(--display); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mc-badge { justify-self: start; padding: 3px 10px; border-radius: 99px; font-size: 13px; font-weight: 600; background: color-mix(in srgb, var(--primary) 12%, var(--surface)); color: var(--primary); }
.mc-badge.free { background: var(--chip); color: var(--mut); }
.mc-badge:empty { display: none; }
.mc-edit { min-height: 44px; padding: 0 14px; border-radius: 12px; border: 0; background: var(--chip); color: var(--ink); font: 600 14px var(--body); flex: none; }
.mc-form { flex: 1; display: grid; gap: 12px; }
.mc-form > * { margin: 0; }
.mc-val { color: var(--mut); font-size: 14px; display: inline-flex; align-items: center; gap: 4px; }
.olist .ol-btn { display: flex; align-items: center; gap: 14px; width: 100%; min-height: 60px; padding: 10px 16px; border: 0; background: none; color: var(--ink); font: inherit; text-align: start; cursor: pointer; }
.olist .ol-btn svg.oi { width: 24px; height: 24px; flex: none; color: var(--primary); }
.mc-more { margin: 0 0 14px; border-radius: var(--r); background: var(--surface); box-shadow: var(--shadow); overflow: hidden; }
.mc-more summary { display: flex; align-items: center; gap: 14px; min-height: 60px; padding: 10px 16px; font-weight: 700; cursor: pointer; list-style: none; }
.mc-more summary::-webkit-details-marker { display: none; }
.mc-more summary svg.oi { width: 24px; height: 24px; color: var(--primary); flex: none; }
.mc-more summary .ot { flex: 1; }
.mc-more summary .chev { width: 20px; height: 20px; color: var(--mut); transition: transform .2s; flex: none; }
.mc-more[open] summary .chev { transform: rotate(90deg); }
.mc-more > .olist { box-shadow: none; border-radius: 0; margin: 0; border-top: 1px solid var(--line); }
.mc-beta { margin-top: 18px; }
.mc-beta .abo-beta { margin: 0; border-radius: 0; box-shadow: none; border-top: 1px solid var(--line); }

/* Interrupteur « Apparaître dans les classements » (reference/classement.html) */
.cl-sw { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px 16px; border-radius: var(--r); background: var(--surface); box-shadow: var(--shadow); cursor: pointer; }
.cl-sw-tx { display: grid; gap: 2px; }
.cl-sw-tx small { color: var(--mut); font-size: 13.5px; }
