/* Police : Somar Sans (Baianat), servie depuis assets/fonts. */
@font-face { font-family: Somar; src: url(../assets/fonts/SomarSans-Regular.woff2) format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: Somar; src: url(../assets/fonts/SomarSans-Medium.woff2) format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: Somar; src: url(../assets/fonts/SomarSans-SemiBold.woff2) format('woff2'); font-weight: 600; font-display: swap; }
@font-face { font-family: Somar; src: url(../assets/fonts/SomarSans-Bold.woff2) format('woff2'); font-weight: 700; font-display: swap; }
@font-face { font-family: Somar; src: url(../assets/fonts/SomarSans-ExtraBold.woff2) format('woff2'); font-weight: 800; font-display: swap; }
:root {
  --bg: #F4F5F8; --card: #fff; --ink: #0F172A; --ink2: #334155; --muted: #64748B; --line: #E2E8F0;
  --primary: #0A7F3B; --primary-2: #086932; --gold: #FFD43B; --green: #02D15F; --black: #1B1B1B; --ok: #16A34A; --ko: #DC2626;
  --ok-bg: #ECFDF3; --ko-bg: #FEF2F2; --u: var(--primary);
  --r: 16px; --sh: 0 1px 2px rgba(15,23,42,.05), 0 6px 24px rgba(15,23,42,.06);
  --font: Somar, 'Segoe UI', Tahoma, system-ui, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 17px; line-height: 1.7; }
a { color: var(--primary); text-decoration: none; }
h1, h2, h3, h4 { line-height: 1.35; margin: 0 0 .4em; }
h1 { font-size: 1.6rem; } h2 { font-size: 1.25rem; } h3 { font-size: 1.05rem; }
p { margin: .35em 0; }
.n { direction: ltr; unicode-bidi: isolate; white-space: nowrap; font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); } .small { font-size: .86rem; }
.container { max-width: 1100px; margin: 0 auto; padding: 22px 18px 80px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--sh); padding: 20px; }
.eyebrow { color: var(--u); font-weight: 600; font-size: .85rem; margin: 0 0 4px; }
.page-title { margin-top: 6px; }

/* ---- buttons ---- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: inherit; font-weight: 600; font-size: .95rem; border: 1px solid var(--line); background: #fff; color: var(--ink); padding: 9px 16px; border-radius: 12px; cursor: pointer; transition: .15s; }
.btn:hover { border-color: #CBD5E1; background: #F8FAFC; }
.btn.primary { background: var(--u); border-color: var(--u); color: #fff; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.lg { padding: 12px 22px; font-size: 1rem; }
.btn.sm { padding: 5px 12px; font-size: .85rem; border-radius: 10px; }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--ko); border-color: #FECACA; }
.btn:disabled { opacity: .5; cursor: default; }
.icon-btn { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 12px; border: 1px solid var(--line); background: #fff; color: var(--muted); font-size: 1rem; }
.row-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 16px 0; align-items: center; }
.row-actions.center { justify-content: center; }

/* ---- topbar ---- */
.topbar { position: sticky; top: 0; z-index: 20; background: rgba(255,255,255,.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.topbar-in { max-width: 1100px; margin: 0 auto; padding: 10px 18px; display: flex; align-items: center; gap: 18px; }
.brand { display: flex; align-items: center; gap: 8px; color: var(--ink); font-weight: 700; font-size: 1.2rem; white-space: nowrap; }
.brand small { font-weight: 500; color: var(--muted); font-size: .75rem; }
.logo { width: 32px; height: 32px; display: block; flex: none; }
.nav { display: flex; gap: 4px; }
.nav a { color: var(--ink2); padding: 6px 12px; border-radius: 10px; font-weight: 500; font-size: .95rem; }
.nav a.active, .nav a:hover { background: #F1F5F9; color: var(--ink); }
.hdr-right { margin-inline-start: auto; display: flex; align-items: center; gap: 10px; }
.hdr-stats { display: flex; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px; background: #F1F5F9; font-size: .82rem; font-weight: 600; white-space: nowrap; }
.chip.xp { background: #FEF3C7; color: #92400E; }
.chip.lvl { background: #CCFBF1; color: var(--primary-2); }
.flame { font-style: normal; color: #CBD5E1; } .flame.on { color: #F97316; }
.parent-btn.on { background: #FEF3C7; border-color: #FCD34D; color: #92400E; }

/* ---- home ---- */
.hero { display: grid; grid-template-columns: 1.5fr 1fr; gap: 16px; margin-bottom: 16px; }
.hero-main { display: flex; flex-direction: column; justify-content: center; }
.hero-main h1 { font-size: 1.9rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.level-card { display: grid; grid-template-columns: auto 1fr; gap: 14px 16px; align-items: center; }
.lv-info b { font-size: 1.1rem; }
.goal { grid-column: 1 / -1; display: flex; align-items: center; gap: 12px; border-top: 1px dashed var(--line); padding-top: 12px; }
.ring { --p: 0; width: 92px; height: 92px; border-radius: 50%; background: conic-gradient(var(--u) calc(var(--p) * 360deg), #E2E8F0 0); display: grid; place-items: center; flex: none; }
.ring > div { width: 74%; height: 74%; border-radius: 50%; background: #fff; display: grid; place-content: center; text-align: center; line-height: 1.15; }
.ring b { font-size: 1.25rem; } .ring span { font-size: .7rem; color: var(--muted); }
.ring.big { width: 140px; height: 140px; margin: 0 auto 10px; } .ring.big b { font-size: 1.7rem; }
.goal .ring { width: 70px; height: 70px; --u: var(--gold); } .goal .ring b { font-size: .95rem; }
.bar { height: 10px; background: #E2E8F0; border-radius: 99px; overflow: hidden; margin: 6px 0; }
.bar.thin { height: 6px; }
.bar i { display: block; height: 100%; background: var(--u); border-radius: 99px; transition: width .4s; }
.quick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 26px; }
.tile { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; color: var(--ink); box-shadow: var(--sh); transition: .15s; display: flex; flex-direction: column; gap: 2px; }
.tile:hover { transform: translateY(-2px); border-color: var(--primary); }
.tile > span { color: var(--muted); font-size: .84rem; line-height: 1.5; }
.unit { margin-bottom: 26px; }
.unit h2 { display: flex; align-items: center; gap: 10px; }
.u-ico { width: 36px; height: 36px; border-radius: 10px; background: var(--u); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: .85rem; flex: none; direction: ltr; }
.lessons { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.lesson { padding: 16px; border-top: 3px solid var(--u); display: flex; flex-direction: column; }
.l-top { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.l-top h3 { margin: 0; }
.l-actions { display: flex; gap: 8px; margin-top: auto; padding-top: 10px; }
.stars { white-space: nowrap; letter-spacing: 1px; }
.stars i { font-style: normal; color: #CBD5E1; } .stars i.on { color: var(--gold); }

/* ---- lesson page ---- */
.back { display: inline-block; margin-bottom: 10px; color: var(--muted); }
.l-head { display: flex; gap: 14px; align-items: center; margin-bottom: 14px; border-top: 4px solid var(--u); }
.l-head .u-ico { width: 48px; height: 48px; font-size: 1.05rem; }
.l-head > div { flex: 1; }
.learn { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.rule, .example { border-radius: 12px; padding: 14px 16px; }
.rule { background: #F8FAFC; border: 1px solid var(--line); }
.example { background: color-mix(in srgb, var(--u) 6%, #fff); border: 1px solid color-mix(in srgb, var(--u) 25%, #fff); }
.rule h4, .example h4 { color: var(--u); }
.rule ol, .rule ul { padding-inline-start: 22px; margin: 6px 0; }
.note { background: #FFFBEB; border: 1px solid #FDE68A; border-radius: 10px; padding: 6px 10px; font-size: .9rem; }
.big-line { font-size: 1.1rem; font-weight: 600; }
.rels { list-style: none; padding: 0 !important; display: grid; gap: 4px; }
.rels li { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 2px 10px; text-align: center; }
.parent-tip { margin-top: 6px; background: #FFFBEB; border-color: #FDE68A; }
.ctx { background: #F8FAFC; border-radius: 10px; padding: 10px 12px; }
.solved { padding-inline-start: 20px; } .solved li span { font-weight: 600; }
.op-line { margin: 2px 0; }

/* ---- tables ---- */
.ptable, .utable, .dtable, .grid { border-collapse: collapse; margin: 10px auto; font-variant-numeric: tabular-nums; }
.ptable th, .ptable td, .utable th, .utable td, .dtable th, .dtable td { border: 1px solid #CBD5E1; padding: 4px 10px; text-align: center; min-width: 44px; }
.ptable th { background: #F1F5F9; font-size: .78rem; font-weight: 600; }
.ptable th.grp { background: #E2E8F0; }
.ptable td, .utable td { font-size: 1.25rem; font-weight: 600; height: 42px; background: #fff; }
.utable th { background: #F1F5F9; font-family: Arial, sans-serif; font-size: .9rem; }
.ptable .hl, .utable .hl { background: color-mix(in srgb, var(--u) 16%, #fff); color: var(--ink); }
.dtable th { background: #F1F5F9; font-size: .85rem; }
.grid th { font-weight: 600; color: var(--muted); padding: 2px 8px; font-family: Arial, sans-serif; }
.grid td { border: 1.5px solid #3B82F6; width: 44px; height: 44px; text-align: center; padding: 0; font-size: 1.5rem; background: #fff; }
.grid .cell { width: 100%; height: 100%; border: 0; background: transparent; font: inherit; cursor: pointer; }
.grid .cell:hover { background: #EFF6FF; }
.grid .cell.good { background: var(--ok-bg); } .grid .cell.bad { background: var(--ko-bg); }
.grid .cell.bad::after { content: '✕'; color: var(--ko); }
.mk.ok { color: var(--ok); font-weight: 700; }

/* ---- vertical ops ---- */
.vop { display: inline-block; margin: 8px auto; font-family: 'Courier New', ui-monospace, monospace; font-size: 1.45rem; font-weight: 700; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 10px 18px; }
.vop-row { display: flex; justify-content: flex-end; }
.vop .c { width: 1.05em; text-align: center; display: inline-block; min-height: 1.3em; }
.vop .c.gap { margin-right: .3em; }
.vop .c.op { color: var(--u); }
.vop-line { border-top: 2.5px solid var(--ink); margin: 3px 0; }
.vop .carry { font-size: .8rem; color: var(--ko); line-height: 1; min-height: 0; }
.vop .carry .c { min-height: 0; }
.vop .part { color: var(--ink2); }
.vop .res { color: var(--ok); }
.vop .ask .c { border-bottom: 2px dotted #CBD5E1; }

/* ---- session ---- */
.session { max-width: 760px; margin: 0 auto; }
.s-top { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.s-progress { flex: 1; display: flex; gap: 4px; }
.s-progress i { flex: 1; height: 8px; border-radius: 99px; background: #E2E8F0; }
.s-progress i.ok { background: var(--ok); } .s-progress i.ko { background: var(--ko); } .s-progress i.cur { background: var(--u); opacity: .55; }
.combo { font-weight: 700; font-size: .85rem; color: #CBD5E1; white-space: nowrap; }
.combo.on { color: #EA580C; }
.s-xp { font-weight: 700; color: #92400E; background: #FEF3C7; padding: 2px 10px; border-radius: 99px; font-size: .85rem; white-space: nowrap; }
.q-card { padding: 24px; }
.q-meta { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.tag { background: color-mix(in srgb, var(--u) 12%, #fff); color: var(--u); font-weight: 600; font-size: .82rem; padding: 2px 10px; border-radius: 99px; }
.q-context { background: #F8FAFC; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-bottom: 12px; }
.q-visual { text-align: center; margin: 10px 0; overflow-x: auto; }
.q-visual svg { max-width: 100%; height: auto; }
.q-visual.sm svg { max-height: 200px; }
.q-prompt { font-size: 1.15rem; font-weight: 600; margin: 8px 0 14px; }
.q-prompt.sm { font-size: 1rem; }
.words { margin-top: 8px; padding: 10px 14px; background: #F8FAFC; border-radius: 10px; border-inline-start: 4px solid var(--u); font-size: 1.12rem; }
.expr { margin-top: 10px; font-size: 1.3rem; text-align: center; background: #F8FAFC; border-radius: 10px; padding: 10px; }
.claim { margin-top: 8px; font-size: 1.2rem; text-align: center; padding: 8px; background: #F8FAFC; border-radius: 10px; }
.hl-d { color: var(--u); font-size: 1.3em; }
.inp-wrap { display: flex; align-items: center; gap: 10px; justify-content: center; }
.ans { font: inherit; font-size: 1.5rem; font-weight: 700; text-align: center; width: min(320px, 100%); padding: 10px 14px; border: 2px solid var(--line); border-radius: 14px; outline: none; letter-spacing: 1px; }
.ans:focus { border-color: var(--u); box-shadow: 0 0 0 4px color-mix(in srgb, var(--u) 15%, transparent); }
.ans.good { border-color: var(--ok); background: var(--ok-bg); } .ans.bad { border-color: var(--ko); background: var(--ko-bg); }
.suffix { font-weight: 700; color: var(--muted); font-size: 1.1rem; }
.choices { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.choices.stack { grid-template-columns: 1fr; }
.choices.two { max-width: 420px; margin: 0 auto; }
.choice { font: inherit; font-size: 1.02rem; text-align: start; display: flex; gap: 10px; align-items: center; padding: 12px 14px; border: 2px solid var(--line); border-radius: 14px; background: #fff; cursor: pointer; transition: .12s; color: var(--ink); }
.choices.two .choice { justify-content: center; font-weight: 700; }
.choice:hover:not(:disabled) { border-color: var(--u); background: color-mix(in srgb, var(--u) 5%, #fff); }
.choice .key { flex: none; width: 26px; height: 26px; border-radius: 8px; background: #F1F5F9; display: grid; place-items: center; font-size: .8rem; font-weight: 700; color: var(--muted); }
.choice.good { border-color: var(--ok); background: var(--ok-bg); } .choice.bad { border-color: var(--ko); background: var(--ko-bg); }
.choice:disabled { cursor: default; }
.cmp { display: flex; align-items: center; justify-content: center; gap: 18px; font-size: 1.6rem; font-weight: 700; margin: 6px 0 16px; flex-wrap: wrap; }
.cmp.sm { font-size: 1.1rem; justify-content: flex-start; }
.slot { width: 60px; height: 60px; border: 2px dashed #CBD5E1; border-radius: 14px; display: grid; place-items: center; color: #CBD5E1; }
.slot.filled { border-style: solid; border-color: var(--ok); color: var(--ok); background: var(--ok-bg); }
.cmp.sm .slot { width: 40px; height: 40px; }
.cmp-btns { display: flex; justify-content: center; gap: 12px; }
.choice.sym { width: 76px; height: 64px; justify-content: center; font-size: 1.8rem; font-weight: 700; font-family: Arial, sans-serif; }
.q-actions { display: flex; justify-content: space-between; align-items: center; margin-top: 16px; }
.hint { background: #FFFBEB; border: 1px solid #FDE68A; border-radius: 12px; padding: 10px 14px; margin-top: 10px; }
.parent-peek { margin-top: 14px; background: #FFFBEB; border: 1px dashed #F59E0B; border-radius: 12px; padding: 10px 14px; }
.parent-peek > span { color: #92400E; font-weight: 600; }
.fb { margin-top: 16px; border-radius: 14px; padding: 14px 16px; animation: pop .25s ease; }
.fb.ok { background: var(--ok-bg); border: 1px solid #BBF7D0; }
.fb.ko { background: var(--ko-bg); border: 1px solid #FECACA; }
.fb-head { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; align-items: center; }
.fb.ok .fb-head > b { color: var(--ok); font-size: 1.15rem; } .fb.ko .fb-head > b { color: var(--ko); font-size: 1.1rem; }
.xp-pop { font-weight: 700; color: #92400E; background: #FEF3C7; padding: 2px 10px; border-radius: 99px; }
.explain { margin-top: 8px; background: #fff; border-radius: 10px; padding: 10px 12px; overflow-x: auto; }
details summary { cursor: pointer; color: var(--u); font-weight: 600; margin-top: 8px; }
.next-row { display: flex; justify-content: flex-start; margin-top: 14px; }
.angles-row { display: flex; justify-content: center; flex-wrap: wrap; gap: 12px; }
.angles-row figure { margin: 0; text-align: center; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 4px 8px; }
.angles-row figcaption { font-weight: 700; font-family: Arial, sans-serif; }
.svg-lbl { font: 700 15px Arial, sans-serif; }
.chart-box { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 10px; max-width: 520px; margin: 0 auto; }
.chart-title { font-weight: 600; font-size: .9rem; color: var(--ink2); }
.chart .gl { stroke: #CBD5E1; } .chart .gl.minor { stroke: #EEF2F6; } .chart .ax { stroke: #0F172A; stroke-width: 1.5; }
.chart .tk { font: 12px var(--font); fill: var(--muted); } .chart .lb { font: 600 13px var(--font); fill: var(--ink); }
svg.lines { max-width: 380px; border: 1px solid var(--line); border-radius: 12px; }
@keyframes pop { from { transform: scale(.97); opacity: 0; } to { transform: none; opacity: 1; } }
.shake { animation: shake .35s; } @keyframes shake { 25% { transform: translateX(6px); } 75% { transform: translateX(-6px); } }

/* ---- result ---- */
.result { max-width: 760px; margin: 0 auto; }
.res-card { text-align: center; }
.res-stats { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; margin: 14px 0; }
.res-stats > div { background: #F8FAFC; border: 1px solid var(--line); border-radius: 12px; padding: 8px 16px; min-width: 110px; display: flex; flex-direction: column; }
.res-stats > div > b { font-size: 1.3rem; } .res-stats > div > span { font-size: .8rem; color: var(--muted); }
.sec-title { margin: 24px 0 10px; }
.mistake { margin-bottom: 10px; }

/* ---- challenge ---- */
.center-card { max-width: 560px; margin: 30px auto; text-align: center; }
.best { margin: 10px 0 18px; font-size: 1.05rem; }
.challenge-run { max-width: 680px; margin: 0 auto; }
.c-top { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; padding: 12px 16px; }
.timer { flex: 1; height: 12px; border-radius: 99px; background: #E2E8F0; overflow: hidden; }
.timer i { display: block; height: 100%; background: linear-gradient(90deg, var(--ko), var(--gold), var(--primary)); width: 100%; transition: width .1s linear; }
.c-score { font-weight: 600; } .c-score b { font-size: 1.4rem; color: var(--primary); }
.tleft { font-weight: 700; font-size: 1.3rem; width: 42px; text-align: center; font-variant-numeric: tabular-nums; }
.cfb { text-align: center; margin-top: 10px; color: var(--ko); min-height: 1.6em; }
.flash-ok { box-shadow: 0 0 0 3px var(--ok); } .flash-ko { box-shadow: 0 0 0 3px var(--ko); }

/* ---- badges / parent ---- */
.badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; margin-top: 12px; }
.badge { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 4px; opacity: .55; filter: grayscale(1); }
.badge.earned { opacity: 1; filter: none; border-color: #FCD34D; }
.b-ico { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(135deg, #FDE68A, #F59E0B); color: #78350F; font-weight: 700; font-size: .95rem; direction: ltr; margin-bottom: 4px; }
.date { color: var(--ok); }
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 14px 0; }
.kpi { display: flex; flex-direction: column; } .kpi > b { font-size: 1.7rem; color: var(--primary); } .kpi > span { color: var(--muted); font-size: .88rem; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; }
.weak { list-style: none; padding: 0; margin: 0; }
.weak li { display: flex; gap: 10px; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--line); padding: 8px 0; }
.pill { font-size: .78rem; font-weight: 700; padding: 1px 8px; border-radius: 99px; } .pill.bad { background: var(--ko-bg); color: var(--ko); }
.ptab { width: 100%; border-collapse: collapse; }
.ptab th, .ptab td { text-align: start; padding: 8px 6px; border-bottom: 1px solid var(--line); font-size: .92rem; }
.ptab th { color: var(--muted); font-weight: 600; font-size: .82rem; }
.ptab td .bar { width: 120px; display: inline-block; vertical-align: middle; margin-inline-end: 6px; }
.card + .card { margin-top: 12px; }
.how ol { padding-inline-start: 22px; }
.settings { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: end; }
.field { display: flex; flex-direction: column; gap: 4px; font-weight: 600; font-size: .9rem; }
.field input { font: inherit; font-weight: 500; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 12px; outline: none; }
.field input:focus { border-color: var(--primary); }
.check { display: flex; gap: 8px; align-items: center; }

/* ---- onboarding ---- */
.onboard { max-width: 560px; margin: 40px auto; text-align: center; display: flex; flex-direction: column; gap: 12px; }
.brand-big { font-size: 2.6rem; font-weight: 700; color: var(--primary); }
.onboard .field { text-align: start; }
.onboard input { font-size: 1.2rem; }

/* ---- toasts / confetti ---- */
.toasts { position: fixed; bottom: 18px; left: 18px; display: flex; flex-direction: column; gap: 8px; z-index: 50; }
.toast { background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 12px; box-shadow: var(--sh); display: flex; flex-direction: column; animation: pop .25s; max-width: 320px; transition: .4s; }
.toast span { font-size: .85rem; opacity: .85; }
.toast.gold { background: linear-gradient(135deg, #B45309, #F59E0B); }
.toast.badge { background: #115E59; } .toast.err { background: var(--ko); }
.toast.out { opacity: 0; transform: translateY(10px); }
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 60; overflow: hidden; }
.confetti i { position: absolute; top: -12px; width: 9px; height: 14px; border-radius: 2px; animation: fall 2.2s ease-in forwards; }
@keyframes fall { to { top: 105%; transform: rotate(540deg); } }

/* ---- exam paper ---- */
.exam-bar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 16px; margin-bottom: 16px; }
.exam-bar .row-actions { margin: 0; }
.paper { background: #fff; max-width: 820px; margin: 0 auto 20px; padding: 28px 34px; border: 2px dashed #60A5FA; border-radius: 10px; font-size: 16px; }
.paper.corr { border-color: #F59E0B; }
.hidden-corr { display: none; }
.ex-head { width: 100%; border-collapse: collapse; margin-bottom: 12px; }
.ex-head td { border: 1px solid #94A3B8; padding: 6px 10px; font-weight: 600; font-size: .92rem; }
.ex-title { text-align: center; background: #FEF9C3; border: 2px solid #65A30D; border-radius: 10px; padding: 6px; font-size: 1.2rem; color: #B91C1C; }
.ex h3 { display: inline-flex; gap: 8px; align-items: baseline; background: #DCFCE7; border: 1.5px solid #65A30D; border-radius: 8px; padding: 2px 14px; margin: 14px 0 6px; color: #B91C1C; }
.ex h3 em { font-style: normal; color: var(--ink); font-size: .85rem; font-weight: 600; }
.ex ol { padding-inline-start: 22px; margin: 4px 0; } .ex li { margin: 3px 0; }
.ops-row { display: flex; justify-content: space-around; flex-wrap: wrap; gap: 10px; font-size: 1.15rem; font-weight: 600; margin: 8px 0; }
.ops-sol { display: flex; justify-content: space-around; flex-wrap: wrap; gap: 8px; }
.ops-sol .vop { font-size: 1.1rem; }
.work { height: 120px; }
.conv-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 20px; font-size: 1.1rem; font-weight: 600; margin: 6px 0; }
.ex-fig { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.ex-fig > div { flex: 1; min-width: 220px; }
.ex-fig .grid td { width: 36px; height: 36px; }
.ex-foot { text-align: center; color: var(--muted); margin-top: 16px; }
.ex-total { text-align: center; font-weight: 700; font-size: 1.15rem; border: 2px solid var(--ink); border-radius: 10px; width: 200px; margin: 16px auto 0; }

/* ---- responsive ---- */
@media (max-width: 860px) {
  .hero, .learn, .two-col { grid-template-columns: 1fr; }
  .quick, .kpis { grid-template-columns: 1fr 1fr; }
  .nav { display: none; }
  .brand small { display: none; }
}
@media (max-width: 560px) {
  body { font-size: 16px; }
  .container { padding: 14px 12px 60px; }
  .choices { grid-template-columns: 1fr; }
  .hdr-stats .chip.lvl { display: none; }
  .q-card { padding: 16px; }
  .settings { grid-template-columns: 1fr; }
  .paper { padding: 16px; }
  .conv-grid { grid-template-columns: 1fr; }
  .parent-btn { font-size: .75rem; padding: 4px 8px; }
}

/* ---- print ---- */
@media print {
  @page { size: A4; margin: 12mm; }
  body { background: #fff; font-size: 14px; }
  .no-print, .topbar, .exam-bar, .toasts { display: none !important; }
  .container { padding: 0; max-width: none; }
  .paper { border: 2px solid #94A3B8; margin: 0; max-width: none; box-shadow: none; }
  #corr { display: none !important; }
  body.print-corr #corr { display: block !important; page-break-before: always; }
  .ex { page-break-inside: avoid; }
}

/* ================= الدروس المتحركة ================= */
.player { margin: 0 0 18px; border-radius: 20px; overflow: hidden; background: #0F172A; box-shadow: var(--sh); }
.stage-wrap { position: relative; }
.stage { position: relative; height: clamp(360px, 52vw, 470px); overflow: auto; background:
  radial-gradient(circle at 1px 1px, #E2E8F0 1px, transparent 0) 0 0 / 22px 22px, #FBFCFE; }
.scene { min-height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; padding: 26px 18px; text-align: center; animation: sceneIn .45s ease both; }
@keyframes sceneIn { from { opacity: 0; transform: scale(.985); } to { opacity: 1; transform: none; } }
.caption { background: #0F172A; color: #fff; min-height: 70px; display: flex; align-items: center; padding: 12px 20px; }
.caption p { margin: 0; font-size: 1.12rem; font-weight: 500; line-height: 1.6; }
.caption p.fresh { animation: capIn .35s ease both; }
@keyframes capIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.caption .n { color: #FDE68A; }
.pl-ctrl { display: flex; align-items: center; gap: 8px; padding: 8px 12px 12px; background: #0F172A; }
.pc { font: inherit; border: 0; background: #1E293B; color: #E2E8F0; height: 38px; min-width: 38px; border-radius: 10px; cursor: pointer; font-size: 1rem; padding: 0 10px; }
.pc:hover { background: #334155; }
.pc.main { background: var(--u); color: #fff; min-width: 48px; }
.pc.wide { font-size: .85rem; white-space: nowrap; }
.pl-bar { flex: 1; display: flex; gap: 3px; direction: rtl; }
.pl-bar i { flex: 1; height: 7px; border-radius: 99px; background: #334155; cursor: pointer; }
.pl-bar i.done { background: color-mix(in srgb, var(--u) 70%, #fff); } .pl-bar i.cur { background: #fff; }
.big-play { position: absolute; left: 0; right: 0; bottom: 26px; margin: 0 auto; width: fit-content; display: flex; align-items: center; gap: 12px; font: inherit; font-size: 1.25rem; font-weight: 700; color: #fff; background: var(--u); border: 0; border-radius: 999px; padding: 14px 28px 14px 22px; cursor: pointer; box-shadow: 0 10px 30px rgba(15,23,42,.25); animation: pulseBtn 1.8s ease-in-out infinite; }
.big-play .bp-ico { width: 36px; height: 36px; border-radius: 50%; background: rgba(255,255,255,.22); display: grid; place-items: center; font-size: 1rem; }
@keyframes pulseBtn { 50% { transform: scale(1.04); } }
.end-ov { position: absolute; inset: 0; background: rgba(251,252,254,.9); display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap; backdrop-filter: blur(2px); }
.end-ov[hidden], .big-play[hidden] { display: none; }

/* حركات أساسية */
.stage .a { opacity: 0; }
.stage .a.in { animation: aIn .55s cubic-bezier(.2,.8,.2,1) both; }
@keyframes aIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.stage .a.drop.in { animation-name: aDrop; }
@keyframes aDrop { from { opacity: 0; transform: translateY(-34px) scale(1.25); } to { opacity: 1; transform: none; } }
.stage .a.pop.in { animation-name: aPop; }
@keyframes aPop { 0% { opacity: 0; transform: scale(.4); } 70% { opacity: 1; transform: scale(1.12); } 100% { opacity: 1; transform: none; } }
.stage .a.slide.in { animation-name: aSlide; }
@keyframes aSlide { from { opacity: 0; transform: translateX(40px); } to { opacity: 1; transform: none; } }
.stage svg .a { transform-box: fill-box; transform-origin: center; }
.stage .draw { stroke-dasharray: 1; stroke-dashoffset: 1; }
.stage .draw.in { animation: drawIn 1.1s ease forwards; }
@keyframes drawIn { to { stroke-dashoffset: 0; } }
.stage .grow { transform: scaleY(0); transform-box: fill-box; transform-origin: 50% 100%; transition: transform .8s cubic-bezier(.2,.8,.2,1), opacity .3s; }
.stage .grow.in { transform: scaleY(1); }
.stage .settled { animation: none !important; opacity: 1; }
.stage .draw.settled { stroke-dashoffset: 0; }
.stage.instant *, .stage.instant .scene { animation-duration: 0s !important; animation-delay: 0s !important; transition: none !important; }

/* بطاقة العنوان */
.t-card { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.t-card h2 { font-size: 2rem; margin: 6px 0 0; }
.t-card p { color: var(--muted); margin: 0; }
.t-ico { width: 72px; height: 72px; border-radius: 20px; color: #fff; display: grid; place-items: center; font-size: 1.4rem; font-weight: 700; direction: ltr; }

/* الأعداد */
.digits { display: flex; align-items: baseline; justify-content: center; font-weight: 700; font-variant-numeric: tabular-nums; }
.digits.xl { font-size: clamp(2.6rem, 8vw, 4.2rem); letter-spacing: .02em; }
.dg { display: inline-block; padding: 0 .05em; border-radius: 10px; transition: color .35s, background .35s; }
.dg.hl { color: var(--u); background: color-mix(in srgb, var(--u) 13%, transparent); }
.dg.zero { color: var(--u); }
.dg.last.ring { color: #fff; background: var(--u); box-shadow: 0 0 0 6px color-mix(in srgb, var(--u) 25%, transparent); }
.gsep { display: inline-block; width: .25em; transition: width .7s ease; }
.digits.split .gsep { width: 1.5em; }
.grp-labels { display: flex; gap: 3.2em; justify-content: center; }
.grp-labels span { background: #fff; border: 1.5px solid var(--u); color: var(--u); border-radius: 99px; padding: 2px 14px; font-weight: 600; font-size: .95rem; }
.words-out { font-size: 1.35rem; font-weight: 600; min-height: 1.8em; max-width: 680px; }
.words-out.big { font-size: 1.45rem; color: var(--u); }
.words-out .w1 { color: var(--u); } .words-out .w2 { color: #EA580C; }
.ptA td, .ptA th { transition: background .35s; }
.ptA .hl { background: color-mix(in srgb, var(--u) 22%, #fff); }
.ptA td.hl2 { background: #FEF9C3; }
.expr-build { font-size: 1.3rem; font-weight: 600; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 8px 16px; min-height: 2.4em; }
.expr-build.alt { color: var(--u); }
.alt-slot:empty { display: none; }
.cards2 { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; }
.info { background: #fff; border: 2px solid var(--line); border-radius: 14px; padding: 10px 18px; min-width: 170px; display: flex; flex-direction: column; font-weight: 600; }
.info b { font-size: 1.9rem; color: var(--u); }
.info.glow { border-color: var(--u); }
.cmp-stack { display: flex; flex-direction: column; gap: 6px; font-size: clamp(2.2rem, 7vw, 3.4rem); font-weight: 700; font-variant-numeric: tabular-nums; background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 10px 22px; }
.cmp-row { display: flex; justify-content: center; }
.cd { padding: 0 .08em; border-radius: 10px; transition: background .3s, color .3s; }
.cd.same { color: #94A3B8; } .cd.focus { background: #FEF3C7; } .cd.diff { color: #fff; background: var(--u); }
.gsep2 { width: .4em; display: inline-block; }
.cmp-result { font-size: 1.7rem; font-weight: 700; min-height: 1.6em; }
.cmp-result .sym { color: var(--u); font-size: 1.3em; margin: 0 .25em; display: inline-block; }
.nl { position: relative; width: min(620px, 92%); height: 120px; }
.nl-track { position: absolute; left: 4%; right: 4%; top: 60px; height: 4px; background: #0F172A; border-radius: 4px; }
.nl-tick { position: absolute; top: 46px; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 6px; font-weight: 700; }
.nl-tick i { width: 4px; height: 30px; background: #0F172A; border-radius: 3px; display: block; }
.stage .nl-tick.a.in { animation-name: aIn; }
.nl-mark { position: absolute; top: 0; transform: translateX(-50%); opacity: 0; transition: left 1.6s cubic-bezier(.4,0,.2,1), opacity .3s; font-weight: 700; color: #fff; }
.nl-mark.in { opacity: 1; }
.nl-mark span { background: var(--u); padding: 4px 12px; border-radius: 10px; display: block; position: relative; }
.nl-mark span::after { content: ''; position: absolute; left: 50%; bottom: -8px; transform: translateX(-50%); border: 8px solid transparent; border-bottom: 0; border-top-color: var(--u); }
.vopA { font-size: clamp(1.6rem, 4.5vw, 2.3rem); }
.vopA .c { transition: background .3s; border-radius: 6px; }
.vopA .c.focus { background: #FEF3C7; }
.vopA .carry { font-size: .6em; min-height: 1.1em; }
.vopA .res.glow .c b { color: var(--ok); }
.vopA b { font-weight: 700; display: inline-block; }
.rules3 { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; font-size: 1.2rem; font-weight: 600; }
.rules3 li { background: #fff; border: 1px solid var(--line); border-inline-start: 5px solid var(--u); border-radius: 12px; padding: 10px 16px; text-align: start; }
.chips3 { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.chip3 { padding: 8px 16px; border-radius: 99px; font-weight: 700; font-size: 1.05rem; background: #fff; border: 2px solid; }
.chip3.yes { color: var(--ok); border-color: var(--ok); background: var(--ok-bg); }
.chip3.no { color: #94A3B8; border-color: #CBD5E1; }

/* القياس */
.utA { font-size: 1.1rem; }
.utA th, .utA td { transition: background .35s; min-width: 52px; }
.utA td { font-size: 1.5rem; }
.utA .hl { background: color-mix(in srgb, var(--u) 22%, #fff); }
.utA .zero { color: var(--u); }
.utA tr.hop td { border: 0; height: 26px; background: transparent; position: relative; padding: 0; }
.hopl { position: absolute; right: -16px; top: 2px; font-size: .78rem; font-weight: 700; color: var(--u); background: #fff; border: 1px solid var(--u); border-radius: 99px; padding: 0 6px; z-index: 1; }
.rels-a { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.rels-a li { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 4px 12px; font-weight: 600; }
.q-big { font-size: 1.8rem; font-weight: 700; color: var(--u); }

/* الهندسة */
.ang { width: min(360px, 88%); height: auto; overflow: visible; }
.ang .r1, .ang .r2 { stroke: var(--u); stroke-width: 5; stroke-linecap: round; }
.ang .setsq { fill: #FCA5A5; opacity: 0; transition: opacity .6s; }
.ang .setsq.in { opacity: .45; }
.ang-label { font-size: 1.8rem; font-weight: 700; color: var(--u); min-height: 1.4em; }
.lines-a { width: min(460px, 94%); height: auto; background: #fff; border: 1px solid var(--line); border-radius: 14px; }
.lines-a text { font: 700 17px Arial, sans-serif; }
.lines-a .pulse { animation: lpulse 1.2s ease-in-out 2; stroke-dashoffset: 0; }
@keyframes lpulse { 50% { stroke-width: 7; } }
.gridA td { transition: background .4s; }
.gridA td.colhl { background: #DBEAFE; } .gridA td.rowhl { background: #FEF3C7; } .gridA td.colhl.rowhl { background: #FDE68A; }
.gridA td.target { box-shadow: inset 0 0 0 3px var(--u); }
.gridA th.hl { color: #fff; background: var(--u); border-radius: 8px; }
.symA { color: #DC2626; font-size: 1.6rem; display: inline-block; }
.shape-a { width: min(300px, 80%); height: auto; overflow: visible; }
.svg-n { font: 700 13px Arial, sans-serif; }
.chartA { width: min(520px, 96%); height: auto; background: #fff; border-radius: 12px; }
.chartA .cbar.focus, .chartA .cbar.top { opacity: 1; }
.chartA .cbar.dim { opacity: .35; transition: opacity .5s; }
.chartA .cbar.top { opacity: 1; stroke: #0F172A; stroke-width: 2.5; }

/* الوضعيات */
.pb-a { max-width: 680px; text-align: start; display: flex; flex-direction: column; gap: 10px; }
.ctx-a { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; font-size: 1.08rem; line-height: 1.9; }
.ctx-a .n { transition: background .4s; border-radius: 4px; padding: 0 2px; }
.ctx-a .n.mark { background: #FDE68A; }
.step-a { background: #fff; border: 1px solid var(--line); border-inline-start: 4px solid var(--u); border-radius: 12px; padding: 8px 14px; }
.step-a b { display: block; }
.step-a .op-line { color: var(--u); font-weight: 600; }

@media (max-width: 560px) {
  .stage { height: 420px; }
  .caption p { font-size: 1rem; }
  .pc.wide { font-size: .75rem; padding: 0 6px; }
  .grp-labels { gap: 1.4em; }
  .hopl { right: -13px; font-size: .68rem; }
  .utA th, .utA td { min-width: 38px; padding: 3px 4px; }
}
@media (max-width: 560px) {
  .pl-ctrl { flex-wrap: wrap; }
  .pl-bar { order: -1; flex-basis: 100%; margin-bottom: 4px; }
  .pc.wide { margin-inline-start: auto; }
}

/* ================= الأستاذ رياض ================= */
.stage2 { display: grid; grid-template-columns: 200px 1fr; grid-template-rows: 1fr auto; grid-template-areas: "teacher board" "teacher bubble"; gap: 12px 10px; padding: 14px 14px 12px; background: linear-gradient(180deg, #EEF2F7 0%, #E2E8F0 100%); height: clamp(470px, 56vw, 560px); }
.teacher-box { grid-area: teacher; display: flex; align-items: flex-end; justify-content: center; }
.teacher { width: 100%; max-width: 200px; height: auto; overflow: visible; }
.board { grid-area: board; position: relative; background: #fff; border: 6px solid #CBD5E1; border-bottom-width: 10px; border-radius: 14px; overflow: hidden; min-height: 0; box-shadow: inset 0 0 0 1px #E2E8F0; }
.board .stage { height: 100%; }
.bubble { grid-area: bubble; position: relative; background: #fff; border: 2px solid var(--u); border-radius: 18px; padding: 8px 16px 10px; min-height: 74px; box-shadow: 0 6px 18px rgba(15,23,42,.08); }
.bubble::after { content: ''; position: absolute; right: -13px; bottom: 26px; border: 12px solid transparent; border-left-color: var(--u); border-right: 0; }
.bubble.pop { animation: bubblePop .3s ease both; }
@keyframes bubblePop { from { transform: scale(.97); opacity: .6; } to { transform: none; opacity: 1; } }
.b-name { font-size: .75rem; font-weight: 700; color: var(--u); margin-bottom: 2px; }
.b-say, .b-joke { margin: 0; font-size: 1.08rem; line-height: 1.65; font-weight: 500; }
.b-joke { margin-top: 4px; color: #9A3412; font-weight: 600; }
.b-joke[hidden] { display: none; }
.bubble .w { opacity: 0; transition: opacity .18s; }
.bubble .w.on { opacity: 1; }
.bubble .n { color: var(--u); font-weight: 700; }

/* حركات الأستاذ */
.teacher .t-body { transform-origin: 110px 300px; animation: breathe 3.2s ease-in-out infinite; }
@keyframes breathe { 50% { transform: scale(1.01, 1.018); } }
.teacher .armL { transform-origin: 82px 148px; transition: transform .55s cubic-bezier(.3,1.4,.5,1); }
.teacher .armR { transform-origin: 138px 148px; transition: transform .55s cubic-bezier(.3,1.4,.5,1); }
.teacher .finger { opacity: 0; }
.teacher .eyes { transform-origin: 110px 85px; animation: blink 4.6s infinite; }
@keyframes blink { 0%, 95%, 100% { transform: scaleY(1); } 97% { transform: scaleY(.1); } }
.teacher .eyes-happy, .teacher .wink, .teacher .m-open, .teacher .m-o { opacity: 0; }
.teacher .brows { transition: transform .3s; }
.teacher.talking .m-closed { opacity: 0; }
.teacher.talking .m-open { opacity: 1; transform-origin: 110px 119px; animation: talk .17s ease-in-out infinite alternate; }
@keyframes talk { from { transform: scaleY(.25); } to { transform: scaleY(1); } }
.teacher.t-point .armL { transform: rotate(118deg); }
.teacher.t-wave .armR { animation: wave .45s ease-in-out infinite alternate; }
@keyframes wave { from { transform: rotate(-128deg); } to { transform: rotate(-158deg); } }
.teacher.t-wave .finger, .teacher.t-idea .finger { opacity: 1; }
.teacher.t-idea .armR { transform: rotate(-162deg); }
.teacher.t-idea .brows, .teacher.t-wow .brows { transform: translateY(-6px); }
.teacher.t-wow .m-closed { opacity: 0; } .teacher.t-wow:not(.talking) .m-o { opacity: 1; }
.teacher.t-laugh .eyes, .teacher.t-laugh .eyes { opacity: 0; }
.teacher.t-laugh .eyes-happy { opacity: 1; }
.teacher.t-laugh .t-body { animation: laugh .32s ease-in-out infinite; }
@keyframes laugh { 50% { transform: translateY(-4px) rotate(-1deg); } }
.teacher.t-laugh .armR { transform: rotate(-30deg); }
.teacher.t-wink .eyeR { opacity: 0; } .teacher.t-wink .wink { opacity: 1; }
.teacher.t-wink .armL { transform: rotate(40deg); }

@media (max-width: 700px) {
  .stage2 { grid-template-columns: 92px 1fr; grid-template-rows: 1fr auto; grid-template-areas: "board board" "teacher bubble"; height: auto; padding: 10px; }
  .board { height: 380px; }
  .teacher { max-width: 92px; }
  .bubble { min-height: 92px; }
  .bubble::after { bottom: 34px; }
  .b-say, .b-joke { font-size: .98rem; }
}

/* ================= الحسابات والاشتراك ================= */
.boot { text-align: center; padding: 80px 0; }
.auth { max-width: 460px; margin: 30px auto; display: flex; flex-direction: column; gap: 10px; }
.auth .brand-big { text-align: center; }
.auth h1 { font-size: 1.35rem; margin: 6px 0 0; }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; background: #F1F5F9; border-radius: 12px; padding: 4px; }
.auth-tabs a { text-align: center; padding: 8px; border-radius: 9px; color: var(--ink2); font-weight: 600; }
.auth-tabs a.on { background: #fff; color: var(--primary); box-shadow: var(--sh); }
.auth-form { display: flex; flex-direction: column; gap: 12px; }
.auth-form .btn { width: 100%; }
.auth-form a.small { text-align: center; }
.auth-msg { margin: 0; font-size: .92rem; min-height: 1.2em; }
.auth-msg.err { color: var(--ko); } .auth-msg.ok { color: var(--ok); background: var(--ok-bg); padding: 10px 12px; border-radius: 10px; }
.field select { font: inherit; font-weight: 500; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 12px; background: #fff; }
.kids { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.kid { display: flex; flex-direction: column; gap: 8px; }
.kid.current { border-color: var(--primary); box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary) 25%, transparent); }
.kid-top { display: flex; align-items: center; gap: 10px; }
.kid-top div { display: flex; flex-direction: column; line-height: 1.3; }
.kid-av { width: 44px; height: 44px; border-radius: 50%; background: var(--primary); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 1.2rem; }
.kid .row-actions { margin: 4px 0 0; }
.pill { align-self: flex-start; font-size: .8rem; font-weight: 700; padding: 2px 10px; border-radius: 99px; background: #F1F5F9; color: var(--ink2); }
.pill.ok { background: var(--ok-bg); color: var(--ok); } .pill.wait { background: #FEF3C7; color: #92400E; } .pill.bad { background: var(--ko-bg); color: var(--ko); }
.add-kid { margin-top: 14px; }
.add-kid h3 { margin-bottom: 8px; }
.add-row { display: grid; grid-template-columns: 1fr 1fr auto; gap: 10px; align-items: end; }
.span2 { grid-column: 1 / -1; }
.sub-banner { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: #ECFDF5; border: 1px solid #A7F3D0; border-radius: 14px; padding: 10px 16px; margin-bottom: 14px; font-size: .95rem; }
.sub-banner.wait { background: #FFFBEB; border-color: #FDE68A; }
.free-tag { align-self: center; font-size: .72rem; font-weight: 700; color: var(--ok); background: var(--ok-bg); padding: 1px 8px; border-radius: 99px; }
.btn.locked { color: var(--muted); background: #F8FAFC; }
.chip.kidchip { background: var(--primary); color: #fff; }
.sub-page, .account, .admin { max-width: 860px; margin: 0 auto; }
.sub-steps { display: flex; flex-direction: column; gap: 12px; }
.step h2 { display: flex; align-items: center; gap: 10px; font-size: 1.1rem; }
.step-n { width: 30px; height: 30px; border-radius: 50%; background: var(--primary); color: #fff; display: grid; place-items: center; font-size: .9rem; }
.plans { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.plan { cursor: pointer; }
.plan input { position: absolute; opacity: 0; }
.plan-in { position: relative; display: flex; flex-direction: column; gap: 4px; border: 2px solid var(--line); border-radius: 14px; padding: 14px; height: 100%; }
.plan input:checked + .plan-in { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 5%, #fff); }
.plan .price { font-size: 1.5rem; font-weight: 700; }
.plan select { font: inherit; padding: 6px 8px; border-radius: 10px; border: 1.5px solid var(--line); }
.tag-best { position: absolute; top: -11px; left: 12px; background: var(--gold); color: #0F172A; font-size: .72rem; font-weight: 700; padding: 1px 10px; border-radius: 99px; }
.pay-table { width: 100%; border-collapse: collapse; }
.pay-table th, .pay-table td { padding: 8px 6px; border-bottom: 1px solid var(--line); text-align: start; }
.pay-table th { color: var(--muted); font-weight: 600; font-size: .9rem; width: 32%; }
.pay-table td { font-weight: 700; font-variant-numeric: tabular-nums; }
.notice { border-radius: 14px; padding: 14px 16px; margin: 10px 0; background: #F8FAFC; border: 1px solid var(--line); }
.notice.ok { background: var(--ok-bg); border-color: #BBF7D0; } .notice.wait { background: #FFFBEB; border-color: #FDE68A; } .notice.bad { background: var(--ko-bg); border-color: #FECACA; }
.paywall { max-width: 560px; margin: 30px auto; text-align: center; display: flex; flex-direction: column; gap: 10px; align-items: center; }
.lock-ico { font-size: 2.4rem; }
.pw-prices { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.pw-prices span { background: #F8FAFC; border: 1px solid var(--line); border-radius: 12px; padding: 6px 14px; }
.admin-tabs { display: flex; gap: 6px; margin: 10px 0 14px; flex-wrap: wrap; }
.admin-tabs a { padding: 6px 14px; border-radius: 99px; background: #F1F5F9; color: var(--ink2); font-weight: 600; font-size: .9rem; }
.admin-tabs a.on { background: var(--primary); color: #fff; }
.req-list { display: flex; flex-direction: column; gap: 10px; }
.req-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.req .row-actions { margin: 6px 0 0; }
.req .note { font: inherit; padding: 5px 10px; border: 1.5px solid var(--line); border-radius: 10px; flex: 1; min-width: 160px; }
.nav [hidden] { display: none; }

@media (max-width: 860px) {
  .nav { display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 30; background: #fff; border-top: 1px solid var(--line); justify-content: space-around; padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); gap: 0; }
  .nav a { font-size: .78rem; padding: 6px 6px; }
  body { padding-bottom: 64px; }
  .add-row, .plans { grid-template-columns: 1fr; }
  .sub-banner { flex-direction: column; align-items: flex-start; }
}
@media print { .nav { display: none !important; } body { padding-bottom: 0; } }

[hidden] { display: none !important; }

/* TawrDz wordmark */
.wm { direction: ltr; unicode-bidi: isolate; letter-spacing: -.02em; color: #1B1B1B; }
.wm b { color: #02D15F; font-weight: inherit; }

/* ===== v3 — style Ujeed : à plat (pas d'ombres, cartes à angles droits), boutons en pilule,
   bouton principal noir, étiquettes jaunes, texte noir. Les couleurs d'unité (--u) restent. ===== */
:root {
  --bg: #F4F4F2; --ink: #1B1B1B; --ink2: #333333; --muted: #5E5E5E; --line: #DEDEDE;
  --r: 0px; --sh: none; --k: #1B1B1B; --y: #FFD43B; --gs: #E3F9EC;
}
.card, .tile, .toast, .player, .bubble, .big-play, .auth-tabs a.on { box-shadow: none; }
.card { border: 0; }
.tile { border: 0; }
.tile:hover { transform: none; box-shadow: inset 0 0 0 2px var(--k); }
.eyebrow { display: inline-block; background: var(--y); color: var(--k); font-weight: 700; padding: .05em .6em; margin-bottom: 8px; }

/* boutons */
.btn { border: 2px solid var(--k); border-radius: 999px; background: #fff; color: var(--k); font-weight: 700; }
.btn:hover { background: var(--k); border-color: var(--k); color: #fff; }
.btn.primary { background: var(--k); border-color: var(--k); color: #fff; }
.btn.primary:hover { filter: none; opacity: .86; }
.btn.sm { border-radius: 999px; border-width: 1.5px; }
.btn.ghost { background: transparent; }
.btn.ghost:hover { background: var(--k); }
.btn.danger { color: var(--ko); border-color: var(--ko); }
.btn.danger:hover { background: var(--ko); color: #fff; }
.icon-btn { border-radius: 999px; border: 1.5px solid var(--k); color: var(--k); }

/* en-tête blanc : logo complet + liens texte */
.topbar { background: #fff; backdrop-filter: none; }
.logo-full { height: 28px; width: auto; display: block; flex: none; }
.brand small { color: var(--muted); font-weight: 500; }
.nav a { border-radius: 0; color: var(--ink); }
.nav a:hover { background: none; text-decoration: underline; text-underline-offset: 6px; }
.nav a.active { background: none; font-weight: 700; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 6px; }
.chip { background: #EDEDEB; }
.chip.xp { background: var(--y); color: var(--k); }
.chip.lvl { background: var(--gs); color: #0A7F3B; }
.parent-btn.on { background: var(--y); border-color: var(--k); color: var(--k); }

/* connexion, chargement */
.logo-big { height: 44px; width: auto; display: block; margin: 0 auto; }
.brand-big { line-height: 1; }
.auth-tabs { border-radius: 999px; background: #E7E7E4; }
.auth-tabs a { border-radius: 999px; }
.auth-tabs a.on { background: var(--k); color: #fff; }

/* champs : contour noir en pilule, comme la recherche du site */
.field input, .field select { border: 2px solid var(--k); border-radius: 999px; padding: 10px 18px; background: #fff; }
.field input:focus, .field select:focus { border-color: var(--k); outline: 3px solid #5B93FC; outline-offset: 2px; }
.ans:focus { box-shadow: none; outline: 3px solid #5B93FC; outline-offset: 2px; }
.toast { border-radius: 0; }

/* ===== v4 — style SkillUp (sombre) : fond noir, cartes sombres arrondies, accent citron (#DAFF96),
   cartes pastel (citron, pêche, bleu, crème), Poppins pour le latin + Somar pour l'arabe.  Le contenu
   mathématique (questions, résumé, scènes animées, examen) reste sur des cartes claires pour la lisibilité. ===== */
@font-face { font-family: Poppins; src: url(../assets/fonts/Poppins-Light 300.woff2) format('woff2'); font-weight: ; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: Poppins; src: url(../assets/fonts/Poppins-Regular 400.woff2) format('woff2'); font-weight: ; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: Poppins; src: url(../assets/fonts/Poppins-Medium 500.woff2) format('woff2'); font-weight: ; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: Poppins; src: url(../assets/fonts/Poppins-SemiBold 600.woff2) format('woff2'); font-weight: ; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: Poppins; src: url(../assets/fonts/Poppins-Bold 700.woff2) format('woff2'); font-weight: ; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
:root {
  --bg: #0A0A0A; --card: #151515; --card2: #1D1D1D; --panel: #13170D; --line: #262626;
  --ink: #F4F4F4; --ink2: #D4D4D4; --muted: #A3A3A3;
  --lime: #DAFF96; --peach: #FFE5C6; --blue: #C6E7FE; --cream: #FFF1BF; --lilac: #E6DCFF; --pink: #FFD9EA;
  --primary: #DAFF96; --primary-2: #C6F27A; --gold: #FFD86B;
  --ok: #B7F57A; --ko: #FF9B9B; --ok-bg: rgba(183,245,122,.12); --ko-bg: rgba(255,155,155,.12);
  --k: #0A0A0A; --y: #FFF1BF; --gs: #DAFF96; --pu: var(--lime);
  --r: 24px; --sh: none;
  --font: Poppins, Somar, 'Segoe UI', Tahoma, system-ui, sans-serif;
  --arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M18 18 6 6M6 6h9M6 6v9'/%3E%3C/svg%3E");
  color-scheme: dark;
}
body { background: var(--bg); color: var(--ink); }
::selection { background: var(--lime); color: #0A0A0A; }
h1, h2, h3 { font-weight: 600; letter-spacing: -.01em; }
.card { background: var(--card); border: 1px solid #1F1F1F; border-radius: var(--r); }
.card + .card { margin-top: 14px; }
.eyebrow { display: inline-block; background: var(--card2); color: var(--lime); font-weight: 600; font-size: .8rem; padding: .25em .95em; border-radius: 999px; margin-bottom: 10px; }
.muted { color: var(--muted); }
.wm { color: var(--ink); } .wm b { color: var(--lime); }

/* couleurs pastel par unité (le --u foncé reste pour le contenu sur fond clair) */
[data-u=num] { --pu: var(--lime); } [data-u=mes] { --pu: var(--blue); } [data-u=geo] { --pu: var(--lilac); }
[data-u=dat] { --pu: var(--peach); } [data-u=pb] { --pu: var(--pink); }

/* boutons en pilule : contour sombre, principal citron */
.btn { border: 1.5px solid #3A3A3A; border-radius: 999px; background: transparent; color: var(--ink); font-weight: 600; }
.btn:hover { background: #222; border-color: #4A4A4A; color: var(--ink); }
.btn.primary { background: var(--lime); border-color: var(--lime); color: #0A0A0A; }
.btn.primary:hover { background: #E8FFC0; border-color: #E8FFC0; color: #0A0A0A; opacity: 1; }
.btn.ghost { background: transparent; } .btn.ghost:hover { background: #222; }
.btn.danger { color: var(--ko); border-color: rgba(255,155,155,.45); }
.btn.danger:hover { background: var(--ko); border-color: var(--ko); color: #0A0A0A; }
.btn.locked { color: var(--muted); background: transparent; border-style: dashed; }
.icon-btn { background: var(--card2); border: 0; color: var(--ink); border-radius: 999px; }
.icon-btn:hover { background: #2A2A2A; }

/* en-tête : barre sombre (barre latérale sur ordinateur, voir plus bas) */
.topbar { background: rgba(10,10,10,.88); backdrop-filter: blur(10px); border-bottom: 1px solid #1C1C1C; }
.brand small { color: var(--muted); }
.nav a { color: var(--ink2); border-radius: 999px; display: inline-flex; align-items: center; gap: 10px; }
.nav a:hover { background: #1F1F1F; color: var(--ink); text-decoration: none; }
.nav a.active { background: var(--lime); color: #0A0A0A; font-weight: 600; text-decoration: none; }
.nav a::before { content: ''; width: 19px; height: 19px; flex: none; background: currentColor; -webkit-mask: var(--i) center / contain no-repeat; mask: var(--i) center / contain no-repeat; }
.nav a[href="#/home"] { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 19V5a2 2 0 0 1 2-2h13v14H6a2 2 0 0 0-2 2Zm0 0a2 2 0 0 0 2 2h13'/%3E%3C/svg%3E"); }
.nav a[href="#/challenge"] { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M13 2 4 14h7l-1 8 9-12h-7l1-8Z'/%3E%3C/svg%3E"); }
.nav a[href="#/exam"] { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 3h7l5 5v13H7Z'/%3E%3Cpath d='M14 3v5h5M10 13h6M10 17h6'/%3E%3C/svg%3E"); }
.nav a[href="#/parent"] { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='9' cy='8' r='3.5'/%3E%3Cpath d='M2.5 20a6.5 6.5 0 0 1 13 0M16 4.5a3.5 3.5 0 0 1 0 7M18 14.5a6.5 6.5 0 0 1 3.5 5.5'/%3E%3C/svg%3E"); }
.nav a[href="#/account"] { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='8' r='4'/%3E%3Cpath d='M4 21a8 8 0 0 1 16 0'/%3E%3C/svg%3E"); }
.nav a[href="#/admin"] { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3 4 6v6c0 5 3.5 8 8 9 4.5-1 8-4 8-9V6Z'/%3E%3C/svg%3E"); }
.chip { background: var(--card2); color: var(--ink); font-weight: 600; }
.chip.xp { background: var(--cream); color: #0A0A0A; }
.chip.lvl { background: var(--lime); color: #0A0A0A; }
.chip.kidchip { background: var(--blue); color: #0A0A0A; }
.flame { color: #4A4A4A; } .flame.on { color: #FFB27A; }
.parent-btn.on { background: var(--peach); border-color: var(--peach); color: #0A0A0A; }

@media (min-width: 861px) {
  body:has(.nav:not([hidden])) { padding-inline-start: 252px; }
  body:has(.nav:not([hidden])) .topbar { position: fixed; top: 0; bottom: 0; inset-inline-start: 0; width: 252px; background: var(--panel); border: 0; backdrop-filter: none; overflow-y: auto; }
  body:has(.nav:not([hidden])) .topbar-in { height: 100%; flex-direction: column; align-items: stretch; gap: 30px; padding: 28px 18px 22px; max-width: none; }
  body:has(.nav:not([hidden])) .brand { flex-direction: column; align-items: flex-start; gap: 8px; padding-inline: 10px; }
  body:has(.nav:not([hidden])) .brand small { display: block; background: #1E2416; color: var(--lime); border-radius: 999px; padding: 1px 12px; font-size: .74rem; }
  body:has(.nav:not([hidden])) .nav { flex-direction: column; gap: 6px; }
  body:has(.nav:not([hidden])) .nav a { padding: 11px 16px; font-size: .97rem; }
  body:has(.nav:not([hidden])) .hdr-right { margin: auto 0 0; flex-direction: column; align-items: stretch; gap: 12px; background: #1A1F12; border-radius: 22px; padding: 14px; }
  body:has(.nav:not([hidden])) .hdr-stats { flex-wrap: wrap; }
  body:has(.nav:not([hidden])) .container { padding-top: 30px; }
}
@media (min-width: 861px) and (max-width: 1180px) {
  body:has(.nav:not([hidden])) .quick, body:has(.nav:not([hidden])) .kpis { grid-template-columns: 1fr 1fr; }
  body:has(.nav:not([hidden])) .hero { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .nav { background: #121212; border-top: 1px solid #222; padding-top: 8px; }
  .nav a { flex-direction: column; gap: 2px; font-size: .72rem; padding: 6px 10px; border-radius: 16px; }
  .nav a.active { background: var(--lime); }
}

/* accueil */
.hero-main h1 { font-size: 2.1rem; }
.ring { background: conic-gradient(var(--lime) calc(var(--p) * 360deg), #262626 0); }
.ring > div { background: var(--card); }
.goal { border-top-color: #2A2A2A; }
.goal .ring { background: conic-gradient(var(--peach) calc(var(--p) * 360deg), #262626 0); }
.bar { background: #262626; }
.bar i { background: var(--pu); }
.quick { gap: 14px; }
.quick .tile { position: relative; border: 0; border-radius: 24px; padding: 18px 18px 52px; color: #0A0A0A; min-height: 150px; }
.quick .tile:nth-child(1) { background: var(--lime); } .quick .tile:nth-child(2) { background: var(--peach); }
.quick .tile:nth-child(3) { background: var(--blue); } .quick .tile:nth-child(4) { background: var(--cream); }
.quick .tile b { font-size: 1.08rem; }
.quick .tile > span { color: rgba(10,10,10,.7); }
.quick .tile::after { content: ''; position: absolute; bottom: 14px; inset-inline-end: 14px; width: 36px; height: 36px; border-radius: 50%; background: #0A0A0A; }
.quick .tile::before { content: ''; position: absolute; bottom: 24px; inset-inline-end: 24px; width: 16px; height: 16px; z-index: 1; background: var(--lime); -webkit-mask: var(--arrow) center / contain no-repeat; mask: var(--arrow) center / contain no-repeat; }
.quick .tile:hover { transform: translateY(-3px); box-shadow: none; }
.u-ico { background: var(--pu); color: #0A0A0A; border-radius: 14px; }
.lesson { border-top: 0; border-radius: 22px; }
.lesson:hover { border-color: #333; }
.stars i { color: #3A3A3A; } .stars i.on { color: var(--gold); }
.free-tag { color: #0A0A0A; background: var(--lime); }
.sub-banner { background: rgba(218,255,150,.07); border: 1px solid rgba(218,255,150,.28); border-radius: 22px; }
.sub-banner.wait { background: rgba(255,241,191,.07); border-color: rgba(255,241,191,.3); }

/* page du cours */
.l-head { border-top: 0; }
.player { background: var(--card); border-radius: 26px; border: 1px solid #1F1F1F; }
.caption, .pl-ctrl { background: var(--card); }
.caption .n { color: var(--lime); }
.pc { background: #262626; color: var(--ink); border-radius: 999px; }
.pc:hover { background: #333; }
.pc.main { background: var(--lime); color: #0A0A0A; }
.pl-bar i { background: #333; } .pl-bar i.done { background: color-mix(in srgb, var(--lime) 55%, #333); } .pl-bar i.cur { background: var(--lime); }
.big-play { background: var(--lime); color: #0A0A0A; box-shadow: 0 10px 30px rgba(0,0,0,.35); }
.big-play .bp-ico { background: #0A0A0A; color: var(--lime); }
.parent-tip { background: var(--cream); border: 0; color: #0A0A0A; }
.parent-tip .muted { color: #4A4A4A; }

/* surfaces claires : tout le contenu mathématique (questions, résumé, scènes, graphiques, examen) */
:is(.q-card, .learn, .mistake, .paper, .chart-box, .stage, .stage2) {
  --card: #FFFFFF; --card2: #F3F3EE; --ink: #0A0A0A; --ink2: #333333; --muted: #5E5E5E; --line: #E4E4DE;
  --primary: #0A0A0A; --ok: #15803D; --ko: #DC2626; --ok-bg: #ECFDF3; --ko-bg: #FEF2F2; --gold: #F5B400;
  color-scheme: light; color: var(--ink);
}
.q-card, .learn, .mistake { background: #FFFFFF; border: 0; border-radius: 28px; }
:is(.q-card, .learn, .mistake) .btn { border-color: #0A0A0A; color: #0A0A0A; background: transparent; }
:is(.q-card, .learn, .mistake) .btn:hover { background: #0A0A0A; color: #FFFFFF; }
:is(.q-card, .learn, .mistake) .btn.primary { background: #0A0A0A; color: var(--lime); }
:is(.q-card, .learn, .mistake) .btn.primary:hover { background: #262626; color: var(--lime); }
.q-card .tag { background: var(--lime); color: #0A0A0A; }
.ans:focus { outline: 3px solid #0A0A0A; outline-offset: 2px; box-shadow: none; }

/* séance, résultats, défi */
.s-progress i { background: #262626; } .s-progress i.ok { background: var(--lime); } .s-progress i.ko { background: var(--ko); } .s-progress i.cur { background: #F4F4F4; opacity: .5; }
.combo { color: #4A4A4A; } .combo.on { color: var(--peach); }
.s-xp, .xp-pop { background: var(--cream); color: #0A0A0A; }
.res-stats > div { background: var(--card2); border: 0; border-radius: 18px; }
.timer { background: #262626; }
.timer i { background: linear-gradient(90deg, var(--ko), var(--peach), var(--lime)); }
.c-score b { color: var(--lime); }
.badge.earned { border-color: rgba(218,255,150,.5); }
.b-ico { background: var(--cream); color: #0A0A0A; }
.badge.earned .b-ico { background: var(--lime); }

/* fiches : stat pastel comme les cartes SkillUp */
.kpis { gap: 14px; }
.kpis .kpi { border: 0; color: #0A0A0A; border-radius: 24px; }
.kpis .kpi:nth-child(1) { background: var(--lime); } .kpis .kpi:nth-child(2) { background: var(--peach); }
.kpis .kpi:nth-child(3) { background: var(--blue); } .kpis .kpi:nth-child(4) { background: var(--cream); }
.kpis .kpi > b { color: #0A0A0A; font-size: 2.1rem; font-weight: 600; }
.kpis .kpi > span { color: rgba(10,10,10,.7); }
.two-col svg.chart rect { fill: var(--lime); }
.two-col svg.chart rect[fill="#E5E7EB"] { fill: #2A2A2A; }
.pill { background: var(--card2); color: var(--ink2); }
.pill.ok { background: var(--lime); color: #0A0A0A; } .pill.wait { background: var(--cream); color: #0A0A0A; } .pill.bad { background: var(--ko); color: #0A0A0A; }

/* champs sombres en pilule, focus citron */
.field input, .field select, .req .note, .plan select { background: #101010; color: var(--ink); border: 1.5px solid #333; border-radius: 999px; }
.field input::placeholder { color: #6B6B6B; }
.field input:focus, .field select:focus, .req .note:focus { border-color: var(--lime); outline: 3px solid rgba(218,255,150,.25); outline-offset: 1px; }

/* comptes, abonnement, administration */
.brand-big { color: var(--lime); }
.auth-tabs { background: var(--card2); }
.auth-tabs a { color: var(--ink2); }
.auth-tabs a.on { background: var(--lime); color: #0A0A0A; }
.kid.current { border-color: var(--lime); box-shadow: 0 0 0 1px var(--lime); }
.kid-av, .step-n { background: var(--lime); color: #0A0A0A; }
.plan-in { border-color: #2E2E2E; border-radius: 22px; }
.plan input:checked + .plan-in { border-color: var(--lime); background: rgba(218,255,150,.06); }
.tag-best { background: var(--lime); color: #0A0A0A; }
.notice { background: var(--card2); border-color: #2A2A2A; border-radius: 20px; }
.notice.ok { background: rgba(183,245,122,.08); border-color: rgba(183,245,122,.35); }
.notice.wait { background: rgba(255,241,191,.08); border-color: rgba(255,241,191,.35); }
.notice.bad { background: rgba(255,155,155,.08); border-color: rgba(255,155,155,.35); }
.pw-prices span { background: var(--card2); border-color: #2A2A2A; }
.admin-tabs a { background: var(--card2); color: var(--ink2); }
.admin-tabs a.on { background: var(--lime); color: #0A0A0A; }
.auth-msg.ok { background: var(--ok-bg); }

/* notifications */
.toast { background: #1D1D1D; color: var(--ink); border: 1px solid #2E2E2E; border-radius: 20px; }
.toast.gold { background: var(--cream); color: #0A0A0A; border: 0; }
.toast.badge { background: var(--lime); color: #0A0A0A; border: 0; }
.toast.err { background: var(--ko); color: #0A0A0A; border: 0; }

/* impression : retour au blanc */
@media print {
  :root { --bg: #fff; --ink: #0A0A0A; --ink2: #333; --muted: #5E5E5E; --line: #DDD; color-scheme: light; }
  body, body:has(.nav:not([hidden])) { background: #fff; color: #0A0A0A; padding: 0; }
}
.hero-main .eyebrow { align-self: flex-start; }
body:has(.nav:not([hidden])) .hdr-right:has(#parentBtn[hidden]) { background: none; padding: 0; }
@media (max-width: 860px) {
  /* backdrop-filter piège la barre fixe du bas dans l'en-tête : on l'enlève sur mobile */
  .topbar { backdrop-filter: none; background: #0A0A0A; }
}
@media (max-width: 860px) {
  .nav { gap: 2px; padding-inline: 6px; }
  .nav a { flex: 1 1 0; min-width: 0; padding: 6px 2px; text-align: center; line-height: 1.25; }
}
.card:has(> .ptab) { overflow-x: auto; }
@media (max-width: 560px) {
  .ptab td .bar { width: 56px; }
  .ptab th, .ptab td { padding: 6px 4px; font-size: .84rem; }
}
.parent-btn { white-space: nowrap; }
@media (max-width: 430px) { .hdr-stats .chip.kidchip { display: none; } .topbar-in { gap: 10px; padding-inline: 12px; } }
