/* VOICE everyday learning for a family: warm, encouraging, precise, never childish
   IDEA a pocket notebook from Algiers: Casbah whitewash, flag green, sea-blue doors, zellige stars
   PICTURE the Casbah cascading to the sea on the home and login screens (windows lit at night); the large study card in sessions
   COLOUR white ground, Algerian green #006233 dominant, Casbah blue #1b5fa8 support, flag red #c8102e accent
   TYPE Readex Pro for Latin and Arabic interface text, Amiri for Arabic words
   LAYOUT one 720px app column: top bar, content, bottom tabs; on a phone it fills the screen, on desktop tiled margins */

:root {
  --bg: #fff; --ink: #10201a; --mute: #56675f; --line: #e1e8e4; --soft: #f2f6f3; --card: #fff;
  --green: #006233; --green-2: #e0f1e7; --on-green: #fff; --band: #006233;
  --blue: #1b5fa8; --blue-2: #e8f0fa; --cta: #1b5fa8;
  --red: #c8102e; --red-2: #fdebee;
  --sky: #cfe5f5; --sky-2: #f5fafd; --far: #c2d8e7; --hill: #eee6d4; --house: #fff; --shade: #cdd7df; --win: #29445f;
  --sea: #1d6db3; --sea-2: #7db1de; --tree: #1f7a47;
  --edge: #ecf2ee; --h1: #bfe3cd; --h2: #5db488; --h3: #006233;
  --sb: env(safe-area-inset-bottom, 0px); --st: env(safe-area-inset-top, 0px);
  --ui: 'Readex Pro', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --arf: 'Amiri', 'Noto Naskh Arabic', 'Geeza Pro', 'Traditional Arabic', serif;
  --star: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='%23fff' fill-opacity='.9' d='M8 2L9.76 3.76L12.24 3.76L12.24 6.24L14 8L12.24 9.76L12.24 12.24L9.76 12.24L8 14L6.24 12.24L3.76 12.24L3.76 9.76L2 8L3.76 6.24L3.76 3.76L6.24 3.76Z'/%3E%3C/svg%3E");
  --tile: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 40'%3E%3Cpath fill='%23fff' fill-opacity='.08' transform='translate(12 12)' d='M8 2L9.76 3.76L12.24 3.76L12.24 6.24L14 8L12.24 9.76L12.24 12.24L9.76 12.24L8 14L6.24 12.24L3.76 12.24L3.76 9.76L2 8L3.76 6.24L3.76 3.76L6.24 3.76Z'/%3E%3C/svg%3E");
  --edge-tile: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 40'%3E%3Cpath fill='%23006233' fill-opacity='.07' transform='translate(12 12)' d='M8 2L9.76 3.76L12.24 3.76L12.24 6.24L14 8L12.24 9.76L12.24 12.24L9.76 12.24L8 14L6.24 12.24L3.76 12.24L3.76 9.76L2 8L3.76 6.24L3.76 3.76L6.24 3.76Z'/%3E%3C/svg%3E");
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme=light]) {
    --bg: #0c1712; --ink: #ecf3ef; --mute: #9db1a7; --line: #243a30; --soft: #12231b; --card: #13241c;
    --green: #3cc07c; --green-2: #12341f; --on-green: #04170c; --band: #0f4a2c;
    --blue: #84b9f2; --blue-2: #13263a; --cta: #1f5592;
    --red: #ff6f86; --red-2: #3b141c;
    --sky: #07172a; --sky-2: #10263c; --far: #15293b; --hill: #1b2a2b; --house: #c6d0da; --shade: #7c8b9a; --win: #ffd166;
    --sea: #0b2f52; --sea-2: #2d5f8f; --tree: #1b5a39;
    --edge: #08110d; --h1: #1d4a31; --h2: #2b8a56; --h3: #3cc07c;
    --edge-tile: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 40'%3E%3Cpath fill='%23fff' fill-opacity='.04' transform='translate(12 12)' d='M8 2L9.76 3.76L12.24 3.76L12.24 6.24L14 8L12.24 9.76L12.24 12.24L9.76 12.24L8 14L6.24 12.24L3.76 12.24L3.76 9.76L2 8L3.76 6.24L3.76 3.76L6.24 3.76Z'/%3E%3C/svg%3E");
    color-scheme: dark;
  }
}
:root[data-theme=dark] {
  --bg: #0c1712; --ink: #ecf3ef; --mute: #9db1a7; --line: #243a30; --soft: #12231b; --card: #13241c;
  --green: #3cc07c; --green-2: #12341f; --on-green: #04170c; --band: #0f4a2c;
  --blue: #84b9f2; --blue-2: #13263a; --cta: #1f5592;
  --red: #ff6f86; --red-2: #3b141c;
  --sky: #07172a; --sky-2: #10263c; --far: #15293b; --hill: #1b2a2b; --house: #c6d0da; --shade: #7c8b9a; --win: #ffd166;
  --sea: #0b2f52; --sea-2: #2d5f8f; --tree: #1b5a39;
  --edge: #08110d; --h1: #1d4a31; --h2: #2b8a56; --h3: #3cc07c;
  --edge-tile: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 40'%3E%3Cpath fill='%23fff' fill-opacity='.04' transform='translate(12 12)' d='M8 2L9.76 3.76L12.24 3.76L12.24 6.24L14 8L12.24 9.76L12.24 12.24L9.76 12.24L8 14L6.24 12.24L3.76 12.24L3.76 9.76L2 8L3.76 6.24L3.76 3.76L6.24 3.76Z'/%3E%3C/svg%3E");
  color-scheme: dark;
}

* { box-sizing: border-box; min-width: 0; }
html { background: var(--edge); -webkit-text-size-adjust: 100%; scroll-padding-top: 72px; }
@media (min-width: 760px) { html { background-image: var(--edge-tile); background-size: 40px 40px; } }
body { margin: 0 auto; max-width: 720px; min-height: 100vh; min-height: 100dvh; background: var(--bg); color: var(--ink); font: 16px/1.55 var(--ui); overflow-x: clip; -webkit-tap-highlight-color: transparent; }
@media (min-width: 760px) { body { box-shadow: 0 0 0 1px var(--line); } }
h1, h2, h3 { margin: 0; line-height: 1.1; letter-spacing: -.02em; text-wrap: balance; }
h1 { font-size: clamp(28px, 7vw, 36px); font-weight: 700; }
h2 { font-size: 21px; font-weight: 600; margin: 30px 0 12px; }
h3 { font-size: 17px; font-weight: 600; }
p { margin: 0; }
a { color: inherit; }
code { font-size: .92em; background: var(--soft); padding: 1px 5px; border-radius: 6px; overflow-wrap: anywhere; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[lang=ar] { font-family: var(--arf); }
.ic { width: 24px; height: 24px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.ic.fill { fill: currentColor; stroke: none; }
.muted { color: var(--mute); font-size: 15px; }
.lead { color: var(--mute); margin-top: 6px; max-width: 36em; }
.boot { padding: 40px 20px; color: var(--mute); }

/* Barre du haut et onglets */
.bar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 8px; min-height: calc(58px + var(--st)); padding: var(--st) 12px 0; background: var(--bg); border-bottom: 1px solid var(--line); }
.bar:empty { display: none; }
.brand { display: flex; align-items: center; gap: 9px; padding: 6px 4px; text-decoration: none; font-weight: 700; font-size: 19px; white-space: nowrap; }
.logo { width: 32px; height: 32px; border-radius: 9px; flex: none; }
.brand [lang=ar] { color: var(--green); font-size: 21px; }
.pills { margin-left: auto; display: flex; gap: 6px; }
.pill { display: inline-flex; align-items: center; gap: 5px; height: 34px; padding: 0 11px; border-radius: 99px; background: var(--soft); font-size: 15px; font-variant-numeric: tabular-nums; white-space: nowrap; }
/* Petits écrans : le mot arabe de l'en-tête cède la place aux compteurs. */
@media (max-width: 374px) { .brand [lang=ar] { display: none; } .pill { padding: 0 9px; } }
.pill .ic { width: 18px; height: 18px; color: var(--mute); }
.pill.st.on .ic { color: var(--red); }
.pill.xp .ic { color: var(--green); }
.tabs { position: fixed; z-index: 20; bottom: 0; left: 50%; transform: translateX(-50%); width: min(720px, 100%); display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); padding: 6px 4px calc(6px + var(--sb)); background: var(--bg); border-top: 1px solid var(--line); }
.tabs:empty { display: none; }
.tabs a { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; min-height: 54px; padding: 5px 0 3px; text-decoration: none; color: var(--mute); font-size: 13px; font-weight: 500; }
.tabs .ic { width: 26px; height: 26px; padding: 3px 12px; box-sizing: content-box; border-radius: 99px; }
.tabs a.on { color: var(--green); }
.tabs a.on .ic { background: var(--green-2); }
.tabs em { position: absolute; top: 1px; left: calc(50% + 8px); min-width: 21px; height: 21px; padding: 0 6px; border-radius: 99px; background: var(--red); color: #fff; font: 600 13px/21px var(--ui); font-style: normal; text-align: center; }
main { display: block; padding-bottom: calc(92px + var(--sb)); }
body.in-session .bar, body.in-session .tabs, body.gate .bar, body.gate .tabs { display: none; }
body.in-session main, body.gate main { padding-bottom: 0; }
.pad { padding: 20px 16px 8px; }
.pad > h2:first-child, .cta + h2 { margin-top: 8px; }
.cta + h2 { margin-top: 24px; }
@media (min-width: 600px) { .pad { padding: 28px 28px 8px; } }
.iconbtn { display: inline-grid; place-items: center; width: 44px; height: 44px; flex: none; border: 0; border-radius: 12px; background: none; color: inherit; cursor: pointer; }
.iconbtn:hover { background: var(--soft); }
.iconbtn.light { color: #fff; }
.iconbtn.light:hover { background: rgba(255, 255, 255, .14); }
.backl { display: inline-flex; align-items: center; gap: 4px; margin: -6px 0 10px -8px; padding: 8px; min-height: 44px; color: var(--green); text-decoration: none; font-weight: 600; }

/* Boutons et champs */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 50px; padding: 0 20px; border: 2px solid transparent; border-radius: 14px; background: var(--green); color: var(--on-green); font-weight: 600; font-size: 16px; line-height: 1.2; text-align: center; text-decoration: none; cursor: pointer; }
.btn:hover { filter: brightness(1.07); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .6; cursor: default; }
.btn.wait { cursor: progress; }
.btn .ic { width: 20px; height: 20px; }
.btn.ghost { background: transparent; color: var(--green); border-color: var(--green); }
.btn.alt { background: var(--cta); color: #fff; }
.btn.no { background: var(--red-2); color: var(--red); }
.btn.danger { background: var(--red); color: #fff; }
.btn.danger-o { background: transparent; color: var(--red); border-color: var(--red); }
.btn.wide { width: 100%; }
.btn.sm { min-height: 44px; padding: 0 14px; font-size: 15px; }
.row { display: flex; flex-wrap: wrap; gap: 10px; }
.row > .btn { flex: 1 1 170px; }
.field { display: grid; gap: 6px; margin-top: 14px; }
.field label { font-weight: 600; font-size: 15px; }
.field small { color: var(--mute); font-size: 13px; }
.in { width: 100%; height: 50px; padding: 0 14px; border: 2px solid var(--line); border-radius: 14px; background: var(--card); font-size: 16px; }
.in:focus { border-color: var(--green); outline: none; }
.in.big { height: 58px; font-size: 19px; }
.in.mono { font: 14px/1.2 ui-monospace, Consolas, monospace; height: 46px; }
.in.auto { width: auto; }
.in.ok { border-color: var(--green); background: var(--green-2); }
.in.ko { border-color: var(--red); background: var(--red-2); }
.err { color: var(--red); font-size: 15px; font-weight: 500; min-height: 1.4em; margin: 10px 0 4px; }
.err:empty { margin: 4px 0; }
.msg { padding: 12px 14px; border-radius: 14px; background: var(--blue-2); margin: 12px 0; }
.line { display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 62px; padding: 8px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.line > span { display: grid; gap: 2px; font-weight: 500; }
.line small { color: var(--mute); font-size: 14px; font-weight: 400; line-height: 1.35; }
.sw { appearance: none; -webkit-appearance: none; position: relative; flex: none; width: 52px; height: 32px; margin: 0; border-radius: 99px; background: var(--line); cursor: pointer; transition: background .2s; }
.sw::after { content: ''; position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .3); transition: transform .2s; }
.sw:checked { background: var(--green); }
.sw:checked::after { transform: translateX(20px); }
.sw:disabled { opacity: .5; }
.two { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 14px; }
.panel { margin-top: 18px; padding: 18px; border-radius: 20px; background: var(--soft); }
.panel h2 { margin: 0 0 4px; }
.panel .btn[type=submit] { margin-top: 8px; }
.chip { display: inline-flex; align-items: center; height: 28px; padding: 0 11px; border-radius: 99px; background: var(--green); color: var(--on-green); font-size: 13px; font-weight: 600; white-space: nowrap; }
.chip.ok { background: var(--green-2); color: var(--green); }
.chip.wait { background: var(--blue-2); color: var(--blue); }
.chip.off { background: var(--soft); color: var(--mute); }

/* Écrans d’accès */
.gatepage { min-height: 100vh; min-height: 100dvh; background: linear-gradient(180deg, var(--sky), var(--sky-2) 46%, var(--bg) 46.1%); }
.gate-top { padding: calc(36px + var(--st)) 20px 6px; }
.gate-brand { display: flex; align-items: center; gap: 12px; }
.gate-brand .logo { width: 48px; height: 48px; border-radius: 13px; }
.gate-brand h1 { font-size: clamp(36px, 10vw, 48px); }
.gate-brand h1 [lang=ar] { color: var(--green); font-weight: 700; margin-left: 4px; }
.gate-top p { margin-top: 8px; color: var(--mute); font-size: 17px; }
.gform { max-width: 460px; margin: 0 auto; padding: 22px 20px calc(36px + var(--sb)); background: var(--bg); }
.gform h2 { margin: 0 0 6px; }
.gform > p { margin-top: 6px; }
.gform .btn.wide { margin-top: 10px; }
.gform .muted { margin-top: 16px; }
.idbox { display: grid; gap: 2px; margin-top: 14px; padding: 12px 14px; border-radius: 14px; background: var(--green-2); }
.idbox b { font-size: 19px; color: var(--green); }
.idbox small { color: var(--mute); }

/* Accueil */
.hero { background: linear-gradient(180deg, var(--sky), var(--sky-2)); overflow: hidden; }
.hero-top { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; align-items: start; padding: 22px 16px 0; }
@media (min-width: 600px) { .hero-top { padding: 28px 28px 0; } }
.greet h1 { font-size: clamp(28px, 7.4vw, 42px); }
.hello { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.hello [lang=ar] { font-size: 27px; line-height: 1.3; color: var(--green); }
.greet .fr { color: var(--mute); }
.goal { display: grid; justify-items: center; gap: 2px; font-size: 13px; color: var(--mute); text-align: center; }
.scene { display: block; width: 100%; height: clamp(120px, 26vw, 190px); margin-top: 6px; }
.scene .far { fill: var(--far); }
.scene .hl { fill: var(--hill); }
.scene .hf { fill: var(--house); }
.scene .hs { fill: var(--shade); }
.scene .hw { fill: var(--win); }
.scene .hd { fill: var(--cta); }
.scene .gt { fill: var(--green); }
.scene .tr { fill: var(--tree); }
.scene .sea { fill: var(--sea); }
.scene .wave { fill: none; stroke: var(--sea-2); stroke-width: 1.6; stroke-linecap: round; }
.ring { width: 78px; height: 78px; }
.ring.big { width: 150px; height: 150px; }
.ring .rt { fill: none; stroke: var(--line); stroke-width: 7; }
.hero .ring .rt { stroke: var(--bg); stroke-opacity: .75; }
.ring .rv { fill: none; stroke: var(--green); stroke-width: 7; stroke-linecap: round; }
.ring text { text-anchor: middle; fill: var(--ink); font-family: var(--ui); }
.ring .r1 { font-size: 18px; font-weight: 700; }
.ring .r2 { font-size: 12.5px; fill: var(--mute); }
.cta { display: flex; align-items: center; gap: 14px; margin-bottom: 6px; padding: 16px; border-radius: 18px; background: var(--cta); color: #fff; text-decoration: none; }
.cta b { display: block; font-size: 18px; }
.cta small { display: block; opacity: .92; font-size: 14px; line-height: 1.35; }
.cta > span:first-child { min-width: 0; }
.cta .go { flex-shrink: 0; margin-left: auto; padding: 11px 16px; border-radius: 12px; background: #fff; color: #1b5fa8; font-weight: 600; white-space: nowrap; }
.path { position: relative; list-style: none; margin: 0; padding: 0; }
.path::before { content: ''; position: absolute; left: 38px; top: 38px; bottom: 38px; width: 4px; border-radius: 2px; background: var(--line); }
.path a { position: relative; display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 10px 12px; border-radius: 18px; text-decoration: none; }
.path a:hover { background: var(--soft); }
.badge { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; border: 3px solid var(--line); background: var(--bg); color: var(--green); font: 700 20px/1 var(--arf); }
.badge.sm { width: 46px; height: 46px; font-size: 17px; }
.path .done .badge { background: var(--green); border-color: var(--green); color: var(--on-green); }
.path .cur .badge { border-color: var(--green); }
.path .cur a { background: var(--green-2); }
.ut b { display: block; font-size: 17px; font-weight: 600; }
.ut small { display: block; margin-bottom: 7px; color: var(--mute); font-size: 14px; line-height: 1.35; }
.pct { color: var(--mute); font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.meter { display: block; height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; }
.meter i { display: block; height: 100%; border-radius: 3px; background: var(--green); transition: width .4s; }

/* Leçon */
.uhead { position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 18px; align-items: center; padding: 10px 16px 26px; background: var(--band) var(--tile); background-size: 40px 40px; color: #fff; }
@media (min-width: 600px) { .uhead { padding: 14px 28px 30px; } }
.uhead .iconbtn { grid-column: 1 / -1; margin-left: -8px; }
.uar { font: 700 clamp(52px, 15vw, 80px)/1.15 var(--arf); }
.uinfo h1 { color: #fff; }
.uinfo p { opacity: .9; margin: 4px 0 10px; }
.uinfo .meter { background: rgba(255, 255, 255, .25); }
.uinfo .meter i { background: #fff; }
.uinfo small { display: block; margin-top: 6px; font-size: 14px; opacity: .9; }
.tip { margin-top: 20px; padding: 16px 18px; border-radius: 18px; background: var(--blue-2); }
.tip h3 { margin-bottom: 6px; color: var(--blue); }
.words { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.words li { border-bottom: 1px solid var(--line); }
.words summary, .words .row0 { display: grid; grid-template-columns: minmax(0, 1fr) auto 44px; gap: 12px; align-items: center; min-height: 64px; padding: 10px 2px; }
.words summary { cursor: pointer; list-style: none; }
.words summary::-webkit-details-marker { display: none; }
.wd .lat { display: block; font-size: 17px; font-weight: 600; }
.wd .fr { display: block; color: var(--mute); font-size: 15px; line-height: 1.35; }
details[open] > summary .lat { color: var(--green); }
.tag { display: inline-block; margin-top: 3px; color: var(--blue); font-size: 13px; }
.words .arw { color: var(--green); font-size: 24px; line-height: 1.35; text-align: right; }
.dots { display: flex; gap: 4px; margin-top: 6px; }
.dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--line); }
.dots i.on { background: var(--green); }
.more { padding: 0 2px 16px; }
.ex { display: grid; gap: 2px; }
.ex b { font-weight: 600; }
.ex span { color: var(--mute); }
.note { margin-top: 6px; color: var(--mute); font-size: 15px; }
.play { display: inline-grid; place-items: center; width: 44px; height: 44px; flex: none; border: 0; border-radius: 50%; background: var(--green-2); color: var(--green); cursor: pointer; }
.play .ic { width: 22px; height: 22px; }
.play.tts { background: var(--soft); color: var(--mute); }
.play.on { background: var(--green); color: var(--on-green); }
.play.lg { width: 56px; height: 56px; }
.play.lg .ic { width: 28px; height: 28px; }
.play-sp { width: 44px; }

/* Sessions : cartes et quiz */
.sess { display: flex; flex-direction: column; gap: 18px; min-height: 100vh; min-height: 100dvh; padding: calc(10px + var(--st)) 16px calc(20px + var(--sb)); }
@media (min-width: 600px) { .sess { padding-inline: 28px; } }
.sess.fbopen { padding-bottom: 300px; }
.sp { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 10px; align-items: center; }
.sp .meter { height: 10px; border-radius: 5px; }
.spn { color: var(--mute); font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }
.card { flex: 1; display: grid; min-height: 330px; max-height: 560px; perspective: 1400px; cursor: pointer; outline: none; }
.card:focus-visible .face { outline: 3px solid var(--blue); outline-offset: 2px; }
.face { grid-area: 1 / 1; position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 42px 22px 26px; border: 1.5px solid var(--line); border-radius: 26px; background: var(--card); box-shadow: 0 14px 30px -20px rgba(0, 40, 20, .45); text-align: center; overflow: hidden; backface-visibility: hidden; -webkit-backface-visibility: hidden; transition: transform .55s cubic-bezier(.2, .75, .25, 1); }
.face::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 16px; background: var(--band) var(--star) repeat-x center / 16px 16px; }
.back { transform: rotateY(180deg); }
.card.flip .front { transform: rotateY(-180deg); }
.card.flip .back { transform: rotateY(0deg); }
.card:not(.flip) .back, .card.flip .front { pointer-events: none; }
.face .lat.big { color: var(--ink); font-size: clamp(32px, 9vw, 46px); font-weight: 600; line-height: 1.1; }
.face .arw.big { color: var(--green); font-size: clamp(40px, 11vw, 58px); line-height: 1.45; }
.face .fr.big { font-size: clamp(26px, 7vw, 36px); font-weight: 600; line-height: 1.15; }
.face .lat { color: var(--green); font-size: 19px; font-weight: 600; }
.face .ex { max-width: 34em; padding: 12px 14px; border-radius: 14px; background: var(--soft); }
.face .note { max-width: 34em; }
.hint { margin-top: 6px; color: var(--mute); font-size: 14px; }
.new { position: absolute; top: 28px; left: 18px; padding: 3px 10px; border-radius: 99px; background: var(--blue-2); color: var(--blue); font-size: 13px; font-weight: 600; }
.btn.rec { background: var(--red); color: #fff; border-color: var(--red); }
.grade { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grade .wide { grid-column: 1 / -1; }
.ql { color: var(--mute); font-size: 15px; font-weight: 600; }
.pr { font-size: clamp(26px, 7vw, 34px); font-weight: 600; line-height: 1.2; }
.pr.lat { color: var(--green); }
.pr-ar { margin-top: 4px; color: var(--green); font-size: 32px; line-height: 1.5; }
.pr-ar.big { font-size: clamp(46px, 13vw, 66px); }
.bigplay { display: grid; place-items: center; width: 108px; height: 108px; margin: 6px auto; border: 0; border-radius: 50%; background: var(--green); color: var(--on-green); cursor: pointer; box-shadow: 0 10px 24px -12px rgba(0, 60, 30, .6); }
.bigplay .ic { width: 46px; height: 46px; }
.bigplay.on { background: var(--cta); }
.opts { display: grid; gap: 10px; }
@media (min-width: 600px) { .opts { grid-template-columns: 1fr 1fr; } }
.opt { display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 10px 14px; border: 2px solid var(--line); border-radius: 16px; background: var(--card); font-size: 17px; line-height: 1.3; text-align: left; cursor: pointer; }
.opt:hover:not(:disabled) { border-color: var(--green); }
.opt:disabled { cursor: default; opacity: 1; }
.opt kbd { display: grid; place-items: center; flex: none; width: 28px; height: 28px; border: 1.5px solid var(--line); border-radius: 8px; color: var(--mute); font: 600 13px var(--ui); }
.opt .lat { font-weight: 600; }
.opt.ok { border-color: var(--green); background: var(--green-2); }
.opt.ok kbd { border-color: var(--green); background: var(--green); color: var(--on-green); }
.opt.ko { border-color: var(--red); background: var(--red-2); }
.wf .row { margin-top: 12px; }
.fbx { position: fixed; z-index: 30; left: 50%; bottom: 0; transform: translateX(-50%); width: min(720px, 100%); display: grid; gap: 12px; padding: 18px 16px calc(16px + var(--sb)); border-top: 2px solid; animation: up .25s ease-out; }
.fbx.good { border-color: var(--green); background: var(--green-2); }
.fbx.bad { border-color: var(--red); background: var(--red-2); }
.fbt { display: grid; gap: 8px; max-height: 40vh; overflow: auto; }
.fbx .h { font-size: 21px; }
.good .h { color: var(--green); }
.bad .h { color: var(--red); }
.typed { color: var(--mute); }
.ans { display: flex; align-items: center; gap: 12px; }
.ans .lat { font-size: 18px; }
.ans .arx { font-size: 22px; color: var(--green); }
.ans .fr { display: block; }
@keyframes up { from { transform: translate(-50%, 100%); } to { transform: translate(-50%, 0); } }
.end { gap: 14px; }
.endc { display: grid; justify-items: center; gap: 10px; padding: 10px 0; text-align: center; }
.end .row { margin-top: auto; }

/* Révisions */
.deckw { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; align-items: center; margin-top: 16px; padding: 20px; border-radius: 24px; background: var(--soft); }
@media (max-width: 520px) { .deckw { grid-template-columns: 1fr; } }
.deck { position: relative; height: 210px; }
.dk { position: absolute; inset: 16px 22px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding-top: 14px; border: 1.5px solid var(--line); border-radius: 20px; background: var(--card); box-shadow: 0 10px 24px -16px rgba(0, 40, 20, .45); overflow: hidden; }
.dk::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 14px; background: var(--band) var(--star) repeat-x center / 14px 14px; }
.d3 { transform: rotate(-8deg) translate(-10px, 6px); }
.d2 { transform: rotate(5deg) translate(10px, 2px); }
.d1 .arw { color: var(--green); font-size: 42px; line-height: 1.4; }
.d1 .lat { font-weight: 600; font-size: 18px; }
.khat { width: 64px; height: 64px; fill: var(--green-2); }
.decktx { display: grid; gap: 8px; justify-items: start; }
.bign { font-size: 64px; font-weight: 700; line-height: 1; color: var(--green); font-variant-numeric: tabular-nums; }
.decktx small { color: var(--mute); font-size: 14px; }
.boxes { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.bx { position: relative; display: grid; align-content: end; justify-items: center; gap: 1px; height: 150px; padding: 10px 4px; border-radius: 14px; background: var(--soft); text-align: center; overflow: hidden; }
.bx .fill { position: absolute; left: 0; right: 0; bottom: 0; background: var(--h1); }
.bx > :not(.fill) { position: relative; }
.bx b { font-size: 24px; font-variant-numeric: tabular-nums; }
.bx span { font-size: 13px; font-weight: 600; }
.bx small { color: var(--mute); font-size: 13px; line-height: 1.2; }
.boxes + .muted { margin-top: 12px; }
.tools { display: grid; gap: 10px; margin: 18px 0 6px; }
.tool { display: grid; grid-template-columns: 44px minmax(0, 1fr) 24px; gap: 12px; align-items: center; margin-top: 14px; padding: 14px; border-radius: 18px; background: var(--soft); text-decoration: none; }
.tools .tool { margin-top: 0; }
.tool > .ic:first-child { width: 44px; height: 44px; padding: 9px; border-radius: 12px; background: var(--green-2); color: var(--green); }
.tool b { display: block; }
.tool small { color: var(--mute); font-size: 14px; }
.tool > .ic:last-child { color: var(--mute); }

/* Lexique */
.lexbar { position: sticky; top: calc(58px + var(--st)); z-index: 5; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 220px); gap: 8px; margin: 12px -16px 0; padding: 8px 16px; background: var(--bg); }
@media (max-width: 520px) { .lexbar { grid-template-columns: 1fr; } }
.legend { margin: 10px 0; border-radius: 16px; background: var(--soft); }
.legend summary { padding: 14px 16px; min-height: 48px; font-weight: 600; color: var(--blue); cursor: pointer; }
.lg { display: grid; gap: 2px; padding: 0 16px 14px; }
.lg div { display: grid; grid-template-columns: 40px 30px minmax(0, 1fr); gap: 10px; align-items: baseline; padding: 8px 0; border-top: 1px solid var(--line); }
.lg b { color: var(--green); font-size: 20px; }
.lg [lang=ar] { font-size: 24px; }
.lg small { display: block; color: var(--mute); font-size: 14px; }
.count { margin: 10px 0 8px; color: var(--mute); font-size: 14px; }

/* Famille et membres */
.fam { list-style: none; margin: 18px 0 0; padding: 0; display: grid; gap: 10px; }
.fam li { display: grid; grid-template-columns: 52px minmax(0, 1fr) auto auto; gap: 14px; align-items: center; padding: 14px; border-radius: 18px; background: var(--soft); }
.fam li.me { background: var(--green-2); }
.fam li.muted { display: block; background: none; padding: 0; }
@media (max-width: 520px) { .fam li { grid-template-columns: 52px minmax(0, 1fr) auto; } .fam .fs:last-child { grid-column: 2 / -1; justify-items: start; display: flex; gap: 8px; align-items: center; } }
.av { display: inline-grid; place-items: center; width: 40px; height: 40px; flex: none; border-radius: 50%; color: #fff; font-weight: 700; font-size: 17px; }
.av.big { width: 52px; height: 52px; font-size: 22px; }
.fm b { display: block; font-size: 17px; }
.fm small, .un small { color: var(--mute); font-weight: 400; }
.strip { display: flex; gap: 4px; margin-top: 7px; }
.strip i { width: 16px; height: 16px; border-radius: 4px; background: var(--line); }
.strip .l1, .heat .l1 { background: var(--h1); }
.strip .l2, .heat .l2 { background: var(--h2); }
.strip .l3, .heat .l3 { background: var(--h3); }
.fs { display: grid; justify-items: end; text-align: right; }
.fs b { font-size: 20px; font-variant-numeric: tabular-nums; }
.fs small { color: var(--mute); font-size: 13px; line-height: 1.25; }
.fl { display: inline-flex; align-items: center; gap: 3px; }
.fl .ic { width: 18px; height: 18px; color: var(--red); }
.ulist { display: grid; gap: 10px; }
.ucard { border-radius: 18px; background: var(--soft); }
.ucard summary { display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px 14px; min-height: 64px; list-style: none; cursor: pointer; }
.ucard summary::-webkit-details-marker { display: none; }
.un b { display: block; }
.un small { display: block; font-size: 14px; }
.ubody { padding: 0 14px 16px; }
.ubody .row { margin-top: 12px; }
.linkcard { display: grid; gap: 10px; margin-top: 14px; padding: 14px; border-radius: 16px; background: var(--bg); border: 2px dashed var(--green); }
.confirm { margin-top: 12px; padding: 14px; border-radius: 16px; background: var(--red-2); }
.confirm .row { margin-top: 10px; }
.checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.checks li { display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: 10px; padding: 12px 14px; border-radius: 16px; background: var(--soft); }
.checks li.ok .ic { color: var(--green); }
.checks li.bad { background: var(--red-2); }
.checks li.bad .ic { color: var(--red); }
.checks small { display: block; color: var(--mute); font-size: 14px; }

/* Studio */
.slist { list-style: none; margin: 18px 0 0; padding: 0; }
.slist a { display: grid; grid-template-columns: 46px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 10px 4px; border-bottom: 1px solid var(--line); text-decoration: none; }
.slist .ut b { margin-bottom: 6px; }
.recp { position: sticky; top: calc(58px + var(--st)); z-index: 4; margin: 16px -16px 14px; padding: 16px; background: var(--bg); border-bottom: 1px solid var(--line); display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 16px; align-items: center; }
@media (min-width: 600px) { .recp { margin-inline: -28px; padding-inline: 28px; } }
.recw { display: grid; gap: 2px; }
.recw .lat { font-size: 26px; font-weight: 700; color: var(--green); }
.recw .arw { font-size: 30px; line-height: 1.3; }
.recw .fr { font-size: 17px; }
.recctl { display: grid; justify-items: center; gap: 6px; text-align: center; max-width: 220px; }
.recctl .row { flex-wrap: nowrap; }
.recctl .row .btn { flex: 0 0 auto; padding: 0 14px; }
.recbtn { position: relative; display: grid; place-items: center; width: 84px; height: 84px; border: 0; border-radius: 50%; background: var(--red); color: #fff; cursor: pointer; box-shadow: 0 10px 22px -12px rgba(150, 0, 30, .7); }
.recbtn .ic { width: 36px; height: 36px; }
.recbtn.play2 { background: var(--green); }
.recbtn:disabled { background: var(--mute); }
.recbtn.on::after { content: ''; position: absolute; inset: -6px; border-radius: 50%; border: 3px solid var(--red); animation: pulse 1.2s ease-out infinite; }
@keyframes pulse { from { transform: scale(1); opacity: .9; } to { transform: scale(1.25); opacity: 0; } }
.rtime { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--red); }
.recfoot { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding-top: 8px; }
.recfoot .cur { display: flex; align-items: center; gap: 8px; margin-right: auto; }
.recfoot .cur small { color: var(--mute); font-size: 14px; }
.recfoot > small { margin-right: auto; }
.file { position: relative; overflow: hidden; }
.file input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
@media (max-width: 520px) { .recp { grid-template-columns: 1fr; } .recctl { max-width: none; } }
.studio li.sel { background: var(--green-2); }
.srow { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 12px; align-items: center; width: 100%; min-height: 64px; padding: 10px 6px; border: 0; background: none; text-align: left; cursor: pointer; }
.srow .arw { color: var(--green); font-size: 22px; }
@media (max-width: 420px) { .srow .arw { display: none; } }

/* Moi */
.mehead { display: flex; align-items: center; gap: 14px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(9.5em, 1fr)); gap: 10px; margin-top: 18px; }
.tile { padding: 14px 16px; border-radius: 18px; background: var(--soft); }
.tile b { display: block; font-size: 30px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.tile span { color: var(--mute); font-size: 14px; }
.heatw { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 6px; }
.hdays { display: grid; grid-template-rows: repeat(7, 1fr); gap: 3px; color: var(--mute); font-size: 13px; line-height: 1; align-items: center; }
.heat { display: grid; grid-template-rows: repeat(7, auto); grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 3px; }
.heat i { aspect-ratio: 1; border-radius: 4px; background: var(--line); }
.dist { display: flex; height: 16px; border-radius: 8px; overflow: hidden; background: var(--line); }
.dist i { display: block; height: 100%; }
.leg { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 10px; color: var(--mute); font-size: 14px; }
.leg span::before { content: ''; display: inline-block; width: 10px; height: 10px; margin-right: 6px; border-radius: 3px; background: var(--c); }
.inst { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; margin-top: 24px; background: var(--blue-2); }
.inst > div { flex: 1 1 240px; }
.inst p { color: var(--mute); margin-top: 4px; }
/* Bandeau d'installation de l'accueil et audios hors connexion (page Moi) */
.instb { display: flex; align-items: flex-start; gap: 14px; margin: 0 0 18px; background: var(--blue-2); }
.instb > .ic { width: 30px; height: 30px; margin-top: 2px; color: var(--blue); }
.instb > div { flex: 1; min-width: 0; }
.instb h3 { color: var(--blue); }
.instb p { color: var(--mute); margin-top: 6px; }
.instb .row { margin-top: 12px; }
.instb .row > .btn { flex: 0 1 auto; }
.isteps { margin: 8px 0 0; padding-left: 22px; }
.isteps li { margin: 6px 0; }
.isteps .ic { width: 20px; height: 20px; margin: 0 4px 0 2px; vertical-align: -4px; color: var(--blue); }
.offa p { margin-top: 6px; }
.offa .btn { margin-top: 14px; }
.offa .meter { margin-top: 12px; height: 8px; }
.okline { display: flex; align-items: flex-start; gap: 8px; }
.okline .ic { color: var(--green); }
.set { border-top: 1px solid var(--line); }
#logout { margin: 26px 0 10px; }

/* Dialogues : liste, page de scène */
.stars { display: inline-flex; gap: 2px; flex: none; }
.stars .ic { width: 18px; height: 18px; color: var(--line); }
.stars .ic.on { color: var(--green); }
.uinfo .stars .ic { color: rgba(255, 255, 255, .3); }
.uinfo .stars .ic.on { color: #fff; }
.endc .stars .ic { width: 30px; height: 30px; }
.slist.dl li.cur a { margin-inline: -8px; padding-inline: 12px; border-radius: 16px; border-bottom-color: transparent; background: var(--green-2); }
.tool .badge.sm { width: 44px; height: 44px; font-size: 16px; }
.gq .muted { margin-top: 6px; }
.gq .row { margin-top: 14px; }
.gq .row > .btn { flex: 1 1 140px; }
.gline { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 14px; margin-top: 18px; }
.gline > span { color: var(--mute); font-size: 15px; }
.seg { display: inline-flex; padding: 4px; border-radius: 99px; background: var(--soft); }
.seg button { min-height: 40px; padding: 0 16px; border: 0; border-radius: 99px; background: none; color: var(--mute); font-weight: 600; font-size: 15px; cursor: pointer; }
.seg button[aria-pressed=true] { background: var(--green); color: var(--on-green); }
.levels { list-style: none; margin: 18px 0 0; padding: 0; display: grid; gap: 10px; }
.lvl { display: grid; grid-template-columns: 44px minmax(0, 1fr) 24px; gap: 12px; align-items: center; padding: 14px; border-radius: 18px; background: var(--soft); text-decoration: none; }
.lvl .ln { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--green-2); color: var(--green); font-weight: 700; font-size: 18px; }
.lvl .ln .ic { width: 22px; height: 22px; }
.lvl.done .ln { background: var(--green); color: var(--on-green); }
.lvl b { display: block; }
.lvl small { display: block; color: var(--mute); font-size: 14px; line-height: 1.35; }
.lvl > .ic:last-child { color: var(--mute); }
.lvl.locked { opacity: .65; }
.lvl.locked .ln { background: var(--line); color: var(--mute); }
.script { margin-top: 20px; }
.script .chat { padding: 4px 14px 16px; }

/* Dialogues : la conversation */
.dlg { gap: 12px; padding-bottom: 0; }
.frt { height: 36px; padding: 0 12px; border: 2px solid var(--line); border-radius: 99px; background: none; color: var(--mute); font-weight: 700; font-size: 14px; cursor: pointer; }
.frt[aria-pressed=true] { border-color: var(--blue); background: var(--blue-2); color: var(--blue); }
.dhead { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.dhead b { font-size: 19px; }
.dhead span { color: var(--mute); font-size: 15px; }
.chat { flex: 1; display: flex; flex-direction: column; gap: 14px; }
.bub { display: grid; gap: 4px; max-width: min(88%, 540px); animation: pop .25s ease-out; }
.bub.them { align-self: flex-start; }
.bub.me { align-self: flex-end; }
.who { padding: 0 8px; color: var(--mute); font-size: 13px; font-weight: 600; }
.me .who { text-align: right; }
.bt { display: flex; align-items: flex-start; gap: 10px; padding: 10px 14px 12px 10px; border-radius: 20px; background: var(--soft); }
.them .bt { border-top-left-radius: 6px; }
.me .bt { border-top-right-radius: 6px; background: var(--green-2); }
.bt .play { width: 40px; height: 40px; margin-top: 2px; }
.me .bt .play { background: var(--bg); }
.btx { display: grid; gap: 1px; min-width: 0; }
.btx .lat { font-size: 18px; font-weight: 600; line-height: 1.35; }
.arb { color: var(--green); font-size: 22px; line-height: 1.55; }
.frb { color: var(--mute); font-size: 15px; line-height: 1.35; }
.nofr .frb { display: none; }
.bnote { padding: 0 8px; color: var(--blue); font-size: 14px; line-height: 1.4; }
.narr { align-self: center; padding: 4px 14px; border-radius: 99px; background: var(--blue-2); color: var(--blue); font-size: 14px; font-style: italic; }
.dctl { position: sticky; bottom: 0; z-index: 3; display: grid; gap: 10px; margin: 0 -16px; padding: 12px 16px calc(14px + var(--sb)); background: var(--bg); border-top: 1px solid var(--line); }
@media (min-width: 600px) { .dctl { margin-inline: -28px; padding-inline: 28px; } }
.dctl:empty { display: none; }
.dctl .opts { grid-template-columns: 1fr; }
.dctl .opt { min-height: 54px; }
.dctl .wf .row { margin-top: 10px; }
.dpr { font-size: clamp(20px, 5.6vw, 26px); font-weight: 600; line-height: 1.25; }
.dwait { min-height: 24px; color: var(--mute); font-size: 15px; text-align: center; }
#dfb { display: grid; gap: 8px; }
#dfb:empty { display: none; }
#dfb .btn.sm { justify-self: start; }
.dfb { font-size: 17px; font-weight: 600; }
.dfb.good { color: var(--green); }
.dfb.bad { color: var(--red); }
.endic .ic { width: 84px; height: 84px; padding: 22px; box-sizing: content-box; border-radius: 50%; background: var(--green-2); color: var(--green); }
@keyframes pop { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.toast { position: fixed; z-index: 50; top: calc(12px + var(--st)); left: 50%; width: max-content; max-width: calc(100vw - 32px); text-align: center; padding: 11px 18px; border-radius: 99px; background: var(--ink); color: var(--bg); font-size: 15px; font-weight: 600; transform: translate(-50%, -160%); transition: transform .3s; pointer-events: none; }
.toast.on { transform: translate(-50%, 0); }

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