/* Ivrit — feuille de style. Mobile d'abord. */

:root {
  --bg: #F7F4EE;
  --surface: #FFFFFF;
  --surface-2: #F1EDE5;
  --line: #E4DED3;
  --ink: #1C1F26;
  --ink-2: #565C68;
  --ink-3: #8C919B;
  --accent: #0E7C66;
  --accent-ink: #FFFFFF;
  --accent-soft: #DDF1EB;

  /* code couleur de la grammaire — le même partout */
  --m: #2459D6;  --m-soft: #E7EEFF;
  --f: #D2366F;  --f-soft: #FDE7EF;
  --inf: #7443D8; --inf-soft: #EFE8FF;
  --n: #2A3140;  --n-soft: #EEF0F3;

  --ok: #13955F; --ok-soft: #DDF5E9;
  --ko: #D6452F; --ko-soft: #FDE6E1;
  --warn: #B7791F; --warn-soft: #FCF1DC;

  --radius: 18px;
  --shadow: 0 1px 2px rgba(28, 31, 38, .05), 0 6px 20px rgba(28, 31, 38, .06);
  --font: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --he-font: 'Frank Ruhl Libre', 'Times New Roman', serif;
  --tab-h: 68px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
}
:root[data-hefont="sans"] { --he-font: 'Rubik', 'Arial Hebrew', sans-serif; }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #14161B; --surface: #1C1F26; --surface-2: #252932; --line: #30353F;
    --ink: #F1F2F4; --ink-2: #B5BAC4; --ink-3: #7F8592;
    --accent: #3CC7A6; --accent-ink: #0B1F1A; --accent-soft: #163B33;
    --m: #78A2FF; --m-soft: #1D2A48; --f: #FF7AA8; --f-soft: #47202F;
    --inf: #B697FF; --inf-soft: #2E2350; --n: #E3E6EB; --n-soft: #2A2F38;
    --ok: #43D194; --ok-soft: #173B2A; --ko: #FF7D66; --ko-soft: #46221C; --warn: #F2B65A; --warn-soft: #3E3020;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #14161B; --surface: #1C1F26; --surface-2: #252932; --line: #30353F;
  --ink: #F1F2F4; --ink-2: #B5BAC4; --ink-3: #7F8592;
  --accent: #3CC7A6; --accent-ink: #0B1F1A; --accent-soft: #163B33;
  --m: #78A2FF; --m-soft: #1D2A48; --f: #FF7AA8; --f-soft: #47202F;
  --inf: #B697FF; --inf-soft: #2E2350; --n: #E3E6EB; --n-soft: #2A2F38;
  --ok: #43D194; --ok-soft: #173B2A; --ko: #FF7D66; --ko-soft: #46221C; --warn: #F2B65A; --warn-soft: #3E3020;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px 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(--ink); font: 15px/1.45 var(--font);
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
  padding-bottom: calc(var(--tab-h) + var(--safe-b) + 12px);
  overflow-x: hidden;
}
body.noscroll { overflow: hidden; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
a { color: var(--accent); }
h1, h2, h3, h4 { margin: 0; line-height: 1.2; letter-spacing: -.01em; }
h1 { font-size: 26px; font-weight: 800; }
h2 { font-size: 21px; font-weight: 700; }
h3 { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); margin-bottom: 10px; }
h4.sub { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); margin: 16px 0 8px; }
.muted { color: var(--ink-3); }
.small { font-size: 12px; }
.center { text-align: center; }
code { background: var(--surface-2); padding: 1px 5px; border-radius: 6px; font-size: 12px; }
[hidden] { display: none !important; }

.ic { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; flex: none; }
#i-play path, #i-star path, #i-flame path, #i-spark path { fill: currentColor; stroke-width: 1.2; }

.view { max-width: 640px; margin: 0 auto; padding: 0 16px; min-height: 60vh; }
.boot { display: grid; place-items: center; height: 70vh; font: 700 44px var(--he-font); color: var(--ink-3); }

/* ---------- hébreu & code couleur ---------- */
.he { font-family: var(--he-font); font-weight: 500; direction: rtl; unicode-bidi: isolate; letter-spacing: .01em; }
.tone-m { --tone: var(--m); --tone-soft: var(--m-soft); }
.tone-f { --tone: var(--f); --tone-soft: var(--f-soft); }
.tone-inf { --tone: var(--inf); --tone-soft: var(--inf-soft); }
.tone-n { --tone: var(--n); --tone-soft: var(--n-soft); }
.he[class*="tone-"] { color: var(--tone); }
.he .end { font-weight: 700; color: var(--tone); background: var(--tone-soft); border-radius: 5px; padding: 0 .03em; box-shadow: inset 0 -2px 0 color-mix(in srgb, var(--tone) 55%, transparent); }
.ph { font-size: 13px; color: var(--ink-3); font-style: italic; direction: ltr; }

/* ---------- barre d'onglets ---------- */
.tabbar {
  position: fixed; inset: auto 0 0 0; z-index: 20; display: flex; justify-content: space-around; align-items: stretch;
  height: calc(var(--tab-h) + var(--safe-b)); padding: 6px 6px calc(6px + var(--safe-b));
  background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--line);
}
.tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; text-decoration: none; color: var(--ink-3); font-size: 11px; font-weight: 600; border-radius: 14px; }
.tabbar a.on { color: var(--accent); }
.tabbar a.mid .ic { width: 44px; height: 44px; padding: 11px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); margin-top: -4px; box-shadow: 0 6px 16px color-mix(in srgb, var(--accent) 35%, transparent); }
.tabbar a.mid .ic path { fill: var(--accent-ink); stroke: var(--accent-ink); }
.tabbar a.mid span { margin-top: -2px; }
body[data-route="session"] .tabbar { display: none; }
body[data-route="session"] { padding-bottom: 0; }

/* ---------- en-têtes ---------- */
.top { display: flex; align-items: center; gap: 10px; padding: 22px 0 14px; position: sticky; top: 0; z-index: 5; background: linear-gradient(var(--bg) 75%, transparent); }
.top h1 { flex: 1; }
.hero { display: flex; justify-content: space-between; align-items: flex-end; padding: 28px 0 16px; }
.hello { margin: 0 0 2px; font: 600 22px var(--he-font); color: var(--accent); }
.streak { display: flex; align-items: center; gap: 4px; padding: 8px 12px; border-radius: 999px; background: var(--surface); box-shadow: var(--shadow); color: var(--ink-3); font-weight: 800; }
.streak.on { color: #E8590C; }
.streak.on .ic path { fill: #FF8A3D; stroke: #E8590C; }

/* ---------- cartes ---------- */
.card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; margin-bottom: 14px; }
.card-h { display: flex; justify-content: space-between; align-items: baseline; }
.link { font-size: 13px; font-weight: 600; text-decoration: none; }
.today { display: flex; flex-direction: column; gap: 14px; background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 70%, #1B4D9A)); color: #fff; }
.today h2 { font-size: 22px; }
.today p { margin: 4px 0 0; opacity: .92; }
.today .btn.primary { background: #fff; color: var(--accent); }
:root[data-theme="dark"] .today .btn.primary { color: #0E7C66; }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px; }
.stat { background: var(--surface); border-radius: 16px; box-shadow: var(--shadow); padding: 12px; text-align: center; }
.stat b { display: block; font-size: 24px; font-weight: 800; }
.stat span { font-size: 12px; color: var(--ink-3); }
.stat.ok b { color: var(--ok); }

.heat { display: grid; grid-auto-flow: column; grid-template-rows: repeat(7, 1fr); grid-template-columns: repeat(var(--w), 1fr); gap: 3px; }
.heat i, .heat-leg i { display: block; aspect-ratio: 1; border-radius: 3px; background: var(--surface-2); }
.heat i.fut { background: transparent; }
.heat .l1, .heat-leg .l1 { background: color-mix(in srgb, var(--accent) 30%, var(--surface-2)); }
.heat .l2, .heat-leg .l2 { background: color-mix(in srgb, var(--accent) 55%, var(--surface-2)); }
.heat .l3, .heat-leg .l3 { background: color-mix(in srgb, var(--accent) 78%, var(--surface-2)); }
.heat .l4, .heat-leg .l4 { background: var(--accent); }
.heat-leg { display: flex; align-items: center; justify-content: flex-end; gap: 4px; margin-top: 8px; font-size: 11px; color: var(--ink-3); }
.heat-leg i { width: 11px; }

.lessons { display: flex; flex-direction: column; gap: 6px; }
.lesson-row { display: flex; align-items: center; gap: 10px; padding: 8px 4px; border-radius: 12px; text-align: left; }
.lesson-row:active { background: var(--surface-2); }
.lesson-row .ic { width: 16px; height: 16px; color: var(--accent); }
.bar { flex: 1; height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; position: relative; }
.bar i { position: absolute; inset: 0 auto 0 0; border-radius: 99px; background: var(--ok); }
.bar.two i.s { background: color-mix(in srgb, var(--ok) 30%, var(--surface-2)); }

.quick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px; }
.qk { background: var(--surface); border-radius: 16px; box-shadow: var(--shadow); padding: 12px 8px; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.qk .ic { color: var(--ink-3); }
.qk b { font-size: 18px; }
.qk span { font-size: 11px; color: var(--ink-3); text-align: center; line-height: 1.2; }

.legend .leg { display: grid; grid-template-columns: auto 1fr; gap: 8px 14px; align-items: center; margin-bottom: 10px; }
.legend .he { font-size: 26px; text-align: right; }
.legend p { margin: 0; font-size: 13px; }

/* ---------- puces ---------- */
.chip { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); white-space: nowrap; }
.chip.lesson { background: hsl(var(--h) 70% 92%); color: hsl(var(--h) 55% 30%); }
:root[data-theme="dark"] .chip.lesson { background: hsl(var(--h) 35% 22%); color: hsl(var(--h) 70% 80%); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .chip.lesson { background: hsl(var(--h) 35% 22%); color: hsl(var(--h) 70% 80%); } }
.chip.warn { background: var(--warn-soft); color: var(--warn); }
.chip.type { font-weight: 600; }
.chip.t-verbe { background: var(--inf-soft); color: var(--inf); }
.chip .g { font-style: normal; font-weight: 700; }
.g-m { color: var(--m); } .g-f { color: var(--f); } .g-mf { background: linear-gradient(90deg, var(--m), var(--f)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.flag { display: inline-grid; place-items: center; width: 16px; height: 16px; border-radius: 50%; background: var(--warn-soft); color: var(--warn); font-size: 11px; font-weight: 800; }

/* ---------- boutons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 16px; border-radius: 14px; font-weight: 700; transition: transform .1s, background .2s; }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .45; pointer-events: none; }
.btn.busy { opacity: .8; pointer-events: none; }
.btn.busy .ic { animation: spin 1.2s linear infinite; }
.btn.primary { background: var(--accent); color: var(--accent-ink); }
.btn.ghost { background: var(--surface-2); color: var(--ink); }
.btn.danger { color: var(--ko); }
.btn.big { min-height: 54px; font-size: 16px; width: 100%; border-radius: 16px; }
.btn.sm { min-height: 36px; font-size: 13px; padding: 0 12px; }
.btn small { font-weight: 600; opacity: .7; }
.btn.loading { position: relative; color: transparent !important; }
.btn.loading::after { content: ''; position: absolute; width: 20px; height: 20px; border-radius: 50%; border: 2.5px solid var(--accent-ink); border-right-color: transparent; animation: spin .8s linear infinite; }
.btn.ghost.loading::after { border-color: var(--ink); border-right-color: transparent; }
@keyframes spin { to { transform: rotate(360deg); } }
.icon-btn { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; color: var(--ink-2); flex: none; }
.icon-btn:active { background: var(--surface-2); }
.icon-btn.speak { width: 34px; height: 34px; color: var(--ink-3); }
.icon-btn.speak .ic { width: 19px; height: 19px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.actions.col { flex-direction: column; }
.actions .btn:not(.big) { flex: 1; }
.cta-bar { position: sticky; bottom: calc(var(--tab-h) + var(--safe-b) + 8px); display: flex; gap: 8px; align-items: center; padding: 12px 0; background: linear-gradient(transparent, var(--bg) 30%); z-index: 4; }
.cta-bar .btn { flex: 1; }
body[data-route="session"] .cta-bar { bottom: 0; padding-bottom: calc(12px + var(--safe-b)); }

/* ---------- recherche, onglets, filtres ---------- */
.search { display: flex; align-items: center; gap: 8px; background: var(--surface); border-radius: 14px; padding: 0 12px; box-shadow: var(--shadow); margin-bottom: 12px; }
.search .ic { color: var(--ink-3); width: 18px; }
.search input { flex: 1; border: 0; background: none; height: 46px; outline: none; min-width: 0; font-size: 16px; }
.tabs { display: flex; gap: 4px; background: var(--surface-2); padding: 4px; border-radius: 14px; overflow-x: auto; scrollbar-width: none; margin-bottom: 10px; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { flex: 1; white-space: nowrap; padding: 8px 10px; border-radius: 10px; font-weight: 700; font-size: 13px; color: var(--ink-2); }
.tabs button small { margin-left: 4px; font-weight: 600; color: var(--ink-3); }
.tabs button.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.filters, .pills { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 6px; margin-bottom: 8px; }
.pills { flex-wrap: wrap; overflow: visible; }
.filters::-webkit-scrollbar { display: none; }
.pill { white-space: nowrap; padding: 7px 12px; border-radius: 999px; font-size: 13px; font-weight: 600; background: var(--surface); color: var(--ink-2); border: 1px solid var(--line); }
.pill.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.pill.lesson-pill.on { background: hsl(var(--h) 55% 42%); border-color: transparent; color: #fff; }

/* ---------- liste ---------- */
.grp { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 10px; overflow: hidden; }
.grp-h { width: 100%; display: flex; align-items: center; gap: 10px; padding: 12px 12px 12px 16px; text-align: left; border-left: 5px solid hsl(var(--h) 60% 55%); }
.grp-t { font-weight: 800; min-width: 74px; }
.grp-n { font-size: 12px; color: var(--ink-3); font-weight: 700; min-width: 24px; }
.grp-h .bar { max-width: 120px; }
.grp-play { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); }
.grp-play .ic { width: 14px; height: 14px; }
.grp-h .chev { width: 18px; color: var(--ink-3); transition: transform .2s; }
.grp.open .chev { transform: rotate(180deg); }
.grp-b { display: none; border-top: 1px solid var(--line); }
.grp.open .grp-b { display: block; }

.row { width: 100%; display: flex; align-items: center; gap: 10px; padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--line); }
.row:last-child { border-bottom: 0; }
.row:active { background: var(--surface-2); }
.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--line); }
.dot.d-learn { background: var(--warn); }
.dot.d-ok { background: var(--ok); }
.row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.row-fr { font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.row-he { text-align: right; display: flex; flex-direction: column; align-items: flex-end; max-width: 55%; }
.row-he .he { font-size: 22px; line-height: 1.25; }
.row-he .ph { font-size: 12px; }
.list .row { border-radius: 12px; }
.empty-state { text-align: center; color: var(--ink-3); padding: 50px 0; }
.empty-state .ic { width: 40px; height: 40px; }

/* ---------- grille des formes ---------- */
.grid4 { display: grid; grid-template-columns: 34px 1fr 1fr; gap: 8px; margin-top: 12px; }
.gh { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; text-align: center; padding-bottom: 2px; }
.gh.m { color: var(--m); } .gh.f { color: var(--f); }
.gv { font-size: 10px; font-weight: 800; color: var(--ink-3); text-transform: uppercase; writing-mode: vertical-rl; transform: rotate(180deg); display: grid; place-items: center; letter-spacing: .08em; }
.cell { position: relative; border-radius: 14px; padding: 10px 10px 8px; display: flex; flex-direction: column; align-items: center; gap: 2px; min-height: 92px; justify-content: center; background: var(--surface-2); }
.grid4 .cell:has(.tone-m) { background: color-mix(in srgb, var(--m-soft) 75%, var(--surface)); }
.grid4 .cell:has(.tone-f) { background: color-mix(in srgb, var(--f-soft) 75%, var(--surface)); }
.cell .lab { position: absolute; top: 6px; left: 8px; font-size: 10px; font-weight: 800; color: var(--ink-3); }
.cell .val .he { font-size: 30px; line-height: 1.15; }
.cell .ph { text-align: center; }
.cell .speak { position: absolute; bottom: 2px; right: 2px; }
.cell.empty { opacity: .45; }
.inf-line .cell { background: color-mix(in srgb, var(--inf-soft) 80%, var(--surface)); min-height: 0; padding: 12px; }
.inf-line .cell .val .he { font-size: 34px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.grid2 .cell:has(.tone-m) { background: color-mix(in srgb, var(--m-soft) 75%, var(--surface)); }
.grid2 .cell:has(.tone-f) { background: color-mix(in srgb, var(--f-soft) 75%, var(--surface)); }
.single { margin-top: 12px; }
.single .cell { background: var(--surface-2); min-height: 100px; }
.single .cell .val .he { font-size: 40px; }
.num-list { display: flex; flex-direction: column; gap: 6px; }
.num-row { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 12px; background: color-mix(in srgb, var(--tone-soft) 70%, var(--surface)); }
.num-row .num-fr { font-weight: 600; font-size: 13px; }
.num-row .he { font-size: 22px; }
.num-row span:nth-child(2) { display: flex; flex-direction: column; align-items: flex-end; }

/* ---------- feuille (bottom sheet) ---------- */
.sheet-wrap { position: fixed; inset: 0; z-index: 50; }
.sheet-bg { position: absolute; inset: 0; background: rgba(10, 12, 16, .45); opacity: 0; transition: opacity .25s; }
.sheet { position: absolute; left: 0; right: 0; bottom: 0; max-height: 92vh; max-width: 640px; margin: 0 auto; background: var(--bg); border-radius: 24px 24px 0 0; transform: translateY(100%); transition: transform .28s cubic-bezier(.2, .8, .2, 1); display: flex; flex-direction: column; }
.sheet.tall { height: 92vh; }
.sheet-wrap.open .sheet-bg { opacity: 1; }
.sheet-wrap.open .sheet { transform: none; }
.sheet-grip { width: 40px; height: 5px; border-radius: 9px; background: var(--line); margin: 8px auto 0; flex: none; }
.sheet-x { position: absolute; top: 10px; right: 10px; z-index: 2; }
.sheet-body { overflow-y: auto; padding: 14px 16px calc(20px + var(--safe-b)); -webkit-overflow-scrolling: touch; }
.detail-head { padding-right: 40px; display: flex; flex-direction: column; gap: 8px; }
.detail h2 { font-size: 24px; }
.note { margin: 14px 0 0; padding: 10px 12px; background: var(--surface); border-radius: 12px; font-size: 14px; color: var(--ink-2); display: flex; gap: 8px; align-items: flex-start; }
.note .ic { width: 18px; color: var(--ink-3); }
.note.ex { font-family: var(--he-font); font-size: 17px; }
.prog { font-size: 12px; color: var(--ink-3); margin: 14px 0 0; }
.phrase-he { margin-top: 14px; padding: 18px 14px; background: var(--surface); border-radius: 16px; text-align: right; display: flex; gap: 6px; align-items: flex-start; flex-direction: row-reverse; justify-content: space-between; }
.phrase-he .he { font-size: 28px; line-height: 1.5; }
.phrase-he.sm { font: 500 20px var(--he-font); padding: 10px 12px; display: block; }
.wchips { display: flex; flex-wrap: wrap; gap: 6px; direction: rtl; }
.wchip { display: inline-flex; flex-direction: column; align-items: center; padding: 6px 10px; border-radius: 12px; background: var(--surface); box-shadow: var(--shadow); font: 500 19px var(--he-font); }
.wchip small { font: 500 11px var(--font); color: var(--ink-3); direction: ltr; }

/* ---------- formulaires ---------- */
.fld { display: flex; flex-direction: column; gap: 5px; margin-top: 12px; }
.fld > span { font-size: 12px; font-weight: 700; color: var(--ink-2); }
.fld.row { flex-direction: row; justify-content: space-between; align-items: center; gap: 12px; }
.fld.row input[type=number] { width: 80px; text-align: center; }
.fld.row input[type=range] { flex: 1; max-width: 200px; accent-color: var(--accent); }
input:not([type=checkbox]):not([type=range]), select, textarea {
  width: 100%; border: 1.5px solid var(--line); background: var(--surface); border-radius: 12px; padding: 11px 12px; outline: none; font-size: 16px; min-width: 0;
}
.fld.row select { width: auto; max-width: 62%; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); }
textarea { resize: vertical; }
input[lang="he"], textarea[lang="he"] { font: 500 22px var(--he-font); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.check { display: flex; align-items: center; gap: 10px; margin-top: 14px; font-size: 14px; }
.check input { width: 20px; height: 20px; accent-color: var(--accent); }
.hint { font-size: 13px; color: var(--ink-3); margin: 10px 0 0; }
.hint.card { display: flex; gap: 8px; color: var(--ink-2); }
.seg { display: flex; gap: 4px; background: var(--surface-2); padding: 4px; border-radius: 14px; overflow-x: auto; scrollbar-width: none; }
.seg.wrap { flex-wrap: wrap; }
.seg button { flex: 1; white-space: nowrap; padding: 8px 10px; border-radius: 10px; font-weight: 700; font-size: 13px; color: var(--ink-2); }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.editor h2 { margin-bottom: 14px; padding-right: 40px; }
.forms-edit { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.fe { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 10px; border-radius: 14px; background: color-mix(in srgb, var(--tone-soft) 70%, var(--surface)); }
.fe-lab { grid-column: 1 / -1; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--tone); }
.fe input[lang="he"], .fe textarea { color: var(--tone); }
.fe:has(textarea) { grid-template-columns: 1fr; }
.ph-in { font-style: italic; }
.edit-tools { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.actions.sticky { position: sticky; bottom: calc(-20px - var(--safe-b)); background: var(--bg); padding: 12px 0 calc(8px + var(--safe-b)); margin-bottom: calc(-20px - var(--safe-b)); }
.form .fld:first-of-type { margin-top: 0; }
.font-demo { font: 500 30px var(--he-font); text-align: center; padding: 10px; margin-top: 10px; background: var(--surface-2); border-radius: 12px; letter-spacing: .05em; }

/* ---------- entraînement : choix ---------- */
.modes { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.mode { text-align: left; padding: 12px; border-radius: 14px; border: 1.5px solid var(--line); display: flex; flex-direction: column; gap: 3px; }
.mode .ic { color: var(--ink-3); margin-bottom: 4px; }
.mode b { font-size: 15px; }
.mode small { font-size: 12px; color: var(--ink-3); line-height: 1.3; }
.mode.on { border-color: var(--accent); background: var(--accent-soft); }
.mode.on .ic { color: var(--accent); }
.mode:first-child { grid-column: 1 / -1; }
.opts { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.opts label { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 14px; font-weight: 600; }
.opts select { width: auto; max-width: 62%; padding: 8px 10px; }
.lessons-pick { margin-top: 14px; }
.lessons-pick summary { font-weight: 700; cursor: pointer; padding: 6px 0; list-style: none; display: flex; justify-content: space-between; }
.lessons-pick summary::-webkit-details-marker { display: none; }
.lessons-pick .pills { margin-top: 8px; max-height: 220px; overflow-y: auto; }

/* ---------- séance ---------- */
.session { display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; }
.s-top { display: flex; align-items: center; gap: 10px; padding: 14px 0 6px; position: sticky; top: 0; background: var(--bg); z-index: 5; }
.s-bar { flex: 1; height: 10px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.s-bar i { display: block; height: 100%; border-radius: 99px; background: var(--accent); transition: width .35s; }
.s-n { font-size: 12px; font-weight: 700; color: var(--ink-3); min-width: 40px; text-align: right; }
.s-body { flex: 1; display: flex; flex-direction: column; padding-top: 8px; }
.q-card { background: var(--surface); border-radius: 22px; box-shadow: var(--shadow); padding: 18px 16px 20px; animation: pop .25s ease-out; }
@keyframes pop { from { transform: translateY(8px); opacity: 0; } }
.q-meta { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.q-fr { font-size: 26px; font-weight: 800; text-align: center; margin: 8px 0 4px; }
.q-fr.sm { font-size: 18px; margin-top: 12px; }
.q-card > .muted { text-align: center; margin: 4px 0 0; font-size: 14px; }
.q-he { text-align: center; margin: 14px 0 4px; }
.q-he .he { font-size: 52px; line-height: 1.2; }
.q-card > .speak { display: grid; margin: 0 auto; }
.q-card hr { border: 0; border-top: 1px dashed var(--line); margin: 18px 0 6px; }
.listen-big { display: grid; place-items: center; width: 96px; height: 96px; border-radius: 50%; margin: 18px auto 8px; background: var(--accent-soft); color: var(--accent); }
.listen-big .ic { width: 40px; height: 40px; }

.choices { display: flex; flex-direction: column; gap: 8px; margin-top: 18px; }
.choices.he-choices { display: grid; grid-template-columns: 1fr 1fr; }
.choice { min-height: 58px; padding: 10px 12px; border-radius: 14px; border: 1.5px solid var(--line); font-weight: 600; font-size: 16px; text-align: center; background: var(--surface); transition: background .2s, border-color .2s; }
.choice .he { font-size: 28px; }
.choice.right { border-color: var(--ok); background: var(--ok-soft); }
.choice.wrong { border-color: var(--ko); background: var(--ko-soft); animation: shake .35s; }
.choice:disabled { opacity: 1; }
.choice:disabled:not(.right):not(.wrong) { opacity: .5; }
@keyframes shake { 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }
.reveal { margin-top: 14px; animation: pop .25s; }

.w-form { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.w-row { display: grid; grid-template-columns: 78px 1fr; align-items: center; gap: 8px; padding: 6px 6px 6px 10px; border-radius: 14px; background: color-mix(in srgb, var(--tone-soft) 70%, var(--surface)); }
.w-lab { font-size: 12px; font-weight: 800; color: var(--tone); display: flex; flex-direction: column; line-height: 1.2; }
.w-lab small { font-size: 10px; font-weight: 600; color: var(--ink-3); }
.w-row input { font: 500 26px var(--he-font) !important; color: var(--tone); padding: 6px 10px !important; border-color: transparent !important; background: var(--surface) !important; }
.w-row input.active-in { border-color: var(--tone) !important; }
.kbd-wrap { margin-top: 10px; }
.kbd { display: flex; flex-direction: column; gap: 6px; padding: 8px 4px; background: var(--surface-2); border-radius: 16px; user-select: none; -webkit-user-select: none; }
.kr { display: flex; gap: 5px; justify-content: center; }
.k { flex: 1; max-width: 42px; height: 46px; border-radius: 9px; background: var(--surface); box-shadow: 0 1px 0 var(--line); font: 600 22px var(--he-font); touch-action: manipulation; }
.k:active { background: var(--accent-soft); transform: translateY(1px); }
.k.wide { max-width: 64px; font: 600 18px var(--font); display: grid; place-items: center; }
.k.space { max-width: none; flex: 3; font: 600 13px var(--font); color: var(--ink-3); }

.verdict { text-align: center; font-weight: 800; font-size: 15px; padding: 6px 12px; border-radius: 999px; width: fit-content; margin: 6px auto 12px; }
.v-good { background: var(--ok-soft); color: var(--ok); }
.v-hard { background: var(--warn-soft); color: var(--warn); }
.v-again { background: var(--ko-soft); color: var(--ko); }
.corr { display: flex; flex-direction: column; gap: 8px; }
.c-row { display: grid; grid-template-columns: 44px 1fr 24px; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 14px; background: color-mix(in srgb, var(--tone-soft) 60%, var(--surface)); border: 1.5px solid transparent; }
.c-row.ko { border-color: color-mix(in srgb, var(--ko) 45%, transparent); }
.c-main { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.c-exp { display: flex; align-items: center; gap: 4px; flex-direction: row-reverse; }
.c-exp .he { font-size: 28px; }
.c-you { font-size: 13px; color: var(--ink-2); }
.c-you [lang="he"] { font: 500 20px var(--he-font); }
.c-note { font-size: 12px; color: var(--warn); }
.c-ic { color: var(--ok); }
.c-row.ko .c-ic { color: var(--ko); }
mark.d-extra { background: var(--ko-soft); color: var(--ko); text-decoration: line-through; border-radius: 4px; }
mark.d-miss { background: var(--ok-soft); color: var(--ok); border-radius: 4px; }

.grades { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; width: 100%; }
.gb { display: flex; flex-direction: column; align-items: center; padding: 8px 4px; border-radius: 14px; background: var(--surface); border: 1.5px solid var(--line); }
.gb b { font-size: 14px; }
.gb small { font-size: 11px; color: var(--ink-3); }
.gb.g-again b { color: var(--ko); } .gb.g-hard b { color: var(--warn); } .gb.g-good b { color: var(--ok); } .gb.g-easy b { color: var(--m); }
.gb.sug { border-width: 2.5px; box-shadow: var(--shadow); }
.gb.g-again.sug { border-color: var(--ko); background: var(--ko-soft); }
.gb.g-hard.sug { border-color: var(--warn); background: var(--warn-soft); }
.gb.g-good.sug { border-color: var(--ok); background: var(--ok-soft); }
.gb.g-easy.sug { border-color: var(--m); background: var(--m-soft); }

.built { min-height: 64px; margin-top: 16px; padding: 10px; border-radius: 14px; border: 2px dashed var(--line); display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.built.ok { border: 2px solid var(--ok); background: var(--ok-soft); }
.built.ko { border: 2px solid var(--ko); background: var(--ko-soft); }
.tiles { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; justify-content: center; }
.tile { padding: 8px 14px; border-radius: 12px; background: var(--surface-2); font: 500 24px var(--he-font); box-shadow: 0 2px 0 var(--line); }
.tile:disabled { opacity: .25; }
.tile.in { background: var(--surface); }

.summary { text-align: center; padding: 40px 0 20px; }
.trophy { display: grid; place-items: center; width: 86px; height: 86px; border-radius: 50%; margin: 0 auto 14px; background: var(--accent-soft); color: var(--accent); }
.trophy .ic { width: 42px; height: 42px; }
.trophy path { fill: currentColor; }
.sum-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 22px 0; }
.sum-stats div { background: var(--surface); border-radius: 16px; padding: 12px; box-shadow: var(--shadow); }
.sum-stats b { display: block; font-size: 24px; font-weight: 800; }
.sum-stats span { font-size: 12px; color: var(--ink-3); }
.summary h3 { text-align: left; }
.summary .list { background: var(--surface); border-radius: 16px; box-shadow: var(--shadow); text-align: left; }

.w-in { position: relative; display: block; }
.w-in input { padding-left: 44px !important; }
.mic-sm { position: absolute; left: 4px; top: 50%; transform: translateY(-50%); width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; color: var(--ink-3); }
.mic-sm .ic { width: 19px; height: 19px; }
.mic-sm.rec, .mic-big.rec { color: #fff; background: var(--ko); animation: pulse 1.2s infinite; }
.ic.inline { width: 15px; height: 15px; vertical-align: -3px; }
.mic-big { display: grid; place-items: center; width: 108px; height: 108px; border-radius: 50%; margin: 22px auto 6px; background: var(--accent); color: var(--accent-ink); box-shadow: 0 10px 26px color-mix(in srgb, var(--accent) 35%, transparent); }
.mic-big .ic { width: 46px; height: 46px; }
.mic-big:disabled { opacity: .35; animation: none; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--ko) 55%, transparent); } 100% { box-shadow: 0 0 0 22px transparent; } }
.mic-status { text-align: center; margin: 4px 0 0; }
.heard { min-height: 44px; text-align: center; font: 500 30px var(--he-font); color: var(--ink-2); margin-top: 8px; }
.speak-res { margin-top: 6px; }
.speak-card .muted { text-align: center; }
.slot-name { color: var(--tone); }
.cta-bar.wrap-bar { flex-wrap: wrap; }
.cta-bar.wrap-bar > .btn { flex-basis: 100%; }

/* ---------- ajouter ---------- */
.add-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.add-opt { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 14px; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; text-align: left; }
.add-opt .ic { width: 28px; height: 28px; color: var(--accent); margin-bottom: 6px; }
.add-opt b { font-size: 15px; }
.add-opt small { font-size: 12px; color: var(--ink-3); line-height: 1.3; }
.add-opt.main { grid-column: 1 / -1; background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 65%, #1B4D9A)); color: #fff; flex-direction: row; align-items: center; gap: 14px; }
.add-opt.main .ic { color: #fff; width: 36px; height: 36px; margin: 0; }
.add-opt.main small { color: rgba(255,255,255,.85); display: block; }
.add-opt.main b { display: block; }
.shots { display: flex; gap: 8px; flex-wrap: wrap; }
.shot { position: relative; width: 84px; height: 110px; border-radius: 12px; overflow: hidden; background: var(--surface-2); }
.shot img { width: 100%; height: 100%; object-fit: cover; }
.shot .icon-btn { position: absolute; top: 2px; right: 2px; width: 28px; height: 28px; background: rgba(0,0,0,.55); color: #fff; border-radius: 50%; }
.shot .icon-btn .ic { width: 14px; }
.ai-panel .card .btn.big { margin-top: 14px; }
.review { display: flex; flex-direction: column; gap: 10px; margin: 6px 0 10px; }
.rv { display: flex; gap: 10px; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 12px; opacity: .55; transition: opacity .2s; }
.rv.on { opacity: 1; }
.rv-check input { position: absolute; opacity: 0; }
.rv-check span { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; border: 2px solid var(--line); }
.rv-check input:checked + span { background: var(--accent); border-color: var(--accent); }
.rv-check input:checked + span::after { content: '✓'; color: var(--accent-ink); font-weight: 800; }
.rv-body { flex: 1; min-width: 0; cursor: pointer; }
.rv-h { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.rv .grid4 { grid-template-columns: 26px 1fr 1fr; }
.rv .cell { min-height: 70px; }
.rv .cell .val .he { font-size: 24px; }

/* ---------- toast ---------- */
.toast { position: fixed; left: 50%; bottom: calc(var(--tab-h) + var(--safe-b) + 20px); transform: translate(-50%, 20px); opacity: 0; z-index: 100; background: var(--ink); color: var(--bg); padding: 11px 18px; border-radius: 14px; font-weight: 600; font-size: 14px; max-width: calc(100vw - 32px); box-shadow: var(--shadow); transition: all .25s; text-align: center; }
.toast.show { transform: translate(-50%, 0); opacity: 1; }
.toast.ok { background: var(--ok); color: #fff; }
.toast.err { background: var(--ko); color: #fff; }

@media (min-width: 700px) {
  .view { padding: 0 24px; }
  .grid4 { gap: 10px; }
  .cell .val .he { font-size: 34px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- leçons, entretien, test ---------- */
.section-t { font-size: 17px; font-weight: 800; margin: 22px 0 10px; }
.section-t small { font-weight: 600; }
.fc-k { display: block; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .07em; opacity: .75; }
.flows, .duo { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.flow-card { position: relative; text-align: left; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 14px 16px; display: flex; flex-direction: column; gap: 2px; min-height: 108px; }
.flow-card b { font-size: 22px; font-weight: 800; }
.flow-card small { font-size: 12px; color: var(--ink-3); }
.flow-card .fc-go { position: absolute; right: 12px; bottom: 12px; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); }
.flow-card .fc-go .ic { width: 16px; height: 16px; }
.flow-card.lesson-flow { grid-column: 1 / -1; background: linear-gradient(135deg, hsl(var(--h) 60% 42%), hsl(calc(var(--h) + 40) 55% 38%)); color: #fff; gap: 8px; }
.flow-card.lesson-flow .fc-go { position: static; width: auto; height: auto; border-radius: 12px; padding: 10px; background: rgba(255,255,255,.95); color: hsl(var(--h) 60% 32%); font-weight: 800; gap: 6px; display: flex; justify-content: center; }
.today[style*="--h"] { background: linear-gradient(135deg, hsl(var(--h) 60% 40%), hsl(calc(var(--h) + 40) 55% 34%)); }
.today .fc-k { color: #fff; }

.stages { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; width: 100%; }
.st { position: relative; display: flex; flex-direction: column; gap: 1px; padding: 7px 8px 6px; border-radius: 10px; background: rgba(127,127,127,.16); overflow: hidden; }
.st i { position: absolute; inset: 0 auto 0 0; background: rgba(19,149,95,.28); }
.today .st, .lesson-flow .st { background: rgba(255,255,255,.18); }
.today .st i, .lesson-flow .st i { background: rgba(255,255,255,.32); }
.st em, .st small { position: relative; font-style: normal; }
.st em { font-size: 11px; font-weight: 800; }
.st small { font-size: 11px; opacity: .8; }

.st-chip { font-size: 11px; font-weight: 800; padding: 3px 8px; border-radius: 999px; white-space: nowrap; }
.st-chip.s-current { background: var(--accent-soft); color: var(--accent); }
.st-chip.s-done { background: var(--ok-soft); color: var(--ok); }
.st-chip.s-todo { background: var(--surface-2); color: var(--ink-3); }

.lesson-list { display: flex; flex-direction: column; gap: 10px; }
.lesson-card { text-align: left; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 14px 14px 18px; border-left: 5px solid hsl(var(--h) 60% 55%); display: flex; flex-direction: column; gap: 8px; }
.lc-h { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.lc-h b { font-size: 17px; }
.lc-counts { font-size: 12px; color: var(--ink-3); }
.top h1[style*="--h"] { color: hsl(var(--h) 55% 38%); }
.grp-h.static { cursor: default; }
.lesson-grp .grp-b { display: block; }
.stage-pips { display: flex; flex-direction: column; gap: 2px; flex: none; }
.stage-pips i { width: 6px; height: 6px; border-radius: 50%; background: var(--line); }
.stage-pips i.on { background: var(--ok); }

.s-level { display: flex; align-items: center; gap: 5px; margin: 2px 0 4px; font-size: 12px; color: var(--ink-3); }
.s-level span { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--surface-2); font-weight: 800; font-size: 11px; }
.s-level span.on { background: var(--accent); color: var(--accent-ink); }
.s-level b { margin-left: 4px; font-weight: 700; }
.grades.two { grid-template-columns: 1fr 1.4fr; }
.choices.spell .choice { min-height: 64px; }
.c-you.center { text-align: center; margin-top: 10px; }
.trophy.gold { background: #FFF3D6; color: #E0A100; }
.sum-lesson { margin: 18px 0 0; }
.add-intro { margin: -6px 0 12px; }
.acc-mail { display: flex; align-items: center; gap: 8px; font-weight: 700; margin: 0; }
.acc-mail .ic { color: var(--ok); }

/* ---------- connexion ---------- */
.login { max-width: 420px; margin: 0 auto; padding: 48px 0 40px; text-align: center; }
.login-logo img { border-radius: 22px; box-shadow: var(--shadow); }
.login .hello { margin-top: 18px; }
.login h1 { margin-bottom: 18px; }
.login .seg { margin-bottom: 14px; }
.login form { text-align: left; }
.login form .btn { margin-top: 16px; }
.login-err { color: var(--ko); font-weight: 600; font-size: 14px; margin: 12px 0 0; }
body[data-route="login"] .tabbar { display: none; }
