/* ==========================================================================
   Galien — thème étudiant
   Palette douce, contrastée et reposante pour les yeux :
   fond légèrement bleuté (pas de blanc pur), encre ardoise, accents calmes.
   ========================================================================== */
:root {
  --bg: #f7f8fa;
  --bg-soft: #f2f4f7;
  --card: #ffffff;
  --surface-2: #f7f8fa;
  --surface-3: #eceff3;
  --ink: #1f2937;
  --ink-soft: #374151;
  --muted: #6b7280;
  --line: #e5e7eb;
  --line-strong: #d1d5db;
  --brand: #3b82f6;
  --brand-dark: #2563eb;
  --brand-soft: #eaf2ff;
  --brand-ink: #ffffff;
  --ok: #15803d;
  --ok-soft: #e9f9ef;
  --bad: #dc2626;
  --bad-soft: #fdecec;
  --gold: #f6c343;
  --gold-ink: #3f2d00;
  --gold-soft: #fff7dd;
  --topbar: #1f2937;
  --topbar-ink: #f9fafb;
  --topbar-muted: #9ca3af;
  --shadow: 0 1px 2px rgba(17, 24, 39, .05);
  --shadow-lg: 0 14px 34px rgba(17, 24, 39, .10);
  --radius: 14px;
  color-scheme: light;
}

/* Mode sombre — bleu nuit, jamais du noir pur, pour limiter la fatigue. */
html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0c1420;
  --bg-soft: #0f1927;
  --card: #131e2d;
  --surface-2: #1a2738;
  --surface-3: #223248;
  --ink: #e9eff8;
  --ink-soft: #c6d3e3;
  --muted: #9fb0c7;
  --line: #26374c;
  --line-strong: #354a64;
  --brand: #5b9bf0;
  --brand-dark: #8dbdf9;
  --brand-soft: #1a2d47;
  --brand-ink: #ffffff;
  --ok: #43c98c;
  --ok-soft: #123026;
  --bad: #ff8b82;
  --bad-soft: #3a1c1e;
  --gold: #f2c14e;
  --gold-ink: #3a2a00;
  --gold-soft: #382e15;
  --topbar: #09111c;
  --topbar-ink: #e9eff8;
  --topbar-muted: #a9b9ce;
  --shadow: 0 1px 2px rgba(0, 0, 0, .35);
  --shadow-lg: 0 18px 40px rgba(0, 0, 0, .45);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  min-height: 100vh;
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: none; }

/* ---------------- top bar ---------------- */
.topbar {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 9px 22px;
  background: var(--topbar);
  color: var(--topbar-ink);
  flex-wrap: wrap;
  position: sticky;
  top: 0;
  z-index: 60;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .06), 0 8px 26px rgba(7, 14, 26, .20);
}
.brand { display: flex; align-items: center; gap: 9px; color: #fff; font-weight: 700; letter-spacing: -.2px; }
.brand-img { width: 30px; height: 30px; border-radius: 9px; display: block; box-shadow: 0 2px 8px rgba(0,0,0,.25); }
.nav-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.nav { display: flex; gap: 2px; flex-wrap: wrap; align-items: center; }
.nav a {
  position: relative; display: grid; place-items: center;
  width: 37px; height: 36px; padding: 0;
  color: var(--topbar-muted); border-radius: 11px;
  transition: color .12s ease, background .12s ease, transform .12s ease;
}
.nav a:hover { color: #fff; background: rgba(255, 255, 255, .08); transform: translateY(-1px); }
.nav a.on {
  color: #fff;
  background: linear-gradient(145deg, rgba(129, 140, 248, .42), rgba(79, 70, 229, .20));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .16), 0 6px 14px -8px rgba(0, 0, 0, .8);
}
.nav a.on::after {
  content: ""; position: absolute; bottom: 3px; left: 50%; width: 4px; height: 4px;
  border-radius: 50%; background: var(--gold); transform: translateX(-50%);
}
.nav-ico { width: 19px; height: 19px; display: block; pointer-events: none; }
.nav-tip {
  position: absolute; top: calc(100% + 7px); left: 50%; z-index: 90;
  padding: 5px 9px; border-radius: 8px; white-space: nowrap;
  background: #0b1626; color: #e7edf8; border: 1px solid rgba(255, 255, 255, .14);
  box-shadow: 0 10px 24px -10px rgba(0, 0, 0, .8);
  font-size: 11.5px; font-weight: 600; letter-spacing: .1px;
  opacity: 0; pointer-events: none; transform: translate(-50%, -4px);
  transition: opacity .14s ease, transform .14s ease;
}
.nav a:hover .nav-tip,
.nav a:focus-visible .nav-tip { opacity: 1; transform: translate(-50%, 0); }
.nav a:focus-visible { outline: 2px solid rgba(255, 255, 255, .55); outline-offset: 2px; }
.nav a .nav-count {
  position: absolute; top: -3px; right: -3px; margin: 0;
  min-width: 15px; padding: 0 4px; line-height: 15px; font-size: 9.5px;
  border-radius: 999px; background: var(--bad); color: #fff;
  box-shadow: 0 0 0 2px var(--topbar); text-align: center;
}
.who { margin-left: auto; display: flex; align-items: center; gap: 7px; }
.who-ico {
  position: relative; display: grid; place-items: center;
  width: 34px; height: 34px; border-radius: 10px;
  color: var(--topbar-muted); transition: color .12s ease, background .12s ease;
}
.who-ico:hover { color: #fff; background: rgba(255, 255, 255, .08); }
.who-ico .nav-ico { width: 18px; height: 18px; }
.who-ico:hover .nav-tip,
.who-ico:focus-visible .nav-tip { opacity: 1; transform: translate(-50%, 0); }
.pill {
  background: rgba(255, 255, 255, .10); color: var(--topbar-ink); border: 1px solid rgba(255, 255, 255, .10);
  border-radius: 999px; padding: 3px 11px; font-size: 12.5px;
}
.pill:hover { background: rgba(255, 255, 255, .17); color: #fff; }
.link-muted { color: var(--topbar-muted); font-size: 13px; }
.link-muted:hover { color: #fff; }
.who-user { display: inline-flex; align-items: center; gap: 8px; color: var(--topbar-ink); font-size: 13px; }
.who-user:hover { color: #fff; }
.avatar-sm {
  width: 28px; height: 28px; border-radius: 50%; object-fit: cover;
  border: 1px solid rgba(255,255,255,.35); display: block; flex: none;
}
.avatar-sm.initial {
  display: grid; place-items: center; background: linear-gradient(135deg, #3b82d6, #2568b8);
  color: #fff; font-size: 12.5px; font-weight: 700;
}
.icon-btn {
  all: unset; box-sizing: border-box; cursor: pointer;
  width: 34px; height: 34px; border-radius: 10px;
  display: grid; place-items: center; font-size: 15px; line-height: 1;
  color: var(--topbar-muted); background: rgba(255, 255, 255, .07);
  border: 1px solid rgba(255, 255, 255, .10);
  transition: background .12s ease, color .12s ease, transform .12s ease;
}
.icon-btn:hover { background: rgba(255, 255, 255, .16); color: #fff; transform: translateY(-1px); }
.icon-btn:focus-visible { outline: 2px solid #8dbdf9; outline-offset: 2px; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 22px 18px 60px; }
.foot { text-align: center; color: var(--muted); font-size: 12.5px; padding: 18px 0 30px; }

h1 { font-size: 23px; margin: 0 0 6px; letter-spacing: -.3px; }
h2 { font-size: 17px; margin: 26px 0 6px; }
h3 { font-size: 15px; margin: 0 0 4px; }
.sub { color: var(--muted); margin: 0 0 18px; font-size: 14px; }
.sub.small { font-size: 12.5px; margin: 0 0 10px; color: var(--muted); }
.muted { color: var(--muted); }
.meta { color: var(--muted); font-size: 12.5px; }
.center { text-align: center; }
.mt-2 { margin-top: 10px; }

/* ---------------- flashes ---------------- */
.flashes { margin-bottom: 14px; }
.flash {
  padding: 10px 14px; border-radius: 10px; margin-bottom: 8px;
  font-size: 14px; border: 1px solid transparent;
}
.flash-ok { background: var(--ok-soft); border-color: var(--ok); color: var(--ok); }
.flash-error { background: var(--bad-soft); border-color: var(--bad); color: var(--bad); }
.flash-warning { background: var(--gold-soft); border-color: var(--gold); color: #6b4a00; }
html[data-theme="dark"] .flash-warning { color: var(--gold); }

/* ---------------- grids ---------------- */
.grid { display: grid; gap: 14px; }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 900px) { .grid-4, .grid-3 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 640px) { .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; } }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: 0 1px 2px rgba(20, 35, 60, .04);
}

/* ---------------- hero ---------------- */
.hero {
  background: linear-gradient(135deg, #3b82f6 0%, #4f8ef7 55%, #60a5fa 100%);
  border-radius: 18px;
  color: #fff;
  padding: 20px 24px 22px;
  box-shadow: 0 10px 24px rgba(47, 111, 208, .25);
}
.hero-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.hero-hello { display: flex; align-items: center; gap: 14px; }
.avatar {
  width: 46px; height: 46px; border-radius: 50%;
  background: rgba(255,255,255,.2);
  display: grid; place-items: center;
  font-size: 19px; font-weight: 700;
  border: 1px solid rgba(255,255,255,.35);
}
.hero h1 { color: #fff; margin: 0; font-size: 21px; }
.hero-hello p { margin: 0; color: #e3eeff; font-size: 13px; }
.hero-pills { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.hp {
  border-radius: 999px; padding: 5px 12px; font-size: 12.5px;
  background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.25);
  color: #fff; white-space: nowrap;
}
.hp-plan { background: rgba(255, 255, 255, .18); color: #fff; font-weight: 600; }
.hp-cta { background: #d9551f; border-color: #d9551f; color: #fff; font-weight: 700; }
.hero-progress { margin-top: 18px; background: rgba(255,255,255,.13); border-radius: 12px; padding: 12px 14px; }
.hp-label { font-size: 12px; color: #dce9ff; }
.hp-value { font-size: 18px; font-weight: 700; margin: 1px 0 8px; }
.hp-note { font-size: 12px; color: #dce9ff; margin-top: 6px; }
.hero-goal {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-top: 12px; padding-top: 10px;
  border-top: 1px solid rgba(255,255,255,.2);
}
.hero-goal label { font-size: 12px; font-weight: 600; color: #eaf3ff; }
.hero-goal input {
  width: 92px; padding: 5px 9px; border-radius: 8px;
  border: 1px solid rgba(255,255,255,.42);
  background: rgba(255,255,255,.16); color: #fff;
  font-family: inherit; font-size: 14px; font-weight: 700;
}
.hero-goal input::placeholder { color: rgba(255,255,255,.65); }
.hero-goal input:focus { outline: 2px solid rgba(255,255,255,.6); border-color: #fff; }
.hero-goal-unit { font-size: 12px; color: #dce9ff; }
.hero-goal .btn {
  min-height: 30px; border: 1px solid #fff;
  background: #fff; color: #1c4f8f; font-weight: 700;
}
.hero-goal .btn:hover { background: #eaf3ff; }
@media (max-width: 560px) {
  .hero-goal input { width: 80px; }
}

.bar { height: 8px; border-radius: 999px; background: var(--surface-3); overflow: hidden; display: flex; }
.bar > span { display: block; height: 100%; background: linear-gradient(90deg, #3f8ae0, #67b0ff); }
.bar-light { background: rgba(255,255,255,.28); }
.bar-light > span { background: #ffffff; }

/* ---------------- stats ---------------- */
.stat .k { color: var(--muted); font-size: 11.5px; text-transform: uppercase; letter-spacing: .07em; }
.stat .v { font-size: 25px; font-weight: 700; margin-top: 2px; }
.stat .v small { font-size: 12.5px; font-weight: 500; color: var(--muted); }
.quick { margin-top: 14px; }

/* ---------------- modes ---------------- */
.modes { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; }
.modes-small { grid-template-columns: repeat(5, minmax(0, 1fr)); margin-top: 4px; }
@media (max-width: 900px) { .modes { grid-template-columns: repeat(3, 1fr); } .modes-small { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 560px) { .modes, .modes-small { grid-template-columns: 1fr 1fr; } }

.mode {
  background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  padding: 16px 10px 14px; text-align: center; color: var(--ink);
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  transition: transform .12s ease, box-shadow .12s ease;
  position: relative;
}
.mode:hover { transform: translateY(-2px); box-shadow: 0 8px 18px rgba(30, 60, 110, .10); }
.mode-icon {
  width: 44px; height: 44px; border-radius: 14px;
  display: grid; place-items: center; font-size: 20px; margin-bottom: 6px;
}
.mode-name { font-weight: 700; font-size: 14px; }
.mode-desc { font-size: 11.5px; color: var(--muted); line-height: 1.3; }
.mode-badge {
  position: absolute; top: 8px; right: 8px;
  background: var(--brand-soft); color: var(--brand-dark); font-size: 10.5px;
  border-radius: 999px; padding: 1px 7px;
}
.mode-off { opacity: .55; }
.mode-form { padding: 0; }
.mode-form button {
  all: unset; cursor: pointer; width: 100%; height: 100%;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 16px 10px 14px; text-align: center;
}

.mi-study { background: #e6f0ff; }
.mi-session { background: #e8f8ef; }
.mi-revision { background: #fff4d8; }
.mi-exam { background: #ffe9e9; }
.mi-last { background: #e6f7f4; }
.mi-team { background: #eef1f6; }
.mi-block { background: #efe9ff; }
.mi-enc { background: #fff0e3; }
.mi-streak { background: #ffeede; }
.mi-league { background: #eaf0ff; }

/* ---------------- lower panels ---------------- */
.lower { margin-top: 16px; }
.card-h { margin-bottom: 10px; font-size: 14.5px; }

.act { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; border-bottom: 1px solid var(--line); }
.act:last-of-type { border-bottom: none; }
.act .grow { flex: 1; min-width: 0; }
.act-q { font-size: 13px; font-weight: 600; }
.act-time { font-size: 11.5px; color: var(--muted); }
.dot { width: 9px; height: 9px; border-radius: 50%; margin-top: 6px; flex: none; }
.dot.ok { background: var(--ok); }
.dot.ko { background: var(--bad); }

.mini-module {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 0; border-bottom: 1px solid var(--line);
  color: var(--ink); font-size: 13.5px; font-weight: 600;
}
.mini-module:hover { color: var(--brand); }
.mini-icon {
  width: 28px; height: 28px; border-radius: 9px; background: var(--surface-2);
  display: grid; place-items: center; font-size: 14px; flex: none;
}

.my-position { background: linear-gradient(135deg, #f3f0ff, #eef4ff); border-radius: 12px; padding: 10px; text-align: center; margin-bottom: 10px; }
.my-position .pos { font-size: 24px; font-weight: 800; color: #6b46c1; }
.rank { display: flex; align-items: center; gap: 10px; padding: 6px 0; font-size: 13.5px; }
.rank-pos { width: 18px; color: var(--muted); font-weight: 700; }
.rank-pts { color: var(--muted); font-size: 12.5px; }
.rank.me { font-weight: 700; color: var(--brand); }
.me-row { background: var(--brand-soft); }

/* ---------------- module cards ---------------- */
.mcard {
  background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  padding: 14px 16px; box-shadow: 0 1px 2px rgba(20,35,60,.04);
}
.mcard-top { display: flex; align-items: flex-start; gap: 12px; }
.mcard-icon {
  width: 42px; height: 42px; border-radius: 12px; background: var(--surface-2);
  display: grid; place-items: center; font-size: 20px; flex: none;
}

/* ---------------- logos illustrés des modules ---------------- */
.ml-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

.modlogo {
  --ml-size: 52px;
  --ml-c1: #93c5fd; --ml-c2: #2563eb; --ml-c3: #1e3a8a;
  position: relative; flex: none; display: inline-grid; place-items: center;
  width: var(--ml-size); height: var(--ml-size);
  border-radius: calc(var(--ml-size) * .31);
  color: #fff;
  background:
    radial-gradient(120% 100% at 24% 4%, rgba(255,255,255,.55), rgba(255,255,255,0) 45%),
    radial-gradient(95% 95% at 84% 102%, rgba(3,10,24,.44), rgba(3,10,24,0) 60%),
    linear-gradient(148deg, var(--ml-c1) 0%, var(--ml-c2) 55%, var(--ml-c3) 100%);
  border: 1px solid rgba(255,255,255,.34);
  box-shadow:
    0 10px 22px -12px rgba(8,18,36,.68),
    0 3px 7px rgba(8,18,36,.14),
    inset 0 1px 0 rgba(255,255,255,.48),
    inset 0 -9px 18px rgba(5,13,28,.22);
  overflow: hidden; isolation: isolate;
  transition: transform .25s cubic-bezier(.22,1,.36,1), box-shadow .25s ease;
}
.modlogo::before {
  content: ""; position: absolute; inset: 0; z-index: 0;
  background-image: radial-gradient(rgba(255,255,255,.55) 1px, transparent 1.3px);
  background-size: 9px 9px; opacity: .13; mix-blend-mode: overlay;
}
.modlogo::after {
  content: ""; position: absolute; left: -24%; top: -68%; width: 148%; height: 105%;
  border-radius: 50%; transform: rotate(-10deg); z-index: 0;
  background: linear-gradient(180deg, rgba(255,255,255,.42), rgba(255,255,255,0));
  opacity: .42;
}
.modlogo svg {
  position: relative; z-index: 1; width: 62%; height: 62%;
  filter: drop-shadow(0 2px 3px rgba(3,8,20,.38));
}
.modlogo .ml-emoji {
  position: relative; z-index: 1; display: grid; place-items: center;
  width: 100%; height: 100%;
  font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
  font-size: calc(var(--ml-size) * .50);
  line-height: 1;
  filter: drop-shadow(0 3px 5px rgba(3,8,20,.38));
  transform: translateY(1px);
}
.modlogo-sm { --ml-size: 32px; border-radius: 11px; }
.modlogo-md { --ml-size: 52px; border-radius: 18px; }
.modlogo-lg { --ml-size: 72px; border-radius: 26px; }
.modlogo-xl { --ml-size: 88px; border-radius: 32px; }

.mcard:hover .modlogo,
.mini-module:hover .modlogo {
  transform: translateY(-2px) scale(1.035);
  box-shadow:
    0 14px 26px -12px rgba(8,18,36,.7),
    0 4px 9px rgba(8,18,36,.16),
    inset 0 1px 0 rgba(255,255,255,.5),
    inset 0 -9px 18px rgba(5,13,28,.2);
}
html[data-theme="dark"] .modlogo {
  border-color: rgba(255,255,255,.22);
  box-shadow:
    0 14px 26px -14px rgba(0,0,0,.8),
    0 3px 8px rgba(0,0,0,.34),
    inset 0 1px 0 rgba(255,255,255,.34),
    inset 0 -9px 18px rgba(0,0,0,.32);
}

/* Chaque spécialité a sa palette : le module se reconnaît d'un regard. */
.modlogo-cardio     { --ml-c1: #fda4af; --ml-c2: #e11d48; --ml-c3: #7f1d1d; }
.modlogo-pneumo     { --ml-c1: #a5f3fc; --ml-c2: #0891b2; --ml-c3: #164e63; }
.modlogo-gastro     { --ml-c1: #fde68a; --ml-c2: #f59e0b; --ml-c3: #92400e; }
.modlogo-hepato     { --ml-c1: #fdba74; --ml-c2: #ea580c; --ml-c3: #7c2d12; }
.modlogo-nephro     { --ml-c1: #99f6e4; --ml-c2: #0d9488; --ml-c3: #134e4a; }
.modlogo-urolog     { --ml-c1: #bfdbfe; --ml-c2: #3b82f6; --ml-c3: #1e3a8a; }
.modlogo-hematolog  { --ml-c1: #fda4af; --ml-c2: #dc2626; --ml-c3: #7f1d1d; }
.modlogo-neuro      { --ml-c1: #ddd6fe; --ml-c2: #8b5cf6; --ml-c3: #4c1d95; }
.modlogo-endocrino  { --ml-c1: #fef08a; --ml-c2: #eab308; --ml-c3: #854d0e; }
.modlogo-dermato    { --ml-c1: #fbcfe8; --ml-c2: #ec4899; --ml-c3: #831843; }
.modlogo-pediatr    { --ml-c1: #bbf7d0; --ml-c2: #10b981; --ml-c3: #065f46; }
.modlogo-psychiatr  { --ml-c1: #ddd6fe; --ml-c2: #7c3aed; --ml-c3: #3b0764; }
.modlogo-radiol     { --ml-c1: #bae6fd; --ml-c2: #0ea5e9; --ml-c3: #075985; }
.modlogo-gyneco     { --ml-c1: #fbcfe8; --ml-c2: #db2777; --ml-c3: #831843; }
.modlogo-ophtalmo   { --ml-c1: #a5f3fc; --ml-c2: #06b6d4; --ml-c3: #164e63; }
.modlogo-orl        { --ml-c1: #fed7aa; --ml-c2: #f97316; --ml-c3: #7c2d12; }
.modlogo-orthoped   { --ml-c1: #e2e8f0; --ml-c2: #94a3b8; --ml-c3: #334155; }
.modlogo-rhumato    { --ml-c1: #fecaca; --ml-c2: #ef4444; --ml-c3: #7f1d1d; }
.modlogo-neurochir  { --ml-c1: #c7d2fe; --ml-c2: #6366f1; --ml-c3: #312e81; }
.modlogo-chirurgie  { --ml-c1: #fecdd3; --ml-c2: #f43f5e; --ml-c3: #881337; }
.modlogo-anatomie   { --ml-c1: #fecaca; --ml-c2: #dc2626; --ml-c3: #7f1d1d; }
.modlogo-biochim    { --ml-c1: #bbf7d0; --ml-c2: #22c55e; --ml-c3: #14532d; }
.modlogo-physiolog  { --ml-c1: #99f6e4; --ml-c2: #14b8a6; --ml-c3: #134e4a; }
.modlogo-microbio   { --ml-c1: #d9f99d; --ml-c2: #84cc16; --ml-c3: #3f6212; }
.modlogo-immuno     { --ml-c1: #bfdbfe; --ml-c2: #2563eb; --ml-c3: #1e3a8a; }
.modlogo-epidemio   { --ml-c1: #a7f3d0; --ml-c2: #059669; --ml-c3: #064e3b; }
.modlogo-legale     { --ml-c1: #fde68a; --ml-c2: #ca8a04; --ml-c3: #713f12; }
.modlogo-geriatr    { --ml-c1: #fde68a; --ml-c2: #f59e0b; --ml-c3: #78350f; }
.modlogo-genetique  { --ml-c1: #f5d0fe; --ml-c2: #c026d3; --ml-c3: #701a75; }
.modlogo-travail    { --ml-c1: #fcd34d; --ml-c2: #f59e0b; --ml-c3: #78350f; }
.modlogo-reanimat   { --ml-c1: #fda4af; --ml-c2: #e11d48; --ml-c3: #881337; }
.modlogo-therapeut  { --ml-c1: #bae6fd; --ml-c2: #0284c7; --ml-c3: #0c4a6e; }
.modlogo-infectieux { --ml-c1: #bbf7d0; --ml-c2: #16a34a; --ml-c3: #14532d; }
.modlogo-toxicolog  { --ml-c1: #d9f99d; --ml-c2: #65a30d; --ml-c3: #365314; }
.modlogo-cat-med    { --ml-c1: #93c5fd; --ml-c2: #2563eb; --ml-c3: #1e3a8a; }
.modlogo-cat-chir   { --ml-c1: #fecdd3; --ml-c2: #e11d48; --ml-c3: #881337; }
.modlogo-cat-bio    { --ml-c1: #a7f3d0; --ml-c2: #059669; --ml-c3: #064e3b; }

.logo-gallery {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(196px, 1fr)); gap: 11px;
}
.logo-card {
  display: flex; align-items: center; gap: 13px; padding: 12px 14px;
  background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  box-shadow: 0 1px 2px rgba(20,35,60,.04);
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.logo-card:hover {
  border-color: var(--line-strong); box-shadow: var(--shadow); transform: translateY(-1px);
}
.logo-card-text b { display: block; font-size: 13px; line-height: 1.25; }
.logo-card-text .meta { display: block; font-size: 10.5px; margin-top: 2px; letter-spacing: .02em; }
.mcard-name { font-weight: 700; font-size: 15px; }
.mcard-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.count-pill {
  background: #1f9d63; color: #fff; border-radius: 999px;
  min-width: 30px; height: 26px; display: grid; place-items: center;
  font-size: 12.5px; font-weight: 700; padding: 0 8px;
}

.splitbar { display: flex; height: 9px; background: var(--surface-3); border-radius: 999px; overflow: hidden; margin: 12px 0 6px; }
.sb-ok { background: linear-gradient(90deg, #16a34a, #22c55e); display: block; height: 100%; }
.sb-ko { background: linear-gradient(90deg, #ef4444, #f87171); display: block; height: 100%; }
.mcard-foot { display: flex; gap: 14px; flex-wrap: wrap; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid var(--line); background: var(--card); color: var(--ink);
  padding: 7px 12px; border-radius: 10px; font-size: 13.5px; font-weight: 600;
  cursor: pointer; font-family: inherit;
}
.btn:hover { background: var(--surface-2); }
.btn-primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn-primary:hover { background: var(--brand-dark); }
.btn-ghost { background: transparent; }
.btn-danger { color: var(--bad); border-color: #f7c6c6; }
.btn-danger:hover { background: var(--bad-soft); }
.btn-sm { padding: 4px 9px; font-size: 12.5px; border-radius: 8px; }
.btn-yellow { background: var(--gold); border-color: var(--gold); color: var(--gold-ink); }
.btn-yellow:hover { background: var(--gold); filter: brightness(.95); }
.btn-red { background: #ef4444; border-color: #dc2626; color: #fff; }
.btn-red:hover { background: #dc2626; }
.row-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
form.inline { display: inline; }

/* ---------------- forms ---------------- */
label { display: block; font-size: 13.5px; font-weight: 600; margin: 14px 0 6px; }
input[type=text], input[type=password], input[type=number], select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px;
  font-size: 14.5px; background: var(--card); color: var(--ink); font-family: inherit;
}
input:focus, select:focus { outline: 2px solid var(--brand-soft); border-color: var(--brand); }
.select-inline { width: auto; padding: 6px 10px; font-size: 13px; }

.auth { max-width: 420px; margin: 40px auto 0; }
.auth h1 { text-align: center; }
.auth .card { padding: 24px; }
.auth .switch { text-align: center; margin-top: 14px; font-size: 14px; color: var(--muted); }

/* ---------------- lists ---------------- */
.list { display: flex; flex-direction: column; gap: 12px; }
.list-item {
  display: flex; align-items: center; gap: 14px; background: var(--card);
  border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; flex-wrap: wrap;
}
.list-item .name { font-weight: 600; }
.list-item .grow { flex: 1; min-width: 0; }

.badge {
  display: inline-block; padding: 2px 9px; border-radius: 999px;
  font-size: 12px; font-weight: 600; background: var(--surface-3); color: var(--muted);
}
.badge-ok { background: var(--ok-soft); color: #146c43; }
.badge-bad { background: var(--bad-soft); color: #a12626; }

/* ---------------- course rows ---------------- */
.module-head { display: flex; gap: 14px; align-items: center; margin-bottom: 18px; flex-wrap: wrap; }
.mhead-icon {
  width: 54px; height: 54px; border-radius: 16px; background: var(--brand-soft);
  display: grid; place-items: center; font-size: 26px;
}
.course {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  padding: 14px 16px;
}
.course-top { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.course-name { font-weight: 700; font-size: 15px; }
.course-tags { margin-top: 2px; }
.tag { font-size: 11px; border-radius: 999px; padding: 1px 8px; }
.tag-gold { background: var(--gold-soft); color: #8a6100; }
.course-actions { display: flex; gap: 12px; align-items: center; font-size: 12.5px; }
.qcm-count { color: #3a6fc4; font-weight: 700; }
.qcm-count span { color: var(--muted); font-weight: 500; }
.err-count { color: var(--bad); }
.course-links { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 6px; }
.link-action {
  background: none; border: none; padding: 0; cursor: pointer;
  color: #2f5fa8; font-size: 12.5px; font-family: inherit;
}
.link-action:hover { text-decoration: underline; }
.link-action.muted { cursor: default; }

/* ---------------- quiz ---------------- */
.question-box { max-width: 820px; margin: 0 auto; }
.q-head { display: flex; justify-content: space-between; gap: 12px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }
.q-text { font-size: 17px; font-weight: 600; line-height: 1.5; margin: 6px 0 18px; }
.q-src { color: var(--muted); font-size: 12.5px; }

.opt {
  display: flex; gap: 12px; align-items: flex-start;
  border: 1px solid var(--line); border-radius: 12px;
  padding: 12px 14px; margin-bottom: 9px; cursor: pointer; background: var(--card);
}
.opt:hover { border-color: var(--brand); background: var(--brand-soft); }
.opt input { margin-top: 3px; }
.opt .letter { font-weight: 700; color: var(--muted); min-width: 18px; }
.opt.correct { border-color: #86efac; background: #f0fdf4; }
.opt.wrong { border-color: #fca5a5; background: #fef2f2; }

.correction-banner { border-radius: 12px; padding: 13px 16px; font-weight: 700; margin-bottom: 16px; }
.correction-banner.ok { background: var(--ok-soft); color: #14532d; }
.correction-banner.bad { background: var(--bad-soft); color: #7f1d1d; }

.comments { margin-top: 18px; border-top: 1px dashed var(--line); padding-top: 14px; }
.comment { font-size: 13.5px; color: #334155; margin: 8px 0; }

/* ---------------- tables ---------------- */
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th, td { text-align: left; padding: 9px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; font-weight: 600; }
.table-wrap { overflow-x: auto; }

.code-chip {
  font-family: "Cascadia Code", Consolas, monospace;
  background: #0f172a; color: #a7f3d0;
  padding: 3px 9px; border-radius: 7px; font-size: 13px;
  letter-spacing: .5px; white-space: nowrap;
}
.copy-btn {
  margin-left: 6px; padding: 2px 8px; min-height: 0;
  font-size: 11.5px; line-height: 1.4; vertical-align: 1px;
}

/* ---------------- reprise ---------------- */
.resume {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  margin-top: 14px; padding: 14px 18px;
  background: var(--card); border: 1px solid var(--line); border-left: 5px solid var(--brand);
  border-radius: var(--radius); box-shadow: 0 1px 2px rgba(20, 35, 60, .04);
}
.resume-ico {
  width: 38px; height: 38px; border-radius: 50%; flex: none;
  display: grid; place-items: center; font-size: 15px;
  background: var(--brand-soft); color: var(--brand);
}
.resume-t { font-weight: 700; font-size: 14.5px; }

/* ---------------- semaine ---------------- */
.weekbars { display: flex; align-items: flex-end; gap: 8px; height: 74px; margin-top: 10px; }
.wb { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 3px; }
.wb-val { font-size: 10.5px; color: var(--muted); }
.wb-bar {
  display: block; width: 14px; max-width: 100%; min-height: 6px;
  border-radius: 6px 6px 3px 3px;
  background: linear-gradient(180deg, #67b0ff, #2f6fd0);
}
.wb-lbl { font-size: 10.5px; color: var(--muted); }
.wb-lbl.now { color: var(--brand); font-weight: 700; }

/* ---------------- blocks ---------------- */
.block-module { display: block; color: var(--ink); }
.block-module:hover { box-shadow: 0 8px 18px rgba(30, 60, 110, .10); transform: translateY(-2px); }
.block-grid { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.block-chip {
  display: flex; flex-direction: column; align-items: center; gap: 1px;
  min-width: 64px; padding: 6px 9px; border-radius: 10px; cursor: pointer;
  border: 1px solid var(--line); background: var(--card); color: var(--ink);
  font-family: inherit; transition: transform .12s ease, box-shadow .12s ease;
}
.block-chip:hover { transform: translateY(-1px); box-shadow: 0 4px 10px rgba(30, 60, 110, .10); }
.block-chip .bc-n { font-weight: 700; font-size: 12.5px; }
.block-chip .bc-m { font-size: 10.5px; color: var(--muted); }
.block-chip.new { background: var(--surface-2); }
.block-chip.part { background: var(--gold-soft); border-color: var(--gold); }
.block-chip.done { background: var(--ok-soft); border-color: var(--ok); color: var(--ok); }
.block-chip.done .bc-m { color: #2f8f5f; }
.block-chip.warn { background: var(--bad-soft); border-color: var(--bad); color: var(--bad); }
.block-chip.warn .bc-m { color: #b95353; }

/* ---------------- encoding ---------------- */
.encoding-top { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 6px; }

/* ---------------- équipe ---------------- */
.team-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.team-badge {
  width: 54px; height: 54px; border-radius: 16px; flex: none;
  display: grid; place-items: center; font-size: 26px; background: var(--brand-soft);
}

/* ---------------- ligues ---------------- */
.league-hero {
  display: flex; align-items: center; gap: 16px;
  padding: 18px 20px; border-radius: var(--radius);
  background: linear-gradient(135deg, #ffffff, #f1f6ff);
  border: 1px solid var(--line); border-left: 6px solid var(--league, var(--brand));
}
.league-icon {
  width: 64px; height: 64px; border-radius: 50%; flex: none;
  display: grid; place-items: center; font-size: 30px; background: var(--card);
  box-shadow: 0 2px 8px rgba(20, 35, 60, .08);
}
.league-name { font-size: 21px; font-weight: 800; letter-spacing: -.3px; }
.league-sub { color: var(--muted); font-size: 13.5px; }
.tiers { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.tier {
  display: flex; align-items: center; gap: 7px;
  padding: 6px 13px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--card); font-size: 12.5px; color: var(--muted);
}
.tier.on { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-dark); font-weight: 700; }
.tier-ico { font-size: 14px; }
.tier-min { font-size: 11px; opacity: .8; }

/* ---------------- auth ---------------- */
.auth-logo { display: block; width: 64px; height: 64px; margin: 0 auto 10px; }

.steps { display: flex; gap: 8px; justify-content: center; margin: 4px 0 14px; flex-wrap: wrap; }
.step {
  display: flex; align-items: center; gap: 7px;
  font-size: 12.5px; color: var(--muted); background: var(--card);
  border: 1px solid var(--line); border-radius: 999px; padding: 5px 12px;
}
.step b {
  display: grid; place-items: center; width: 18px; height: 18px;
  border-radius: 50%; background: var(--surface-3); color: var(--muted);
  font-size: 11px; font-weight: 700;
}
.step.on { color: var(--brand-dark); border-color: #b9d4ff; background: var(--brand-soft); font-weight: 600; }
.step.on b { background: var(--brand); color: var(--brand-ink); }

.auth-note {
  margin: 12px auto 0; max-width: 420px; text-align: center;
  font-size: 12.5px; color: var(--muted); background: var(--surface-2);
  border: 1px dashed var(--line); border-radius: 10px; padding: 10px 14px;
}

/* ---------------- landing ---------------- */
.land-nav {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap; padding: 6px 0 0;
}
.land-brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 17px; color: var(--ink); }
.land-brand img { width: 34px; height: 34px; border-radius: 10px; display: block; }
.land-actions { display: flex; gap: 8px; }

.land-hero {
  display: grid; grid-template-columns: 1.35fr .9fr;
  gap: 30px; align-items: center; padding: 46px 0 10px;
}
.land-kicker {
  display: inline-block; background: var(--brand-soft); color: var(--brand-dark);
  font-size: 12.5px; font-weight: 700; padding: 4px 12px;
  border-radius: 999px; margin-bottom: 14px;
}
.land-hero h1 { font-size: 40px; line-height: 1.12; letter-spacing: -1px; margin: 0 0 14px; }
.land-lead { font-size: 15.5px; color: #42536b; max-width: 560px; margin: 0 0 20px; }
.btn-lg { padding: 11px 20px; font-size: 14.5px; border-radius: 12px; }
.land-stats { display: flex; gap: 30px; margin-top: 26px; }
.land-stats b { display: block; font-size: 24px; line-height: 1.1; }
.land-stats span { font-size: 12px; color: var(--muted); }
.land-login { padding: 22px; box-shadow: 0 14px 34px rgba(20, 35, 60, .10); }
.land-login h3 { font-size: 16px; margin-bottom: 4px; }
.land-login-links { text-align: center; font-size: 12.5px; margin: 10px 0 6px; }

.land-section { margin-top: 46px; }
.land-section h2 { font-size: 22px; margin: 0 0 4px; }
.feature, .source { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 20px; }
.feature-ico {
  width: 46px; height: 46px; border-radius: 14px;
  display: grid; place-items: center; font-size: 21px; margin-bottom: 10px;
}
.feature h3, .source h3 { font-size: 15.5px; }
.feature p, .source p { font-size: 13.5px; color: var(--muted); margin: 4px 0 0; }
.source-count { font-size: 30px; font-weight: 800; color: var(--brand); line-height: 1; }

.offer {
  background: var(--card); border: 1px solid var(--line); border-radius: 18px;
  padding: 24px; position: relative;
}
.offer-dark { background: linear-gradient(135deg, #101827, #1d2c46); color: #fff; border-color: #1d2c46; }
.offer-dark p, .offer-dark .offer-list { color: #c7d2e3; }
.offer-tag {
  display: inline-block; font-size: 11.5px; font-weight: 700;
  letter-spacing: .06em; text-transform: uppercase; color: var(--brand);
  background: var(--brand-soft); padding: 3px 10px; border-radius: 999px;
}
.offer-dark .offer-tag { background: rgba(255,255,255,.12); color: #dbe7ff; }
.offer h3 { font-size: 20px; margin: 12px 0 6px; }
.offer p { color: var(--muted); font-size: 13.5px; }
.offer-list { margin: 14px 0 18px; padding-left: 18px; color: #42536b; font-size: 13.5px; }
.offer-list li { margin: 5px 0; }

@media (max-width: 820px) {
  .land-hero { grid-template-columns: 1fr; padding-top: 26px; }
  .land-hero h1 { font-size: 30px; }
}

/* ---------------- modules tools ---------------- */
.mod-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 10px 0 14px; }
.cat-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.cat-tab {
  all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--card); font-size: 12.5px; color: var(--muted); font-family: inherit;
}
.cat-tab span { font-size: 11px; background: var(--surface-3); border-radius: 999px; padding: 1px 7px; }
.cat-tab:hover { border-color: #b9d4ff; color: var(--brand-dark); }
.cat-tab.on { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); font-weight: 600; }
.cat-tab.on span { background: rgba(255,255,255,.22); color: #fff; }
.mod-search {
  margin-left: auto; max-width: 280px; padding: 8px 12px; font-size: 13px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--card);
  color: var(--ink); font-family: inherit;
}
.mod-search:focus { outline: 2px solid var(--brand-soft); border-color: var(--brand); }

/* ---------------- signalements ---------------- */
.report {
  margin-top: 14px; background: var(--card); border: 1px solid var(--line);
  border-radius: 12px; padding: 10px 14px;
}
.report summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--brand-dark); }
.report form { margin-top: 10px; display: grid; gap: 8px; }
.report select, .report textarea { width: 100%; }

/* ---------------- administration ---------------- */
.nav-count {
  display: inline-block; min-width: 16px; padding: 0 5px; margin-left: 4px;
  background: var(--bad); color: #fff; border-radius: 999px;
  font-size: 10.5px; font-weight: 700; text-align: center; line-height: 16px;
}
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.admin-links {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px; margin: 18px 0 4px;
}
.admin-link {
  display: flex; align-items: center; gap: 11px; background: var(--card);
  border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; color: var(--ink);
}
.admin-link:hover { border-color: #b9d4ff; box-shadow: 0 6px 16px rgba(47,111,208,.08); }
.admin-link strong { display: block; font-size: 13.5px; }
.admin-link small { display: block; color: var(--muted); font-size: 11.5px; }
.al-ico { font-size: 19px; }
.user-actions form.inline {
  display: inline-flex; align-items: center; gap: 4px;
  margin: 2px 4px 2px 0; vertical-align: middle;
}
.user-actions .btn { white-space: nowrap; }
.user-actions input[type="password"], .user-actions input[type="text"],
.expiry-form input[type="date"] {
  width: auto; padding: 5px 8px; font-size: 12px; border: 1px solid var(--line);
  border-radius: 8px; font-family: inherit;
}
.password-form input { width: 128px; }
.expiry-form { display: inline-flex; gap: 4px; align-items: center; }
.q-cell { font-size: 13px; line-height: 1.35; }
.comment-card { padding: 12px 15px; margin-bottom: 8px; }
.comment-head { display: flex; justify-content: space-between; gap: 10px; font-size: 12.5px; margin-bottom: 3px; }
.comments-block { margin-top: 18px; }
.comments-block textarea { width: 100%; }
.crumb { font-size: 12.5px; color: var(--muted); margin-bottom: 10px; display: flex; gap: 7px; }

/* ---------------- annonces ---------------- */
.announcements { display: grid; gap: 9px; margin-bottom: 14px; }
.announce {
  display: flex; align-items: flex-start; gap: 11px; padding: 11px 14px;
  background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--brand);
  border-radius: 12px;
}
.announce-warning { border-left-color: var(--gold); background: rgba(224, 160, 33, .10); }
.announce-success { border-left-color: var(--ok); background: rgba(31, 157, 99, .08); }
.announce-ico { font-size: 17px; line-height: 1.2; }
.announce-t { font-weight: 600; font-size: 13.5px; }
.announce-b { color: var(--muted); font-size: 12.5px; }
.badge-new { background: var(--brand-soft); color: var(--brand-dark); }
.notif { border-left: 4px solid var(--brand); margin-bottom: 12px; }
.notif.unread { box-shadow: 0 4px 14px rgba(47,111,208,.08); }
.notif-warning { border-left-color: #e0a021; }
.notif-success { border-left-color: var(--ok); }
.notif-head { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; flex-wrap: wrap; }
.notif-title { margin-left: 8px; font-size: 15px; }
.notif-body { color: #3d4b60; font-size: 13.5px; margin: 8px 0 10px; white-space: pre-line; }

@media (max-width: 860px) {
  .admin-links { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 520px) {
  .admin-links { grid-template-columns: 1fr; }
}

/* ---------------- inscription (façade étudiant) ---------------- */
.reg-hero {
  display: flex; justify-content: space-between; align-items: center; gap: 18px;
  flex-wrap: wrap; background: linear-gradient(135deg, #16233a 0%, #245aa9 100%);
  color: #fff; border-radius: 18px; padding: 22px 26px; margin-bottom: 18px;
}
.reg-brand { display: flex; align-items: center; gap: 14px; }
.reg-logo { width: 52px; height: 52px; border-radius: 14px; display: block; }
.reg-kicker { font-size: 11px; letter-spacing: .18em; color: #a9c9ff; font-weight: 700; }
.reg-hero h1 { color: #fff; margin: 3px 0 2px; font-size: 24px; }
.reg-hero p { margin: 0; color: #d6e4ff; font-size: 13.5px; }
.reg-hero-badges { display: flex; gap: 7px; flex-wrap: wrap; }
.reg-hero-badges span {
  background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.18);
  color: #eaf2ff; border-radius: 999px; padding: 4px 11px; font-size: 11.5px;
}
.reg-shell { display: grid; grid-template-columns: 330px minmax(0, 1fr); gap: 18px; align-items: start; }
.reg-side { display: grid; gap: 14px; position: sticky; top: 16px; }
.reg-main { padding: 22px 24px; }
.reg-main .switch { text-align: center; margin-top: 14px; font-size: 14px; color: var(--muted); }
.plan-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; margin: 14px 0 10px; }
.plan-card {
  position: relative; display: grid; gap: 3px; align-content: start;
  border: 1px solid var(--line); border-radius: 12px; padding: 12px 12px 13px;
  background: var(--card); cursor: pointer; transition: border-color .15s, box-shadow .15s;
}
.plan-card input { position: absolute; opacity: 0; pointer-events: none; }
.plan-card:hover { border-color: #b9d4ff; }
.plan-card.on { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.plan-name { font-weight: 700; font-size: 13px; }
.plan-desc { color: var(--muted); font-size: 11.5px; line-height: 1.35; }
.year-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; font-size: 13px; margin: 0 0 10px; }
.year-row > span { color: var(--muted); }
.year-row label { display: inline-flex; align-items: center; gap: 5px; margin: 0; }
.check { display: flex; align-items: center; gap: 7px; font-size: 13px; margin: 8px 0; }
.reg-points { display: grid; gap: 9px; }
.reg-point {
  display: flex; gap: 10px; align-items: flex-start; background: var(--card);
  border: 1px solid var(--line); border-radius: 12px; padding: 11px 13px;
}
.reg-point > span { font-size: 17px; line-height: 1.2; }
.reg-point strong { display: block; font-size: 13px; }
.reg-point small { display: block; color: var(--muted); font-size: 11.5px; }
.plan-price { font-size: 12.5px; font-weight: 700; color: var(--brand-dark); }
.pay-box { border-top: 1px solid var(--line); margin-top: 14px; padding-top: 14px; }
.pay-box h3 { font-size: 14px; margin: 0 0 8px; }
.pay-coords { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.pay-coords > div {
  background: var(--brand-soft); border: 1px solid var(--line-strong); border-radius: 10px;
  padding: 7px 11px; font-size: 12.5px;
}
.pay-coords span {
  display: block; color: var(--muted); font-size: 10.5px;
  text-transform: uppercase; letter-spacing: .06em;
}
.pay-coords strong { font-size: 13px; }
.pay-radios { display: flex; gap: 14px; margin: 4px 0 10px; flex-wrap: wrap; }
.pay-radios label { display: inline-flex; gap: 5px; align-items: center; margin: 0; font-size: 13px; }
.pay-tabs { display: flex; gap: 7px; flex-wrap: wrap; margin: 0 0 12px; }
@media (max-width: 860px) {
  .reg-shell { grid-template-columns: 1fr; }
  .reg-side { position: static; }
  .plan-grid { grid-template-columns: 1fr; }
}

/* ---------------- téléphone ---------------- */
@media (max-width: 760px) {
  .topbar { gap: 8px 10px; padding: 8px 12px; }
  .brand span { font-size: 15px; }
  .nav {
    order: 3;
    width: 100%;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 14px;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .nav::-webkit-scrollbar { display: none; }
  .nav a {
    display: flex; flex-direction: column; gap: 2px;
    width: 52px; height: auto; padding: 5px 3px 4px;
    border-radius: 10px;
  }
  .nav-ico { width: 20px; height: 20px; }
  .nav a .nav-tip {
    position: static; opacity: 1; transform: none; pointer-events: none;
    padding: 0; background: none; border: 0; box-shadow: none;
    font-size: 8.5px; font-weight: 600; line-height: 1.1; color: currentColor;
  }
  .who-ico .nav-tip { display: none; }
  .nav a.on::after { bottom: 1px; width: 3px; height: 3px; }
  .who { gap: 10px; }
  .who .link-muted { font-size: 12.5px; }

  .wrap { padding: 16px 12px 48px; }
  h1 { font-size: 20px; }
  h2 { font-size: 16px; margin-top: 22px; }
  .card { padding: 14px 15px; border-radius: 14px; }

  .hero { padding: 16px 16px 18px; border-radius: 15px; }
  .hero h1 { font-size: 18px; }
  .hero-hello { gap: 10px; }
  .hero-hello p { font-size: 12.5px; }
  .avatar { width: 40px; height: 40px; font-size: 17px; }
  .hero-pills { gap: 6px; }
  .hp { font-size: 11.5px; padding: 4px 10px; }
  .hero-progress { margin-top: 14px; padding: 10px 12px; }

  .grid { gap: 11px; }
  .modes { gap: 9px; }
  .mode { padding: 12px; }

  .mod-tools { align-items: stretch; gap: 8px; }
  .mod-search { margin-left: 0; max-width: 100%; width: 100%; }

  .table-wrap { -webkit-overflow-scrolling: touch; }
  table { font-size: 12.5px; }
  th, td { padding: 8px; }

  input:not([type="checkbox"]):not([type="radio"]),
  select, textarea { font-size: 16px; }
  input[type="file"] { max-width: 100%; }
  .user-actions form.inline { display: flex; width: 100%; }
  .user-actions input[type="password"],
  .user-actions input[type="text"],
  .expiry-form input[type="date"] { width: 100%; max-width: none; }
  .password-form input { width: 100%; }
  .expiry-form { width: 100%; }

  .reg-hero { padding: 16px; margin-bottom: 14px; border-radius: 15px; }
  .reg-hero h1 { font-size: 20px; }
  .reg-logo { width: 42px; height: 42px; }
  .reg-main { padding: 16px; }
  .reg-side { gap: 12px; }
  .pay-coords > div { flex: 1 1 130px; }

  .announce { padding: 10px 11px; }
  .announce .btn { align-self: center; }
}

@media (max-width: 420px) {
  .wrap { padding: 12px 9px 40px; }
  .card { padding: 13px 13px; }
  .hero { padding: 14px 13px 16px; }
  .hero-pills .hp-plan { display: none; }
  .modes, .modes-small { gap: 7px; }
  .plan-grid { gap: 7px; }
  .btn { padding: 8px 11px; font-size: 12.5px; }
  .flash { font-size: 13px; }
}

/* ==========================================================================
   COMPOSANTS GALIEN (v3) — tableau de bord, modules, fiches, compte
   ========================================================================== */

.skip-link {
  position: absolute; left: -9999px; top: 8px; z-index: 200;
  background: var(--brand); color: #fff; padding: 8px 14px; border-radius: 10px;
}
.skip-link:focus { left: 12px; }

:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.page-head .sub { margin-bottom: 6px; }
.section-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; margin: 26px 0 10px;
}
.section-head h2 { margin: 0; }
.section-head .sub { margin: 0; }

/* Cartes de statistiques avec accent de couleur discret */
.stat { position: relative; overflow: hidden; padding-left: 20px; }
.stat::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
  background: var(--accent, var(--brand)); border-radius: 4px 0 0 4px;
}
.stat.k-blue { --accent: #3b82d6; }
.stat.k-green { --accent: #1f9d63; }
.stat.k-gold { --accent: #e0a021; }
.stat.k-purple { --accent: #7c5cc4; }
.stat .stat-ico {
  position: absolute; right: 14px; top: 13px; font-size: 19px; opacity: .55;
}
.stat .v { letter-spacing: -.5px; }
.stat .k { display: flex; align-items: center; gap: 6px; }

/* Bandeau de reprise */
.resume { border-left-width: 5px; }
.resume .bar { max-width: 460px; }

/* Boutons : cibles tactiles confortables */
.btn { min-height: 36px; }
.btn-sm { min-height: 30px; }
.btn-lg { min-height: 44px; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

/* Recherche et filtres */
.search-wrap { position: relative; display: flex; align-items: center; }
.search-wrap .search-ico {
  position: absolute; left: 11px; font-size: 14px; color: var(--muted); pointer-events: none;
}
.search-wrap input { padding-left: 34px; }
.search-input {
  width: 100%; padding: 9px 12px; font-size: 13.5px;
  border: 1px solid var(--line); border-radius: 10px;
  background: var(--card); color: var(--ink); font-family: inherit;
}
.search-bar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 18px; }
.search-bar .search-wrap { min-width: 220px; }
.search-bar .btn { flex: none; }
.search-result { display: block; color: inherit; padding: 14px 16px; transition: border-color .15s, transform .15s; }
.search-result:hover { border-color: var(--brand); transform: translateY(-1px); }
.search-result-head { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 6px; }
.search-open { font-size: 12px; font-weight: 700; color: var(--brand); }
.search-text { margin: 0; font-size: 14px; color: var(--ink); line-height: 1.5; }
.filter-panel {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  padding: 14px 16px; margin: 0 0 14px; box-shadow: var(--shadow);
}
.filter-panel summary {
  cursor: pointer; font-weight: 700; font-size: 13.5px; color: var(--ink);
  list-style: none;
}
.filter-panel summary::-webkit-details-marker { display: none; }
.filter-panel summary::after { content: " ▾"; color: var(--muted); }
.filter-panel[open] summary::after { content: " ▴"; }
.filter-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px; margin-top: 12px;
}
.filter-grid label { margin: 0 0 4px; font-size: 12px; color: var(--muted); }
.filter-grid select, .filter-grid input { font-size: 13.5px; padding: 8px 10px; }
.filter-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }

/* Onglets */
.tabs {
  display: flex; gap: 2px; border-bottom: 1px solid var(--line);
  margin: 18px 0 14px; overflow-x: auto; scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  all: unset; box-sizing: border-box; cursor: pointer;
  padding: 9px 14px; font-size: 13.5px; font-weight: 600;
  color: var(--muted); border-bottom: 2px solid transparent;
  white-space: nowrap; font-family: inherit;
}
.tab:hover { color: var(--ink); }
.tab.on { color: var(--brand); border-bottom-color: var(--brand); }
.tab .tab-count {
  display: inline-block; min-width: 18px; margin-left: 5px; padding: 0 5px;
  border-radius: 999px; background: var(--surface-3); color: var(--muted);
  font-size: 10.5px; font-weight: 700; text-align: center; line-height: 17px;
}
.tab.on .tab-count { background: var(--brand-soft); color: var(--brand-dark); }
[hidden] { display: none !important; }

/* Cartes modules enrichies */
.mcard { display: flex; flex-direction: column; gap: 2px; }
.mcard-top { align-items: flex-start; }
.mcard-icon { font-size: 21px; }
.mcard-name { line-height: 1.3; }
.mcard-cat { font-size: 11px; color: var(--muted); margin-top: 1px; }
.mcard-actions { margin-left: auto; justify-content: flex-end; }
.mcard-actions .btn { white-space: nowrap; }
.mcard-foot { margin-top: 2px; row-gap: 4px; }
.mcard-foot .ok { color: var(--ok); font-weight: 700; }
.mcard-foot .ko { color: var(--bad); font-weight: 700; }
.mcard-link { display: block; color: inherit; }
.mcard-link:hover .mcard-name { color: var(--brand); }
.last-seen { font-size: 11.5px; color: var(--muted); }
.progress-line { display: flex; justify-content: space-between; gap: 10px; font-size: 12px; }
.progress-line b { font-weight: 700; }

/* Ligne de cours */
.course { transition: border-color .12s ease, box-shadow .12s ease; }
.course:hover { border-color: var(--line-strong); box-shadow: var(--shadow); }
.course-head { display: flex; align-items: flex-start; gap: 12px; }
.course-ico {
  width: 38px; height: 38px; border-radius: 11px; flex: none;
  display: grid; place-items: center; font-size: 17px;
  background: var(--brand-soft); color: var(--brand-dark);
}
.course-links { align-items: center; }
.link-action { font-weight: 600; }

/* Fiche question / correction */
.question-box { max-width: 860px; margin: 0 auto; }
.q-text { font-size: 17.5px; }
.opt { align-items: flex-start; transition: border-color .1s ease, background .1s ease; }
.opt .letter {
  display: grid; place-items: center; width: 24px; height: 24px; min-width: 24px;
  border-radius: 7px; background: var(--surface-2); color: var(--ink-soft);
  font-size: 12.5px; font-weight: 700;
}
.opt.correct .letter { background: var(--ok); color: #fff; }
.opt.wrong .letter { background: var(--bad); color: #fff; }
.opt strong { color: var(--ok); }
.opt em { color: var(--bad); font-style: normal; font-weight: 600; }
.correction-banner { display: flex; align-items: center; gap: 10px; font-size: 14.5px; }
.answer-line {
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 10px; padding: 9px 12px; font-size: 13px; color: var(--ink-soft);
}
.explanation p { margin: 6px 0; }
.explanation .comment { color: var(--ink-soft); }

/* Statistique d'une question */
.stat-mini-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px; margin-top: 6px;
}
.stat-mini {
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 10px; padding: 10px 12px; text-align: center;
}
.stat-mini b { display: block; font-size: 20px; line-height: 1.15; }
.stat-mini span { font-size: 11.5px; color: var(--muted); }

/* Notes personnelles */
.note-card {
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 12px; padding: 13px 15px;
}
.note-card textarea {
  width: 100%; min-height: 96px; resize: vertical;
  background: var(--card); border: 1px solid var(--line);
  border-radius: 9px; padding: 9px 11px; color: var(--ink);
  font-family: inherit; font-size: 13.5px; line-height: 1.5;
}
.note-head { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.note-status { font-size: 11.5px; color: var(--muted); }
.note-actions { display: flex; align-items: center; gap: 10px; margin-top: 8px; flex-wrap: wrap; }
.note-saved { color: var(--ok); font-size: 12.5px; font-weight: 600; }

/* Compte */
.account-wrap { max-width: 940px; margin: 0 auto; }
.account-hero {
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  background: linear-gradient(135deg, var(--brand-soft), var(--card));
  border: 1px solid var(--line); border-radius: 18px; padding: 20px 22px;
  box-shadow: var(--shadow);
}
.profile-avatar {
  width: 84px; height: 84px; border-radius: 50%; flex: none;
  object-fit: cover; border: 3px solid var(--card);
  box-shadow: 0 4px 14px rgba(20, 35, 60, .16); display: block;
}
.profile-avatar.initial {
  display: grid; place-items: center; font-size: 32px; font-weight: 700;
  color: #fff; background: linear-gradient(135deg, #3b82d6, #1c4f8f);
}
.profile-name { font-size: 20px; font-weight: 800; letter-spacing: -.3px; margin: 0; }
.profile-sub { color: var(--muted); font-size: 13px; margin: 1px 0 8px; }
.account-meta { display: flex; gap: 6px; flex-wrap: wrap; }
.account-grid {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px; align-items: start; margin-top: 16px;
}
.account-grid .card { height: 100%; }
.info-list { display: grid; gap: 1px; margin-top: 8px; }
.info-row {
  display: flex; justify-content: space-between; gap: 6px 14px; align-items: baseline;
  flex-wrap: wrap;
  padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 13.5px;
}
.info-row:last-child { border-bottom: none; }
.info-row span { color: var(--muted); }
.info-row b { text-align: right; font-weight: 600; max-width: 100%; overflow-wrap: anywhere; }
.upload-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 6px; }
.upload-row input[type="file"] { flex: 1; min-width: 180px; }
.avatar-form { margin-top: 10px; }
.avatar-form label { margin-top: 0; }

/* Badges et petits utilitaires */
.badge-plan { background: var(--brand-soft); color: var(--brand-dark); }
.badge-gold { background: var(--gold-soft); color: #8a6100; }
.badge-live { background: var(--ok-soft); color: var(--ok); }
.meta-chip {
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 999px; padding: 2px 9px; font-size: 11.5px; color: var(--muted);
}
.empty-state {
  border: 1px dashed var(--line-strong); border-radius: 14px;
  padding: 28px 18px; text-align: center; color: var(--muted);
  background: var(--card);
}
.empty-state .big { font-size: 30px; display: block; margin-bottom: 6px; }
.kbd {
  display: inline-block; min-width: 20px; text-align: center;
  padding: 1px 6px; border-radius: 5px; border: 1px solid var(--line-strong);
  background: var(--surface-2); color: var(--muted);
  font-family: "Cascadia Code", Consolas, monospace; font-size: 11px;
}
.muted-small { color: var(--muted); font-size: 12px; }
.nowrap { white-space: nowrap; }

/* Bouton de thème flottant (pages sans barre de navigation) */
.theme-fab {
  position: fixed; right: 16px; bottom: 16px; z-index: 90;
  width: 46px; height: 46px; border-radius: 50%;
  border: 1px solid var(--line-strong); background: var(--card); color: var(--ink);
  box-shadow: var(--shadow-lg); cursor: pointer; font-size: 19px;
  display: grid; place-items: center;
}
.theme-fab:hover { transform: translateY(-2px); }

/* Façade publique */
.land-kicker { display: inline-flex; align-items: center; gap: 7px; }
.land-accent {
  background: linear-gradient(100deg, #2568b8, #3b8ae0 55%, #1f9d63);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
html[data-theme="dark"] .land-accent {
  background: linear-gradient(100deg, #8dbdf9, #5b9bf0 55%, #43c98c);
  -webkit-background-clip: text; background-clip: text;
}
.land-trust {
  display: flex; gap: 8px 16px; flex-wrap: wrap;
  margin-top: 16px; font-size: 12.5px; color: var(--muted);
}
.land-trust span { display: inline-flex; align-items: center; gap: 5px; }
.login-brand {
  display: flex; align-items: center; gap: 10px; margin-bottom: 14px;
  padding-bottom: 12px; border-bottom: 1px solid var(--line);
}
.login-brand img { width: 42px; height: 42px; border-radius: 12px; display: block; }
.login-brand strong { display: block; font-size: 16px; line-height: 1.2; }
.login-brand small { display: block; color: var(--muted); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; }

.step-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  padding: 20px; position: relative; box-shadow: var(--shadow);
}
.step-num {
  display: grid; place-items: center; width: 32px; height: 32px;
  border-radius: 50%; background: var(--brand-soft); color: var(--brand-dark);
  font-weight: 800; font-size: 14px; margin-bottom: 10px;
}
.step-card h3 { font-size: 15.5px; }
.step-card p { font-size: 13.5px; color: var(--muted); margin: 4px 0 0; }

.offer { display: flex; flex-direction: column; }
.offer .btn { margin-top: auto; width: 100%; }
.offer-price { font-size: 27px; font-weight: 800; letter-spacing: -.6px; margin: 6px 0 2px; }
.offer-badge {
  position: absolute; top: -12px; right: 16px;
  background: var(--gold); color: #3a2a00;
  font-size: 10.5px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase;
  padding: 3px 10px; border-radius: 999px;
}
.offer-featured {
  background: linear-gradient(150deg, #16233a 0%, #1c4f8f 60%, #2568b8 100%);
  border-color: #1c4f8f; color: #fff; box-shadow: 0 18px 40px rgba(20, 35, 60, .22);
}
.offer-featured p, .offer-featured .offer-list { color: #d7e5f7; }
.offer-featured .offer-tag { background: rgba(255,255,255,.14); color: #eaf2ff; }
.offer-featured h3 { color: #fff; }
.offer-featured .btn-yellow { color: #3a2a00; }

.land-cta-band {
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  flex-wrap: wrap; padding: 26px 28px; border-radius: 20px;
  background: linear-gradient(120deg, #1c4f8f, #2568b8 55%, #3b8ae0);
  color: #fff; box-shadow: 0 16px 34px rgba(37, 104, 184, .24);
}
.land-cta-band h2 { margin: 0 0 4px; color: #fff; }
.land-cta-band p { margin: 0; color: #dbe9fb; font-size: 13.5px; max-width: 560px; }

.faq { display: grid; gap: 8px; }
.faq details {
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: 12px 16px;
}
.faq summary { cursor: pointer; font-weight: 600; font-size: 14px; }
.faq summary::marker { color: var(--brand); }
.faq p { color: var(--muted); font-size: 13.5px; margin: 8px 0 0; }

@media (max-width: 820px) {
  .land-cta-band { padding: 20px; }
  .land-trust { font-size: 12px; }
}
@media (max-width: 560px) {
  .land-actions .btn-ghost { display: none; }
  .land-stats { gap: 20px; }
  .land-stats b { font-size: 21px; }
  .step-card { padding: 16px; }
  .offer-price { font-size: 23px; }
}

/* ==========================================================================
   MODE SOMBRE — surcharges des composants
   ========================================================================== */
html[data-theme="dark"] body {
  background:
    radial-gradient(1000px 480px at 10% -10%, rgba(91, 155, 240, .10), transparent 70%),
    var(--bg);
}

html[data-theme="dark"] .card,
html[data-theme="dark"] .mode,
html[data-theme="dark"] .mcard,
html[data-theme="dark"] .course,
html[data-theme="dark"] .list-item,
html[data-theme="dark"] .resume,
html[data-theme="dark"] .opt,
html[data-theme="dark"] .feature,
html[data-theme="dark"] .source,
html[data-theme="dark"] .plan-card,
html[data-theme="dark"] .admin-link,
html[data-theme="dark"] .comment-card,
html[data-theme="dark"] .report,
html[data-theme="dark"] .reg-point,
html[data-theme="dark"] .tier,
html[data-theme="dark"] .step,
html[data-theme="dark"] .auth-note,
html[data-theme="dark"] .cat-tab,
html[data-theme="dark"] .filter-panel,
html[data-theme="dark"] .search-input,
html[data-theme="dark"] .league-icon {
  background: var(--card);
  border-color: var(--line);
  box-shadow: none;
}
html[data-theme="dark"] .offer:not(.offer-dark):not(.offer-featured) { background: var(--card); border-color: var(--line); }
html[data-theme="dark"] .offer-featured { box-shadow: 0 18px 40px rgba(0, 0, 0, .45); }

html[data-theme="dark"] .hero {
  background: linear-gradient(135deg, #173a6b 0%, #1f4f8f 55%, #2a63aa 100%);
  box-shadow: 0 12px 30px rgba(0, 0, 0, .38);
}
html[data-theme="dark"] .league-hero {
  background: linear-gradient(135deg, var(--card), var(--surface-2));
}
html[data-theme="dark"] .my-position {
  background: linear-gradient(135deg, #211a3a, #16243a);
}
html[data-theme="dark"] .my-position .pos { color: #c4b5fd; }

html[data-theme="dark"] .announce { border-color: var(--line); color: var(--ink); }
html[data-theme="dark"] .announce.announce-warning { background: rgba(224, 160, 33, .14); border-left-color: var(--gold); }
html[data-theme="dark"] .announce.announce-success { background: rgba(67, 201, 140, .12); border-left-color: var(--ok); }
html[data-theme="dark"] .notif { color: var(--ink); }
html[data-theme="dark"] .notif.unread { box-shadow: 0 4px 18px rgba(91, 155, 240, .14); }

html[data-theme="dark"] .tier.on {
  border-color: var(--brand); background: var(--brand-soft); color: var(--brand-dark);
}
html[data-theme="dark"] .step.on {
  border-color: var(--brand); background: var(--brand-soft); color: var(--brand-dark);
}
html[data-theme="dark"] .plan-card.on {
  border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft);
}
html[data-theme="dark"] .admin-link:hover { border-color: var(--brand); }
html[data-theme="dark"] .btn-danger { border-color: var(--bad); }

/* Tuiles d'icônes : teintes adaptées au fond sombre */
html[data-theme="dark"] .mi-study { background: rgba(59, 130, 214, .22); }
html[data-theme="dark"] .mi-session { background: rgba(31, 157, 99, .20); }
html[data-theme="dark"] .mi-revision { background: rgba(224, 160, 33, .20); }
html[data-theme="dark"] .mi-exam { background: rgba(220, 80, 80, .20); }
html[data-theme="dark"] .mi-last { background: rgba(32, 178, 170, .20); }
html[data-theme="dark"] .mi-team { background: rgba(148, 163, 184, .18); }
html[data-theme="dark"] .mi-block { background: rgba(124, 92, 196, .22); }
html[data-theme="dark"] .mi-enc { background: rgba(234, 138, 60, .20); }
html[data-theme="dark"] .mi-streak { background: rgba(245, 130, 60, .20); }
html[data-theme="dark"] .mi-league { background: rgba(91, 155, 240, .20); }

html[data-theme="dark"] .block-chip { background: var(--card); border-color: var(--line); color: var(--ink); }
html[data-theme="dark"] .block-chip.new { background: var(--surface-2); }
html[data-theme="dark"] .block-chip.part { background: var(--gold-soft); border-color: var(--gold); }
html[data-theme="dark"] .block-chip.done { background: var(--ok-soft); border-color: var(--ok); color: var(--ok); }
html[data-theme="dark"] .block-chip.done .bc-m { color: var(--ok); }
html[data-theme="dark"] .block-chip.warn { background: var(--bad-soft); border-color: var(--bad); color: var(--bad); }
html[data-theme="dark"] .block-chip.warn .bc-m { color: var(--bad); }

html[data-theme="dark"] .opt:hover { background: var(--brand-soft); border-color: var(--brand); }
html[data-theme="dark"] .opt.correct { background: rgba(67, 201, 140, .13); border-color: var(--ok); }
html[data-theme="dark"] .opt.wrong { background: rgba(255, 139, 130, .12); border-color: var(--bad); }

html[data-theme="dark"] .correction-banner.ok { background: var(--ok-soft); color: var(--ok); }
html[data-theme="dark"] .correction-banner.bad { background: var(--bad-soft); color: var(--bad); }
html[data-theme="dark"] .badge-ok { color: var(--ok); }
html[data-theme="dark"] .badge-bad { color: var(--bad); }

html[data-theme="dark"] .sub.small,
html[data-theme="dark"] .land-lead,
html[data-theme="dark"] .offer-list,
html[data-theme="dark"] .comment,
html[data-theme="dark"] .notif-body,
html[data-theme="dark"] .q-text,
html[data-theme="dark"] .explanation .comment { color: var(--ink-soft); }
html[data-theme="dark"] .qcm-count,
html[data-theme="dark"] .link-action,
html[data-theme="dark"] .plan-price,
html[data-theme="dark"] .report summary { color: var(--brand-dark); }
html[data-theme="dark"] .tag-gold,
html[data-theme="dark"] .badge-gold { color: var(--gold); }
html[data-theme="dark"] .offer-featured p,
html[data-theme="dark"] .offer-featured .offer-list { color: #d7e5f7; }

html[data-theme="dark"] .btn-primary,
html[data-theme="dark"] .cat-tab.on,
html[data-theme="dark"] .step.on b { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
html[data-theme="dark"] .btn-primary:hover { background: var(--brand-dark); }
html[data-theme="dark"] .btn-yellow { color: var(--gold-ink); }
html[data-theme="dark"] .count-pill { background: #177a52; }

html[data-theme="dark"] input[type=text],
html[data-theme="dark"] input[type=password],
html[data-theme="dark"] input[type=number],
html[data-theme="dark"] input[type=email],
html[data-theme="dark"] input[type=date],
html[data-theme="dark"] input[type=search],
html[data-theme="dark"] select,
html[data-theme="dark"] textarea,
html[data-theme="dark"] .mod-search {
  background: var(--surface-2);
  color: var(--ink);
  border-color: var(--line);
}
html[data-theme="dark"] input::placeholder,
html[data-theme="dark"] textarea::placeholder { color: #8094ad; }
html[data-theme="dark"] input:focus,
html[data-theme="dark"] select:focus,
html[data-theme="dark"] textarea:focus { outline-color: var(--brand-soft); }

html[data-theme="dark"] .code-chip { border: 1px solid var(--line); }
html[data-theme="dark"] .auth-note { border-color: var(--line-strong); }
html[data-theme="dark"] .reg-hero { box-shadow: 0 12px 30px rgba(0, 0, 0, .35); }
html[data-theme="dark"] .land-login { box-shadow: var(--shadow-lg); }
html[data-theme="dark"] .theme-fab { background: var(--card); }

/* Accessibilité : respect du réglage système « animations réduites » */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Responsive des nouveaux composants */
@media (max-width: 1080px) {
  /* Barre du haut sur deux lignes : identité + compte, puis onglets défilants. */
  .topbar { gap: 8px 12px; padding: 8px 12px; }
  .nav {
    order: 3; width: 100%; flex-wrap: nowrap; overflow-x: auto;
    scrollbar-width: none; -webkit-overflow-scrolling: touch;
    padding-bottom: 2px; margin: 0 -2px;
  }
  .nav::-webkit-scrollbar { display: none; }
  .nav a { white-space: nowrap; flex: none; }
}
@media (max-width: 820px) {
  .account-grid { grid-template-columns: 1fr; }
  .account-hero { padding: 16px; }
}
@media (max-width: 700px) {
  .mcard-actions { margin-left: 0; justify-content: flex-start; width: 100%; }
  .mcard-top { flex-wrap: wrap; }
  .mcard-actions .btn { flex: 1 1 auto; }
  .stat { padding-left: 17px; }
  .stat .stat-ico { font-size: 16px; right: 11px; }
}
@media (max-width: 560px) {
  .who-user .pill { display: none; }
  .who { gap: 7px; }
  .section-head { margin-top: 22px; }
  .filter-grid { grid-template-columns: 1fr; }
  .profile-avatar { width: 68px; height: 68px; font-size: 26px; }
  .account-hero { gap: 13px; }
  .profile-name { font-size: 18px; }
  .info-row { font-size: 13px; }
  .tab { padding: 8px 11px; font-size: 12.5px; }
  .q-text { font-size: 16px; }
  .theme-fab { right: 12px; bottom: 12px; width: 42px; height: 42px; }
}

/* ==========================================================================
   Tags, navigation du QCM et pièces jointes
   ========================================================================== */

/* --- Pastilles de tag ---------------------------------------------------- */
.tag-chip {
  display: inline-flex; align-items: center; gap: 4px;
  max-width: 100%; padding: 3px 10px; border-radius: 999px;
  font-size: 12.5px; font-weight: 650; line-height: 1.5;
  color: var(--tag-color, var(--gold));
  background: var(--surface-2);
  background: color-mix(in srgb, var(--tag-color, var(--gold)) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--tag-color, var(--gold)) 45%, transparent);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.tag-chip-btn { cursor: pointer; font-family: inherit; }
.tag-chip-btn:hover { filter: brightness(1.08); }
.tag-chip.on {
  background: var(--tag-color, var(--gold)); color: #fff;
  border-color: var(--tag-color, var(--gold));
}
.tag-chip.on:hover { filter: brightness(.94); }

.tag-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.tag-chips-current { padding: 10px 18px 0; }

.tag-open { gap: 6px; }
.tag-count {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 17px; height: 17px; padding: 0 5px; margin-left: 3px;
  border-radius: 999px; background: var(--brand); color: #fff;
  font-size: 10.5px; font-weight: 700;
}
.tag-count[hidden] { display: none; }

/* --- Fenêtre « Tags » (comme Cram) -------------------------------------- */
.tag-dialog {
  width: min(430px, calc(100vw - 24px));
  max-height: calc(100vh - 32px); overflow: auto;
  padding: 0; border: none; border-radius: 18px;
  background: var(--card); color: var(--ink);
  box-shadow: var(--shadow-lg);
}
.tag-dialog::backdrop { background: rgba(8, 16, 28, .58); backdrop-filter: blur(2px); }
.tag-dialog-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; padding: 15px 18px 4px;
}
.tag-dialog-head h2 { margin: 0; font-size: 19px; }
.tag-dialog-x {
  border: none; background: none; color: var(--muted);
  font-size: 27px; line-height: 1; padding: 0 4px; cursor: pointer;
}
.tag-dialog-sub {
  margin: 6px 18px 0; padding: 0 0 10px; font-weight: 700; font-size: 14.5px;
  border-bottom: 1px solid var(--line);
}
.tag-search {
  width: calc(100% - 36px); margin: 12px 18px 8px;
  padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--surface-2); color: var(--ink); font-family: inherit; font-size: 14px;
}
.tag-search:focus { outline: 2px solid var(--brand-soft); border-color: var(--brand); }
.tag-options {
  display: flex; flex-wrap: wrap; gap: 6px;
  padding: 0 18px 8px; max-height: 168px; overflow: auto;
}
.tag-empty { padding: 0 18px 8px; }

.tag-create { margin-top: 4px; padding: 12px 18px 0; border-top: 1px dashed var(--line); }
.tag-name-row {
  display: flex; align-items: center; gap: 8px;
  padding: 2px 12px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--surface-2);
}
.tag-hash { color: var(--muted); font-weight: 700; }
.tag-name-row input {
  flex: 1; min-width: 0; padding: 9px 0; border: none; background: transparent;
  color: var(--ink); font-family: inherit; font-size: 14px;
}
.tag-name-row input:focus { outline: none; }
.tag-colors { display: flex; flex-wrap: wrap; gap: 10px; padding: 12px 0 10px; }
.tag-color { position: relative; cursor: pointer; }
.tag-color input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.tag-color span {
  display: block; width: 22px; height: 22px; border-radius: 50%;
  background: var(--c); border: 2px solid var(--card);
  box-shadow: 0 0 0 1px var(--line);
}
.tag-color input:checked + span { box-shadow: 0 0 0 2px var(--ink); }
.tag-color input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }
.tag-create-foot {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; padding-bottom: 14px;
}
.tag-preview { min-width: 26px; justify-content: center; }
.tag-dialog-foot {
  display: flex; align-items: center; justify-content: center;
  flex-wrap: wrap; gap: 8px; padding: 0 18px 18px;
}
.tag-current-empty { margin: 0 18px 10px; }
.tag-toast {
  margin: 0 18px 10px; padding: 7px 11px; border-radius: 6px;
  background: var(--brand-soft); color: var(--brand-dark);
  font-size: 12.5px; font-weight: 600; text-align: center;
}
html[data-theme="dark"] .tag-toast { background: #1b3a5c; color: #cfe4ff; }

/* --- Last Look : mise de côté pour une revue unique --------------------- */
/* Œil fermé = pas encore mis de côté ; œil ouvert et vert = ajouté. */
.lastlook-btn .look-ico-on { display: none; }
.lastlook-btn.look-on .look-ico-off { display: none; }
.lastlook-btn.look-on .look-ico-on { display: block; }
.lastlook-btn.look-on { color: var(--ok); }
.lastlook-btn.look-on:hover { color: var(--ok); filter: brightness(.92); }
.look-toast {
  position: fixed; left: 50%; bottom: 84px; z-index: 9999;
  transform: translate(-50%, 10px);
  padding: 9px 16px; border-radius: 999px;
  background: #111827; color: #fff;
  font-size: 13px; font-weight: 600; box-shadow: var(--shadow-lg);
  opacity: 0; pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
}
.look-toast.show { opacity: 1; transform: translate(-50%, 0); }
.look-toast.is-add { background: var(--brand); }
html[data-theme="dark"] .look-toast { background: #1b3a5c; color: #e8f1ff; }
.list-item .row-actions { flex: none; }

/* --- Page « Réviser par tag » ------------------------------------------- */
.tag-howto { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
.tag-howto .tag-chip { vertical-align: middle; }
.tag-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px; margin-bottom: 18px;
}
.tag-grid .card { padding: 16px; }
.tag-card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.tag-card-desc { margin: 9px 0 12px; }
.tag-card-actions { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.tag-card-actions form { margin: 0; }

/* --- Navigation numérotée du QCM ---------------------------------------- */
.qnav { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 14px; }
.qnav-track { display: flex; flex-wrap: wrap; gap: 6px; }
.qnav-dot {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: 8px;
  font-size: 12.5px; font-weight: 700; text-decoration: none;
  background: var(--surface-2); color: var(--muted); border: 1px solid var(--line);
}
.qnav-dot:hover { border-color: var(--brand); color: var(--brand); }
.qnav-dot.ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.qnav-dot.bad { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
.qnav-dot.current { outline: 2px solid var(--brand); outline-offset: 1px; color: var(--brand); }
.qnav-legend {
  display: flex; gap: 10px; margin-left: auto;
  font-size: 11.5px; color: var(--muted);
}
.qdot { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 4px; vertical-align: middle; }
.qdot.ok { background: var(--ok); }
.qdot.bad { background: var(--bad); }
.qdot.todo { background: var(--line-strong); }

/* --- Pièces jointes des notes ------------------------------------------- */
.note-files { margin-top: 16px; padding-top: 14px; border-top: 1px dashed var(--line); }
.note-files-head { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.note-file-list { list-style: none; margin: 0 0 12px; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.note-file {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border: 1px solid var(--line); border-radius: 12px;
  background: var(--surface-2);
}
.nf-thumb img { display: block; width: 54px; height: 54px; object-fit: cover; border-radius: 9px; }
.nf-ico { width: 54px; text-align: center; font-size: 22px; }
.nf-body { display: flex; flex-direction: column; gap: 3px; flex: 1; min-width: 0; }
.nf-name {
  font-weight: 600; font-size: 13.5px; color: var(--ink); text-decoration: none;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.nf-name:hover { color: var(--brand); }
.nf-meta { font-size: 11.5px; color: var(--muted); }
.nf-body audio { max-width: 100%; height: 34px; margin-top: 3px; }
.note-upload { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.note-recorder { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.rec-on { background: var(--bad) !important; border-color: var(--bad) !important; color: #fff !important; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* --- Page « Mes notes » -------------------------------------------------- */
.note-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.note-item { display: flex; flex-direction: column; gap: 8px; }
.note-item-head { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.note-item-q { margin: 0; font-weight: 600; }
.note-item-body { margin: 0; color: var(--ink-soft); font-size: 13.5px; white-space: pre-line; }
.note-item-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }

/* --- Barre d'actions groupées (admin questions) ------------------------- */
.bulk-bar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 12px 14px; margin-bottom: 12px;
  border: 1px dashed var(--line-strong); border-radius: 12px; background: var(--surface-2);
}
.bulk-bar select { max-width: 230px; }
.th-check { width: 34px; }

html[data-theme="dark"] .tag-chip { background: color-mix(in srgb, var(--tag-color, var(--gold)) 24%, transparent); }
html[data-theme="dark"] .tag-name-row,
html[data-theme="dark"] .tag-search,
html[data-theme="dark"] .note-file,
html[data-theme="dark"] .bulk-bar { background: var(--surface-2); }

@media (max-width: 620px) {
  .qnav-legend { display: none; }
  .note-grid, .tag-grid { grid-template-columns: 1fr; }
  .tag-dialog { width: calc(100vw - 16px); }
  .note-file { align-items: flex-start; }
  .tag-open .tag-open-label { display: none; }
}

/* --- Changement de question (menu compact, sans grille de numéros) ------- */
.qjump { display: flex; align-items: center; gap: 6px; margin: 0 0 14px; }
.qjump-arrow {
  flex: 0 0 34px; width: 34px; height: 34px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line); border-radius: 10px;
  background: var(--card); color: var(--ink);
  text-decoration: none; font-size: 20px; line-height: 1;
}
.qjump-arrow:hover { border-color: var(--brand); color: var(--brand); }
.qjump-arrow.off { opacity: .35; pointer-events: none; }
.qjump-select {
  flex: 1; min-width: 0; padding: 8px 12px;
  border: 1px solid var(--line); border-radius: 10px;
  background: var(--surface-2); color: var(--ink);
  font-family: inherit; font-size: 13px; font-weight: 600;
}
.qjump-select:focus { outline: 2px solid var(--brand-soft); border-color: var(--brand); }

/* --- Barre d'action toujours visible en bas du QCM ---------------------- */
.qbar {
  position: fixed; left: 50%; bottom: 14px; z-index: 60;
  transform: translateX(-50%);
  display: flex; align-items: center; gap: 8px;
  width: min(720px, calc(100vw - 20px));
  padding: 8px 10px;
  background: var(--card);
  background: color-mix(in srgb, var(--card) 94%, transparent);
  backdrop-filter: blur(10px);
  border: 1px solid var(--line); border-radius: 16px;
  box-shadow: var(--shadow-lg);
}
.qbar-pos { font-size: 14px; font-weight: 700; padding: 0 4px; white-space: nowrap; }
.qbar-select {
  flex: 1 1 120px; min-width: 108px; max-width: 260px;
  padding: 7px 10px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--surface-2); color: var(--ink);
  font-family: inherit; font-size: 12.5px; font-weight: 600;
}
.qbar .btn { flex: 0 0 auto; }
.qbar .btn-primary { margin-left: auto; }
.qbar-spacer { height: 78px; }
body:has(.qbar) .theme-fab { bottom: 86px; }

/* --- J'aime / Je n'aime pas --------------------------------------------- */
.vote-bar { display: flex; align-items: center; gap: 8px; margin: 2px 0 14px; }
.vote-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 11px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface-2);
  color: var(--muted); font-family: inherit; font-size: 13px; font-weight: 600;
  cursor: pointer;
}
.vote-btn:hover { border-color: var(--brand); color: var(--brand); }
.vote-btn.on { background: var(--brand-soft); color: var(--brand-dark); border-color: var(--brand); }
.vote-btn.down.on { background: var(--bad-soft); color: var(--bad); border-color: var(--bad); }

/* --- Commentaires (cartes + pièces jointes) ----------------------------- */
.comment-list { display: flex; flex-direction: column; gap: 10px; }
.comment-item {
  display: flex; gap: 11px; padding: 12px 14px;
  border: 1px solid var(--line); border-radius: 14px; background: var(--card);
}
.comment-avatar {
  flex: 0 0 34px; width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--brand-soft); color: var(--brand-dark);
  font-weight: 700; font-size: 14px;
}
.comment-main { flex: 1; min-width: 0; }
.comment-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12.5px; }
.comment-tools { margin-left: auto; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.link-btn {
  border: none; background: none; padding: 0;
  font-family: inherit; font-size: 12px; color: var(--muted);
  cursor: pointer; text-decoration: underline;
}
.link-btn.danger { color: var(--bad); }
.report-inline summary {
  cursor: pointer; font-size: 12px; color: var(--muted);
  list-style: none;
}
.report-inline summary::-webkit-details-marker { display: none; }
.report-inline[open] { flex-basis: 100%; }
.report-inline form {
  display: flex; flex-direction: column; gap: 6px;
  margin-top: 8px; padding: 10px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2);
}
.report-inline select, .report-inline textarea { width: 100%; }
.comment-sort-note {
  margin: 0 0 10px; font-size: 11.5px; font-weight: 700;
  letter-spacing: .04em; text-transform: uppercase; color: var(--muted);
}
.comment-like {
  flex: 0 0 42px; display: flex; flex-direction: column;
  align-items: center; gap: 2px; padding-top: 2px;
}
.comment-like form { margin: 0; }
.like-heart {
  border: none; background: none; padding: 2px;
  font-size: 23px; line-height: 1; color: var(--muted);
  cursor: pointer; transition: transform .12s ease, color .12s ease;
}
.like-heart:hover { transform: scale(1.14); color: #e0245e; }
.like-heart.on { color: #e0245e; }
.like-count { font-size: 11.5px; font-weight: 700; color: var(--muted); }
.comment-like:has(.like-heart.on) .like-count { color: #e0245e; }
.badge-hot { background: #ffe3ec; color: #c2185b; }
html[data-theme="dark"] .badge-hot { background: #3a1c2a; color: #ff8fb3; }

.comment-files { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 8px; }
.cf-thumb img {
  display: block; width: 74px; height: 74px; object-fit: cover;
  border-radius: 10px; border: 1px solid var(--line);
}
.cf-audio { width: 100%; }
.cf-audio audio { width: 100%; max-width: 340px; height: 36px; }
.cf-file {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 10px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--surface-2); color: var(--ink); text-decoration: none; font-size: 12.5px;
}
.cf-file:hover { border-color: var(--brand); }

.comment-form { margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--line); }
.comment-form textarea {
  width: 100%; min-height: 70px; resize: vertical;
  padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--card); color: var(--ink);
  font-family: inherit; font-size: 13.5px; line-height: 1.5;
}
.comment-form-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.comment-form-bar .btn-primary { margin-left: auto; }
.tab-next { display: flex; justify-content: flex-end; margin-top: 14px; }

/* --- Onglets façon Cram (fiche question / correction) ------------------- */
.tabs {
  display: flex; align-items: flex-end; gap: 26px;
  margin: 20px 0 0; padding: 0;
  border-bottom: 1px solid var(--line); border-radius: 0;
  background: none; box-shadow: none;
  overflow-x: auto; scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  all: unset; box-sizing: border-box; cursor: pointer;
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 0 11px;
  font-family: inherit; font-size: 14.5px; font-weight: 500;
  color: var(--muted); border-bottom: 2.5px solid transparent;
  white-space: nowrap;
}
.tab:hover { color: var(--ink); }
.tab:focus-visible {
  outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 3px;
}
.tab.on {
  color: var(--ink); font-weight: 700;
  border-bottom-color: var(--brand); background: none; box-shadow: none;
}
.ti { width: 18px; height: 18px; flex: none; }
.tag-open .ti { width: 15px; height: 15px; }
.tab .ti { width: 17px; height: 17px; flex: none; }
.question-box .tab .tab-count {
  display: inline-block; min-width: 20px; height: 18px; line-height: 18px;
  margin-left: 1px; padding: 0 6px; border-radius: 4px;
  background: #ef4444; color: #fff;
  font-size: 11px; font-weight: 700; text-align: center;
}
.question-box .tab.on .tab-count { background: #ef4444; color: #fff; }

/* Icônes d'outils alignées à droite des onglets */
.tab-tools {
  margin-left: auto; display: flex; align-items: center; gap: 13px;
  padding-bottom: 8px; flex: none;
}
.tt-count { font-size: 14px; color: var(--muted); }
.tt-count.has { color: var(--bad); font-weight: 700; }
.tt-btn {
  border: 0; background: none; margin: 0; padding: 1px;
  display: inline-grid; place-items: center;
  color: var(--muted); cursor: pointer; font-family: inherit;
  text-decoration: none;
}
.tt-btn .ti { width: 19px; height: 19px; }
.tt-btn:hover { color: var(--ink); }
.tt-btn.on { color: #ef4444; }
.tab-tools form.inline { display: inline-flex; margin: 0; }
.tab-tools .tag-picker { display: inline-flex; }
.tab-tools .tag-open {
  border: 0; background: none; box-shadow: none; padding: 1px;
  display: inline-grid; place-items: center; color: var(--muted);
}
.tab-tools .tag-open:hover { color: var(--ink); }
.tab-tools .tag-open .tag-open-label,
.tab-tools .tag-open .tag-count { display: none; }
.tab-tools .tag-open .ti { width: 19px; height: 19px; }

.tab-panel { padding: 18px 1px 6px; }

/* --- Commentaires façon Cram ------------------------------------------- */
.comment-list { display: flex; flex-direction: column; gap: 10px; }
.comment-item {
  display: flex; gap: 0; padding: 0; overflow: hidden;
  border: 1px solid var(--line); border-left: 4px solid var(--line);
  border-radius: 5px; background: var(--card);
}
.comment-item.is-top { border-left-color: #22c55e; }
.comment-rail {
  flex: 0 0 44px; width: 44px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; padding: 9px 0; background: var(--surface-2);
  border-right: 1px solid var(--line);
}
.like-up, .like-down {
  border: 0; background: none; padding: 2px; margin: 0;
  display: grid; place-items: center; line-height: 1;
  color: var(--muted); cursor: pointer;
}
.like-up svg, .like-down svg { width: 15px; height: 15px; }
.like-up:hover, .like-up.on { color: #22c55e; }
.like-count { font-size: 12.5px; font-weight: 700; color: var(--ink); }
.like-down { cursor: default; opacity: .5; }
.comment-rail .like-heart { font-size: 21px; line-height: 1; }
.comment-rail .like-count { font-size: 12px; }
.comment-rail:has(.like-heart.on) .like-count { color: #e0245e; }
.comment-main { flex: 1; min-width: 0; padding: 10px 14px 9px; }
.comment-head {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  font-size: 13px;
}
.comment-head .c-author { color: #0b7ec4; font-weight: 700; }
.c-time { margin-left: auto; font-size: 12px; color: var(--muted); }
.comment-main .comment {
  margin: 5px 0 0; font-size: 14px; line-height: 1.55; color: var(--ink);
}
.comment-foot {
  display: flex; align-items: center; gap: 10px; margin-top: 7px;
}
.comment-tools {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin-left: 0; font-size: 12.5px; color: var(--muted);
}
.comment-tools .link-btn { font-size: 12.5px; }
.c-verified {
  margin-left: auto; width: 22px; height: 22px; border-radius: 50%;
  display: grid; place-items: center; flex: none;
  background: #22c55e; color: #fff; font-size: 12px; font-weight: 700;
}
.comment-sort-note {
  margin: 0 0 10px; font-size: 11.5px; font-weight: 600;
  letter-spacing: 0; text-transform: none; color: var(--muted);
}

/* Éditeur de commentaire */
.comment-form {
  margin-top: 16px; padding: 0; border: 1px solid var(--line);
  background: var(--card); border-radius: 4px; overflow: hidden;
}
.cram-tools {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 7px 11px; background: var(--surface-2);
  border-bottom: 1px solid var(--line);
}
.cram-tool {
  border: 0; background: none; padding: 0; margin: 0;
  font-family: inherit; font-size: 12.5px; font-weight: 600;
  color: var(--ink-soft); cursor: pointer;
}
.cram-tool:hover { color: var(--brand-dark); }
.comment-form textarea {
  width: 100%; min-height: 64px; resize: vertical;
  padding: 11px 13px; border: 0; border-radius: 0;
  background: var(--card); color: var(--ink);
  font-family: inherit; font-size: 13.5px; line-height: 1.55;
}
.comment-form:focus-within { border-color: var(--brand); }
.comment-form textarea:focus { outline: none; }
.cram-submit { display: flex; justify-content: flex-start; padding: 0 11px 11px; }
.btn-submit {
  background: #1f2937; border-color: #1f2937; color: #fff;
  border-radius: 5px; font-weight: 600;
}
.btn-submit:hover { background: #111827; border-color: #111827; }
.comment-form-bar { display: none; }

/* --- Statistique d'une question, façon Cram ---------------------------- */
.stat-box { margin: 0; }
.stat-tries-lead { margin: 0 0 12px; font-size: 14px; color: var(--ink-soft); }
.stat-tries { display: flex; flex-direction: column; gap: 8px; }
.stat-try {
  position: relative; border-radius: 3px;
  min-height: 56px; padding: 9px 16px;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface-2);
}
.stat-try-mid {
  position: relative; z-index: 1;
  padding: 0 96px; text-align: center; min-width: 0; max-width: 100%;
}
.stat-try-mid b { display: block; font-size: 14px; color: var(--ink); }
.stat-try-mid > span:last-child {
  display: block; margin-top: 2px; font-size: 12px; color: var(--muted);
}
.stat-try-date {
  position: absolute; right: 16px; top: 50%; transform: translateY(-50%);
  z-index: 1; font-size: 13px; color: var(--ink-soft); white-space: nowrap;
}
@media (max-width: 620px) {
  .tabs { gap: 15px; flex-wrap: wrap; overflow-x: visible; }
  .tab { font-size: 13px; padding: 8px 0 10px; }
  .tab .ti { width: 15px; height: 15px; }
  .tab-tools {
    width: 100%; justify-content: flex-end; margin-left: 0;
    gap: 14px; padding: 0 0 9px;
  }
  .tt-count { font-size: 12.5px; }
  .stat-try { padding: 9px 11px; }
  .stat-try-mid { padding: 0 74px; }
  .stat-try-date { right: 11px; font-size: 11.5px; }
}

.stat-community { margin-top: 20px; }
.stat-sub {
  margin: 0 0 8px; font-size: 11.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .05em; color: var(--muted);
}

html[data-theme="dark"] .comment-head .c-author { color: #6fb6ea; }
html[data-theme="dark"] .comment-item { background: var(--card); }
html[data-theme="dark"] .comment-rail { background: var(--surface-2); }
html[data-theme="dark"] .comment-main .comment { color: var(--ink); }
html[data-theme="dark"] .btn-submit {
  background: #e5e7eb; border-color: #e5e7eb; color: #111827;
}
html[data-theme="dark"] .btn-submit:hover {
  background: #d1d5db; border-color: #d1d5db;
}

html[data-theme="dark"] .comment { color: var(--ink-soft); }
html[data-theme="dark"] .qjump-select,
html[data-theme="dark"] .vote-btn,
html[data-theme="dark"] .cf-file,
html[data-theme="dark"] .comment-form textarea { background: var(--surface-2); }

@media (max-width: 560px) {
  .qbar { bottom: 8px; gap: 6px; padding: 7px 8px; border-radius: 14px; }
  .qbar .btn { padding: 7px 9px; font-size: 12.5px; }
  .qbar-pos { font-size: 13px; }
  .qbar-spacer { height: 72px; }
  .comment-item { padding: 0; }
  .comment-rail { flex-basis: 38px; width: 38px; }
  .comment-main { padding: 9px 11px 8px; }
  .comment-tools { width: auto; margin-left: 0; }
}
@media (max-width: 420px) {
  .qbar .btn-ghost { display: none; }
  .qbar-select { max-width: none; }
}

/* --- Note en pourcentage (correction façon résidanat) ------------------- */
.score-ring {
  position: relative; flex: 0 0 auto;
  width: 72px; height: 72px; border-radius: 50%;
  display: grid; place-items: center;
  background: conic-gradient(var(--ring, var(--brand)) calc(var(--pct) * 1%), var(--surface-3) 0);
}
.score-ring::before {
  content: ""; position: absolute; inset: 7px;
  border-radius: 50%; background: var(--card);
}
.score-ring > span { position: relative; font-size: 18px; font-weight: 800; }
.score-ring small { font-size: 10px; font-weight: 700; }
.score-ring-lg { width: 112px; height: 112px; margin: 8px auto 0; }
.score-ring-lg::before { inset: 9px; }
.score-ring-lg > span { font-size: 28px; }
.score-ring-lg small { font-size: 13px; }

.correction-result {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 12px 16px; margin-bottom: 16px;
  border: 1px solid var(--line); border-radius: 14px;
}
.correction-result.ok { --ring: var(--ok); background: var(--ok-soft); }
.correction-result.part { --ring: var(--gold); background: var(--gold-soft); }
.correction-result.bad { --ring: var(--bad); background: var(--bad-soft); }
.correction-result-text { display: flex; flex-direction: column; gap: 3px; flex: 1; min-width: 150px; }
.correction-result-text strong { font-size: 15px; }
.correction-result .badge { margin-left: auto; }

/* --- Préparation de session (couches + sources) ------------------------- */
.session-hero {
  display: flex; align-items: center; justify-content: space-between;
  gap: 18px; flex-wrap: wrap; margin-bottom: 16px;
  padding: 20px 22px; border: 1px solid var(--line); border-radius: 18px;
  background: linear-gradient(135deg, var(--brand-soft), var(--card));
}
.session-hero h1 { margin: 4px 0; font-size: 26px; }
.session-hero-score { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.session-hero-label {
  font-size: 11.5px; font-weight: 700; letter-spacing: .05em;
  text-transform: uppercase; color: var(--muted);
}
.session-hero-score strong { font-size: 34px; line-height: 1; color: var(--brand); }
.session-hero-score strong small { font-size: 15px; }
.session-block { margin-bottom: 14px; padding: 18px 20px; }
.session-block h2 { margin: 0 0 4px; font-size: 17px; }
.session-block-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.layer-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px; margin-top: 14px;
}
.layer-card { position: relative; cursor: pointer; }
.layer-card input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.layer-inner {
  display: flex; flex-direction: column; gap: 6px;
  padding: 12px 13px; border: 1px solid var(--line); border-radius: 12px;
  background: var(--card);
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.layer-card:hover .layer-inner { border-color: var(--brand); transform: translateY(-1px); }
.layer-card input:checked + .layer-inner {
  border-color: var(--brand); background: var(--brand-soft);
  box-shadow: 0 0 0 2px var(--brand-soft);
}
.layer-card input:focus-visible + .layer-inner { outline: 2px solid var(--brand); outline-offset: 2px; }
.layer-card.fresh .layer-inner { border-style: dashed; }
.layer-top { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; }
.layer-name { font-size: 12.5px; font-weight: 700; }
.layer-pct { font-size: 16px; font-weight: 800; color: var(--brand); }
.layer-bar { height: 6px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.layer-bar i { display: block; height: 100%; border-radius: inherit; background: var(--brand); }
.layer-meta { font-size: 10.5px; color: var(--muted); }

.source-grid { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.source-quick { flex: 0 0 auto; display: flex; gap: 6px; flex-wrap: wrap; }
.source-groups { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.source-group {
  border: 1px solid var(--line); border-radius: 12px;
  overflow: hidden; background: var(--card);
}
.source-group-head {
  display: flex; align-items: center; gap: 9px;
  padding: 10px 13px; background: var(--surface-2);
  cursor: pointer; font-size: 13.5px; font-weight: 700;
}
.source-group-head input { width: 16px; height: 16px; accent-color: var(--brand); }
.source-group-head-static { cursor: default; }
.source-group-name { flex: 1; }
.source-group-items { display: flex; flex-wrap: wrap; gap: 8px; padding: 10px 12px 12px; }
.source-note { margin: 8px 0 0; }
.source-chip {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 11px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--surface-2); cursor: pointer; font-size: 13px;
}
.source-chip input { accent-color: var(--brand); }
.source-chip:has(input:checked) {
  border-color: var(--brand); background: var(--brand-soft); color: var(--brand-dark);
}
.source-nb {
  font-size: 10.5px; font-weight: 700; padding: 0 6px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--card);
}

.session-launch {
  position: sticky; bottom: 12px; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; padding: 12px 14px;
  border: 1px solid var(--line); border-radius: 14px;
  background: var(--card); box-shadow: var(--shadow-lg);
}
.session-summary { font-size: 13px; font-weight: 600; color: var(--muted); }
.next-layer-card {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; margin: 12px 0 18px;
  padding: 14px 16px; border: 1px solid var(--line);
  border-radius: 14px; background: var(--surface-2); text-align: left;
}
.next-layer-info { display: flex; flex-direction: column; gap: 4px; }

/* --- Objectif quotidien ------------------------------------------------- */
.goal-form {
  display: flex; align-items: center; gap: 5px; margin-top: 8px;
  font-size: 11px; color: var(--muted);
}
.goal-form label { font-size: 10.5px; text-transform: uppercase; letter-spacing: .04em; }
.link-action-strong { font-weight: 700; color: var(--brand); }
.goal-form select {
  padding: 3px 6px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--surface-2); color: var(--ink);
  font-family: inherit; font-size: 12px; font-weight: 600;
}
.btn-xs { min-height: 24px; padding: 3px 7px; font-size: 11px; border-radius: 7px; }
.result-card { padding: 24px 20px; }

html[data-theme="dark"] .session-hero { background: linear-gradient(135deg, #17283f, var(--card)); }
html[data-theme="dark"] .layer-card input:checked + .layer-inner { background: var(--brand-soft); }

@media (max-width: 620px) {
  .session-hero-score { align-items: flex-start; }
  .layer-grid { grid-template-columns: repeat(2, 1fr); }
  .session-launch { position: static; }
  .correction-result { gap: 10px; }
  .correction-result .badge { margin-left: 0; }
  .score-ring-lg { width: 96px; height: 96px; }
  .score-ring-lg > span { font-size: 24px; }
}

/* --- Navigation douce pendant que l'ambiance joue ---------------------- */
html.soft-loading #main { opacity: .45; pointer-events: none; transition: opacity .12s ease; }
html.soft-loading::after {
  content: ""; position: fixed; top: 0; left: 0; z-index: 9999;
  width: 100%; height: 3px;
  background: linear-gradient(90deg, var(--brand), var(--gold), var(--brand));
  background-size: 200% 100%;
  animation: softBar 1s linear infinite;
}
@keyframes softBar { to { background-position: -200% 0; } }

/* --- Anki : repetition espacee ---------------------------------------- */
.mi-anki { background: #e9efff; }
html[data-theme="dark"] .mi-anki { background: rgba(99, 102, 241, .22); }

.shortcuts {
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px; margin: 0 0 28px;
}
.shortcut {
  display: flex; align-items: center; gap: 10px;
  min-height: 66px; padding: 10px 12px;
  background: var(--card); border: 1px solid var(--line);
  border-radius: 13px; text-decoration: none; color: var(--ink);
  transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.shortcut:hover {
  transform: translateY(-2px); border-color: var(--brand);
  box-shadow: var(--shadow-lg);
}
.sc-ico {
  display: grid; place-items: center; flex: none;
  width: 34px; height: 34px; border-radius: 10px;
  background: var(--surface-2); font-size: 16px;
}
.sc-body { min-width: 0; }
.sc-body strong { display: block; font-size: 12.5px; line-height: 1.2; }
.sc-body small {
  display: block; color: var(--muted); font-size: 10.5px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sc-count {
  margin-left: auto; flex: none;
  min-width: 22px; padding: 2px 7px; border-radius: 999px;
  background: var(--brand-soft); color: var(--brand);
  font-size: 10.5px; font-weight: 800; text-align: center;
}
.sc-erreurs { background: #fff1e6; }
.sc-favoris { background: #fff7d6; }
.sc-tags { background: #e8f7f4; }
.sc-notes { background: #eef1ff; }
.sc-search { background: #e7f0ff; }
html[data-theme="dark"] .sc-erreurs { background: rgba(234, 138, 60, .20); }
html[data-theme="dark"] .sc-favoris { background: rgba(224, 160, 33, .20); }
html[data-theme="dark"] .sc-tags { background: rgba(32, 178, 170, .20); }
html[data-theme="dark"] .sc-notes { background: rgba(99, 102, 241, .22); }
html[data-theme="dark"] .sc-search { background: rgba(59, 130, 214, .22); }

.dash-cta {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; flex-wrap: wrap; margin-top: 16px;
}

@media (max-width: 1000px) {
  .shortcuts { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .shortcuts { grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 22px; }
  .shortcut { min-height: 60px; padding: 8px 10px; }
  .sc-body strong { font-size: 12px; }
}

.anki-decks { display: flex; flex-direction: column; gap: 8px; }
.anki-deck {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px;
  background: var(--card); color: var(--ink); text-decoration: none;
  transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.anki-deck:hover {
  transform: translateY(-1px); border-color: var(--brand);
  box-shadow: var(--shadow-lg);
}
.anki-deck .grow { min-width: 0; }
.anki-deck strong { display: block; font-size: 13.5px; }
.anki-deck small { color: var(--muted); font-size: 11.5px; }
.anki-pill {
  padding: 3px 9px; border-radius: 999px; white-space: nowrap;
  font-size: 11px; font-weight: 700;
  color: var(--brand); background: var(--brand-soft);
}
.anki-pill.zero { color: var(--muted); background: var(--surface-2); }

.anki-stage { display: grid; place-items: center; padding: 6px 0 34px; }
.anki-card {
  width: min(780px, 100%); background: var(--card);
  border: 1px solid var(--line); border-radius: 22px; padding: 26px;
  box-shadow: var(--shadow-lg);
}
.anki-meta {
  font-size: 11px; text-transform: uppercase; letter-spacing: .08em;
  color: var(--muted); font-weight: 700;
}
.anki-q { font-size: 20px; font-weight: 750; line-height: 1.5; margin: 10px 0 16px; }
.anki-options { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.anki-options li {
  padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--surface-2); font-size: 14px;
}
.anki-letter {
  display: inline-grid; place-items: center; width: 20px; height: 20px;
  border-radius: 6px; background: var(--card); border: 1px solid var(--line);
  font-size: 11px; font-weight: 800; color: var(--brand); margin-right: 7px;
}
.anki-card.revealed .anki-options li.ok {
  background: var(--ok-soft); border-color: var(--ok); color: var(--ok);
}
.anki-card.revealed .anki-options li.ok .anki-letter {
  color: var(--ok); border-color: var(--ok);
}
.anki-answer { margin-top: 16px; padding-top: 16px; border-top: 1px dashed var(--line); }
.anki-correct { font-weight: 800; color: var(--ok); font-size: 15px; }
.anki-exp {
  margin-top: 8px; color: var(--muted); font-size: 13.5px;
  line-height: 1.55; white-space: pre-line;
}
.anki-grades { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.anki-grades .btn { flex: 1 1 110px; }
.anki-again { color: #b91c1c; border-color: #fecaca; }
.anki-hard { color: #b45309; border-color: #fde68a; }
.anki-easy { color: #047857; border-color: #a7f3d0; }
html[data-theme="dark"] .anki-again { color: #fca5a5; border-color: #7f1d1d; }
html[data-theme="dark"] .anki-hard { color: #fcd34d; border-color: #78350f; }
html[data-theme="dark"] .anki-easy { color: #6ee7b7; border-color: #064e3b; }
.anki-done { max-width: 620px; margin: 40px auto; text-align: center; }
.anki-done-ico { font-size: 46px; }
.anki-kbd { font-size: 11px; color: var(--muted); margin-top: 10px; }

@media (max-width: 560px) {
  .anki-card { padding: 18px; border-radius: 18px; }
  .anki-q { font-size: 17px; }
  .anki-deck { flex-wrap: wrap; }
}

/* --- Page Modules : barre de recherche + cartes compactes --------------- */
.modules-toolbar {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  background: var(--card); border: 1px solid var(--line);
  border-radius: 16px; padding: 8px 12px; margin: 6px 0 14px;
  box-shadow: 0 1px 2px rgba(20, 35, 60, .04);
}
.modules-search {
  flex: 1 1 240px; min-width: 0;
  display: flex; align-items: center; gap: 8px;
}
.ms-ico { opacity: .6; font-size: 14px; flex: none; }
.modules-search .mod-search {
  flex: 1; min-width: 0; max-width: none; width: 100%;
  margin: 0; padding: 7px 0;
  border: 0; background: transparent; box-shadow: none;
}
.modules-search .mod-search:focus { outline: none; }
.modules-sort { display: flex; align-items: center; gap: 7px; }
.modules-sort label { margin: 0; font-size: 11.5px; color: var(--muted); }
.modules-sort .select-inline { padding: 5px 8px; }

.modules-tabs {
  justify-content: center; gap: 28px;
  margin: 0 0 14px; padding: 0;
  border-bottom: 1px solid var(--line);
}
.modules-tabs .cat-tab {
  background: none; border: 0; border-bottom: 2px solid transparent;
  border-radius: 0; padding: 8px 1px 9px;
  color: var(--muted); font-size: 13px; font-weight: 600;
}
.modules-tabs .cat-tab:hover { color: var(--ink); background: none; }
.modules-tabs .cat-tab.on {
  color: var(--ink); border-bottom-color: var(--ink); background: none;
}
.modules-tabs .cat-tab span {
  background: none; color: var(--muted); padding: 0; margin-left: 5px; font-size: 11px;
}
.modules-tabs .cat-tab.on span { background: none; color: var(--muted); }

.modules-page .mcard {
  padding: 12px 14px; border-radius: 15px; gap: 3px;
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.modules-page .mcard:hover {
  border-color: var(--line-strong); box-shadow: var(--shadow);
  transform: translateY(-1px);
}
.modules-page .mcard-top { align-items: center; gap: 10px; }
.modules-page .mcard-logo { --ml-size: 46px; }
.modules-page .mcard-name { font-size: 14.5px; line-height: 1.25; }
.modules-page .mcard-cat { font-size: 11px; margin-top: 1px; }
.modules-page .last-seen { font-size: 10.5px; margin-top: 3px; }
.modules-page .mcard-actions { gap: 5px; }
.modules-page .mcard-actions .btn { padding: 5px 9px; font-size: 11.5px; }
.modules-page .splitbar { height: 8px; margin: 10px 0 5px; }
.modules-page .mcard-foot {
  display: flex; align-items: center; gap: 10px; font-size: 10.5px;
}
.modules-page .mcard-prog { margin-left: auto; color: var(--muted); }

@media (max-width: 760px) {
  .modules-toolbar { padding: 7px 10px; gap: 6px; }
  .modules-sort { width: 100%; justify-content: flex-start; }
  .modules-tabs {
    justify-content: flex-start; gap: 16px;
    overflow-x: auto; white-space: nowrap; scrollbar-width: none;
  }
  .modules-tabs::-webkit-scrollbar { display: none; }
  .modules-page .mcard-actions { width: 100%; margin-left: 0; }
}

/* --- Page d'un module : en-tête + cours façon Cram ---------------------- */
.module-page .module-hero { align-items: flex-start; gap: 16px; margin-bottom: 14px; }
.module-page .module-hero .modlogo { --ml-size: 58px; }
.module-page .module-hero h1 { font-size: 27px; letter-spacing: -.4px; }
.module-page .module-progress { max-width: 560px; margin-top: 8px; }
.module-page .module-progress .splitbar { height: 8px; margin: 0 0 5px; }
.module-page .module-progress .meta { font-size: 11.5px; color: var(--muted); }
.module-page .module-progress b { color: var(--ink); }
.module-page .module-hero-actions { margin-left: auto; align-items: center; }
.module-page .btn-icon {
  width: 34px; height: 34px; padding: 0;
  display: grid; place-items: center; font-size: 14px;
}

.module-page .filter-panel:not([open]) { display: none; }
.module-page .filter-panel > summary { display: none; }
.module-page .filter-panel { margin: 0 0 8px; }
.module-page .course-list { gap: 0; }
.module-page .course {
  background: transparent; border: 0; border-radius: 0;
  padding: 16px 10px 16px 20px; position: relative;
  transition: background .15s ease;
}
.module-page .course::before {
  content: ""; position: absolute; left: 0; top: 18px; bottom: 18px;
  width: 4px; border-radius: 4px; background: var(--surface-3);
  transition: background .15s ease;
}
html[data-theme="dark"] .module-page .course { background: transparent; }
.module-page .course:hover { background: var(--surface-2); }
.module-page .course:hover::before { background: var(--brand); }
.module-page .course-head { align-items: flex-start; gap: 12px; }
.module-page .course-name {
  display: inline-block; font-size: 16px; font-weight: 700;
  color: var(--ink); text-decoration: none;
}
.module-page .course-name:hover { color: var(--brand); }
.module-page .course-tags {
  margin-top: 5px; display: flex; flex-wrap: wrap; gap: 5px; align-items: center;
}
.module-page .course-actions { display: flex; gap: 16px; align-items: center; padding-top: 2px; }
.module-page .course-stat { font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.module-page .course-stat b { color: var(--ink); font-size: 13px; }
.module-page .course-stat.ko b { color: var(--bad); }
.module-page .course-links { margin-top: 9px; gap: 18px; }
.module-page .link-action { font-size: 12px; color: #2f5fa8; }
.module-page .link-action-strong { font-weight: 700; }
html[data-theme="dark"] .module-page .link-action { color: #93c5fd; }
.module-page .course-bar { margin-top: 10px; }
.module-page .course-bar .splitbar { height: 8px; margin: 0 0 5px; }
.module-page .progress-line { font-size: 11px; color: var(--muted); align-items: center; }
.module-page .progress-line b { color: var(--ink); }
.module-page .course-last { margin-left: auto; color: var(--muted); white-space: nowrap; }

@media (max-width: 760px) {
  .module-page .module-hero-actions { width: 100%; }
  .module-page .course-head { flex-wrap: wrap; }
  .module-page .course-actions { width: 100%; justify-content: flex-start; gap: 12px; padding-top: 6px; }
  .module-page .course-links { gap: 12px; }
  .module-page .progress-line { flex-wrap: wrap; gap: 6px 12px; }
  .module-page .course-last { margin-left: 0; width: 100%; }
}

/* --- Selecteur rapide : couches + sources (modale) --------------------- */
.module-page .layer-btn { border: 0; cursor: pointer; font-family: inherit; }
.module-page .course-name {
  border: 0; background: none; padding: 0; font-family: inherit;
  cursor: pointer; text-align: left;
}

.quick-modal {
  border: 0; border-radius: 18px; padding: 0;
  width: min(760px, calc(100vw - 24px)); max-height: 90vh;
  background: var(--card); color: var(--ink);
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .6);
}
.quick-modal::backdrop { background: rgba(8, 16, 28, .62); backdrop-filter: blur(3px); }
.quick-head { display: flex; align-items: flex-start; gap: 12px; padding: 18px 20px 8px; }
.quick-kicker {
  font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em;
  color: var(--muted); font-weight: 800;
}
.quick-head h2 { margin: 3px 0 0; font-size: 20px; }
.quick-x {
  margin-left: auto; width: 30px; height: 30px; border: 0; border-radius: 9px;
  background: var(--surface-2); color: var(--muted); font-size: 19px;
  line-height: 1; cursor: pointer;
}
.quick-x:hover { color: var(--ink); background: var(--surface-3); }
.quick-tabs { display: flex; gap: 8px; padding: 0 20px; border-bottom: 1px solid var(--line); }
.quick-tab {
  background: none; border: 0; border-bottom: 2px solid transparent;
  padding: 9px 4px; color: var(--muted); font-family: inherit;
  font-size: 13px; font-weight: 700; cursor: pointer;
}
.quick-tab.on { color: var(--ink); border-bottom-color: var(--brand); }
.quick-body { padding: 16px 20px; overflow: auto; max-height: calc(90vh - 200px); }
.layer-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.layer-chip {
  text-align: left; padding: 9px 10px; border: 1px solid var(--line);
  border-radius: 11px; background: var(--surface-2); color: var(--ink);
  cursor: pointer; font-family: inherit;
}
.layer-chip:hover { border-color: var(--brand); }
.layer-chip.on {
  border-color: var(--brand); background: var(--brand-soft);
  box-shadow: 0 0 0 1px var(--brand);
}
.layer-chip span {
  display: block; font-size: 9.5px; text-transform: uppercase;
  letter-spacing: .05em; color: var(--muted); font-weight: 700;
}
.layer-chip b { display: block; font-size: 16px; line-height: 1.25; }
.layer-chip small { display: block; font-size: 9.5px; color: var(--muted); }
.layer-stat {
  margin-top: 12px; padding: 10px 12px; border: 1px solid var(--line);
  border-radius: 10px; background: var(--surface-2);
  font-size: 12.5px; color: var(--muted);
}
.layer-stat b { color: var(--ink); }
.quick-sources-head {
  display: flex; justify-content: space-between; align-items: center;
  gap: 10px; flex-wrap: wrap; margin-bottom: 10px;
}
.src-group {
  border: 1px solid var(--line); border-radius: 12px;
  padding: 10px 12px; margin-bottom: 8px;
}
.src-group-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; font-size: 13px; font-weight: 700;
}
.src-group-head label { display: inline-flex; align-items: center; gap: 7px; margin: 0; cursor: pointer; }
.src-count {
  font-size: 10.5px; color: var(--muted); background: var(--surface-2);
  padding: 1px 7px; border-radius: 999px;
}
.src-rows { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.src-rows-flat { margin: 0 0 8px; padding: 0 2px; }
.src-row {
  display: inline-flex; align-items: center; gap: 6px; margin: 0;
  padding: 5px 9px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--card); font-size: 11.5px; cursor: pointer;
}
.src-row:hover { border-color: var(--brand); }
.src-row input, .src-all { margin: 0; accent-color: var(--brand); }
.src-nb { color: var(--muted); font-size: 10px; }
.quick-foot {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; flex-wrap: wrap; padding: 12px 20px 16px;
  border-top: 1px solid var(--line);
}
.quick-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.quick-actions form { display: flex; gap: 6px; flex-wrap: wrap; margin: 0; }
.quick-actions .btn { white-space: nowrap; }

@media (max-width: 560px) {
  .layer-grid { grid-template-columns: repeat(2, 1fr); }
  .quick-body { max-height: calc(90vh - 230px); }
  .quick-foot { align-items: flex-start; }
}

/* --- Minuteur d'étude (Pomodoro + sons de la nature) ------------------- */
.pomo-fab {
  position: fixed; left: 16px; bottom: 16px; z-index: 55;
  display: flex; align-items: center; gap: 8px;
  padding: 6px 13px 6px 6px; border-radius: 999px;
  background: var(--card); border: 1px solid var(--line);
  box-shadow: var(--shadow-lg); color: var(--ink); cursor: pointer;
  font-family: inherit; font-size: 13px; font-weight: 700;
  transition: transform .15s ease, border-color .15s ease;
}
.pomo-fab:hover { transform: translateY(-2px); border-color: var(--brand); }
.pomo-fab-ring {
  position: relative; width: 42px; height: 42px; border-radius: 50%;
  display: grid; place-items: center;
  background: conic-gradient(var(--brand) calc(var(--pomo-pct, 0) * 1%), var(--surface-3) 0);
}
.pomo-fab-ring::before {
  content: ""; position: absolute; inset: 4px;
  border-radius: 50%; background: var(--card);
}
.pomo-fab-ring span {
  position: relative; font-size: 10.5px; font-weight: 800;
  letter-spacing: -.3px; font-variant-numeric: tabular-nums;
}
.pomo-fab-mode { font-size: 16px; line-height: 1; }
.pomo-fab.running .pomo-fab-ring { animation: pomoPulse 2.8s ease-in-out infinite; }
.pomo-fab.done { animation: pomoDone .5s ease 3; }
@keyframes pomoPulse { 50% { box-shadow: 0 0 0 6px var(--brand-soft); } }
@keyframes pomoDone { 50% { transform: scale(1.06); border-color: var(--gold); } }
body:has(.qbar) .pomo-fab { bottom: 92px; }

.pomo-dialog {
  width: min(520px, calc(100vw - 20px));
  max-height: calc(100vh - 24px); overflow: auto;
  padding: 0; border: none; border-radius: 20px;
  background: var(--card); color: var(--ink);
  box-shadow: var(--shadow-lg);
}
.pomo-dialog::backdrop { background: rgba(8, 16, 28, .55); backdrop-filter: blur(3px); }
.pomo-head { display: flex; justify-content: space-between; gap: 12px; padding: 18px 20px 6px; }
.pomo-head h2 { margin: 0; font-size: 20px; }
.pomo-sub { margin: 3px 0 0; font-size: 12px; color: var(--muted); }
.pomo-x { border: none; background: none; color: var(--muted); font-size: 28px; line-height: 1; cursor: pointer; }
.pomo-modes { display: flex; gap: 6px; padding: 8px 20px 0; flex-wrap: wrap; }
.pomo-mode {
  border: 1px solid var(--line); background: var(--surface-2); color: var(--muted);
  border-radius: 999px; padding: 7px 11px; font-family: inherit;
  font-size: 12px; font-weight: 600; cursor: pointer;
}
.pomo-mode.on { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.pomo-display { text-align: center; padding: 18px 20px 8px; }
.pomo-big {
  font-size: 56px; font-weight: 800; line-height: 1;
  font-variant-numeric: tabular-nums; letter-spacing: -1px;
}
.pomo-label {
  margin-top: 6px; font-size: 12px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .08em; color: var(--muted);
}
.pomo-bar {
  height: 8px; max-width: 340px; margin: 14px auto 8px;
  border-radius: 999px; background: var(--surface-3); overflow: hidden;
}
.pomo-bar span {
  display: block; height: 100%; border-radius: inherit;
  background: linear-gradient(90deg, var(--brand), var(--gold));
  transition: width .25s linear;
}
.pomo-dots { display: flex; justify-content: center; gap: 6px; }
.pomo-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--surface-3); }
.pomo-dot.on { background: var(--gold); }
.pomo-actions { display: flex; gap: 8px; justify-content: center; padding: 12px 20px 4px; flex-wrap: wrap; }
.pomo-settings { margin: 10px 20px 0; border-top: 1px dashed var(--line); padding-top: 10px; }
.pomo-settings summary { cursor: pointer; font-size: 13px; font-weight: 700; color: var(--ink); }
.pomo-settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding-top: 10px; }
.pomo-settings-grid label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
.pomo-input { display: flex; align-items: center; gap: 5px; }
.pomo-input input {
  width: 64px; padding: 6px 8px; border: 1px solid var(--line);
  border-radius: 8px; background: var(--surface-2); color: var(--ink);
  font-family: inherit; font-weight: 700;
}
.pomo-sounds { padding: 14px 20px 6px; border-top: 1px dashed var(--line); margin-top: 12px; }
.pomo-sounds-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.pomo-sounds-head h3 { margin: 0; font-size: 15px; }
.pomo-sound-grid { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.pomo-sound {
  border: 1px solid var(--line); background: var(--surface-2); color: var(--muted);
  border-radius: 999px; padding: 6px 10px; font-family: inherit; font-size: 12px; cursor: pointer;
}
.pomo-sound.on { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-dark); font-weight: 700; }
.pomo-volume { display: flex; align-items: center; gap: 9px; margin-top: 12px; font-size: 12px; color: var(--muted); }
.pomo-volume input { flex: 1; accent-color: var(--brand); }
.pomo-volume span { min-width: 34px; font-weight: 700; }
.pomo-check { display: flex; align-items: center; gap: 7px; margin-top: 10px; font-size: 12px; color: var(--muted); }
.pomo-note {
  margin: 12px 20px 18px; padding-top: 10px; border-top: 1px dashed var(--line);
  font-size: 11.5px; color: var(--muted); text-align: center;
}
html[data-theme="dark"] .pomo-sound,
html[data-theme="dark"] .pomo-mode { background: var(--surface-2); }

@media (max-width: 560px) {
  .pomo-fab { left: 10px; bottom: 10px; padding: 5px 10px 5px 5px; }
  .pomo-fab-ring { width: 38px; height: 38px; }
  .pomo-big { font-size: 46px; }
  .pomo-dialog { width: calc(100vw - 12px); border-radius: 16px; }
}

/* ==========================================================================
   Contrôle de la façade (administration)
   ========================================================================== */

/* Bandeau « remarque » affiché au-dessus du contenu. */
.notice { border-bottom: 1px solid var(--line); font-size: 13.5px; }
.notice-in {
  max-width: 1180px; margin: 0 auto; padding: 9px 18px;
  display: flex; align-items: center; gap: 9px; flex-wrap: wrap;
}
.notice-ico { flex: none; }
.notice-info { background: var(--brand-soft); color: var(--brand-dark); }
.notice-warning { background: var(--gold-soft); color: #6b4a00; }
.notice-success { background: var(--ok-soft); color: #146c43; }
.notice-inline {
  background: var(--gold-soft); color: #6b4a00; border-radius: 10px;
  padding: 9px 12px; font-size: 13px; margin: 0 0 12px;
}

/* Écrans de blocage / accès expiré. */
.gate-card { text-align: center; padding: 30px 26px; }
.gate-ico { font-size: 42px; line-height: 1; margin-bottom: 6px; }
.closed-box { text-align: center; padding: 8px 4px 4px; }
.closed-box .gate-ico { display: block; }
.closed-box .btn { margin-top: 14px; }

.badge-warn { background: var(--gold-soft); color: #8a6100; }

/* Structure : modules et cours réordonnables. */
.struct-list { display: flex; flex-direction: column; gap: 14px; }
.struct-item {
  display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-start;
  padding: 14px 16px;
}
.struct-rail {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding-top: 18px; flex: none;
}
.struct-rail.small { padding-top: 20px; gap: 2px; }
.struct-pos { font-size: 12px; font-weight: 700; color: var(--muted); }
.struct-body { flex: 1 1 320px; min-width: 0; }
.struct-fields { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.struct-fields > div { min-width: 130px; }
.struct-fields .grow { flex: 1 1 220px; }
.struct-fields label { margin: 0 0 4px; }
.struct-check label { margin: 0 0 8px; white-space: nowrap; }
.struct-logo { min-width: 210px; }
.logo-pick { display: flex; align-items: center; gap: 8px; }
.logo-pick .modlogo { --ml-size: 34px; }
.logo-pick select { min-width: 158px; }
.logo-select { font-size: 13px; }
.struct-actions { display: flex; flex-direction: column; gap: 6px; flex: none; }
.struct-courses {
  flex-basis: 100%; display: flex; flex-direction: column; gap: 8px;
  border-top: 1px dashed var(--line); padding-top: 12px; margin-left: 36px;
}
.struct-course {
  display: flex; gap: 10px; align-items: flex-start; flex-wrap: wrap;
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 10px; padding: 10px 12px;
}
.struct-course .struct-body { flex: 1 1 280px; }
.struct-off { opacity: .62; }
.struct-empty { margin: 4px 0 0 48px; }
.struct-item .row-actions { margin-top: 8px; }

.btn-xs { padding: 1px 6px; font-size: 11px; line-height: 1.5; border-radius: 6px; }
.icon-sm { padding: 2px 8px; font-size: 12px; line-height: 1.3; }
.btn[disabled] { opacity: .38; cursor: default; }

.cat-dot {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  background: var(--muted); vertical-align: middle; margin-right: 4px;
}
.cat-med { background: #2f7fd0; }
.cat-chir { background: #c0483f; }
.cat-bio { background: #17835a; }

/* Paramètres : identité, couleurs, accès, offres. */
.settings-form .card { margin-bottom: 16px; }
.settings-form .card > h2 { margin-top: 0; }

.theme-presets { display: flex; flex-wrap: wrap; gap: 8px; }
.preset {
  display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--card);
  color: var(--ink); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer;
}
.preset:hover { border-color: var(--brand); background: var(--surface-2); }
.preset-dots { display: inline-flex; }
.preset-dots i {
  width: 13px; height: 13px; border-radius: 50%; display: inline-block;
  border: 1px solid rgba(0, 0, 0, .12);
}
.preset-dots i + i { margin-left: -4px; }

.color-row { display: flex; align-items: center; gap: 10px; }
input[type=color] {
  width: 54px; height: 40px; padding: 3px; border: 1px solid var(--line);
  border-radius: 9px; background: var(--card); cursor: pointer;
}
.color-hex { font-family: Consolas, "Segoe UI Mono", monospace; font-size: 12.5px; color: var(--muted); }

.palette-preview {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin-top: 16px; padding: 14px 16px; background: var(--surface-2);
  border: 1px dashed var(--line-strong); border-radius: 12px;
}
.palette-preview .btn-primary {
  background: var(--pv-brand, var(--brand)); border-color: var(--pv-brand, var(--brand));
  color: var(--pv-brand-ink, #fff);
}
.palette-preview .btn-yellow {
  background: var(--pv-gold, var(--gold)); border-color: var(--pv-gold, var(--gold));
  color: var(--pv-gold-ink, #10202f);
}
.palette-link { color: var(--pv-brand, var(--brand)); font-weight: 600; font-size: 13.5px; }

.switch-list { display: flex; flex-direction: column; gap: 10px; }
.switch-row {
  display: flex; gap: 12px; align-items: flex-start; margin: 0;
  padding: 12px 14px; border: 1px solid var(--line);
  border-radius: 12px; background: var(--surface-2); cursor: pointer;
}
.switch-row input[type=checkbox] {
  width: 17px; height: 17px; margin-top: 3px; flex: none; accent-color: var(--brand);
}
.switch-row strong { display: block; font-size: 14px; }
.switch-row small { color: var(--muted); font-size: 12.5px; line-height: 1.45; }

.offer-edit {
  border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px;
  margin-top: 14px; background: var(--surface-2);
}
.offer-edit-head {
  display: flex; justify-content: space-between; align-items: center;
  gap: 10px; flex-wrap: wrap; margin-bottom: 4px;
}
.offer-edit-head .check { margin: 0; }
.offer-edit label:first-of-type { margin-top: 8px; }

.save-bar {
  position: sticky; bottom: 12px; z-index: 5;
  display: flex; justify-content: space-between; align-items: center;
  gap: 12px; flex-wrap: wrap; margin: 18px 0 8px; padding: 10px 16px;
  background: var(--card); border: 1px solid var(--line-strong);
  border-radius: 14px; box-shadow: var(--shadow-lg);
}

html[data-theme="dark"] .notice-warning,
html[data-theme="dark"] .notice-inline { color: var(--gold); }
html[data-theme="dark"] .notice-success { color: var(--ok); }
html[data-theme="dark"] .notice-info { color: var(--brand-dark); }
html[data-theme="dark"] .badge-warn { color: var(--gold); }
html[data-theme="dark"] .cat-med { background: #63a6ea; }
html[data-theme="dark"] .cat-chir { background: #ef8a80; }
html[data-theme="dark"] .cat-bio { background: #43c98c; }
html[data-theme="dark"] .struct-course,
html[data-theme="dark"] .switch-row,
html[data-theme="dark"] .offer-edit { background: var(--surface-2); }

@media (max-width: 760px) {
  .struct-item { padding: 12px; }
  .struct-courses { margin-left: 8px; }
  .struct-empty { margin-left: 8px; }
  .struct-rail { flex-direction: row; padding-top: 0; }
  .struct-rail.small { padding-top: 0; }
  .struct-actions { flex-direction: row; flex-wrap: wrap; }
  .save-bar { position: static; }
  .palette-preview { justify-content: flex-start; }
}


