/* Bac Hub — styles de l'application (mobile d'abord) */

/* ---------- couleurs de matière (variables posées en ligne : --sc, --sc-d, --sc-l, --sc-soft, --sc-soft2) ---------- */
[style*="--sc:"] { --sc-ink: var(--sc-d); }
:root[data-theme="dark"] [style*="--sc:"] { --sc-ink: var(--sc-l); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) [style*="--sc:"] { --sc-ink: var(--sc-l); } }
:root { --shimmer: rgba(255, 255, 255, .5); --topbar-h: 60px; --tabbar-h: 68px; --glass: rgba(255, 255, 255, .82); }
:root[data-theme="dark"] { --shimmer: rgba(255, 255, 255, .05); --glass: rgba(16, 28, 48, .82); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --shimmer: rgba(255, 255, 255, .05); --glass: rgba(16, 28, 48, .82); } }
.skel::after { background: linear-gradient(90deg, transparent, var(--shimmer), transparent) !important; }

body { padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px)); min-height: 100vh; }
body.no-tabs { padding-bottom: 0; }
body.no-tabs .tabbar, body.no-header .topbar { display: none; }
.app { min-height: 100vh; }
.muted { color: var(--muted); }
.center { text-align: center; margin-top: 16px; }
.rich { line-height: 1.9; overflow-wrap: anywhere; }
.rich strong { color: var(--navy); font-weight: 600; }
.skip { position: absolute; top: -60px; right: 12px; z-index: 100; background: var(--blue); color: #fff; padding: 10px 16px; border-radius: 10px; }
.skip:focus { top: 8px; }

/* ---------- en-tête ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30; height: var(--topbar-h);
  background: var(--glass); backdrop-filter: saturate(1.6) blur(14px); -webkit-backdrop-filter: saturate(1.6) blur(14px);
  border-bottom: 1px solid var(--line-soft);
}
.tb-in { max-width: 1120px; margin: 0 auto; height: 100%; display: flex; align-items: center; gap: 6px; padding: 0 10px; }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--f-head); font-weight: 700; font-size: 1.15rem; color: var(--navy); margin-inline-end: auto; padding: 4px; direction: ltr; }
.brand[hidden], .tb-title[hidden], .tb-back[hidden] { display: none; }
.brand .logo { border-radius: 10px; box-shadow: 0 4px 12px rgba(47, 128, 237, .35); }
.tb-title { flex: 1; min-width: 0; font-family: var(--f-head); font-weight: 600; color: var(--navy); font-size: 1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.net-off { margin-inline-start: auto; }
.net-off[hidden] { display: none; }
.net-off .ic { width: 1em; height: 1em; }

/* ---------- barre d'onglets ---------- */
.tabbar {
  position: fixed; inset-inline: 0; bottom: 0; z-index: 30;
  background: var(--glass); backdrop-filter: saturate(1.6) blur(14px); -webkit-backdrop-filter: saturate(1.6) blur(14px);
  border-top: 1px solid var(--line-soft); padding-bottom: env(safe-area-inset-bottom, 0px);
}
.tab-in { display: flex; max-width: 520px; margin: 0 auto; height: var(--tabbar-h); }
.tabbar a {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: var(--muted); font-size: .74rem; font-weight: 600; font-family: var(--f-head); position: relative; min-height: 44px;
}
.tabbar a .ic { width: 24px; height: 24px; padding: 3px; box-sizing: content-box; border-radius: 12px; transition: background .2s, color .2s; width: 22px; height: 22px; }
.tabbar a[aria-current="page"] { color: var(--blue-d); }
.tabbar a[aria-current="page"] .ic { background: var(--pale); padding: 3px 16px; }

/* ---------- page ---------- */
#view { outline: none; }
.page { animation: pageIn .26s var(--ease); }
@keyframes pageIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.pad { max-width: 1120px; margin: 0 auto; padding: 14px 16px 32px; }
.pad.narrow { max-width: 760px; }
.page-h { margin: 6px 0 18px; }
.page-h h1 { font-size: 1.6rem; }
.page-h a { font-weight: 600; }

.crumbs { margin: 2px 0 12px; font-size: .8rem; color: var(--muted); min-width: 0; }
.crumbs ol { list-style: none; display: flex; flex-wrap: nowrap; overflow: hidden; gap: 4px; align-items: center; }
.crumbs li { display: flex; align-items: center; gap: 4px; white-space: nowrap; min-width: 0; flex-shrink: 1; }
.crumbs li:first-child { flex-shrink: 0; }
.crumbs li + li::before { content: "‹"; color: var(--line); font-size: 1rem; }
.crumbs a, .crumbs span { overflow: hidden; text-overflow: ellipsis; color: var(--muted); }
.crumbs a:hover { color: var(--blue-d); }
.crumbs [aria-current] { color: var(--text); font-weight: 600; }

.sec-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 28px 0 12px; scroll-margin-top: calc(var(--topbar-h) + 64px); }
.sec-h h2 { display: flex; align-items: center; gap: 10px; font-size: 1.12rem; }
.sec-h h2 .ic { width: 34px; height: 34px; padding: 7px; border-radius: 11px; background: var(--ice); color: var(--blue-d); box-sizing: border-box; }
.sec-sub { color: var(--muted); font-size: .8rem; font-weight: 500; }
.sec-link { display: inline-flex; align-items: center; gap: 2px; font-size: .88rem; font-weight: 600; min-height: 44px; }
.sec-link .ic { width: 1.1em; height: 1.1em; }
.sec-desc { color: var(--muted); font-size: .86rem; margin: -4px 0 12px; }
.note { display: flex; gap: 8px; align-items: flex-start; color: var(--muted); font-size: .8rem; margin-top: 14px; line-height: 1.6; }
.note .ic { width: 1.1em; height: 1.1em; margin-top: .2em; }

.bar { flex: 1; display: block; height: 6px; border-radius: 99px; background: var(--line-soft); overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--sc-l, var(--sky)), var(--sc, var(--blue))); transition: width .6s var(--ease); }
.bar.light { background: rgba(255, 255, 255, .22); }
.bar.light i { background: #fff; }

/* icône de matière */
.s-ic {
  width: 44px; height: 44px; flex: none; border-radius: 14px; display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(140deg, var(--sc-l, var(--sky)), var(--sc, var(--blue)) 55%, var(--sc-d, var(--blue-d)));
  color: #fff; font-family: var(--f-head); font-weight: 700; font-size: 1.25rem; line-height: 1;
  box-shadow: 0 6px 14px -6px var(--sc, var(--blue)); direction: ltr;
}
.s-ic.sm { width: 28px; height: 28px; border-radius: 9px; font-size: .85rem; box-shadow: none; }
.s-ic.lg { width: 54px; height: 54px; border-radius: 16px; font-size: 1.5rem; }
.s-ic.xl { width: 66px; height: 66px; border-radius: 20px; font-size: 1.9rem; background: rgba(255, 255, 255, .2); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .3); }

/* fréquence au bac */
.freq { display: flex; align-items: center; gap: 8px; font-size: .78rem; color: var(--muted); flex-wrap: wrap; line-height: 1.4; }
.fbar { display: inline-flex; gap: 2px; direction: ltr; flex: none; }
.fbar i { width: 5px; height: 12px; border-radius: 2px; background: var(--line); }
.fbar i.on { background: linear-gradient(180deg, #FFC861, var(--amber)); }

/* ---------- accueil ---------- */
.hello { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin: 6px 0 14px; }
.hello h1 { font-size: 1.45rem; }
.hello p { font-size: .9rem; }
.countdown {
  position: relative; overflow: hidden; border-radius: var(--radius-lg); padding: 18px 18px 16px; color: var(--on-hero);
  background: linear-gradient(135deg, var(--hero) 0%, var(--hero-2) 100%);
  box-shadow: 0 14px 30px -14px rgba(11, 37, 69, .55);
}
.cd-deco { position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(circle at 8% 0%, rgba(142, 197, 255, .35) 0, transparent 38%), radial-gradient(circle at 100% 120%, rgba(245, 165, 36, .28) 0, transparent 45%); }
.cd-row { position: relative; display: flex; align-items: center; gap: 16px; }
.cd-num { display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: 86px; padding: 8px 10px; border-radius: 18px; background: rgba(255, 255, 255, .12); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .18); }
.cd-num b { font-family: var(--f-head); font-size: 2.2rem; line-height: 1.05; font-weight: 700; }
.cd-num span { font-size: .78rem; opacity: .9; }
.cd-txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; position: relative; }
.cd-txt b { font-family: var(--f-head); font-size: 1.1rem; font-weight: 600; }
.cd-txt span { font-size: .8rem; opacity: .85; line-height: 1.5; }
.cd-bar { position: relative; margin-top: 14px; height: 6px; border-radius: 9px; background: rgba(255, 255, 255, .16); overflow: hidden; }
.cd-bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #FFD27A, var(--amber)); }

.home-grid { display: grid; gap: 14px; margin-top: 14px; }
.home-col { min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.home-col > .sec-h { margin: 6px 0 0; }
.resume { display: flex; align-items: center; gap: 14px; padding: 14px; transition: transform .15s, box-shadow .15s; color: inherit; }
.resume:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.resume-ic { width: 52px; height: 52px; flex: none; border-radius: 16px; display: flex; align-items: center; justify-content: center; color: #fff; font-family: var(--f-head); font-weight: 700; font-size: 1.35rem; background: linear-gradient(140deg, var(--sc-l, var(--sky)), var(--sc, var(--blue))); }
.resume-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.45; }
.resume-txt b { font-family: var(--f-head); font-weight: 600; color: var(--navy); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.resume-txt .muted { font-size: .8rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kicker { font-family: var(--f-head); font-size: .74rem; font-weight: 600; color: var(--blue-d); }
.resume-go { width: 44px; height: 44px; flex: none; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: var(--blue); color: #fff; box-shadow: 0 6px 16px -6px var(--blue); }
.resume-go .ic { width: 18px; height: 18px; transform: scaleX(-1); }

.today { display: block; padding: 18px; color: inherit; position: relative; overflow: hidden;
  background: linear-gradient(160deg, var(--sc-soft2, var(--ice)) 0%, transparent 55%), var(--card); transition: transform .15s, box-shadow .15s; }
a.today:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.today-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.today-top .chip .ic { width: 1.05em; height: 1.05em; }
.today-subj { display: inline-flex; align-items: center; gap: 6px; font-size: .82rem; font-weight: 600; color: var(--sc-ink, var(--text)); }
.today h3 { font-size: 1.3rem; margin: 12px 0 6px; }
.today-sum { font-size: .9rem; color: var(--text); margin-bottom: 10px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.today-cta { margin-top: 14px; background: var(--sc, var(--blue)); }
.today-cta:hover { background: var(--sc-d, var(--blue-d)); }
.today-cta .ic, .btn .ic { width: 1.15em; height: 1.15em; }

.sc-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.sc {
  display: flex; flex-direction: column; gap: 6px; padding: 14px; border-radius: 18px; color: inherit; min-width: 0;
  background: linear-gradient(155deg, var(--sc-soft) 0%, transparent 60%), var(--card);
  border: 1px solid var(--line-soft); box-shadow: var(--shadow-sm); transition: transform .15s, box-shadow .15s;
}
.sc:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.sc .s-ic { margin-bottom: 4px; }
.sc-name { font-family: var(--f-head); font-weight: 600; color: var(--navy); font-size: .95rem; line-height: 1.35; }
.sc-meta { font-size: .74rem; color: var(--muted); }
.sc-prog { display: flex; align-items: center; gap: 8px; margin-top: auto; padding-top: 6px; }
.sc-pct { font-size: .74rem; font-weight: 600; color: var(--sc-ink, var(--muted)); min-width: 30px; text-align: end; }

/* ---------- liste des matières ---------- */
.srows { display: flex; flex-direction: column; gap: 12px; }
.srow { display: flex; align-items: center; gap: 14px; padding: 14px; color: inherit; transition: transform .15s, box-shadow .15s;
  background: linear-gradient(100deg, transparent 50%, var(--sc-soft) 100%), var(--card); }
.srow:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.srow-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.srow-name { font-family: var(--f-head); font-weight: 600; color: var(--navy); font-size: 1.05rem; }
.srow-fr { font-size: .78rem; color: var(--muted); text-align: right; }
.srow-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.srow-chips .ic { width: 1em; height: 1em; }
.srow-go, .ch-go { color: var(--muted); flex: none; }
.srow-go .ic, .ch-go .ic { width: 20px; height: 20px; }

/* ---------- page matière ---------- */
.s-hero, .bac-hero {
  position: relative; overflow: hidden; border-radius: 24px; padding: 20px; color: #fff;
  background: radial-gradient(circle at 0% 0%, rgba(255, 255, 255, .22), transparent 45%), linear-gradient(135deg, var(--sc) 0%, var(--sc-d) 100%);
  box-shadow: 0 18px 36px -18px var(--sc);
}
.s-hero-deco { position: absolute; left: -10px; bottom: -40px; font-size: 10rem; line-height: 1; opacity: .12; font-family: var(--f-head); font-weight: 700; pointer-events: none; direction: ltr; }
.s-hero-top { position: relative; display: flex; align-items: center; gap: 14px; }
.s-hero h1, .bac-hero h1 { color: #fff; font-size: 1.55rem; line-height: 1.3; }
.s-fr { opacity: .85; font-size: .85rem; text-align: right; }
.s-hero-chips { position: relative; display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.hchip { display: flex; flex-direction: column; padding: 7px 12px; border-radius: 14px; background: rgba(255, 255, 255, .16); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .2); line-height: 1.35; }
.hchip small { font-size: .7rem; opacity: .85; }
.hchip b { font-family: var(--f-head); font-weight: 600; font-size: 1rem; }
.s-hero-prog { position: relative; display: flex; align-items: center; gap: 10px; margin-top: 14px; font-size: .78rem; opacity: .95; }
.s-hero-actions, .bac-actions { position: relative; display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.dl-btn.is-done { background: var(--green-bg); color: var(--green); border-color: transparent; }
.btn-light.dl-btn.is-done { background: rgba(255, 255, 255, .95); color: #157A52; }

.s-layout { display: grid; gap: 4px; }
.intro { padding: 16px; margin-top: 16px; font-size: .95rem; }
.ch-list { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.ch-row { display: flex; align-items: center; gap: 12px; padding: 14px; color: inherit; transition: transform .15s, box-shadow .15s; }
.ch-row:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.ch-n { width: 38px; height: 38px; flex: none; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-family: var(--f-head); font-weight: 600; background: var(--sc-soft, var(--ice)); color: var(--sc-ink, var(--blue-d)); }
.seen .ch-n, .seen .nt-n { background: var(--green-bg); color: var(--green); }
.ch-n .ic, .nt-n .ic { width: 20px; height: 20px; }
.ch-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.ch-t { font-family: var(--f-head); font-weight: 600; color: var(--navy); line-height: 1.4; }
.ch-t .hot { font-size: .7rem; vertical-align: middle; margin-inline-start: 4px; }
.ch-t .hot .ic { width: 1em; height: 1em; }
.bac-card, .method-card { display: flex; align-items: center; gap: 12px; padding: 14px; margin-bottom: 10px; color: inherit; transition: transform .15s, box-shadow .15s; }
.bac-card:hover, .method-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.bac-ic { position: relative; width: 46px; height: 54px; flex: none; border-radius: 10px; background: var(--amber-bg); color: var(--amber-d); display: flex; align-items: center; justify-content: center; }
.bac-ic .ic { width: 26px; height: 26px; }
.bac-ic b { position: absolute; bottom: -6px; left: -6px; width: 22px; height: 22px; border-radius: 50%; background: var(--amber); color: #2B1A00; font-size: .72rem; display: flex; align-items: center; justify-content: center; font-family: var(--f-head); }
.bac-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; align-items: flex-start; }
.bac-body b { font-family: var(--f-head); font-weight: 600; color: var(--navy); line-height: 1.4; }
.bac-body .muted { font-size: .78rem; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.bac-body .muted .ic { width: 1em; height: 1em; }
.method-card { background: linear-gradient(120deg, var(--sc-soft) 0%, transparent 70%), var(--card); }
.method-card > span:nth-child(2) { flex: 1; display: flex; flex-direction: column; }
.method-card b { font-family: var(--f-head); color: var(--navy); font-weight: 600; }
.method-card .muted { font-size: .8rem; }
.mc-ic { width: 46px; height: 46px; flex: none; border-radius: 14px; display: flex; align-items: center; justify-content: center; background: var(--sc, var(--blue)); color: #fff; }
.method-card > .ic { color: var(--muted); }

/* ---------- chapitre / notion ---------- */
.ch-hero {
  position: relative; overflow: hidden; border-radius: 22px; padding: 18px; border: 1px solid var(--line-soft);
  background: radial-gradient(circle at 0% 0%, var(--sc-soft2), transparent 55%), linear-gradient(160deg, var(--sc-soft) 0%, transparent 70%), var(--card);
  box-shadow: var(--shadow-sm);
}
.ch-hero::before { content: ""; position: absolute; inset-inline-start: 0; top: 18px; bottom: 18px; width: 4px; border-radius: 4px; background: var(--sc); }
.ch-hero-k { display: flex; align-items: center; gap: 8px; font-size: .8rem; font-weight: 600; color: var(--sc-ink); margin-bottom: 6px; }
.ch-hero h1 { font-size: 1.45rem; margin-bottom: 8px; }
.ch-sum { margin-top: 10px; font-size: .93rem; }
.ch-hero-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.ch-hero-actions:empty { display: none; }
.hero-chips-soft { display: flex; gap: 8px; flex-wrap: wrap; }
.hero-chips-soft .ic { width: 1em; height: 1em; }

.sec-nav { position: sticky; top: var(--topbar-h); z-index: 12; margin: 12px -16px 0; padding: 8px 16px; background: linear-gradient(var(--bg) 75%, transparent); }
.sec-nav-in { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.sec-nav-in::-webkit-scrollbar { display: none; }
.sec-nav button { flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 6px 14px; border-radius: 999px; background: var(--card); border: 1px solid var(--line-soft); color: var(--text); font-size: .84rem; font-weight: 600; box-shadow: var(--shadow-sm); }
.sec-nav button:hover { border-color: var(--blue); color: var(--blue-d); }
.sec-nav .ic { width: 1.05em; height: 1.05em; color: var(--blue); }

.two-col { display: flex; flex-direction: column; }
.two-col > .col-main, .two-col > .col-side { display: contents; }
.o-video { order: 1; } .o-pod { order: 2; } .o-notions { order: 3; } .o-fiche { order: 3; } .o-qcm { order: 4; } .o-ex { order: 5; } .o-pit { order: 6; } .o-fc { order: 7; }
.bac-cols > .col-main, .bac-cols > .col-side { display: block; }
.bac-cols > .col-side { order: -1; }

.nt-list { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.nt { overflow: hidden; }
.nt-main { display: flex; align-items: center; gap: 12px; padding: 14px; color: inherit; }
.nt-main:hover { background: var(--soft); }
.nt-n { width: 38px; height: 38px; flex: none; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-family: var(--f-head); font-weight: 600; background: var(--ice); color: var(--blue-d); }
.nt-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.nt-body b { font-family: var(--f-head); color: var(--navy); font-weight: 600; }
.nt-feats { font-size: .76rem; color: var(--muted); display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.nt-feats .ic { width: 1em; height: 1em; }
.nt-ex { display: flex; align-items: center; gap: 8px; padding: 10px 14px; min-height: 44px; border-top: 1px dashed var(--line-soft); font-size: .84rem; font-weight: 600; background: var(--soft); }
.nt-ex .ic { width: 1.1em; height: 1.1em; }

.nt-pager { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 30px; }
.pager { display: flex; align-items: center; gap: 10px; padding: 14px; color: inherit; min-width: 0; }
.pager span { min-width: 0; display: flex; flex-direction: column; }
.pager small { color: var(--muted); font-size: .74rem; }
.pager b { font-family: var(--f-head); color: var(--navy); font-weight: 600; font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pager.next { justify-content: flex-end; text-align: left; background: linear-gradient(120deg, var(--ice), transparent 80%), var(--card); }
.pager .ic { color: var(--blue); flex: none; }

/* lecteurs : repli */
.media-fallback { padding: 16px; }
.mf-head { display: flex; gap: 12px; align-items: center; margin-bottom: 10px; }
.mf-head h4 { font-size: 1rem; }
.mf-head p { font-size: .8rem; }
.mf-ic { width: 46px; height: 46px; flex: none; border-radius: 14px; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, var(--blue), var(--blue-d)); color: #fff; }
.mf-list { padding-inline-start: 20px; font-size: .9rem; display: flex; flex-direction: column; gap: 6px; }
.mf-foot { margin-top: 12px; }
.pod-lines { display: flex; flex-direction: column; gap: 6px; max-height: 340px; overflow: auto; font-size: .9rem; }
.pl { padding: 8px 12px; border-radius: 14px; background: var(--soft); }
.pl-s { background: var(--ice); margin-inline-start: 24px; }
.pl b { font-family: var(--f-head); font-weight: 600; color: var(--blue-d); font-size: .8rem; }

/* ---------- « لم أفهم » ---------- */
.help-btn {
  display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 6px 14px; border-radius: 999px;
  border: 1.5px dashed var(--line); color: var(--muted); font-size: .85rem; font-weight: 600; font-family: var(--f-head); background: transparent;
  transition: color .15s, border-color .15s, background .15s;
}
.help-btn .ic { width: 1.15em; height: 1.15em; }
.help-btn:hover { color: var(--blue-d); border-color: var(--blue); background: var(--ice); border-style: solid; }
.help-sm { min-height: 40px; padding: 4px 12px; font-size: .8rem; }

/* ---------- fiche ---------- */
.fiche { display: flex; flex-direction: column; gap: 12px; }
.fb { --fbc: #2F80ED; --fbt: #1A5FC4; position: relative; padding: 14px 16px 10px; border-radius: 16px; background: linear-gradient(160deg, color-mix(in srgb, var(--fbc) 10%, transparent), transparent 70%), var(--card); border: 1px solid var(--line-soft); border-inline-start: 4px solid var(--fbc); box-shadow: var(--shadow-sm); }
.fb-def { --fbc: #2F80ED; --fbt: #1A5FC4; }
.fb-prop { --fbc: #7B5CE6; --fbt: #5B3FC4; }
.fb-method { --fbc: #1F9D6B; --fbt: #157A52; }
.fb-example { --fbc: #F5A524; --fbt: #8F5A0C; }
.fb-remark { --fbc: #0E8A9A; --fbt: #0B6E7A; }
.fb-formula { --fbc: #3D5AFE; --fbt: #2F45D0; }
:root[data-theme="dark"] .fb-def { --fbt: #8EC5FF; } :root[data-theme="dark"] .fb-prop { --fbt: #B7A6FF; } :root[data-theme="dark"] .fb-method { --fbt: #5FD6A6; }
:root[data-theme="dark"] .fb-example { --fbt: #F7BC5A; } :root[data-theme="dark"] .fb-remark { --fbt: #5FD0DE; } :root[data-theme="dark"] .fb-formula { --fbt: #9AA9FF; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .fb-def { --fbt: #8EC5FF; } :root:not([data-theme="light"]) .fb-prop { --fbt: #B7A6FF; } :root:not([data-theme="light"]) .fb-method { --fbt: #5FD6A6; }
  :root:not([data-theme="light"]) .fb-example { --fbt: #F7BC5A; } :root:not([data-theme="light"]) .fb-remark { --fbt: #5FD0DE; } :root:not([data-theme="light"]) .fb-formula { --fbt: #9AA9FF; }
}
.fb-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.fb-tag { display: inline-flex; align-items: center; gap: 5px; padding: 2px 10px 2px 12px; border-radius: 999px; font-size: .76rem; font-weight: 600; font-family: var(--f-head); color: var(--fbt); background: color-mix(in srgb, var(--fbc) 14%, transparent); }
.fb-tag .ic { width: 1.05em; height: 1.05em; }
.fb-title { font-size: 1rem; color: var(--navy); }
.fb-body { font-size: .97rem; }
.fb-formula .fb-body { font-size: 1.03rem; }
.fb-foot { display: flex; justify-content: flex-end; margin-top: 4px; }

/* ---------- pièges ---------- */
.pitfalls { display: flex; flex-direction: column; gap: 12px; }
.pf { padding: 16px; }
.pf-title { display: flex; align-items: flex-start; gap: 10px; font-size: 1rem; margin-bottom: 12px; }
.pf-n { width: 28px; height: 28px; flex: none; border-radius: 50%; background: var(--red-bg); color: var(--red); display: flex; align-items: center; justify-content: center; font-size: .82rem; }
.pf-grid { display: grid; gap: 8px; }
.pf-wrong, .pf-right, .pf-why { padding: 10px 12px; border-radius: 12px; font-size: .92rem; min-width: 0; }
.pf-wrong { background: var(--red-bg); }

.pf-right { background: var(--green-bg); }
.pf-why { background: var(--soft); margin-top: 8px; }
.pf-lab { display: flex; align-items: center; gap: 4px; font-family: var(--f-head); font-weight: 600; font-size: .76rem; margin-bottom: 2px; }
.pf-wrong .pf-lab { color: var(--red); }
.pf-right .pf-lab { color: var(--green); }
.pf-why .pf-lab { color: var(--amber-d); }
.pf-lab .ic { width: 1.1em; height: 1.1em; }
.pf-foot { display: flex; justify-content: flex-end; margin-top: 8px; }

/* ---------- QCM ---------- */
.qcm-card { padding: 16px; }
.qcm-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.qcm-count { font-size: .8rem; font-weight: 600; color: var(--muted); }
.qcm-dots { display: flex; gap: 5px; align-items: center; }
.qd { width: 8px; height: 8px; border-radius: 99px; background: var(--line); transition: all .25s; }
.qd.done { background: var(--sky); }
.qd.cur { width: 22px; background: var(--blue); }
.qcm-q { margin: 14px 0; font-size: 1.04rem; font-weight: 500; color: var(--navy); }
.qcm-opts { display: flex; flex-direction: column; gap: 8px; }
.qcm-opt {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 52px; padding: 10px 12px; border-radius: 14px;
  border: 1.5px solid var(--line-soft); background: var(--card); text-align: start; transition: border-color .15s, background .15s, transform .1s;
}
.qcm-opt:not([disabled]):hover { border-color: var(--blue); background: var(--ice); }
.qcm-opt:not([disabled]):active { transform: scale(.99); }
.qcm-opt[disabled] { cursor: default; }
.qo-l { width: 30px; height: 30px; flex: none; border-radius: 50%; background: var(--ice); color: var(--blue-d); display: flex; align-items: center; justify-content: center; font-family: var(--f-head); font-weight: 600; font-size: .85rem; }
.qo-t { flex: 1; min-width: 0; line-height: 1.6; }
.qo-s { flex: none; display: flex; }
.qcm-opt.ok { border-color: var(--green); background: var(--green-bg); }
.qcm-opt.ok .qo-l { background: var(--green); color: #fff; }
.qcm-opt.ok .qo-s { color: var(--green); }
.qcm-opt.ko { border-color: var(--red); background: var(--red-bg); animation: shake .3s; }
.qcm-opt.ko .qo-l { background: var(--red); color: #fff; }
.qcm-opt.ko .qo-s { color: var(--red); }
.qcm-opt[disabled]:not(.ok):not(.ko) { opacity: .6; }
@keyframes shake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
.qcm-fb { margin-top: 12px; padding: 12px 14px; border-radius: 14px; font-size: .93rem; animation: pageIn .25s var(--ease); }
.qcm-fb.ok { background: var(--green-bg); }
.qcm-fb.ok > strong { color: var(--green); }
.qcm-fb.ko { background: var(--amber-bg); }
.qcm-fb.ko > strong { color: var(--amber-d); }
.qcm-fb > strong { font-family: var(--f-head); display: block; margin-bottom: 2px; }
.qcm-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.qcm-next[hidden] { display: none; }
.qcm-end { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 24px 16px; }
.qcm-end h4 { font-size: 1.05rem; }
.ring { position: relative; width: 104px; height: 104px; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 8; }
.ring-bg { stroke: var(--line-soft); }
.ring-fg { stroke: var(--green); stroke-linecap: round; transition: stroke-dashoffset .8s var(--ease); }
.ring b { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-family: var(--f-head); font-size: 1.45rem; color: var(--navy); direction: ltr; }

/* ---------- exercices ---------- */
.ex { padding: 16px; margin-bottom: 14px; }
.ex-head { display: flex; align-items: center; justify-content: space-between; gap: 8px 12px; flex-wrap: wrap; margin-bottom: 12px; }
.ex-title { display: flex; align-items: center; gap: 10px; min-width: 0; }
.ex-title h3 { font-size: 1.05rem; }
.ex-ic { width: 36px; height: 36px; flex: none; border-radius: 11px; display: flex; align-items: center; justify-content: center; background: var(--amber-bg); color: var(--amber-d); }
.ex-ic .ic { width: 20px; height: 20px; }
.ex-done .ex-ic { background: var(--green-bg); color: var(--green); }
.ex-meta { display: flex; gap: 6px; flex-wrap: wrap; }
.ex-meta .chip .ic { width: 1em; height: 1em; }
.ex-meta a.chip { max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
.lvl-1 .chip.lvl { background: var(--green-bg); color: var(--green); }
.lvl-2 .chip.lvl { background: var(--ice); color: var(--blue-d); }
.lvl-3 .chip.lvl { background: var(--red-bg); color: var(--red); }
.ex-statement { padding: 12px 14px; border-radius: 14px; background: var(--soft); border: 1px solid var(--line-soft); font-size: .96rem; }
.ex-qs { list-style: none; margin-top: 6px; }
.exq { padding: 14px 0 4px; border-bottom: 1px dashed var(--line-soft); }
.exq:last-child { border-bottom: 0; }
.exq-head { display: flex; align-items: flex-start; gap: 10px; }
.exq-n { width: 28px; height: 28px; flex: none; border-radius: 50%; background: var(--blue); color: #fff; display: flex; align-items: center; justify-content: center; font-family: var(--f-head); font-size: .82rem; font-weight: 600; margin-top: 2px; }
.solved .exq-n { background: var(--green); }
.exq-q { flex: 1; min-width: 0; }
.exq-pts { flex: none; font-size: .74rem; font-weight: 600; color: var(--amber-d); background: var(--amber-bg); padding: 2px 8px; border-radius: 999px; margin-top: 3px; white-space: nowrap; }
.q-sol { padding-inline-start: 38px; }
.steps { list-style: none; display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.steps:empty { display: none; }
.step { display: flex; gap: 10px; align-items: flex-start; animation: stepIn .3s var(--ease); font-size: .95rem; }
.step > div { flex: 1; min-width: 0; }
@keyframes stepIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.step-n { width: 22px; height: 22px; flex: none; border-radius: 7px; background: var(--ice); color: var(--blue-d); font-size: .72rem; font-weight: 700; display: flex; align-items: center; justify-content: center; margin-top: 4px; }
.sol-answer, .sol-pitfall { margin-top: 10px; padding: 10px 14px; border-radius: 14px; animation: stepIn .3s var(--ease); }
.sol-answer { border: 2px solid var(--green); background: var(--green-bg); }
.sol-pitfall { background: var(--amber-bg); border-inline-start: 4px solid var(--amber); }
.sol-answer[hidden], .sol-pitfall[hidden] { display: none; }
.sa-lab { display: flex; align-items: center; gap: 5px; font-family: var(--f-head); font-size: .78rem; font-weight: 600; color: var(--green); }
.sol-pitfall .sa-lab { color: var(--amber-d); }
.sa-lab .ic { width: 1.1em; height: 1.1em; }
.sol-ctrl { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 10px 0 6px; }
.sol-ctrl .btn[hidden], .linkish[hidden] { display: none; }
.linkish { color: var(--link); font-size: .84rem; font-weight: 600; min-height: 44px; text-decoration: underline; text-underline-offset: 3px; }
.muted-n { opacity: .7; font-weight: 500; }
.ex-foot { display: flex; justify-content: flex-end; margin-top: 10px; }

/* ---------- flashcards ---------- */
.fc-wrap { user-select: none; -webkit-user-select: none; }
.fc-meta { display: flex; justify-content: space-between; align-items: center; font-size: .82rem; color: var(--muted); margin-bottom: 10px; }
.fc-meta span { display: inline-flex; align-items: center; gap: 5px; }
.fc-meta .ic { width: 1.1em; height: 1.1em; }
.fc-known { color: var(--green); font-weight: 600; }
.fc-stack { position: relative; padding-bottom: 12px; }
.fc-ghost { position: absolute; inset: 0 0 12px; border-radius: 22px; background: var(--card); border: 1px solid var(--line-soft); }
.fc-ghost.g2 { transform: translateY(6px) scale(.96); opacity: .8; }
.fc-ghost.g3 { transform: translateY(12px) scale(.92); opacity: .5; }
.fc { position: relative; display: block; width: 100%; height: 240px; perspective: 1200px; touch-action: pan-y; transition: transform .22s var(--ease), opacity .22s; border-radius: 22px; }
.fc.out-r { transform: translateX(110%) rotate(10deg) !important; opacity: 0; }
.fc.out-l { transform: translateX(-110%) rotate(-10deg) !important; opacity: 0; }
.fc-inner { position: absolute; inset: 0; transform-style: preserve-3d; transition: transform .5s var(--ease); }
.fc.flipped .fc-inner { transform: rotateY(180deg); }
.fc-face { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; border-radius: 22px; padding: 20px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; text-align: center; overflow: auto; }
.fc-front { background: radial-gradient(circle at 100% 0%, var(--ice), transparent 60%), var(--card); border: 1px solid var(--line); box-shadow: var(--shadow); color: var(--navy); }
.fc-back { transform: rotateY(180deg); background: linear-gradient(140deg, #2F80ED, #1A5FC4 60%, #0B2545); color: #fff; box-shadow: var(--shadow); }
.fc-back .rich strong { color: #fff; }
.fc-lab { position: absolute; top: 12px; inset-inline-start: 16px; font-size: .72rem; font-weight: 600; font-family: var(--f-head); opacity: .7; }
.fc-txt { font-size: 1.08rem; font-weight: 500; line-height: 1.75; max-width: 100%; }
.fc-hint { position: absolute; bottom: 12px; display: flex; align-items: center; gap: 4px; font-size: .74rem; color: var(--muted); }
.fc-hint .ic { width: 1em; height: 1em; }
.fc-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 8px; }
.fc-yes { background: var(--green); }
.fc-yes:hover { background: #17845A; }
.fc-swipe { text-align: center; font-size: .74rem; color: var(--muted); margin-top: 8px; }
.fc-end { padding: 24px 16px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.fc-end-ic { width: 64px; height: 64px; border-radius: 50%; background: var(--amber-bg); color: var(--amber-d); display: flex; align-items: center; justify-content: center; }
.fc-end-ic .ic { width: 32px; height: 32px; }

/* ---------- sujet type bac ---------- */
.honest { position: relative; display: flex; gap: 8px; align-items: flex-start; margin-top: 14px; padding: 8px 12px; border-radius: 12px; background: rgba(255, 255, 255, .14); font-size: .82rem; line-height: 1.55; }
.honest .ic { width: 1.1em; height: 1.1em; margin-top: .2em; }
.exam-bar { position: sticky; top: calc(var(--topbar-h) + 6px); z-index: 15; margin: 12px 0 0; }
.exam-bar[hidden] { display: none; }
.eb-in { display: flex; align-items: center; gap: 10px; padding: 8px 10px 8px 8px; border-radius: 18px; color: #fff; background: linear-gradient(135deg, var(--hero), var(--hero-2)); box-shadow: var(--shadow-lg); }
.eb-ic { display: flex; }
.eb-time { font-family: var(--f-head); font-weight: 700; font-size: 1.25rem; font-variant-numeric: tabular-nums; direction: ltr; }
.eb-track { flex: 1; min-width: 24px; height: 6px; border-radius: 9px; background: rgba(255, 255, 255, .2); overflow: hidden; }
.eb-track i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #FFD27A, var(--amber)); transition: width 1s linear; }
.exam-bar .btn-ghost { color: #fff; border-color: rgba(255, 255, 255, .35); }
.exam-bar .btn-ghost:hover { background: rgba(255, 255, 255, .12); }
.exam-bar.low .eb-time { color: #FFC861; animation: pulse 1s infinite alternate; }
@keyframes pulse { to { opacity: .55; } }
.exam-mode .q-sol, .exam-mode .ex-foot, .exam-mode .show-all { display: none; }
.exam-mode .exam-start { display: none; }
.bac-cols { margin-top: 18px; gap: 4px; }
.bac-cols .exs { min-width: 0; }
.bareme { padding: 4px 16px 14px; margin-bottom: 14px; }
.bareme .sec-h { margin-top: 12px; }
.bt-table { width: 100%; border-collapse: collapse; font-size: .86rem; }
.bt-table th, .bt-table td { padding: 8px 4px; border-bottom: 1px solid var(--line-soft); text-align: start; vertical-align: top; }
.bt-table th { font-family: var(--f-head); font-weight: 600; color: var(--navy); white-space: nowrap; }
.bt-table th small { display: block; font-family: var(--f-body); font-weight: 400; color: var(--muted); font-size: .74rem; white-space: normal; }
.bqs { display: flex; flex-wrap: wrap; gap: 4px; }
.bq { font-size: .72rem; padding: 1px 7px; border-radius: 999px; background: var(--soft); color: var(--text); white-space: nowrap; }
.bt-table td.bt { font-family: var(--f-head); font-weight: 700; color: var(--amber-d); text-align: end !important; white-space: nowrap; }
.bt-table tfoot th, .bt-table tfoot td { border-bottom: 0; padding-top: 10px; font-size: .95rem; }

/* ---------- méthode ---------- */
.method-grid { display: grid; gap: 14px; margin-top: 16px; }
.m-block { padding: 4px 16px 16px; min-width: 0; }
.m-block .sec-h { margin-top: 14px; }
.m-tips { padding: 0; }
.tbar { display: flex; height: 42px; border-radius: 14px; overflow: hidden; gap: 3px; direction: rtl; }
.tseg { display: flex; align-items: center; justify-content: center; color: #fff; font-family: var(--f-head); font-size: .78rem; min-width: 16px; overflow: hidden; }
.tseg.free { background: repeating-linear-gradient(45deg, var(--line-soft) 0 6px, transparent 6px 12px); }
.tlegend { list-style: none; margin-top: 14px; display: flex; flex-direction: column; gap: 4px; }
.tlegend li { display: grid; grid-template-columns: 12px minmax(0, 1fr) auto; grid-template-areas: "dot step min" ". clock clock"; align-items: center; gap: 0 10px; padding: 8px 0; border-bottom: 1px solid var(--line-soft); font-size: .9rem; }
.tlegend li:last-child { border-bottom: 0; }
.tdot { grid-area: dot; width: 12px; height: 12px; border-radius: 4px; }
.tl-step { grid-area: step; }
.tl-min { grid-area: min; font-family: var(--f-head); font-weight: 600; color: var(--navy); white-space: nowrap; }
.tl-clock { grid-area: clock; font-size: .74rem; color: var(--muted); text-align: right; }
.blist { padding-inline-start: 20px; display: flex; flex-direction: column; gap: 8px; }
.blist li::marker { color: var(--blue); }
.tips { list-style: none; display: grid; gap: 10px; }
.tips li { display: flex; gap: 12px; padding: 14px; align-items: flex-start; }
.tips li > div { flex: 1; min-width: 0; }
.tip-n { width: 32px; height: 32px; flex: none; border-radius: 10px; background: var(--amber-bg); color: var(--amber-d); display: flex; align-items: center; justify-content: center; font-family: var(--f-head); font-weight: 700; }
.cta-bac { margin-top: 22px; }

/* ---------- tuteur (repli) ---------- */
.tutor-off { padding: 28px 20px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px; margin-top: 10px; }
.to-ic { width: 72px; height: 72px; border-radius: 24px; display: flex; align-items: center; justify-content: center; color: #fff; background: linear-gradient(135deg, #4C9BFF, #1A5FC4); box-shadow: 0 12px 24px -10px var(--blue); }
.to-ic .ic { width: 36px; height: 36px; }
.tutor-off h2 { font-size: 1.25rem; }
.to-ctx { width: 100%; text-align: start; padding: 12px 14px; border-radius: 14px; background: var(--soft); border: 1px solid var(--line-soft); }
.to-ctx small { color: var(--muted); display: block; font-size: .74rem; }
.to-ctx b { font-family: var(--f-head); color: var(--navy); }
.to-ctx p { font-size: .86rem; margin-top: 4px; }
.to-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-top: 6px; }

/* ---------- réglages ---------- */
.set-block { padding: 2px 16px 16px; margin-bottom: 14px; }
.set-block .sec-h { margin-top: 14px; }
.fil-list { display: flex; flex-direction: column; gap: 8px; }
.fil-opt { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 50px; padding: 10px 14px; border-radius: 14px; border: 1.5px solid var(--line-soft); text-align: start; transition: border-color .15s, background .15s; }
.fil-opt:not(.off):hover { border-color: var(--blue); }
.fil-opt.on { border-color: var(--blue); background: var(--ice); }
.fil-opt.off { opacity: .6; cursor: not-allowed; }
.fo-name { flex: 1; font-weight: 600; color: var(--navy); }
.radio { width: 22px; height: 22px; flex: none; border-radius: 50%; border: 2px solid var(--line); transition: all .15s; }
.on .radio { border-color: var(--blue); box-shadow: inset 0 0 0 4px var(--card), inset 0 0 0 12px var(--blue); }
.fs-row { display: flex; align-items: center; justify-content: center; gap: 18px; }
.fs-btn { border: 1.5px solid var(--line); font-family: var(--f-head); font-weight: 700; font-size: .95rem; width: 52px; height: 48px; direction: ltr; }
.fs-btn.big { font-size: 1.2rem; }
.fs-val { font-family: var(--f-head); font-weight: 700; font-size: 1.2rem; color: var(--navy); min-width: 64px; text-align: center; direction: ltr; }
.fs-preview { margin-top: 12px; padding: 12px; border-radius: 12px; background: var(--soft); font-size: .95rem; }
.seg { display: flex; gap: 4px; padding: 4px; border-radius: 16px; background: var(--soft); border: 1px solid var(--line-soft); }
.seg button { flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; border-radius: 12px; font-weight: 600; font-size: .9rem; color: var(--muted); transition: all .15s; }
.seg button.on { background: var(--card); color: var(--blue-d); box-shadow: var(--shadow-sm); }
.seg .ic { width: 1.1em; height: 1.1em; }
.dl-list .muted { font-size: .88rem; display: flex; gap: 6px; align-items: center; }
.dl-items { list-style: none; }
.dl-items li { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line-soft); }
.dl-items li:last-child { border-bottom: 0; }
.dl-name { flex: 1; display: flex; flex-direction: column; line-height: 1.4; min-width: 0; }
.dl-name b { color: var(--navy); font-weight: 600; }
.dl-name small { color: var(--muted); }
.dl-items .icon-btn { color: var(--red); }
.reset-prog { margin-top: 10px; }
.reset-prog.confirm { border-color: var(--red); color: var(--red); }
.about-list { list-style: none; display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.about-list li { display: flex; gap: 10px; align-items: flex-start; font-size: .9rem; }
.about-list .ic { color: var(--blue); margin-top: .2em; }
.version { color: var(--muted); font-size: .78rem; text-align: center; margin-top: 12px; }

/* ---------- onboarding ---------- */
.onb { min-height: 100vh; display: flex; flex-direction: column; }
.onb-hero {
  position: relative; overflow: hidden; color: #fff; padding: 34px 20px 64px; text-align: center;
  background: radial-gradient(circle at 15% 10%, rgba(142, 197, 255, .45), transparent 40%), radial-gradient(circle at 90% 100%, rgba(245, 165, 36, .35), transparent 45%), linear-gradient(150deg, #0B2545 0%, #1A5FC4 100%);
}
.onb-hero::after { content: ""; position: absolute; width: 420px; height: 420px; border-radius: 50%; border: 2px dashed rgba(255, 255, 255, .14); top: -180px; left: -160px; }
.onb-logo { display: inline-flex; align-items: center; gap: 10px; font-family: var(--f-head); font-weight: 700; font-size: 1.4rem; direction: ltr; }
.onb-logo .logo { box-shadow: 0 10px 24px rgba(0, 0, 0, .25); border-radius: 16px; }
.onb-hero h1 { color: #fff; font-size: 1.85rem; margin: 22px auto 10px; max-width: 560px; }
.onb-hero p { opacity: .9; max-width: 520px; margin: 0 auto; font-size: .98rem; }
.onb-feats { position: relative; z-index: 1; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 20px; }
.onb-feats span { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: rgba(255, 255, 255, .14); font-size: .8rem; font-weight: 600; }
.onb-feats .ic { width: 1.05em; height: 1.05em; }
.onb-body { position: relative; width: 100%; max-width: 680px; margin: -32px auto 0; padding: 22px 16px 32px; background: var(--bg); border-radius: 28px 28px 0 0; flex: 1; }
.onb-body h2 { font-size: 1.3rem; }
.fil-grid { display: grid; gap: 10px; margin-top: 16px; }
.fil { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-height: 72px; padding: 14px 16px; padding-inline-end: 64px; border-radius: 18px; background: var(--card); border: 1.5px solid var(--line-soft); box-shadow: var(--shadow-sm); text-align: start; transition: transform .15s, border-color .15s, box-shadow .15s; }
.fil:not(.off):hover { transform: translateY(-2px); border-color: var(--blue); box-shadow: var(--shadow); }
.fil-name { font-family: var(--f-head); font-weight: 600; font-size: 1.05rem; color: var(--navy); }
.fil-fr { font-size: .78rem; color: var(--muted); }
.fil-go { position: absolute; inset-inline-end: 14px; top: 50%; transform: translateY(-50%); width: 36px; height: 36px; border-radius: 50%; background: var(--blue); color: #fff; display: flex; align-items: center; justify-content: center; }
.fil-go .ic { width: 18px; height: 18px; }
.fil .chip { position: absolute; inset-inline-end: 14px; top: 50%; transform: translateY(-50%); }
.fil.off { opacity: .62; cursor: not-allowed; box-shadow: none; background: var(--soft); }
.privacy { display: flex; gap: 10px; align-items: flex-start; margin-top: 18px; padding: 12px 14px; border-radius: 14px; background: var(--green-bg); font-size: .85rem; line-height: 1.6; }
.privacy .ic { color: var(--green); margin-top: .15em; }

/* ---------- états ---------- */
.empty { text-align: center; padding: 22px 12px; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 6px; }
.empty-ic { width: 54px; height: 54px; border-radius: 50%; background: var(--ice); color: var(--blue); display: flex; align-items: center; justify-content: center; margin-bottom: 4px; }
.empty-ic .ic { width: 26px; height: 26px; }
.empty h4 { font-size: 1rem; color: var(--navy); }
.empty p { font-size: .86rem; }
.soon { text-align: center; padding: 28px 18px; margin-top: 16px; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.soon-art svg { width: 140px; height: auto; }
.sa1 { fill: var(--ice); stroke: var(--line); stroke-width: 1.5; }
.sa2 { fill: var(--sky); }
.sa3 { fill: var(--line); }
.sa4 { fill: var(--amber); }
.sa5 { stroke: #fff; stroke-width: 2.5; fill: none; stroke-linecap: round; }
.soon h3 { font-size: 1.2rem; }
.soon p { color: var(--muted); max-width: 420px; }
.soon .btn { margin-top: 8px; }
.skel-wrap { padding-top: 4px; }

.toast {
  position: fixed; left: 50%; bottom: calc(var(--tabbar-h) + 16px + env(safe-area-inset-bottom, 0px)); z-index: 60;
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none; max-width: calc(100vw - 32px);
  display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-radius: 14px; background: #0B2545; color: #fff;
  font-size: .9rem; font-weight: 500; box-shadow: var(--shadow-lg); transition: opacity .2s, transform .2s var(--ease);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast .ic { color: #5FD6A6; }
.toast-error { background: #8E2A2A; }
.toast-error .ic { color: #FFC861; }
body.no-tabs .toast { bottom: calc(16px + env(safe-area-inset-bottom, 0px)); }
.spin { width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; border-top-color: transparent; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- tablette / desktop ---------- */
@media (min-width: 520px) {
  .fil-grid { grid-template-columns: 1fr 1fr; }
  .pf-grid { grid-template-columns: 1fr 1fr; }
  .fc { height: 260px; }
}
@media (min-width: 720px) {
  .pad { padding: 20px 24px 40px; }
  .sec-nav { margin-inline: -24px; padding-inline: 24px; }
  .sc-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .method-grid { grid-template-columns: 1fr 1fr; }
  .m-time, .m-tips { grid-column: 1 / -1; }
  .tips { grid-template-columns: 1fr 1fr; }
  .s-hero, .bac-hero { padding: 26px 28px; }
  .s-hero h1, .bac-hero h1 { font-size: 1.9rem; }
  .onb-hero { padding: 56px 24px 84px; }
  .onb-hero h1 { font-size: 2.3rem; }
}
@media (min-width: 960px) {
  body { padding-bottom: 96px; }
  .tabbar { inset-inline: auto; left: 50%; transform: translateX(-50%); bottom: 16px; border-radius: 999px; border: 1px solid var(--line-soft); box-shadow: var(--shadow-lg); padding: 0 6px; }
  .tab-in { height: 56px; gap: 4px; }
  .tabbar a { flex-direction: row; gap: 8px; padding: 0 18px; font-size: .88rem; }
  .tabbar a .ic { padding: 0 !important; background: none !important; }
  .tabbar a[aria-current="page"] { background: var(--pale); border-radius: 999px; margin: 6px 0; }
  .toast { bottom: 92px; }
  .home-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 24px; align-items: start; }
  .countdown { padding: 22px 26px; }
  .sc-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .s-layout { grid-template-columns: minmax(0, 1fr) 360px; gap: 28px; align-items: start; }
  .two-col { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 28px; align-items: start; }
  .two-col > .col-main, .two-col > .col-side { display: flex; flex-direction: column; min-width: 0; }
  .nt-cols > .col-side { position: sticky; top: calc(var(--topbar-h) + 60px); }
  .bac-cols > .col-side { order: 0; position: sticky; top: calc(var(--topbar-h) + 80px); }
  .ch-hero { padding: 24px 28px; }
  .ch-hero h1 { font-size: 1.8rem; }
}
@media (hover: none) {
  .sc:hover, .srow:hover, .ch-row:hover, .resume:hover, a.today:hover, .bac-card:hover, .method-card:hover, .fil:hover { transform: none; }
}

/* barre d'examen compacte sur petit écran */
.eb-in { min-width: 0; }
.eb-in .btn { flex: none; }
@media (max-width: 480px) {
  .eb-pause span { display: none; }
  .eb-pause { padding: 0 10px; }
  .eb-in { gap: 8px; }
  .eb-time { font-size: 1.1rem; }
}
html { overflow-x: hidden; }
@supports (overflow: clip) { html, body { overflow-x: clip; } }

/* ---------- tuteur : finition (surcharge les styles injectés par js/tutor.js) ---------- */
.tutor-slot .bt { min-height: calc(100vh - 140px); min-height: calc(100dvh - 140px); padding-top: 6px; }
.tutor-slot .bt-head { margin: 10px 16px 4px; padding: 16px 18px 16px 72px; border-radius: var(--radius-lg); position: relative; overflow: hidden;
  background: linear-gradient(135deg, var(--hero) 0%, var(--hero-2) 100%); color: var(--on-hero); box-shadow: var(--shadow); }
.tutor-slot .bt-head::after { content: ""; position: absolute; inset-inline-end: -26px; bottom: -34px; width: 120px; height: 120px; border-radius: 50%;
  background: radial-gradient(circle, rgba(142, 197, 255, .35), transparent 70%); pointer-events: none; }
.tutor-slot .bt-head::before { content: ""; position: absolute; inset-inline-end: 18px; top: 50%; width: 40px; height: 40px; margin-top: -20px; border-radius: 12px;
  background: rgba(255, 255, 255, .14) center / 22px no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3l1.8 4.6L18.5 9l-4.7 1.6L12 15l-1.8-4.4L5.5 9l4.7-1.4z'/%3E%3Cpath d='M18.5 15.5l.8 2 2 .8-2 .7-.8 2-.8-2-2-.7 2-.8z'/%3E%3C/svg%3E"); z-index: 1; }
.tutor-slot .bt-head h2 { color: #fff; font-size: 1.3rem; position: relative; z-index: 1; }
.tutor-slot .bt-head p { color: rgba(255, 255, 255, .82); position: relative; z-index: 1; font-size: .86rem; }
.tutor-slot .bt-started .bt-head { padding-top: 12px; padding-bottom: 12px; }
.tutor-slot .bt-log { padding: 14px 16px 12px; gap: 12px; }
.tutor-slot .bt-msg { font-size: .98rem; box-shadow: var(--shadow-sm); }
.tutor-slot .bt-bot { background: var(--card); border-color: var(--line-soft); border-radius: 18px 18px 6px 18px; color: var(--ink); }
.tutor-slot .bt-me { background: linear-gradient(135deg, #3D8BF0, #1A5FC4); border-radius: 18px 18px 18px 6px; box-shadow: 0 6px 16px rgba(26, 95, 196, .25); }
.tutor-slot .bt-sugg { padding: 6px 16px 10px; }
.tutor-slot .bt-sugg button { background: var(--ice); border-color: transparent; color: var(--blue-d); font-weight: 500; transition: background .15s, transform .15s; }
.tutor-slot .bt-sugg button:hover { background: var(--pale); }
.tutor-slot .bt-sugg button:active { transform: scale(.97); }
.tutor-slot .bt-form { margin: 0 12px; padding: 8px; border: 1px solid var(--line-soft); border-radius: 26px; background: var(--card); box-shadow: var(--shadow); bottom: 8px; align-items: center; }
.tutor-slot .bt-form textarea { border: 0; background: transparent; min-height: 40px; padding: 9px 6px; line-height: 1.5; }
.tutor-slot .bt-form textarea:focus { outline: none; }
.tutor-slot .bt-form:focus-within { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(47, 128, 237, .18), var(--shadow); }
.tutor-slot .bt-ib { font-size: 0; flex-basis: 42px; width: 42px; height: 42px; }
.tutor-slot .bt-ib::before { content: ""; width: 22px; height: 22px; background: currentColor;
  -webkit-mask: var(--bt-ic) center / contain no-repeat; mask: var(--bt-ic) center / contain no-repeat; }
.tutor-slot .bt-cam { background: var(--ice); color: var(--blue-d);
  --bt-ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 8h3l2-3h6l2 3h3v11H4z'/%3E%3Ccircle cx='12' cy='13' r='3.5'/%3E%3C/svg%3E"); }
.tutor-slot .bt-send { background: var(--amber); color: #0B2545; box-shadow: 0 4px 12px rgba(245, 165, 36, .35);
  --bt-ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M19 12H5M11 6l-6 6 6 6'/%3E%3C/svg%3E"); }
.tutor-slot .bt-send:disabled { box-shadow: none; }
.tutor-slot .bt-note { padding: 14px 16px 8px; }
@media (min-width: 720px) {
  .tutor-slot .bt-sugg { flex-wrap: wrap; justify-content: center; }
  .tutor-slot .bt-head { margin-top: 18px; }
}

/* ---------- liste des matières : puces sur une ligne sur petit écran ---------- */
@media (max-width: 420px) {
  .srow { gap: 12px; padding: 14px 12px; }
  .srow-chips { gap: 4px; }
  .srow-chips .chip { font-size: .72rem; padding: .15em .55em; gap: .25em; }
  .srow-go .ic { width: 16px; height: 16px; }
}
