/* Mission Tables — feuille de style unique (élève + enseignant + impression) */

:root {
  --bg: #f3f5fc;
  --surface: #ffffff;
  --surface-2: #f7f8fc;
  --line: #e3e6ef;
  --ink: #1d2140;
  --ink-2: #4a5072;
  --muted: #767c9a;

  --primary: #5b4bdb;
  --primary-2: #4a3bc4;
  --primary-soft: #eeebff;
  --accent: #ff8a34;
  --accent-soft: #fff1e4;
  --teal: #0f9d9a;
  --teal-soft: #e2f6f5;
  --good: #14935a;
  --good-soft: #e3f6ec;
  --bad: #d9363e;
  --bad-soft: #fde9ea;
  --gold: #f2a900;

  /* statuts des multiplications (palette validée daltonisme) */
  --st-new: #eceef4;
  --st-new-ink: #7a809c;
  --st-learning: #eb6834;
  --st-learning-ink: #2a1206;
  --st-almost: #2a78d6;
  --st-almost-ink: #ffffff;
  --st-mastered: #1baf7a;
  --st-mastered-ink: #062b1d;

  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 1px 2px rgba(29, 33, 64, .06), 0 6px 20px rgba(29, 33, 64, .07);
  --shadow-lg: 0 2px 4px rgba(29, 33, 64, .06), 0 18px 40px rgba(29, 33, 64, .12);
  --font: "Nunito", "Quicksand", ui-rounded, "SF Pro Rounded", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.45;
  color: var(--ink);
  background: var(--bg);
  min-height: 100vh;
}
body.kid {
  background:
    radial-gradient(circle at 1px 1px, rgba(91, 75, 219, .09) 1.5px, transparent 0) 0 0 / 26px 26px,
    linear-gradient(180deg, #eef1ff 0%, #f6f3ff 55%, #fff6ee 100%) fixed;
}
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; font-weight: 800; letter-spacing: -.01em; }
h1 { font-size: 1.9rem; }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.08rem; }
p { margin: 0 0 1em; }
a { color: var(--primary); }
small, .small { font-size: .85rem; }
.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
svg.ico { width: 1.15em; height: 1.15em; vertical-align: -.2em; flex: none; }

/* ---------- Boutons & champs ---------- */
.btn {
  --b: var(--primary); --bi: #fff;
  display: inline-flex; align-items: center; justify-content: center; gap: .45em;
  font: inherit; font-weight: 800; font-size: 1rem;
  padding: .7em 1.2em; border-radius: 999px; border: 0;
  background: var(--b); color: var(--bi); cursor: pointer; text-decoration: none;
  box-shadow: 0 3px 0 rgba(0, 0, 0, .14);
  transition: transform .08s ease, filter .15s ease, box-shadow .08s ease;
  touch-action: manipulation; user-select: none;
}
.btn:hover { filter: brightness(1.06); }
.btn:active { transform: translateY(2px); box-shadow: 0 1px 0 rgba(0, 0, 0, .14); }
.btn:focus-visible, .chip:focus-visible, .key:focus-visible, .mode:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid rgba(91, 75, 219, .55);
  outline: 3px solid color-mix(in srgb, var(--primary) 55%, transparent); outline-offset: 2px;
}
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn.ghost { --b: transparent; --bi: var(--ink-2); box-shadow: none; }
.btn.ghost:hover { background: rgba(29, 33, 64, .06); }
.btn.light { --b: var(--surface); --bi: var(--ink); box-shadow: 0 0 0 1px var(--line), 0 2px 0 rgba(0, 0, 0, .05); }
.btn.danger { --b: var(--bad); }
.btn.good { --b: var(--good); }
.btn.orange { --b: var(--accent); }
.btn.sm { font-size: .88rem; padding: .45em .9em; }
.btn.lg { font-size: 1.2rem; padding: .85em 1.6em; }
.btn.block { width: 100%; }
.btn.icon-only { padding: .55em; }

label { font-weight: 700; font-size: .92rem; color: var(--ink-2); }
input[type=text], input[type=password], input[type=number], select, textarea {
  font: inherit; width: 100%; padding: .7em .9em; border-radius: var(--radius-sm);
  border: 2px solid var(--line); background: #fff; color: var(--ink);
  transition: border-color .15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--primary); outline: none; }
textarea { min-height: 9em; resize: vertical; line-height: 1.5; }
.field { display: grid; gap: .35em; margin-bottom: 1em; }
.field .hint { font-size: .82rem; color: var(--muted); font-weight: 600; }
.row { display: flex; gap: .75em; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.spacer { flex: 1; }
.stack > * + * { margin-top: 1rem; }

.alert { padding: .8em 1em; border-radius: var(--radius-sm); font-weight: 700; margin-bottom: 1em; }
.alert.error { background: var(--bad-soft); color: #9a1c22; }
.alert.ok { background: var(--good-soft); color: #0d6a40; }
.alert.info { background: var(--primary-soft); color: var(--primary-2); }

.card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.4rem; }
.card + .card { margin-top: 1rem; }

/* ---------- Pages de connexion ---------- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.login-card { width: 100%; max-width: 420px; }
.login-card .card { padding: 2rem 1.6rem; }
.brand { display: flex; align-items: center; gap: .6rem; font-weight: 900; font-size: 1.25rem; color: var(--ink); text-decoration: none; }
.brand .logo svg, .pcard .logo svg { width: 70%; height: 70%; display: block; }
.brand .logo { transition: transform .15s ease; }
.brand:hover .logo { transform: translateY(-1px) rotate(-6deg); }
.brand .logo {
  width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center;
  background: linear-gradient(135deg, #7a6cf0, var(--primary)); color: #fff; font-weight: 900; font-size: 1.35rem;
  box-shadow: 0 3px 0 var(--primary-2);
}
.login-hero { text-align: center; margin-bottom: 1.4rem; }
.login-hero .brand { justify-content: center; font-size: 1.6rem; margin-bottom: .6rem; }
.login-hero .brand .logo svg, .pcard .logo svg { width: 70%; height: 70%; display: block; }
.brand .logo { transition: transform .15s ease; }
.brand:hover .logo { transform: translateY(-1px) rotate(-6deg); }
.brand .logo { width: 56px; height: 56px; font-size: 1.8rem; border-radius: 17px; }
.login-hero p { color: var(--ink-2); font-weight: 700; margin: 0; }
.login-foot { text-align: center; margin-top: 1.2rem; font-size: .9rem; }
.login-foot a { color: var(--muted); font-weight: 700; }
.float-nums { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: -1; }
.float-nums span { position: absolute; font-weight: 900; color: rgba(91, 75, 219, .08); font-size: 4rem; }

/* ---------- Barre du haut ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: .75rem; padding: .7rem 16px;
  background: rgba(255, 255, 255, .86); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar .brand { font-size: 1.1rem; }
.topbar .brand .logo svg, .pcard .logo svg { width: 70%; height: 70%; display: block; }
.brand .logo { transition: transform .15s ease; }
.brand:hover .logo { transform: translateY(-1px) rotate(-6deg); }
.brand .logo { width: 34px; height: 34px; font-size: 1.1rem; border-radius: 10px; }
.who { display: flex; align-items: center; gap: .5rem; font-weight: 800; color: var(--ink-2); }
.who .avatar {
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  background: var(--accent-soft); color: #b24f00; font-weight: 900; text-transform: uppercase;
}
.who .cls { font-weight: 700; color: var(--muted); font-size: .85rem; }
.main { max-width: 980px; margin: 0 auto; padding: 1.5rem 16px 4rem; }
.main.wide { max-width: 1180px; }

/* ---------- Élève : accueil ---------- */
.hello { margin: .5rem 0 1.4rem; }
.hello h1 { font-size: clamp(1.6rem, 4.5vw, 2.3rem); margin-bottom: .2em; color: var(--on-bg, var(--ink)); }
.hello p { color: var(--on-bg-2, var(--ink-2)); font-weight: 700; margin: 0; }
.modes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-bottom: 1.4rem; }
.mode {
  --c: var(--primary); --c2: var(--primary-2);
  position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: .35rem;
  text-align: left; font: inherit; color: #fff; cursor: pointer; border: 0;
  padding: 1.3rem 1.2rem 1.2rem; border-radius: 22px; min-height: 170px;
  background: var(--c);
  background: linear-gradient(150deg, var(--c1, var(--c)) 0%, var(--c) 55%);
  box-shadow: 0 5px 0 var(--c2), var(--shadow);
  transition: transform .1s ease, box-shadow .1s ease;
  overflow: hidden;
}
.mode:hover { transform: translateY(-2px); box-shadow: 0 7px 0 var(--c2), var(--shadow-lg); }
.mode:active { transform: translateY(3px); box-shadow: 0 2px 0 var(--c2), var(--shadow); }
.mode .mi { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; background: rgba(255, 255, 255, .22); margin-bottom: .4rem; }
.mode .mi svg { width: 30px; height: 30px; }
.mode b { font-size: 1.35rem; font-weight: 900; }
.mode span { font-weight: 700; opacity: .92; font-size: .95rem; }
.mode::after {
  content: attr(data-deco); position: absolute; right: 10px; top: 12px;
  font-size: 2.6rem; font-weight: 900; color: rgba(255, 255, 255, .16); line-height: 1; letter-spacing: -.03em;
}
.mode.m-serie { --c: #5b4bdb; --c1: #7263ea; --c2: #3f31b3; }
.mode.m-libre { --c: #0b8380; --c1: #11918d; --c2: #06605e; }
.mode.m-chrono { --c: #cf560a; --c1: #e0640f; --c2: #9e4006; }
.mode .mt { display: flex; flex-direction: column; gap: .15rem; position: relative; z-index: 1; }
.mode .mt span { font-weight: 800; }

.panel { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.2rem 1.3rem; margin-bottom: 1rem; }
.panel h2 { font-size: 1.1rem; display: flex; align-items: center; gap: .5rem; }
.chips { display: flex; flex-wrap: wrap; gap: .5rem; }
.chip {
  font: inherit; font-weight: 800; min-width: 48px; padding: .55em .9em; border-radius: 14px; cursor: pointer;
  border: 2px solid var(--line); background: #fff; color: var(--ink-2);
  transition: all .12s ease; touch-action: manipulation;
}
.chip:hover { border-color: #c9cdf0; }
.chip.on { background: var(--primary); border-color: var(--primary); color: #fff; box-shadow: 0 2px 0 var(--primary-2); }
.chip.all.on { background: var(--ink); border-color: var(--ink); box-shadow: 0 2px 0 #000; }

.quick { display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: 1rem; align-items: stretch; }
.quick .tile { background: var(--surface-2); border-radius: 14px; padding: .8rem 1rem; }
.tile .lbl { font-size: .82rem; font-weight: 800; color: var(--muted); }
.tile .val { font-size: 1.6rem; font-weight: 900; line-height: 1.15; }
.tile .val small { font-size: .9rem; color: var(--muted); font-weight: 800; }
.resume-banner { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; background: var(--accent-soft); border: 2px solid #ffd3ad; border-radius: var(--radius); padding: .9rem 1.1rem; margin-bottom: 1rem; font-weight: 800; color: #8a4200; }

/* Barre empilée de statuts (2px d'écart entre segments) */
.stackbar { display: flex; gap: 2px; height: 14px; border-radius: 7px; overflow: hidden; background: var(--st-new); margin: .45rem 0 .5rem; }
.stackbar > i { display: block; height: 100%; min-width: 0; }
.stackbar > i.mastered { background: var(--st-mastered); }
.stackbar > i.almost { background: var(--st-almost); }
.stackbar > i.learning { background: var(--st-learning); }
.stackbar > i.new { background: var(--st-new); }
.legend { display: flex; flex-wrap: wrap; gap: .35rem 1rem; font-size: .84rem; font-weight: 700; color: var(--ink-2); }
.legend span { display: inline-flex; align-items: center; gap: .4em; }
.legend i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.legend i.new { background: var(--st-new); box-shadow: inset 0 0 0 1px #d5d9e6; }
.legend i.learning { background: var(--st-learning); }
.legend i.almost { background: var(--st-almost); }
.legend i.mastered { background: var(--st-mastered); }

/* ---------- Élève : jeu ---------- */
.play { max-width: 560px; margin: 0 auto; padding: 1rem 16px 2rem; }
.play-top { display: flex; align-items: center; gap: .75rem; margin-bottom: .9rem; }
.progress { flex: 1; height: 14px; border-radius: 7px; background: rgba(29, 33, 64, .08); overflow: hidden; }
.progress > i { display: block; height: 100%; background: linear-gradient(90deg, #7a6cf0, var(--primary)); border-radius: 7px; transition: width .3s ease; }
.progress.chrono > i { background: linear-gradient(90deg, #ffb36b, var(--accent)); transition: width .25s linear; }
.progress.chrono.low > i { background: linear-gradient(90deg, #ff7a7f, var(--bad)); }
.play-meta { display: flex; justify-content: space-between; align-items: center; font-weight: 800; color: var(--ink-2); margin-bottom: .8rem; min-height: 32px; }
.pill { display: inline-flex; align-items: center; gap: .35em; background: #fff; border-radius: 999px; padding: .3em .8em; box-shadow: var(--shadow); font-weight: 900; }
.pill.fire { color: #d2540a; }
.pill.fire.hot { background: linear-gradient(135deg, #fff1e4, #ffe0c4); transform-origin: center; animation: pop .35s ease; }
.qcard {
  position: relative; background: var(--surface); border-radius: 26px; box-shadow: 0 1px 2px rgba(29, 33, 64, .06), 0 8px 22px rgba(29, 33, 64, .08);
  padding: 1.6rem 1rem 1.3rem; text-align: center; margin-bottom: 1.1rem; overflow: hidden;
  border: 3px solid transparent; transition: border-color .15s, background-color .15s;
}
.qcard.ok { border-color: var(--good); background: #f3fcf7; }
.qcard.ko { border-color: var(--bad); background: #fff6f6; animation: shake .4s ease; }
.question { font-size: clamp(2.8rem, 13vw, 4.6rem); font-weight: 900; letter-spacing: -.02em; display: flex; justify-content: center; align-items: center; gap: .18em; line-height: 1.1; }
.question .op { color: var(--primary); }
.question .eq { color: var(--muted); }
.answer-box {
  min-width: 2.2em; padding: 0 .15em; border-radius: 16px; background: var(--surface-2); color: var(--ink);
  box-shadow: inset 0 0 0 3px var(--line); display: inline-block;
}
.answer-box.empty { color: #c3c7d8; }
.answer-box .caret { display: inline-block; width: 3px; height: .8em; background: var(--primary); vertical-align: -.05em; animation: blink 1s steps(1) infinite; border-radius: 2px; }
.qcard.ok .answer-box { background: var(--good-soft); box-shadow: inset 0 0 0 3px var(--good); color: var(--good); }
.qcard.ko .answer-box { background: var(--bad-soft); box-shadow: inset 0 0 0 3px var(--bad); color: var(--bad); text-decoration: line-through; text-decoration-thickness: 4px; }
.qanim { animation: qin .28s ease; }
.feedback { min-height: 3.1rem; margin-top: .8rem; font-weight: 900; font-size: 1.25rem; display: flex; align-items: center; justify-content: center; gap: .6rem; flex-wrap: wrap; }
.feedback.ok { color: var(--good); }
.feedback.ko { color: var(--bad); }
.feedback .correction { color: var(--ink); background: #fff; border-radius: 12px; padding: .15em .6em; box-shadow: 0 0 0 2px var(--bad-soft); }
.level-dots { display: flex; justify-content: center; gap: 6px; margin-top: .6rem; height: 12px; }
.level-dots i { width: 12px; height: 12px; border-radius: 50%; background: var(--st-new); box-shadow: inset 0 0 0 1px #dde0ea; }
.level-dots i.on { background: var(--st-almost); box-shadow: none; }
.level-dots.m i.on { background: var(--st-mastered); }

.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: .7rem; }
.key {
  font: inherit; font-size: 1.9rem; font-weight: 900; color: var(--ink);
  height: 68px; border-radius: 18px; border: 0; cursor: pointer; background: #fff;
  box-shadow: 0 4px 0 #d9dcea, 0 6px 14px rgba(29, 33, 64, .06);
  transition: transform .06s ease, box-shadow .06s ease, background .1s;
  touch-action: manipulation; user-select: none; -webkit-tap-highlight-color: transparent;
}
.key:active, .key.pressed { transform: translateY(3px); box-shadow: 0 1px 0 #d9dcea; background: #f5f6fb; }
.key.del { color: var(--ink-2); background: #eef0f7; }
.key.ok { background: var(--good); color: #fff; box-shadow: 0 4px 0 #0c6d41; font-size: 1.4rem; }
.key.ok:active, .key.ok.pressed { box-shadow: 0 1px 0 #0c6d41; background: #12834f; }
.key[disabled] { opacity: .5; }
.key svg { width: 30px; height: 30px; vertical-align: middle; }
.continue-wrap { margin-top: 1rem; }

.toast-zone { position: fixed; left: 50%; top: 76px; transform: translateX(-50%); z-index: 60; display: grid; gap: .5rem; width: min(92vw, 420px); pointer-events: none; }
.toast {
  display: flex; align-items: center; gap: .8rem; background: #fff; border-radius: 16px; padding: .7rem 1rem;
  box-shadow: var(--shadow-lg); font-weight: 800; animation: toastin .35s cubic-bezier(.2, 1.4, .4, 1);
  border: 2px solid var(--primary-soft);
}
.toast.gold { border-color: #ffe39a; background: #fffbea; }
.toast.green { border-color: #bfeeda; background: #f1fcf7; }
.toast .t-ico { flex: none; }
.toast .t-sub { font-size: .85rem; color: var(--muted); font-weight: 700; }
.toast.out { animation: toastout .3s ease forwards; }

/* ---------- Bilan ---------- */
.summary { max-width: 640px; margin: 0 auto; padding: 1.2rem 16px 3rem; text-align: center; }
.big-score { font-size: clamp(3.5rem, 16vw, 5.5rem); font-weight: 900; line-height: 1; color: var(--primary); }
.big-score small { font-size: .38em; color: var(--on-bg-2, var(--muted)); }
.summary .msg { font-size: 1.35rem; font-weight: 900; margin: .6rem 0 1.2rem; color: var(--on-bg, var(--ink)); }
.sub { color: var(--on-bg-2, var(--muted)); }
body.kid .page-head h1 { color: var(--on-bg, var(--ink)); }
body.kid .crumbs a { color: var(--on-bg-2, var(--muted)); }
.sum-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: .7rem; margin-bottom: 1rem; }
.sum-tiles .tile { background: #fff; border-radius: 16px; box-shadow: var(--shadow); padding: .8rem .5rem; }
.sum-tiles .val { font-size: 1.5rem; }
.fact-list { display: flex; flex-wrap: wrap; gap: .5rem; justify-content: center; }
.fact {
  display: inline-flex; align-items: center; gap: .35em; font-weight: 900; font-size: 1.1rem;
  padding: .4em .8em; border-radius: 12px; background: #fff; box-shadow: 0 0 0 2px var(--line);
}
.fact.ko { box-shadow: 0 0 0 2px #f6c2c5; background: #fff8f8; }
.fact.star { box-shadow: 0 0 0 2px #a9e6cf; background: #f1fcf7; }
.fact .res { color: var(--primary); }
.sum-section { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.1rem; margin-bottom: 1rem; }
.sum-section h3 { margin-bottom: .8rem; }
.record { display: inline-flex; gap: .4rem; align-items: center; background: #fffbea; color: #8a6100; border: 2px solid #ffe39a; border-radius: 999px; padding: .3em 1em; font-weight: 900; margin-bottom: 1rem; }

/* ---------- Grille de progression ---------- */
.grid-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 -4px; padding: 4px; }
.pgrid { display: grid; gap: 4px; min-width: 0; }
.pgrid .rh { font-weight: 900; color: var(--ink-2); display: flex; align-items: center; justify-content: flex-end; padding-right: 6px; font-size: .95rem; white-space: nowrap; }
.pgrid .ch { font-weight: 800; color: var(--muted); text-align: center; font-size: .8rem; }
.cell {
  position: relative; aspect-ratio: 1; min-width: 0; border-radius: 8px; display: grid; place-items: center;
  font-weight: 900; font-size: .88rem; border: 0; padding: 0; font-family: inherit; cursor: default;
  background: var(--st-new); color: var(--st-new-ink);
}
.cell.learning { background: var(--st-learning); color: var(--st-learning-ink); }
.cell.almost { background: var(--st-almost); color: var(--st-almost-ink); }
.cell.mastered { background: var(--st-mastered); color: var(--st-mastered-ink); }
.cell .lv { position: absolute; left: 4px; right: 4px; bottom: 3px; height: 3px; border-radius: 2px; background: rgba(255, 255, 255, .35); overflow: hidden; }
.cell .lv b { display: block; height: 100%; background: rgba(255, 255, 255, .95); border-radius: 2px; }
.cell.learning .lv { background: rgba(42, 18, 6, .18); }
.cell.learning .lv b { background: rgba(42, 18, 6, .7); }
.cell svg { width: 60%; height: 60%; }
.cell:hover, .cell:focus-visible { outline: 3px solid rgba(29, 33, 64, .35); outline-offset: 1px; z-index: 1; }
/* grille classe (pourcentage acquis) : rampe séquentielle un seul ton */
.cell.heat { color: var(--ink); }

.stats-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: .8rem; margin-bottom: 1rem; }
.stats-row .tile { background: var(--surface); border-radius: 16px; box-shadow: var(--shadow); padding: .9rem 1rem; }

/* ---------- Badges ---------- */
.badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(136px, 1fr)); gap: .8rem; }
.badge { text-align: center; padding: .8rem .5rem .7rem; border-radius: 16px; background: #fff; position: relative; box-shadow: 0 0 0 2px #f3e6b8, 0 3px 10px rgba(242, 169, 0, .12); }
.badge .bname { font-weight: 900; font-size: .92rem; margin-top: .4rem; line-height: 1.2; }
.badge .bdesc { font-size: .76rem; color: var(--muted); font-weight: 700; line-height: 1.25; margin-top: .2rem; }
.badge.locked { background: var(--surface-2); box-shadow: none; }
.badge.locked .medal { filter: grayscale(1); opacity: .28; }
.badge.locked .bname { color: var(--muted); }
.badge .lock { position: absolute; top: 8px; right: 8px; color: #a3a8bf; }
.badge .lock svg { width: 16px; height: 16px; }
.badge.new-one { background: #fffbea; box-shadow: 0 0 0 2px #ffe39a; }
.medal { width: 64px; height: 64px; display: block; margin: 0 auto; }
.medal.sm { width: 40px; height: 40px; }
.medal.lg { width: 88px; height: 88px; }
.badge-row { display: flex; flex-wrap: wrap; gap: .8rem; justify-content: center; }
.badge-row .badge { width: 132px; background: #fffbea; box-shadow: 0 0 0 2px #ffe39a; }

/* ---------- Enseignant ---------- */
.nav { display: flex; gap: .25rem; margin-left: 1rem; flex-wrap: wrap; }
.nav a { text-decoration: none; color: var(--ink-2); font-weight: 800; padding: .45em .85em; border-radius: 999px; font-size: .95rem; }
.nav a:hover { background: rgba(29, 33, 64, .06); }
.nav a.on { background: var(--primary-soft); color: var(--primary-2); }
.crumbs { font-weight: 700; color: var(--muted); font-size: .9rem; margin-bottom: .4rem; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--primary); text-decoration: underline; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.2rem; }
.page-head h1 { margin: 0; font-size: 1.7rem; }
.class-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; }
.class-card { display: block; text-decoration: none; color: inherit; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.2rem; transition: transform .1s, box-shadow .1s; border: 2px solid transparent; }
.class-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); border-color: var(--primary-soft); }
.class-card h3 { font-size: 1.2rem; margin-bottom: .3rem; }
.class-card .meta { color: var(--muted); font-weight: 700; font-size: .9rem; }
.class-card.new { display: grid; place-items: center; text-align: center; border: 2px dashed #c9cdf0; box-shadow: none; background: transparent; color: var(--primary); font-weight: 900; min-height: 130px; cursor: pointer; font: inherit; font-weight: 900; width: 100%; }
.tbl-chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: .7rem; }
.tbl-chips span { font-size: .78rem; font-weight: 900; padding: .15em .5em; border-radius: 6px; background: var(--primary-soft); color: var(--primary-2); }

.tabs { display: flex; gap: .3rem; border-bottom: 2px solid var(--line); margin-bottom: 1.2rem; overflow-x: auto; }
.tabs button { font: inherit; font-weight: 800; color: var(--muted); background: none; border: 0; padding: .7em 1em; cursor: pointer; border-bottom: 3px solid transparent; margin-bottom: -2px; white-space: nowrap; }
.tabs button.on { color: var(--primary-2); border-bottom-color: var(--primary); }
.tabs button:hover { color: var(--ink); }

.table-wrap { overflow-x: auto; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); }
table.data { width: 100%; border-collapse: collapse; font-size: .92rem; }
table.data th, table.data td { padding: .7em .8em; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.data th { font-size: .74rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 800; background: var(--surface-2); position: sticky; top: 0; cursor: pointer; user-select: none; white-space: normal; line-height: 1.25; vertical-align: bottom; }
table.data th.nosort { cursor: default; }
table.data th .arr { opacity: .6; }
table.data td.n, table.data th.n { text-align: right; font-variant-numeric: tabular-nums; }
table.data tbody tr:hover { background: #fafbff; }
table.data tbody tr:last-child td { border-bottom: 0; }
table.data a.name { font-weight: 900; color: var(--ink); text-decoration: none; }
table.data a.name:hover { color: var(--primary); text-decoration: underline; }
.minibar { display: inline-flex; gap: 2px; width: 110px; height: 10px; border-radius: 5px; overflow: hidden; background: var(--st-new); vertical-align: middle; margin-right: .5em; }
.minibar i { display: block; height: 100%; }
.minibar i.mastered { background: var(--st-mastered); }
.minibar i.almost { background: var(--st-almost); }
.minibar i.learning { background: var(--st-learning); }
.tag { display: inline-block; font-size: .75rem; font-weight: 900; padding: .15em .55em; border-radius: 6px; background: var(--surface-2); color: var(--ink-2); }
.tag.admin { background: var(--primary-soft); color: var(--primary-2); }
.tag.warn { background: var(--accent-soft); color: #9a4700; }
.tag.good { background: var(--good-soft); color: #0d6a40; }
.dot-inactive { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #c3c7d8; margin-right: .4em; }
.dot-active { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--good); margin-right: .4em; }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: .8rem; margin-bottom: 1rem; }
.kpis .tile { background: var(--surface); border-radius: 16px; box-shadow: var(--shadow); padding: .9rem 1rem; }
.kpis .val { font-size: 1.7rem; }
.two-col { display: grid; grid-template-columns: 1.3fr 1fr; gap: 1rem; align-items: start; }
.hard-list { display: grid; gap: .45rem; }
.hard-list .hl { display: grid; grid-template-columns: 70px 1fr 64px; gap: .6rem; align-items: center; font-weight: 800; font-size: .92rem; }
.hard-list .track { height: 10px; border-radius: 5px; background: #fde2d6; overflow: hidden; }
.hard-list .track b { display: block; height: 100%; background: var(--st-learning); border-radius: 0 4px 4px 0; }

/* Graphique d'activité (colonnes) */
.chart { position: relative; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .grid-line { stroke: #eceef4; stroke-width: 1; }
.chart .axis-text { fill: var(--muted); font-size: 11px; font-weight: 700; font-family: var(--font); }
.chart .bar { fill: var(--primary); transition: opacity .1s; }
.chart .bar-hit { fill: transparent; cursor: default; }
.chart .bar-hit:hover + .bar, .chart .bar.hover { fill: #7a6cf0; }
.chart .bar.today { fill: var(--primary-2); }
.tooltip {
  position: absolute; pointer-events: none; background: var(--ink); color: #fff; border-radius: 10px; padding: .45em .7em;
  font-size: .82rem; font-weight: 700; white-space: nowrap; transform: translate(-50%, calc(-100% - 10px)); z-index: 5; box-shadow: var(--shadow-lg);
}
.tooltip b { font-size: 1rem; font-weight: 900; }
.tooltip .tt-sub { color: #c9cdf0; font-weight: 700; }
details.data-view { margin-top: .6rem; }
details.data-view summary { cursor: pointer; font-weight: 800; color: var(--muted); font-size: .85rem; }

/* Modales */
.modal-back { position: fixed; inset: 0; background: rgba(20, 22, 45, .45); display: grid; place-items: center; z-index: 100; padding: 16px; animation: fade .15s ease; }
.modal { background: #fff; border-radius: 22px; box-shadow: var(--shadow-lg); width: 100%; max-width: 520px; max-height: calc(100vh - 32px); overflow: auto; padding: 1.5rem; animation: qin .2s ease; }
.modal h2 { margin-bottom: .8rem; }
.modal .actions { display: flex; justify-content: flex-end; gap: .6rem; margin-top: 1.2rem; flex-wrap: wrap; }
.check-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: .4rem; }
.check-grid .chip { min-width: 0; padding: .5em 0; }

/* Fiches à imprimer */
.print-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: .8rem; }
.pcard { border: 2px dashed #b8bdd6; border-radius: 14px; padding: .9rem 1rem; background: #fff; break-inside: avoid; }
.pcard .pc-head { display: flex; align-items: center; gap: .5rem; font-weight: 900; font-size: .95rem; margin-bottom: .5rem; }
.pcard .pc-head .logo { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; background: var(--primary); color: #fff; font-size: .85rem; }
.pcard .pc-name { font-size: 1.15rem; font-weight: 900; margin-bottom: .35rem; }
.pcard dl { display: grid; grid-template-columns: auto 1fr; gap: .15rem .6rem; margin: 0; }
.pcard dt { color: var(--muted); font-weight: 800; font-size: .85rem; }
.pcard dd { margin: 0; font-weight: 900; font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; font-size: 1.05rem; }
.pcard .pc-url { margin-top: .5rem; font-size: .75rem; color: var(--muted); word-break: break-all; font-weight: 700; }

/* ---------- Boutique, jokers, compagnon ---------- */
svg.coin { width: 1.15em; height: 1.15em; vertical-align: -.2em; flex: none; }
.pill.coins { color: #8a5a00; position: relative; }
.pill.coins.big { font-size: 1.35rem; padding: .35em .9em; }
.pill.shield { color: var(--primary-2); background: var(--primary-soft); }
.coin-float { position: absolute; right: -4px; top: -6px; font-weight: 900; font-size: .9rem; color: #b27700; animation: coinup 1s ease forwards; pointer-events: none; }
@keyframes coinup { from { opacity: 1; transform: translateY(0); } to { opacity: 0; transform: translateY(-22px); } }
.hello-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin: .3rem 0 1.2rem; }
.hello-row .hello { margin: 0; }
.hello-actions { margin-top: .8rem; gap: .6rem; }
.companion-box { text-align: center; width: 190px; flex: none; }
.companion-box .companion { width: 110px; height: 110px; display: block; margin: 0 auto; }
.companion-box .c-name { font-weight: 900; font-size: .95rem; color: var(--on-bg, var(--ink)); }
.companion-box .c-next { font-size: .78rem; font-weight: 700; color: var(--on-bg-2, var(--muted)); line-height: 1.3; }
.progress.big { height: 16px; border-radius: 8px; margin: .7rem 0 .5rem; background: var(--primary-soft); flex: none; }
.progress.big > i { border-radius: 8px; }
.challenge.done .progress.big > i { background: linear-gradient(90deg, #3fd09a, var(--st-mastered)); }
.joker-bar { display: flex; align-items: center; gap: .5rem; margin: -.3rem 0 .9rem; min-height: 40px; }
.jk {
  font: inherit; display: inline-flex; align-items: center; gap: .3rem; border: 0; cursor: pointer;
  background: #fff; color: var(--primary-2); border-radius: 12px; padding: .45em .7em; font-weight: 900;
  box-shadow: 0 0 0 2px var(--primary-soft), 0 2px 0 #d9dcea; touch-action: manipulation;
}
.jk b { font-size: .8rem; background: var(--primary-soft); border-radius: 999px; padding: 0 .45em; }
.jk[disabled] { opacity: .45; cursor: not-allowed; }
.jk:not([disabled]):hover { box-shadow: 0 0 0 2px #c9c1ff, 0 2px 0 #d9dcea; }
.hint-box { display: flex; align-items: center; justify-content: center; gap: .5rem; margin: .8rem auto 0; max-width: 440px;
  background: #fffbea; border: 2px solid #ffe39a; color: #6b4b00; border-radius: 14px; padding: .5rem .8rem; font-weight: 800; font-size: .98rem; text-align: left; }
.hint-box svg { flex: none; color: #c98400; }
.fb-note { flex-basis: 100%; font-size: .85rem; font-weight: 800; color: var(--ink-2); display: inline-flex; align-items: center; justify-content: center; gap: .3rem; }
.qcard.skipped .answer-box { text-decoration: none; }
.coins-won { display: inline-flex; align-items: center; gap: .4rem; font-weight: 900; font-size: 1.15rem; color: #8a5a00; background: #fffbea; border: 2px solid #ffe39a; border-radius: 999px; padding: .25em .9em; margin: -.4rem 0 1rem; }
.wallet { text-align: right; }
.shop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .8rem; }
.shop-grid.jokers { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
.shop-item { background: var(--surface-2); border-radius: 16px; padding: .9rem .7rem; text-align: center; display: flex; flex-direction: column; align-items: center; gap: .35rem; border: 2px solid transparent; }
.shop-item.equipped { border-color: var(--st-mastered); background: #f1fcf7; }
.shop-item .si-ico { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary-2); }
.shop-item .si-ico svg { width: 28px; height: 28px; }
.shop-item .si-name { font-weight: 900; }
.shop-item .si-desc { font-size: .8rem; font-weight: 700; color: var(--muted); line-height: 1.3; flex: 1; }
.shop-item .si-own { font-size: .8rem; font-weight: 800; color: var(--primary-2); }
.shop-item .btn { margin-top: auto; }
.earn-list { margin: 0 0 .6rem; padding-left: 1.2rem; font-weight: 700; color: var(--ink-2); line-height: 1.7; }
.avatar.has-svg { background: none; padding: 0; overflow: hidden; }
.avatar.has-svg svg { width: 100%; height: 100%; display: block; }
.avatar.xl { width: 72px; height: 72px; border-radius: 50%; display: grid; place-items: center; font-size: 2rem; font-weight: 900; background: var(--accent-soft); color: #b24f00; text-transform: uppercase; }
.theme-swatch { width: 100%; max-width: 130px; height: 64px; border-radius: 12px; display: flex; align-items: flex-end; justify-content: center; gap: 5px; padding-bottom: 8px;
  background: linear-gradient(180deg, #eef1ff, #fff6ee); box-shadow: inset 0 0 0 1px rgba(29, 33, 64, .08); }
.theme-swatch i { width: 22px; height: 16px; border-radius: 5px; background: #fff; box-shadow: 0 2px 0 #d9dcea; }
.sw-ocean { background: linear-gradient(180deg, #d4f1ff, #8fd3ea); }
.sw-jungle { background: linear-gradient(180deg, #e3f5d0, #a8d98a); }
.sw-bonbon { background: radial-gradient(circle, #ffc2dc 2px, transparent 2.5px) 0 0 / 12px 12px, linear-gradient(180deg, #ffe6f2, #fff0d9); }
.sw-espace { background: radial-gradient(circle, #fff 1px, transparent 1.5px) 0 0 / 14px 14px, linear-gradient(180deg, #151a3d, #33256b); }

.pill.badgep { color: #8a5a00; background: #fffbea; box-shadow: 0 0 0 2px #ffe39a, var(--shadow); }
.bump { animation: pop .45s ease; }
.fb-note.star { color: #0d6a40; }
.fb-note.star svg { color: var(--gold); }
.earn-intro { font-weight: 700; color: var(--ink-2); margin: 0 0 .8rem; line-height: 1.5; }
.value-chips { display: flex; flex-wrap: wrap; gap: .5rem; }
.vchip { display: inline-flex; align-items: center; gap: .35rem; background: #fffbea; border: 2px solid #ffe39a; border-radius: 12px; padding: .3em .7em; font-weight: 800; color: #6b4b00; }
.vchip b { font-size: 1.1rem; }
.vchip span { font-size: .85rem; color: var(--ink-2); }
.medal.xl { width: 116px; height: 116px; }

.btn.cheat { --b: #1d2140; --bi: #ffd84d; font-weight: 900; letter-spacing: .02em; box-shadow: 0 3px 0 #000, 0 0 0 2px #ffd84d inset; }

/* Écran de fête (badges gagnés pendant la partie) */
.celebrate { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 16px; overflow: hidden;
  background: radial-gradient(circle at 50% 40%, #7a6cf0 0%, #4a3bc4 55%, #2a1f7a 100%); animation: fade .25s ease; }
.celebrate.out { animation: fadeout .25s ease forwards; }
.cel-rays { position: absolute; left: 50%; top: 40%; width: 180vmax; height: 180vmax; transform: translate(-50%, -50%);
  background: repeating-conic-gradient(rgba(255, 255, 255, .07) 0 10deg, transparent 10deg 20deg); animation: spin 40s linear infinite; pointer-events: none; }
.cel-box { position: relative; text-align: center; color: #fff; max-width: 760px; width: 100%; max-height: 100%; overflow: auto; padding: .5rem; }
.cel-title { font-size: clamp(2rem, 7vw, 3.2rem); font-weight: 900; letter-spacing: -.02em; text-shadow: 0 4px 0 rgba(0, 0, 0, .18); animation: qin .5s ease both; }
.cel-medals { display: flex; flex-wrap: wrap; justify-content: center; gap: 1rem; margin: 1.4rem 0 1rem; }
.cel-medal { width: 170px; background: rgba(255, 255, 255, .12); border: 2px solid rgba(255, 255, 255, .25); border-radius: 22px; padding: 1rem .6rem; opacity: 0; animation: medalin .6s cubic-bezier(.2, 1.5, .4, 1) forwards; }
.cel-medal .medal { filter: drop-shadow(0 6px 14px rgba(0, 0, 0, .3)); }
.cel-medal .bname { font-weight: 900; font-size: 1.1rem; margin-top: .5rem; }
.cel-medal .bdesc { font-size: .82rem; font-weight: 700; opacity: .85; line-height: 1.3; margin-top: .2rem; }
.cel-extra { font-weight: 800; margin-bottom: 1.2rem; display: inline-flex; gap: .4rem; align-items: center; background: rgba(255, 255, 255, .14); border-radius: 999px; padding: .4em 1em; }
.cel-extra svg { color: #ffd84d; }
.celebrate .btn { opacity: 0; animation: qin .4s ease forwards; font-size: 1.3rem; padding: .8em 2.4em; }
@media (max-width: 520px) {
  .cel-medals { gap: .6rem; margin: 1rem 0 .8rem; }
  .cel-medal { width: calc(50% - .3rem); padding: .7rem .4rem; }
  .cel-medal .medal.xl { width: 78px; height: 78px; }
  .cel-medal .bname { font-size: .98rem; }
  .cel-medal .bdesc { font-size: .75rem; }
}
@keyframes medalin { 0% { opacity: 0; transform: scale(.3) rotate(-25deg); } 100% { opacity: 1; transform: none; } }
@keyframes spin { to { transform: translate(-50%, -50%) rotate(360deg); } }
@keyframes fadeout { to { opacity: 0; } }

/* Thèmes de l'espace élève */
body.kid.theme-ocean {
  background: radial-gradient(circle at 10px 10px, rgba(255, 255, 255, .55) 3px, transparent 3.5px) 0 0 / 46px 46px,
    linear-gradient(180deg, #dff4ff 0%, #b6e4f5 55%, #8fd3ea 100%) fixed;
}
body.kid.theme-jungle {
  background: radial-gradient(ellipse 9px 5px at 14px 14px, rgba(46, 125, 50, .16) 98%, transparent) 0 0 / 38px 38px,
    linear-gradient(180deg, #eaf7dd 0%, #cdeab4 60%, #b2dd94 100%) fixed;
}
body.kid.theme-bonbon {
  background: radial-gradient(circle, rgba(255, 128, 180, .22) 4px, transparent 4.5px) 0 0 / 30px 30px,
    linear-gradient(180deg, #ffeaf4 0%, #fff0f6 50%, #fff2dd 100%) fixed;
}
body.kid.theme-espace {
  --on-bg: #ffffff; --on-bg-2: #cfd3ff;
  background: radial-gradient(circle at 7px 9px, rgba(255, 255, 255, .8) 1px, transparent 1.6px) 0 0 / 41px 37px,
    radial-gradient(circle at 23px 27px, rgba(255, 255, 255, .5) 1.2px, transparent 1.8px) 0 0 / 67px 59px,
    linear-gradient(180deg, #121736 0%, #241c55 60%, #33256b 100%) fixed;
}
body.kid.theme-espace .play-meta, body.kid.theme-espace .resume-banner { color: var(--ink-2); }
body.kid.theme-espace .key { box-shadow: 0 4px 0 #5a4fa8, 0 6px 14px rgba(0, 0, 0, .25); }
body.kid.theme-espace .key.ok { box-shadow: 0 4px 0 #0c6d41; }
body.kid.theme-jungle .question .op { color: #2e7d32; }
body.kid.theme-ocean .question .op { color: #0a6fa0; }
body.kid.theme-bonbon .question .op { color: #d63384; }

/* ---------- Animations ---------- */
@keyframes shake { 0%, 100% { transform: translateX(0); } 20% { transform: translateX(-9px); } 40% { transform: translateX(8px); } 60% { transform: translateX(-5px); } 80% { transform: translateX(3px); } }
@keyframes qin { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes pop { 0% { transform: scale(1); } 50% { transform: scale(1.18); } 100% { transform: scale(1); } }
@keyframes blink { 50% { opacity: 0; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes toastin { from { opacity: 0; transform: translateY(-14px) scale(.95); } to { opacity: 1; transform: none; } }
@keyframes toastout { to { opacity: 0; transform: translateY(-10px); } }
@keyframes confetti { 0% { transform: translate(0, 0) rotate(0); opacity: 1; } 100% { transform: translate(var(--dx), var(--dy)) rotate(var(--rot)); opacity: 0; } }
.confetti { position: fixed; width: 10px; height: 14px; border-radius: 3px; pointer-events: none; z-index: 95; animation: confetti 1.1s cubic-bezier(.2, .7, .4, 1) forwards; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .confetti { display: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 760px) {
  .hello-row { align-items: flex-start; }
  .companion-box { width: 120px; }
  .companion-box .companion { width: 84px; height: 84px; }
  .companion-box .c-next { display: none; }
  .modes { grid-template-columns: 1fr; gap: .8rem; }
  .mode { min-height: 0; flex-direction: row; align-items: center; gap: .9rem; padding: 1rem; }
  .mode .mi { margin: 0; flex: none; }
  .quick { grid-template-columns: 1fr 1fr; }
  .quick .tile:first-child { grid-column: 1 / -1; }
  .stats-row { grid-template-columns: 1fr 1fr; }
  .two-col { grid-template-columns: 1fr; }
  .who .cls, .who .wname { display: none; }
  .nav { margin-left: 0; order: 3; width: 100%; }
  .topbar { flex-wrap: wrap; }
  .page-head h1 { font-size: 1.4rem; }
  .check-grid { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 480px) {
  .topbar { gap: .5rem; }
  body.kid .topbar { flex-wrap: nowrap; }
  .topbar .btn.sm span { display: none; }
  .topbar .btn.sm { padding: .5em .6em; }
  .topbar .brand { font-size: 1rem; }
  .nav a { padding: .4em .7em; font-size: .9rem; }
}
@media (max-width: 420px) {
  .pgrid { gap: 3px; }
  .cell { font-size: .74rem; border-radius: 6px; }
  .pgrid .rh { font-size: .8rem; padding-right: 3px; }
  .pgrid .ch { font-size: .7rem; }
  .panel { padding: 1rem .9rem; }
  .key { height: 60px; font-size: 1.7rem; }
  .keypad { gap: .55rem; }
  .sum-tiles { grid-template-columns: 1fr 1fr 1fr; }
  .sum-tiles .val { font-size: 1.2rem; }
  .btn.lg { font-size: 1.05rem; }
}
@media (max-height: 700px) and (max-width: 760px) {
  .qcard { padding: 1rem .8rem .8rem; }
  .key { height: 54px; }
}

/* ---------- Impression ---------- */
@media print {
  body, body.kid { background: #fff !important; }
  .topbar, .no-print, .toast-zone, .modal-back { display: none !important; }
  .main { max-width: none; padding: 0; }
  .print-only { display: block !important; }
  .print-cards { grid-template-columns: repeat(3, 1fr); gap: 6mm; }
  .pcard { border-color: #888; }
  .pcard .pc-head .logo { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .card, .panel { box-shadow: none; }
  body.printing #app, body.printing .topbar { display: none !important; }
  body.printing #print-area { display: block !important; }
}
.print-only { display: none; }
