:root {
  --bg: #f5f6fb;
  --surface: #ffffff;
  --surface-2: #eef0f8;
  --text: #151a2d;
  --muted: #5b6178;
  --line: #e1e4ef;
  --primary: #4f46e5;
  --primary-2: #6366f1;
  --primary-soft: #e8e7fd;
  --on-primary: #ffffff;
  --ok: #15803d;
  --ok-bg: #dcfce7;
  --ko: #c2261d;
  --ko-bg: #fee4e2;
  --warn-bg: #fff4d6;
  --warn-line: #f5c451;
  --fire: #f97316;
  --radius: 18px;
  --shadow: 0 1px 2px rgba(20, 24, 50, .05), 0 6px 20px rgba(20, 24, 50, .06);
  --nav-h: 64px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d0f1c; --surface: #161a2c; --surface-2: #20253c; --text: #eceefb; --muted: #a3a8c3;
    --line: #2a3050; --primary: #8b8ff9; --primary-2: #a5a8fb; --primary-soft: #262a52; --on-primary: #0d0f1c;
    --ok: #4ade80; --ok-bg: #12301e; --ko: #fb7a6f; --ko-bg: #3a1714; --warn-bg: #33290f; --warn-line: #a37a1c;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 6px 20px rgba(0,0,0,.25); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0d0f1c; --surface: #161a2c; --surface-2: #20253c; --text: #eceefb; --muted: #a3a8c3;
  --line: #2a3050; --primary: #8b8ff9; --primary-2: #a5a8fb; --primary-soft: #262a52; --on-primary: #0d0f1c;
  --ok: #4ade80; --ok-bg: #12301e; --ko: #fb7a6f; --ko-bg: #3a1714; --warn-bg: #33290f; --warn-line: #a37a1c;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 6px 20px rgba(0,0,0,.25); color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
}
body.noscroll { overflow: hidden; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .4em; letter-spacing: -.01em; }
h1 { font-size: 1.7rem; } h2 { font-size: 1.3rem; } h3 { font-size: 1.05rem; }
p { margin: 0 0 .8em; }
a { color: var(--primary); }
button { font: inherit; color: inherit; cursor: pointer; }
input, textarea, select { font: inherit; color: var(--text); }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
[hidden] { display: none !important; }

/* ---------- Layout ---------- */
#app { min-height: 100vh; }
#view { max-width: 760px; margin: 0 auto; padding: 16px 16px calc(var(--nav-h) + 28px + env(safe-area-inset-bottom)); padding-top: calc(16px + env(safe-area-inset-top)); }
#nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: flex; justify-content: space-around;
  background: var(--surface); border-top: 1px solid var(--line);
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
}
#nav a {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; text-decoration: none;
  color: var(--muted); font-size: .72rem; font-weight: 600; padding: 4px 2px; border-radius: 12px; position: relative;
}
#nav a .ic { font-size: 1.35rem; line-height: 1.2; filter: grayscale(.6); opacity: .8; }
#nav a.active { color: var(--primary); }
#nav a.active .ic { filter: none; opacity: 1; }
#nav .badge { position: absolute; top: 0; right: calc(50% - 22px); background: var(--fire); color: #fff; font-size: .65rem; border-radius: 99px; padding: 0 5px; min-width: 16px; text-align: center; }
.brand { display: none; }
@media (min-width: 900px) {
  #nav { top: 0; right: auto; width: 230px; flex-direction: column; justify-content: flex-start; border-top: 0; border-right: 1px solid var(--line); padding: 20px 12px; gap: 4px; }
  #nav a { flex: 0; flex-direction: row; gap: 12px; font-size: .95rem; padding: 10px 14px; }
  #nav a.active { background: var(--primary-soft); }
  #nav .badge { position: static; margin-left: auto; }
  .brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.1rem; padding: 4px 14px 18px; }
  .brand img { width: 32px; height: 32px; border-radius: 9px; }
  #view { margin-left: 230px; margin-right: auto; padding: 32px 32px 40px; max-width: 820px; }
  @supports (margin: auto) { #view { margin-left: max(230px, calc(115px + 50vw - 410px)); } }
}

/* ---------- Generic ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); margin-bottom: 14px; }
.card h2, .card h3 { margin-top: 0; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
@media (max-width: 380px) { .grid3 { grid-template-columns: 1fr 1fr; } }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.center { justify-content: center; }
.row.end { justify-content: flex-end; }
.spacer { flex: 1; }
.section-title { font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; margin: 22px 4px 10px; }
.back { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); text-decoration: none; font-weight: 600; margin-bottom: 10px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid transparent;
  border-radius: 14px; padding: 12px 18px; font-weight: 700; background: var(--surface-2); color: var(--text);
  transition: transform .08s ease, filter .15s; text-decoration: none; min-height: 46px;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .45; cursor: default; transform: none; }
.btn-primary { background: var(--primary); color: var(--on-primary); box-shadow: 0 3px 0 rgba(0,0,0,.15); }
.btn-soft { background: var(--primary-soft); color: var(--primary); }
.btn-ghost { background: transparent; border-color: var(--line); }
.btn-ok { background: var(--ok); color: #fff; }
.btn-ko { background: var(--ko); color: #fff; }
.btn-lg { padding: 15px 22px; font-size: 1.05rem; width: 100%; }
.btn-block { width: 100%; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--surface);
  border-radius: 99px; padding: 7px 13px; font-size: .9rem; font-weight: 600;
}
.chip.on { background: var(--primary); color: var(--on-primary); border-color: var(--primary); }
.icon-btn { border: 0; background: transparent; font-size: 1.3rem; padding: 6px 10px; border-radius: 10px; color: var(--muted); }
.say-btn, .mini { border: 0; background: var(--primary-soft); color: var(--primary); border-radius: 10px; padding: 4px 9px; font-size: .95rem; vertical-align: middle; }
.pill { display: inline-block; font-size: .75rem; font-weight: 700; padding: 2px 9px; border-radius: 99px; background: var(--surface-2); color: var(--muted); }
.pill.ok { background: var(--ok-bg); color: var(--ok); }
.pill.new { background: var(--primary-soft); color: var(--primary); }
.warn, .tip { background: var(--warn-bg); border-left: 4px solid var(--warn-line); padding: 10px 14px; border-radius: 10px; }
.progress { height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.progress > i { display: block; height: 100%; background: linear-gradient(90deg, var(--primary), var(--primary-2)); border-radius: 99px; transition: width .4s; }
select, input[type="text"], input[type="search"], input[type="password"], textarea {
  width: 100%; border: 1.5px solid var(--line); background: var(--surface); border-radius: 12px; padding: 11px 13px; outline: none;
}
select:focus, input:focus, textarea:focus { border-color: var(--primary); }
input[type="range"] { width: 100%; accent-color: var(--primary); }

/* ---------- Home ---------- */
.hero { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; }
.hero h1 { margin: 0; }
.eyebrow { color: var(--muted); font-weight: 600; margin: 0 0 2px; }
.streak { display: flex; align-items: center; gap: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: 99px; padding: 7px 14px; font-size: 1.1rem; box-shadow: var(--shadow); white-space: nowrap; }
.streak b { color: var(--fire); }
.goal { display: flex; align-items: center; gap: 16px; }
.ring { width: 76px; height: 76px; flex: none; }
.ring circle { fill: none; stroke-width: 9; }
.ring .bg { stroke: var(--surface-2); }
.ring .fg { stroke: var(--primary); stroke-linecap: round; transition: stroke-dashoffset .6s; }
.ring text { font-weight: 800; font-size: 19px; fill: var(--text); }
.continue { display: block; text-decoration: none; color: var(--on-primary); background: linear-gradient(135deg, var(--primary), var(--primary-2)); border-radius: var(--radius); padding: 18px; margin-bottom: 14px; border: 0; width: 100%; text-align: left; box-shadow: var(--shadow); }
.continue small { opacity: .85; font-weight: 600; display: block; }
.continue strong { font-size: 1.2rem; display: block; margin: 2px 0; }
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 14px; }
.tile-btn { text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 15px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 4px; text-decoration: none; color: var(--text); min-height: 108px; }
.tile-btn .em { font-size: 1.6rem; }
.tile-btn b { font-size: 1rem; }
.tile-btn span { color: var(--muted); font-size: .85rem; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px; text-align: center; }
.stat b { display: block; font-size: 1.4rem; }
.stat span { color: var(--muted); font-size: .8rem; }

/* ---------- Path ---------- */
.unit-card { display: flex; gap: 14px; align-items: center; text-decoration: none; color: var(--text); }
.unit-emoji { width: 54px; height: 54px; flex: none; border-radius: 16px; display: grid; place-items: center; font-size: 1.7rem; background: var(--primary-soft); }
.unit-card.done .unit-emoji { background: var(--ok-bg); }
.unit-card .grow { flex: 1; min-width: 0; }
.unit-card h3 { margin: 0 0 2px; font-size: 1rem; }
.unit-card p { margin: 0 0 8px; color: var(--muted); font-size: .85rem; }
.steps { display: flex; flex-direction: column; gap: 10px; }
.step { display: flex; align-items: center; gap: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 14px; text-align: left; width: 100%; box-shadow: var(--shadow); }
.step .ic { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; font-size: 1.4rem; background: var(--surface-2); flex: none; }
.step.done .ic { background: var(--ok-bg); }
.step .grow { flex: 1; }
.step b { display: block; }
.step span { color: var(--muted); font-size: .85rem; }
.step .st { font-size: 1.2rem; }
.wordlist { display: flex; flex-direction: column; }
.wl-row { display: flex; align-items: center; gap: 10px; padding: 10px 2px; border-bottom: 1px solid var(--line); }
.wl-row:last-child { border-bottom: 0; }
.wl-row .en { font-weight: 700; }
.wl-row .fr { color: var(--muted); font-size: .9rem; }
.wl-row .grow { flex: 1; min-width: 0; }
details > summary { cursor: pointer; font-weight: 700; list-style: none; }
details > summary::-webkit-details-marker { display: none; }
details > summary::after { content: " ▾"; color: var(--muted); }

/* ---------- Lesson ---------- */
.lesson table { width: 100%; border-collapse: collapse; margin: 10px 0 14px; font-size: .95rem; }
.lesson th, .lesson td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; vertical-align: top; }
.lesson th { background: var(--surface-2); }
.lesson em { font-style: normal; font-weight: 600; color: var(--primary); cursor: pointer; border-bottom: 1px dashed currentColor; }
.lesson ul { padding-left: 20px; }
.lesson li { margin-bottom: 6px; }
.table-wrap { overflow-x: auto; }

/* ---------- Dialogue ---------- */
.dlg { display: flex; flex-direction: column; gap: 10px; }
.dl { display: flex; gap: 8px; align-items: flex-end; max-width: 88%; }
.dl.B { align-self: flex-end; flex-direction: row-reverse; }
.dl .who { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: .85rem; background: var(--surface-2); flex: none; }
.dl.B .who { background: var(--primary-soft); color: var(--primary); }
.dl .bub { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 10px 13px; cursor: pointer; }
.dl.B .bub { background: var(--primary-soft); border-color: transparent; }
.dl .bub .t-fr { color: var(--muted); font-size: .88rem; margin-top: 3px; }
.dl.playing .bub { outline: 2px solid var(--primary); }
.dlg.hide-en .t-en { filter: blur(5px); }
.dlg.hide-fr .t-fr { display: none; }

/* ---------- Session overlay ---------- */
#overlay { position: fixed; inset: 0; z-index: 50; background: var(--bg); display: flex; flex-direction: column; }
.ses { display: flex; flex-direction: column; height: 100%; max-width: 680px; width: 100%; margin: 0 auto; }
.ses-top { display: flex; align-items: center; gap: 10px; padding: 12px 14px; padding-top: calc(12px + env(safe-area-inset-top)); }
.ses-top .bar { flex: 1; height: 12px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.ses-top .bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--primary), var(--primary-2)); border-radius: 99px; transition: width .35s; }
.ses-xp { font-weight: 800; color: var(--primary); font-size: .9rem; min-width: 52px; text-align: right; }
.ses-body { flex: 1; overflow-y: auto; padding: 10px 18px 24px; display: flex; flex-direction: column; }
.ses-foot { padding: 0 16px; padding-bottom: env(safe-area-inset-bottom); }
.ses-foot.show { padding: 14px 16px calc(14px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--surface); }
.ses-foot.ok { background: var(--ok-bg); border-color: transparent; }
.ses-foot.ko { background: var(--ko-bg); border-color: transparent; }
.fb { display: flex; align-items: center; gap: 14px; justify-content: space-between; flex-wrap: wrap; max-width: 680px; margin: 0 auto; }
.fb > div { flex: 1; min-width: 200px; }
.fb b { font-size: 1.15rem; }
.ses-foot.ok b { color: var(--ok); }
.ses-foot.ko b { color: var(--ko); }
.fb .btn { min-width: 140px; }
.fb-plain { justify-content: flex-end; }
.fb-ans { margin: 4px 0 0; font-weight: 600; }
.fb-note { margin: 4px 0 0; font-size: .9rem; color: var(--muted); }
.t-label { color: var(--muted); font-weight: 700; font-size: .85rem; text-transform: uppercase; letter-spacing: .06em; margin: 6px 0 14px; }
.present { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px; margin: auto 0; padding: 10px 0; }
.present .en, .en-big { font-size: 1.8rem; font-weight: 800; margin: 0; }
.present .fr { font-size: 1.1rem; color: var(--muted); margin: 0; }
.big-say { width: 84px; height: 84px; border-radius: 50%; border: 0; background: var(--primary); color: var(--on-primary); font-size: 2rem; box-shadow: 0 4px 0 rgba(0,0,0,.15); }
.big-say:active { transform: translateY(2px); box-shadow: 0 2px 0 rgba(0,0,0,.15); }
.audio-q { display: flex; align-items: center; justify-content: center; gap: 14px; margin: 10px 0 22px; }
.fr-q, .gq { font-size: 1.35rem; font-weight: 700; margin: 0 0 20px; }
.blank { display: inline-block; min-width: 60px; border-bottom: 3px solid var(--primary); color: var(--primary); text-align: center; }
.opts { display: grid; gap: 10px; }
.opt { text-align: left; border: 2px solid var(--line); background: var(--surface); border-radius: 14px; padding: 14px 16px; font-weight: 600; display: flex; gap: 12px; align-items: center; box-shadow: 0 2px 0 var(--line); }
.opt .key { width: 26px; height: 26px; border-radius: 8px; border: 1.5px solid var(--line); display: grid; place-items: center; font-size: .8rem; color: var(--muted); flex: none; }
.opt.is-ok { border-color: var(--ok); background: var(--ok-bg); }
.opt.is-ko { border-color: var(--ko); background: var(--ko-bg); }
textarea.answer { font-size: 1.15rem; min-height: 90px; resize: none; margin-bottom: 14px; }
.slot { min-height: 62px; border-bottom: 2px solid var(--line); display: flex; flex-wrap: wrap; gap: 8px; padding: 8px 0; margin-bottom: 18px; align-content: flex-start; }
.bank { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-bottom: 22px; }
.tile { border: 2px solid var(--line); background: var(--surface); border-radius: 12px; padding: 8px 13px; font-weight: 600; box-shadow: 0 2px 0 var(--line); }
.tile.used { opacity: .25; box-shadow: none; }
.mic-big { width: 96px; height: 96px; border-radius: 50%; border: 0; font-size: 2.4rem; background: var(--ko); color: #fff; box-shadow: 0 4px 0 rgba(0,0,0,.2); margin: 8px 0; }
.mic-big.rec, .mic.rec { animation: pulse 1.1s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(220, 38, 38, .5); } 100% { box-shadow: 0 0 0 22px rgba(220, 38, 38, 0); } }
.speak-res { min-height: 30px; text-align: center; }
.speak-res .w-ok { color: var(--ok); font-weight: 700; }
.speak-res .w-ko { color: var(--ko); font-weight: 700; text-decoration: underline wavy; }
.speak-res .heard { color: var(--muted); font-size: .9rem; margin-top: 4px; }
.score { font-weight: 800; font-size: 1.1rem; }
.flash { text-align: center; margin: auto 0; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.flash .back-side { border-top: 2px dashed var(--line); padding-top: 14px; margin-top: 4px; width: 100%; }
.grades { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; max-width: 680px; margin: 0 auto; }
.grades button { border: 0; border-radius: 12px; padding: 10px 4px; font-weight: 700; font-size: .9rem; display: flex; flex-direction: column; align-items: center; gap: 1px; }
.grades button small { font-weight: 600; opacity: .8; font-size: .75rem; }
.g0 { background: var(--ko-bg); color: var(--ko); }
.g1 { background: var(--warn-bg); color: inherit; }
.g2 { background: var(--ok-bg); color: var(--ok); }
.g3 { background: var(--primary-soft); color: var(--primary); }
.done { text-align: center; margin: auto 0; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.done-emoji { font-size: 4rem; }
.done-stats { display: flex; gap: 12px; margin: 8px 0 14px; }
.done-stats div { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px 16px; min-width: 88px; }
.done-stats b { display: block; font-size: 1.4rem; }
.done-stats span { color: var(--muted); font-size: .8rem; }

/* ---------- Chat ---------- */
.chat-wrap { display: flex; flex-direction: column; }
.chat-head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.avatar-lg { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; font-size: 1.5rem; background: linear-gradient(135deg, var(--primary), var(--primary-2)); color: #fff; flex: none; }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; background: var(--muted); margin-right: 5px; }
.dot.on { background: #22c55e; }
.modes { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 8px; scrollbar-width: none; }
.modes::-webkit-scrollbar { display: none; }
.modes .chip { white-space: nowrap; }
.msgs { display: flex; flex-direction: column; gap: 12px; padding: 8px 0 16px; min-height: 200px; }
.msg { display: flex; gap: 8px; align-items: flex-start; }
.msg.me { justify-content: flex-end; }
.msg .avatar { width: 30px; height: 30px; border-radius: 50%; background: linear-gradient(135deg, var(--primary), var(--primary-2)); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: .85rem; flex: none; }
.bubble { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 11px 14px; max-width: 86%; box-shadow: var(--shadow); overflow-wrap: anywhere; }
.msg.me .bubble { background: var(--primary); color: var(--on-primary); border-color: transparent; border-bottom-right-radius: 6px; }
.msg.bot .bubble { border-top-left-radius: 6px; }
.bubble.err { background: var(--ko-bg); border-color: transparent; }
.b-en { font-size: 1.05rem; }
.b-label { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; margin-bottom: 3px; }
.b-tools { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.b-fr { margin-top: 8px; color: var(--muted); font-size: .92rem; border-top: 1px dashed var(--line); padding-top: 8px; }
.b-fix { margin-top: 10px; background: var(--warn-bg); border-radius: 12px; padding: 9px 11px; font-size: .92rem; }
.typing span { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--muted); margin: 0 2px; animation: blink 1.2s infinite; }
.typing span:nth-child(2) { animation-delay: .2s; } .typing span:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .2; } 40% { opacity: 1; } }
.composer { position: sticky; bottom: calc(var(--nav-h) + env(safe-area-inset-bottom)); background: var(--bg); padding: 10px 0 6px; }
@media (min-width: 900px) { .composer { bottom: 0; } }
.composer .box { display: flex; gap: 8px; align-items: flex-end; background: var(--surface); border: 1.5px solid var(--line); border-radius: 22px; padding: 6px; box-shadow: var(--shadow); }
.composer textarea { border: 0; resize: none; min-height: 44px; max-height: 140px; padding: 10px 8px; background: transparent; }
.composer .mic, .composer .send { width: 44px; height: 44px; border-radius: 50%; border: 0; flex: none; font-size: 1.2rem; }
.composer .mic { background: var(--ko-bg); color: var(--ko); }
.composer .send { background: var(--primary); color: var(--on-primary); }
.composer .opts-row { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.sugg { display: flex; gap: 8px; flex-wrap: wrap; margin: 6px 0; }

/* ---------- Misc ---------- */
.bars { display: flex; align-items: flex-end; gap: 6px; height: 120px; padding-top: 10px; }
.bars div { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; justify-content: flex-end; }
.bars i { width: 100%; background: linear-gradient(180deg, var(--primary-2), var(--primary)); border-radius: 6px 6px 3px 3px; min-height: 3px; }
.bars span { font-size: .65rem; color: var(--muted); }
.setting { display: flex; flex-direction: column; gap: 8px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.setting:last-child { border-bottom: 0; }
.setting label { font-weight: 700; }
.toggle { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.switch { position: relative; width: 50px; height: 30px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: var(--surface-2); border-radius: 99px; transition: .2s; border: 1px solid var(--line); }
.switch span::after { content: ""; position: absolute; left: 3px; top: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; transition: .2s; box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.switch input:checked + span { background: var(--primary); border-color: var(--primary); }
.switch input:checked + span::after { transform: translateX(20px); }
.list-link { display: flex; align-items: center; gap: 14px; padding: 14px 4px; border-bottom: 1px solid var(--line); text-decoration: none; color: var(--text); font-weight: 600; background: none; border-left: 0; border-right: 0; border-top: 0; width: 100%; text-align: left; }
.list-link:last-child { border-bottom: 0; }
.list-link .em { font-size: 1.4rem; width: 32px; text-align: center; }
.list-link .grow { flex: 1; }
.list-link small { display: block; color: var(--muted); font-weight: 500; }
.method h3 { margin-top: 18px; }
.method ol, .method ul { padding-left: 20px; }
.method li { margin-bottom: 8px; }
#toast { position: fixed; left: 50%; bottom: calc(var(--nav-h) + 24px + env(safe-area-inset-bottom)); transform: translateX(-50%) translateY(20px); background: var(--text); color: var(--bg); padding: 11px 18px; border-radius: 12px; font-weight: 600; opacity: 0; pointer-events: none; transition: .25s; z-index: 100; max-width: calc(100% - 32px); text-align: center; }
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.empty { text-align: center; padding: 30px 10px; color: var(--muted); }
.empty .em { font-size: 2.6rem; display: block; margin-bottom: 6px; }

/* ---------- Question « parler à voix haute » ---------- */
.ask-wrap { flex: 1; display: flex; align-items: center; justify-content: center; padding: 16px; padding-top: calc(16px + env(safe-area-inset-top)); overflow-y: auto; }
.ask { max-width: 460px; width: 100%; text-align: center; display: flex; flex-direction: column; gap: 12px; margin: 0; }
.ask h2, .ask p { margin: 0; }
.ask-em { font-size: 3rem; }
.ask-btns { display: flex; flex-direction: column; gap: 10px; }
.ask-rem { display: flex; align-items: center; justify-content: center; gap: 8px; color: var(--muted); font-size: .9rem; }
.ask-rem input { width: 18px; height: 18px; accent-color: var(--primary); }

/* ---------- Structures et défis ---------- */
.hint { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; background: var(--surface-2); border-radius: 10px; padding: 10px 12px; margin: -4px 0 14px; letter-spacing: .04em; overflow-wrap: anywhere; }
.b-chal { margin-top: 10px; background: var(--primary-soft); border-radius: 12px; padding: 10px 12px; }
.b-chal b { color: var(--primary); }
