/* Centre de jour d'Ardon — feuille de style
   Reprend le style de mozaikmag.ch : fond crème, titres en Fraunces, texte en Inter,
   formes arrondies, une couleur par rubrique avec sa teinte douce.
   Thème clair seulement, comme mozaikmag.ch. Les pages de l'atelier informatique
   gardent leurs dessins en pixels. */

/* Mise en page : une colonne de 1240 px, sections aérées, cartes arrondies sur fond crème */
:root {
  color-scheme: light;

  /* Couleurs de base (mozaikmag.ch) */
  --paper: #faf7f2;           /* fond de page, crème */
  --card: #ffffff;            /* cartes et champs */
  --surface: #efeae0;         /* fonds doux */
  --ink: #141414;
  --ink-2: #3d3c38;
  --muted: #5f5d57;
  --line: #e6e0d5;
  --line-strong: #cdc6b8;
  --grout: #faf7f2;           /* joint entre les pixels des dessins */

  /* Une couleur par rubrique (couleurs de mozaikmag.ch) */
  --cobalt: #2457d6;          /* Cours du jour, informatique */
  --rose: #e0457b;            /* Nos créations */
  --safran: #f2a93b;          /* Jeux */
  --emeraude: #2e9e6b;        /* Apprentissages */
  --lilas: #7a4fd1;           /* Infos pratiques */
  --orange: #e4572e;

  --focus: #1d4acb;
  --pixel-white: #ffffff;

  /* Palette fixe de l'Atelier pixel */
  --p-bleu: #2457d6;
  --p-ciel: #5fb7f0;
  --p-vert: #2e9e6b;
  --p-jaune: #f2c200;
  --p-orange: #e4572e;
  --p-rose: #e0457b;
  --p-violet: #7a4fd1;
  --p-brun: #8a5a3b;
  --p-noir: #141414;
  --p-blanc: #ffffff;

  /* Lettres juste / fausse (Dactylo) et voile de pause */
  --hl-ok: #ddf1e7;
  --hl-ko: #fbe1ea;
  --pause: rgba(250, 247, 242, 0.88);

  /* Typographie */
  --display: "Fraunces", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --text: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --ui: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --step--1: 0.8125rem;
  --step-0: 1.0625rem;
  --step-1: 1.3rem;
  --step-2: clamp(1.6rem, 2.6vw, 2.1rem);
  --step-3: clamp(1.9rem, 3.6vw, 2.8rem);
  --step-4: clamp(2.5rem, 6vw, 4.2rem);

  --radius: 14px;
  --radius-lg: 24px;
  --shadow: 0 1px 2px rgba(20, 20, 20, 0.06), 0 10px 30px rgba(20, 20, 20, 0.1);
  --header-h: 72px;

  --wrap: 1240px;
  --gutter-l: max(16px, env(safe-area-inset-left, 0px));
  --gutter-r: max(16px, env(safe-area-inset-right, 0px));
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--text);
  font-size: var(--step-0);
  line-height: 1.6;
  font-optical-sizing: auto;
}

img, canvas { max-width: 100%; display: block; }

a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.2em; }

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
  border-radius: 2px;
}

h1, h2, h3 {
  font-family: var(--display);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -0.01em;
  text-wrap: balance;
  margin: 0;
}

p { margin: 0; }

.wrap {
  max-width: var(--wrap);
  margin-inline: auto;
  padding-left: var(--gutter-l);
  padding-right: var(--gutter-r);
}

.skip { position: absolute; left: -9999px; }
.skip:focus {
  left: var(--gutter-l);
  top: 8px;
  z-index: 50;
  background: var(--ink);
  color: var(--paper);
  padding: 8px 14px;
  font-family: var(--ui);
  font-size: var(--step--1);
}

.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* ---------- En-tête ---------- */

body::before {
  content: "";
  position: fixed;
  inset: 0 0 auto;
  height: env(safe-area-inset-top, 0px);
  z-index: 10;
  background: var(--paper);
}

.site-header {
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 20;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  gap: 24px;
  min-height: 68px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.125rem;
  letter-spacing: -0.02em;
  flex-shrink: 0;
}

/* Logo : un mini-écran de 3 × 3 pixels */
.brand-mark {
  display: grid;
  grid-template-columns: repeat(3, 7px);
  gap: 2px;
}
.brand-mark span { width: 7px; height: 7px; background: var(--line); }
.brand-mark span:nth-child(1) { background: var(--cobalt); }
.brand-mark span:nth-child(2) { background: var(--rose); }
.brand-mark span:nth-child(3) { background: var(--safran); }
.brand-mark span:nth-child(5) { background: var(--emeraude); }
.brand-mark span:nth-child(9) { background: var(--lilas); }

.brand small {
  font-weight: 400;
  color: var(--muted);
  font-size: 0.75rem;
}

.nav {
  display: flex;
  gap: 4px 20px;
  flex-wrap: wrap;
  margin-left: auto;
  font-family: var(--ui);
  font-size: var(--step--1);
}
.nav a {
  text-decoration: none;
  padding-block: 6px;
  border-bottom: 2px solid transparent;
}
.nav a:hover { border-bottom-color: var(--ink); }
.nav a[aria-current="page"] { border-bottom-color: var(--ink); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--ui);
  font-size: var(--step--1);
  font-weight: 500;
  background: var(--ink);
  color: var(--paper);
  border: 2px solid var(--ink);
  padding: 10px 18px;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}
.btn:hover { background: transparent; color: var(--ink); }
.btn-ghost { background: transparent; color: var(--ink); }
.btn-ghost:hover { background: var(--ink); color: var(--paper); }
.btn-sm { padding: 7px 12px; font-size: 0.75rem; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn:disabled:hover { background: var(--ink); color: var(--paper); }
.btn-ghost:disabled:hover { background: transparent; color: var(--ink); }

.menu-toggle { display: none; }

@media (max-width: 920px) {
  .site-header .wrap { flex-wrap: wrap; gap: 12px; padding-block: 12px; }
  .menu-toggle { display: inline-flex; margin-left: auto; }
  .site-header .btn-sub { display: none; }
  .nav {
    display: none;
    flex-basis: 100%;
    flex-direction: column;
    gap: 2px;
    margin-left: 0;
    padding-bottom: 8px;
  }
  .nav.is-open { display: flex; }
  .nav a { padding-block: 10px; border-bottom: 1px solid var(--line); }
}

/* ---------- Pastilles de rubrique ---------- */

.rubrique {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--ui);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: var(--ink);
  text-decoration: none;
}
.rubrique::before {
  content: "";
  width: 10px;
  height: 10px;
  background: var(--c, var(--ink));
  flex-shrink: 0;
}
[data-r="cours"]     { --c: var(--cobalt); }
[data-r="creations"] { --c: var(--rose); }
[data-r="jeux"]      { --c: var(--safran); }
[data-r="appr"]      { --c: var(--emeraude); }
[data-r="infos"]     { --c: var(--lilas); }

[data-t="scratch"]   { --c: var(--safran); }
[data-t="pixel"]     { --c: var(--rose); }
[data-t="affiche"]   { --c: var(--cobalt); }
[data-t="histoire"]  { --c: var(--lilas); }

.meta {
  font-family: var(--ui);
  font-size: 0.75rem;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
}

.eyebrow {
  font-family: var(--ui);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---------- Accueil : héro ---------- */

.hero { padding-block: 36px 40px; border-bottom: 1px solid var(--line); }

.hero-mosaic {
  width: 100%;
  aspect-ratio: 1000 / 230;
  max-width: 100%;
}
.hero-mosaic canvas { width: 100%; height: 100%; }

.hero-foot {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 24px 48px;
  margin-top: 28px;
  align-items: end;
}

.hero-lede {
  font-size: var(--step-2);
  line-height: 1.3;
  font-weight: 400;
  max-width: 30ch;
  text-wrap: balance;
}

.issue {
  border-left: 3px solid var(--cobalt);
  padding-left: 16px;
  display: grid;
  gap: 4px;
  text-decoration: none;
}
.issue-num { font-family: var(--display); font-weight: 600; font-size: var(--step-1); }
.issue-theme { color: var(--muted); }
a.issue:hover .issue-num { text-decoration: underline; text-decoration-thickness: 2px; }

@media (max-width: 700px) {
  .hero { padding-block: 20px 28px; }
  .hero-mosaic { aspect-ratio: 1000 / 300; }
  .hero-foot { grid-template-columns: 1fr; }
  .hero-lede { font-size: var(--step-1); }
}

/* ---------- Sections ---------- */

.section { padding-block: 56px; }
[id] { scroll-margin-top: 80px; }
.section + .section { border-top: 1px solid var(--line); }

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
}
.section-head h2 {
  font-size: var(--step-2);
  display: inline-flex;
  align-items: center;
  gap: 14px;
}
.section-head h2::before {
  content: "";
  width: 18px;
  height: 18px;
  background: var(--c, var(--ink));
  flex-shrink: 0;
}
.section-head .intro { color: var(--muted); font-size: 1rem; max-width: 52ch; }

/* ---------- Couvertures en pixels ---------- */

.cover {
  position: relative;
  width: 100%;
  max-width: 100%;
  background: var(--surface);
  overflow: hidden;
}
.cover canvas { position: absolute; inset: 0; width: 100%; height: 100%; }

/* ---------- Cours du jour ---------- */

.lesson {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  gap: 40px;
  align-items: start;
}
.lesson .cover { aspect-ratio: 5 / 4; }
.lesson-side { display: grid; gap: 16px; position: sticky; top: 96px; }
.lesson-body { display: grid; gap: 18px; min-width: 0; }
.lesson-when {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--ui);
  font-size: var(--step--1);
  font-weight: 500;
}
.lesson-when .badge {
  background: var(--cobalt);
  color: var(--pixel-white);
  padding: 4px 10px;
  font-size: 0.75rem;
}
.lesson h3 { font-size: var(--step-3); }
.chapo { color: var(--muted); font-size: var(--step-1); line-height: 1.45; max-width: 46ch; }

.facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px 20px;
  margin: 0;
  padding-block: 14px;
  border-block: 1px solid var(--line);
}
.facts dt { font-family: var(--ui); font-size: 0.6875rem; color: var(--muted); letter-spacing: 0.04em; text-transform: uppercase; }
.facts dd { margin: 4px 0 0; font-family: var(--display); font-weight: 500; font-size: 0.9375rem; line-height: 1.3; }

.steps-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
}
.steps-head h4 { margin: 0; font-family: var(--display); font-weight: 600; font-size: 1rem; }
.steps-count { font-family: var(--ui); font-size: 0.75rem; color: var(--muted); font-variant-numeric: tabular-nums; }

.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; counter-reset: etape; border-top: 1px solid var(--line); }
.steps li { border-bottom: 1px solid var(--line); counter-increment: etape; }
.steps label {
  display: grid;
  grid-template-columns: 28px 24px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding-block: 12px;
  cursor: pointer;
  font-size: 1.0625rem;
  line-height: 1.45;
}
.steps label::before {
  content: counter(etape);
  font-family: var(--display);
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--muted);
  padding-top: 2px;
  font-variant-numeric: tabular-nums;
}
.check {
  appearance: none;
  -webkit-appearance: none;
  width: 22px;
  height: 22px;
  margin: 1px 0 0;
  border: 2px solid var(--ink);
  background: var(--paper);
  cursor: pointer;
  display: grid;
  place-content: center;
}
.check::after {
  content: "";
  width: 10px;
  height: 10px;
  background: var(--c, var(--cobalt));
  transform: scale(0);
  transition: transform 120ms ease-out;
}
.check:checked::after { transform: scale(1); }
.steps input:checked + span { color: var(--muted); text-decoration: line-through; text-decoration-thickness: 1px; }

.aside-box {
  background: var(--surface);
  padding: 18px 22px;
  font-size: 1rem;
  display: grid;
  gap: 6px;
}
.aside-box h4 {
  margin: 0;
  font-family: var(--display);
  font-size: 0.875rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.aside-box h4::before { content: ""; width: 10px; height: 10px; background: var(--safran); }

.lesson-nav { display: flex; gap: 8px; flex-wrap: wrap; }

@media (max-width: 860px) {
  .lesson { grid-template-columns: 1fr; gap: 24px; }
  .lesson-side { position: static; }
  .lesson .cover { aspect-ratio: 16 / 9; }
}
@media (max-width: 480px) {
  .facts { grid-template-columns: 1fr 1fr; }
}

/* ---------- Programme (agenda) ---------- */

.subhead {
  font-size: var(--step-1);
  margin: 56px 0 18px;
}
.agenda { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.agenda li {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr) auto;
  gap: 8px 24px;
  align-items: baseline;
  padding-block: 16px;
  border-bottom: 1px solid var(--line);
}
.agenda li.is-past { opacity: 0.55; }
.agenda time {
  font-family: var(--display);
  font-weight: 600;
  font-size: var(--step-1);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.agenda time small { display: block; font-size: 0.75rem; font-weight: 400; color: var(--muted); margin-top: 6px; }
.agenda h3 { font-family: var(--text); font-weight: 600; font-size: var(--step-1); letter-spacing: 0; }
.agenda .open {
  all: unset;
  cursor: pointer;
  text-decoration: none;
}
.agenda .open:hover { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
.agenda .open:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.agenda li[aria-current="true"] h3 .open::after {
  content: "affiché";
  margin-left: 10px;
  font-family: var(--ui);
  font-size: 0.6875rem;
  font-weight: 500;
  color: var(--paper);
  background: var(--cobalt);
  padding: 2px 8px;
  vertical-align: middle;
}
.agenda p { color: var(--muted); font-size: 1rem; }
.agenda .rubrique { justify-self: end; }

@media (max-width: 640px) {
  .agenda li { grid-template-columns: 72px minmax(0, 1fr); }
  .agenda .rubrique { grid-column: 2; justify-self: start; }
}

/* ---------- Filtres ---------- */

.filters { display: flex; flex-wrap: wrap; gap: 8px; }
.filter {
  font-family: var(--ui);
  font-size: 0.75rem;
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
  padding: 8px 14px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.filter::before { content: ""; width: 8px; height: 8px; background: var(--c, var(--ink)); }
.filter:hover { border-color: var(--ink); }
.filter[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.filter[aria-pressed="true"]::before { background: var(--c, var(--paper)); }

/* ---------- Grille de créations ---------- */

.grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-auto-flow: dense;
  gap: 36px 24px;
}
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.card {
  display: grid;
  grid-template-rows: auto auto;
  align-content: start;
  gap: 14px;
  text-decoration: none;
  min-width: 0;
}
.card .cover { aspect-ratio: 1 / 1; }
.card.wide { grid-column: span 2; }
.card.wide .cover { aspect-ratio: 2 / 1; }
.grid.three .card .cover { aspect-ratio: 4 / 3; }
.card-body { display: grid; gap: 8px; min-width: 0; }
.card h3 { font-size: 1.125rem; font-weight: 600; }
.card.wide h3 { font-size: var(--step-1); }
.card p { color: var(--muted); font-size: 1rem; line-height: 1.5; }
a.card:hover h3 { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 0.15em; }

.empty {
  grid-column: 1 / -1;
  color: var(--muted);
  font-family: var(--ui);
  font-size: var(--step--1);
}

@media (max-width: 1000px) {
  .grid, .grid.three { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .grid, .grid.three { grid-template-columns: 1fr; }
  .card.wide { grid-column: auto; }
  .card.wide .cover, .card .cover, .grid.three .card .cover { aspect-ratio: 3 / 2; }
}

/* ---------- Apprentissages : carnet ---------- */

.carnet-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px 32px;
  align-items: end;
  padding: 22px 24px;
  background: var(--surface);
  margin-bottom: 8px;
}
.carnet-score { font-family: var(--display); font-weight: 600; font-size: var(--step-2); line-height: 1.1; font-variant-numeric: tabular-nums; }
.carnet-score small { display: block; font-family: var(--text); font-weight: 400; font-size: 1rem; color: var(--muted); margin-top: 6px; }
.carnet-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.pixbar { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 14px; }
.pixbar span { width: 12px; height: 12px; background: var(--line); }
.pixbar span.on { background: var(--c, var(--emeraude)); }

@media (max-width: 640px) { .carnet-top { grid-template-columns: 1fr; } }

.tracks { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.tracks > li {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 20px;
  padding-block: 24px;
  border-bottom: 1px solid var(--line);
  align-items: start;
}
.tracks .tile {
  width: 56px;
  height: 56px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2px;
}
.tracks .tile span { background: var(--line); }
.tracks .tile span.on { background: var(--c); }
.track-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 6px 16px; }
.track-head h3 { font-size: var(--step-1); }
.track-count { font-family: var(--ui); font-size: 0.75rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.track-desc { color: var(--muted); font-size: 1rem; margin-top: 4px; max-width: 60ch; }
.skills {
  list-style: none;
  margin: 14px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
  gap: 8px 24px;
}
.skills label {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1.4;
}
.skills .check { --c: var(--emeraude); }

@media (max-width: 520px) {
  .tracks > li { grid-template-columns: 1fr; gap: 12px; }
}

.links { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px 24px; }
.links a {
  display: grid;
  gap: 4px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  text-decoration: none;
  height: 100%;
}
.links a:hover { border-color: var(--ink); }
.links strong { font-family: var(--display); font-weight: 600; font-size: 1rem; }
.links strong::after { content: " ↗"; font-weight: 400; color: var(--muted); }
.links span { color: var(--muted); font-size: 0.9375rem; line-height: 1.45; }
@media (max-width: 800px) { .links { grid-template-columns: 1fr; } }

/* ---------- Infos pratiques ---------- */

.infos {
  background: var(--surface);
  padding-block: 56px;
}
.infos .wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr);
  gap: 32px 56px;
  align-items: start;
}
.infos h2 {
  font-size: var(--step-3);
}
.infos .intro { color: var(--muted); margin-top: 12px; max-width: 40ch; }
.contact-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 32px; margin: 0; }
.contact-list dt { font-family: var(--ui); font-size: 0.75rem; color: var(--muted); }
.contact-list dd { margin: 4px 0 0; font-size: var(--step-1); font-family: var(--display); font-weight: 500; line-height: 1.25; word-break: break-word; }
.contact-list dd small { display: block; font-family: var(--text); font-weight: 400; font-size: 1rem; color: var(--muted); margin-top: 4px; }

@media (max-width: 800px) {
  .infos .wrap { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .contact-list { grid-template-columns: 1fr; }
}

/* ---------- Pied de page ---------- */

.site-footer {
  padding-block: 48px 40px;
  border-top: 1px solid var(--line);
  font-size: 1rem;
}
.site-footer .wrap {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) repeat(2, minmax(0, 1fr));
  gap: 32px;
}
.site-footer h2 { font-size: 0.875rem; margin-bottom: 12px; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.site-footer a { text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }
.site-footer .fine { color: var(--muted); font-size: 0.875rem; margin-top: 14px; max-width: 40ch; }

@media (max-width: 700px) {
  .site-footer .wrap { grid-template-columns: 1fr 1fr; }
  .site-footer .wrap > :first-child { grid-column: 1 / -1; }
}

/* ---------- Page Jeux ---------- */

.page-head { padding-block: 48px 36px; border-bottom: 1px solid var(--line); }
.page-head .inner { display: grid; gap: 18px; max-width: 820px; }
.page-head h1 { font-size: var(--step-4); }
.page-head .chapo { font-size: var(--step-2); max-width: 36ch; line-height: 1.35; }
.page-head .filters { margin-top: 6px; }
.page-head .filter { text-decoration: none; }

.game {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 32px 48px;
  align-items: start;
}
.game-info { display: grid; gap: 16px; min-width: 0; }
.game-info .chapo { font-size: 1.125rem; }
.status {
  font-family: var(--ui);
  font-size: var(--step--1);
  min-height: 2.8em;
  padding: 12px 14px;
  background: var(--surface);
  line-height: 1.45;
}
.status.is-ok { background: var(--emeraude); color: var(--pixel-white); }
.status.is-ko { background: var(--rose); color: var(--pixel-white); }

@media (max-width: 860px) {
  .game { grid-template-columns: 1fr; }
}

/* Robot programmeur */
.levels { display: flex; gap: 6px; flex-wrap: wrap; }
.level {
  font-family: var(--ui);
  font-size: 0.75rem;
  min-width: 40px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  font-variant-numeric: tabular-nums;
}
.level:hover { border-color: var(--ink); }
.level[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.level.done::after { content: " ✓"; color: var(--emeraude); }
.level[aria-pressed="true"].done::after { color: var(--paper); }

.board {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  grid-template-rows: repeat(6, minmax(0, 1fr));
  gap: 4px;
  background: var(--grout);
  width: 100%;
  max-width: 480px;
  aspect-ratio: 1 / 1;
}
.cell {
  background: var(--surface);
  position: relative;
  display: grid;
  place-items: center;
}
.cell.wall { background: var(--ink); }
.cell.trail::before {
  content: "";
  position: absolute;
  inset: 32%;
  background: var(--emeraude);
  opacity: 0.45;
}
.cell.goal::before {
  content: "";
  position: absolute;
  inset: 18%;
  background: var(--safran);
  clip-path: polygon(50% 0, 62% 36%, 100% 38%, 70% 60%, 80% 100%, 50% 76%, 20% 100%, 30% 60%, 0 38%, 38% 36%);
}
.cell.robot { background: var(--emeraude); }
.cell.robot::after {
  content: "";
  width: 46%;
  height: 46%;
  background: var(--pixel-white);
  clip-path: polygon(50% 0, 100% 100%, 50% 74%, 0 100%);
  transform: rotate(var(--rot, 0deg));
  transition: transform 160ms ease-out;
}
.cell.robot.crash { background: var(--rose); }

.cmds { display: flex; gap: 8px; flex-wrap: wrap; }
.cmds .btn { min-width: 0; }
.program {
  list-style: none;
  margin: 0;
  padding: 10px;
  min-height: 64px;
  border: 2px dashed var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-content: flex-start;
  counter-reset: ordre;
}
.program li { counter-increment: ordre; }
.program button {
  font-family: var(--ui);
  font-size: 0.75rem;
  border: 0;
  padding: 7px 10px;
  background: var(--ink);
  color: var(--paper);
  cursor: pointer;
  display: inline-flex;
  gap: 6px;
  align-items: center;
}
.program button::before { content: counter(ordre); opacity: 0.6; font-variant-numeric: tabular-nums; }
.program button.is-active { background: var(--emeraude); color: var(--pixel-white); }
.program .hint { font-family: var(--ui); font-size: 0.75rem; color: var(--muted); align-self: center; }
.program-head { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.program-head h3 { font-size: 1rem; }

/* Clavier éclair */
.typing {
  display: grid;
  gap: 18px;
  padding: 28px;
  background: var(--surface);
  min-width: 0;
}
.word {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(1.75rem, 6vw, 3.25rem);
  line-height: 1.1;
  min-height: 1.2em;
  letter-spacing: 0.02em;
  word-break: break-word;
}
.word .ok { color: var(--emeraude); }
.word .ko { color: var(--paper); background: var(--rose); }
.word .next { text-decoration: underline; text-decoration-thickness: 3px; text-underline-offset: 0.18em; }
.typing input {
  font: inherit;
  font-family: var(--ui);
  font-size: 1.25rem;
  color: var(--ink);
  background: var(--paper);
  border: 2px solid var(--ink);
  padding: 12px 14px;
  width: 100%;
  min-width: 0;
}
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 0; }
.stats dt { font-family: var(--ui); font-size: 0.6875rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.stats dd { margin: 4px 0 0; font-family: var(--display); font-weight: 600; font-size: var(--step-2); font-variant-numeric: tabular-nums; line-height: 1; }
.timebar { height: 8px; background: var(--line); }
.timebar span { display: block; height: 100%; width: 100%; background: var(--safran); transform-origin: left; }
.modes { display: flex; gap: 8px; flex-wrap: wrap; }

/* Atelier pixel */
.pixel-wrap { display: grid; gap: 12px; min-width: 0; }
.pixel-canvas {
  width: 100%;
  max-width: 480px;
  aspect-ratio: 1 / 1;
  touch-action: none;
  cursor: crosshair;
  background: var(--grout);
}
.palette { display: flex; flex-wrap: wrap; gap: 6px; }
.swatch {
  width: 38px;
  height: 38px;
  border: 2px solid var(--line);
  background: var(--sw);
  cursor: pointer;
  padding: 0;
  position: relative;
}
.swatch[aria-pressed="true"] { border-color: var(--ink); box-shadow: 0 0 0 2px var(--paper), 0 0 0 4px var(--ink); }
.swatch.eraser {
  background:
    linear-gradient(45deg, var(--line) 25%, transparent 25%, transparent 75%, var(--line) 75%),
    linear-gradient(45deg, var(--line) 25%, var(--paper) 25%, var(--paper) 75%, var(--line) 75%);
  background-size: 12px 12px;
  background-position: 0 0, 6px 6px;
}
.tools { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.toggle { display: inline-flex; gap: 10px; align-items: center; font-family: var(--ui); font-size: var(--step--1); cursor: pointer; }
.pixel-count { font-family: var(--ui); font-size: 0.75rem; color: var(--muted); font-variant-numeric: tabular-nums; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* ---------- Dactylo (page dactylo.html) ---------- */


.dl-head { padding-block: 40px 28px; }
.dl-head .inner { gap: 14px; }
.dl-app { padding-block: 32px 56px; }
.dl-layout {
  display: grid;
  grid-template-columns: minmax(240px, 290px) minmax(0, 1fr);
  gap: 32px 44px;
  align-items: start;
}
@media (max-width: 960px) {
  .dl-layout { grid-template-columns: 1fr; }
}

/* Colonne de choix */
.dl-side { display: grid; gap: 20px; position: sticky; top: 92px; min-width: 0; }
@media (max-width: 960px) { .dl-side { position: static; } }
.seg { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: 2px solid var(--ink); }
.seg button {
  font-family: var(--ui);
  font-size: 0.75rem;
  padding: 10px 6px;
  background: transparent;
  color: var(--ink);
  border: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.seg button + button { border-left: 2px solid var(--ink); }
.seg button::before { content: ""; width: 8px; height: 8px; background: var(--c); flex-shrink: 0; }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.dl-level-desc { color: var(--muted); font-size: 0.9375rem; line-height: 1.45; }

.dl-list { list-style: none; margin: 6px 0 0; padding: 0; border-top: 1px solid var(--line); }
.dl-list li { border-bottom: 1px solid var(--line); }
.dl-item {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 12px;
  padding: 14px 12px 14px 14px;
  text-align: left;
  background: transparent;
  border: 0;
  border-left: 4px solid transparent;
  color: var(--ink);
  font: inherit;
  cursor: pointer;
}
.dl-item:hover { background: var(--surface); }
.dl-item[aria-current="true"] { background: var(--surface); border-left-color: var(--c); }
.dl-item strong { font-family: var(--display); font-weight: 600; font-size: 0.9375rem; line-height: 1.25; }
.dl-item .meta { grid-column: 1; }
.dl-item .best { grid-column: 2; grid-row: 1 / span 2; align-self: center; }

.pill {
  display: inline-block;
  min-width: 38px;
  text-align: center;
  font-family: var(--display);
  font-weight: 600;
  font-size: 0.8125rem;
  padding: 3px 8px;
  background: var(--c);
  color: var(--paper);
  font-variant-numeric: tabular-nums;
}
.pill.none { background: transparent; color: var(--muted); border: 1px dashed var(--line); font-weight: 400; }

.dl-options { display: grid; gap: 10px; }
.dl-tip { font-size: 0.9375rem; color: var(--muted); background: var(--surface); padding: 14px 16px; line-height: 1.45; }
.dl-tip b { color: var(--ink); font-family: var(--ui); font-weight: 600; }

/* Zone de jeu */
.dl-main { display: grid; gap: 14px; min-width: 0; }
.dl-strip { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 12px 24px; }
.dl-stats { display: grid; grid-template-columns: repeat(4, minmax(84px, auto)); gap: 12px 36px; margin: 0; }
.dl-stats dt { font-family: var(--ui); font-size: 0.6875rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.dl-stats dd { margin: 4px 0 0; font-family: var(--display); font-weight: 600; font-size: var(--step-2); line-height: 1; font-variant-numeric: tabular-nums; white-space: nowrap; }
.dl-stats dd small, .stats dd small { font-family: var(--ui); font-size: 0.6875rem; font-weight: 400; color: var(--muted); }
@media (max-width: 600px) {
  .dl-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 20px; width: 100%; }
}
.progress { height: 8px; background: var(--line); }
.progress span { display: block; height: 100%; width: 0; background: var(--cobalt); transition: width 120ms linear; }

.texte-box {
  position: relative;
  padding: 20px 28px 34px;
  background: var(--surface);
  border: 2px solid transparent;
  cursor: text;
  display: grid;
  gap: 12px;
  min-width: 0;
}
.texte-box.is-focus { border-color: var(--ink); }
.texte-top { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; flex-wrap: wrap; }
.texte-pos { font-family: var(--ui); font-size: 0.75rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.texte-view {
  position: relative;
  overflow: hidden;
  font-size: clamp(1.0625rem, 2.1vw, 1.375rem);
  height: calc(2.2em * 5);
}
.texte-view::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 2.2em;
  background: linear-gradient(to bottom, transparent, var(--surface));
  pointer-events: none;
}
.texte {
  position: relative;
  font-family: var(--ui);
  font-weight: 400;
  line-height: 2.2;
  letter-spacing: 0.02em;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--ink);
  transition: transform 200ms ease-out;
}
.texte .mot { display: inline-block; white-space: nowrap; }
.texte .ch { display: inline-block; padding-block: 0.1em; }
.texte .ch.sp { min-width: 0.42em; }
.texte .ch.ok { background: var(--hl-ok); }
.texte .ch.ko { background: var(--hl-ko); }
.texte .ch.cur { background: var(--ink); color: var(--paper); }
.texte .ch.cur.miss { background: var(--rose); color: var(--paper); animation: secoue 220ms ease-out; }
@keyframes secoue {
  25% { transform: translateX(-2px); }
  75% { transform: translateX(2px); }
}
.texte-hint {
  position: absolute;
  right: 14px;
  bottom: 10px;
  left: 28px;
  text-align: right;
  font-family: var(--ui);
  font-size: 0.6875rem;
  color: var(--muted);
}
.pause {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: var(--pause);
  font-family: var(--ui);
  font-size: var(--step--1);
  font-weight: 500;
  text-align: center;
  padding: 16px;
}
.pause span { background: var(--ink); color: var(--paper); padding: 10px 16px; }
.dl-input {
  position: absolute;
  left: 0;
  top: 0;
  width: 1px;
  height: 1px;
  opacity: 0;
  font-size: 16px;
  border: 0;
  padding: 0;
  pointer-events: none;
}

/* Clavier suisse romand */
.kbd-wrap { display: grid; gap: 12px; max-width: 820px; margin-top: 6px; }
.next-key { font-family: var(--ui); font-size: var(--step--1); display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 8px; min-height: 2em; }
.next-key .nk-label { color: var(--muted); font-size: 0.6875rem; text-transform: uppercase; letter-spacing: 0.05em; }
.next-key b { font-weight: 600; background: var(--ink); color: var(--paper); padding: 2px 8px; }
.next-key .doigt { color: var(--muted); font-size: 0.75rem; }
.next-key .doigt::before { content: "· "; }
.kbd { display: grid; gap: 4px; user-select: none; -webkit-user-select: none; }
.kbd-row { display: flex; gap: 4px; }
.key {
  --fc: var(--line);
  flex: 1 1 0;
  min-width: 0;
  height: clamp(28px, 5vw, 46px);
  display: grid;
  place-items: center;
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  font-family: var(--ui);
  font-size: clamp(0.5625rem, 1.5vw, 0.875rem);
  color: var(--ink);
  transition: transform 100ms ease-out;
}
.key[data-f="P"] { --fc: var(--lilas); }
.key[data-f="R"] { --fc: var(--cobalt); }
.key[data-f="M"] { --fc: var(--emeraude); }
.key[data-f="I"] { --fc: var(--safran); }
.key[data-f="T"] { --fc: var(--rose); }
.fingers .key { background: color-mix(in srgb, var(--fc) 20%, var(--paper)); border-color: color-mix(in srgb, var(--fc) 45%, var(--paper)); }
.key.fn { color: var(--muted); font-size: clamp(0.5rem, 1.3vw, 0.75rem); }
.key.wide { flex-grow: 1.5; }
.key.wider { flex-grow: 1.8; }
.key.space { flex: 0 1 56%; margin-inline: auto; }
.key.home::after {
  content: "";
  position: absolute;
  bottom: 16%;
  width: 26%;
  height: 2px;
  background: currentColor;
}
.key.next,
.fingers .key.next {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
  box-shadow: inset 0 -5px 0 var(--fc);
  transform: translateY(-2px);
  z-index: 1;
}
.legend { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 18px; font-family: var(--ui); font-size: 0.75rem; color: var(--muted); }
.legend li { display: inline-flex; align-items: center; gap: 8px; }
.legend li::before { content: ""; width: 12px; height: 12px; background: var(--fc); }
.legend [data-f="P"] { --fc: var(--lilas); }
.legend [data-f="R"] { --fc: var(--cobalt); }
.legend [data-f="M"] { --fc: var(--emeraude); }
.legend [data-f="I"] { --fc: var(--safran); }
.legend [data-f="T"] { --fc: var(--rose); }

/* Bilan */
.dl-result { display: grid; gap: 26px; padding: 28px; border: 2px solid var(--ink); scroll-margin-top: 90px; min-width: 0; }
.res-top { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 20px 28px; align-items: center; }
.res-msg { display: grid; gap: 8px; }
.res-msg h2 { font-size: var(--step-3); }
.res-msg .chapo { font-size: 1.125rem; }
.note {
  width: 148px;
  height: 148px;
  background: var(--c, var(--cobalt));
  color: var(--paper);
  display: grid;
  place-content: center;
  text-align: center;
  font-family: var(--display);
  gap: 4px;
}
.note b { font-size: 3.5rem; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.note small { font-size: 0.75rem; font-weight: 500; }
.res-chart h3, .res-h { font-size: 1rem; margin-bottom: 14px; }
.bars {
  position: relative;
  display: grid;
  grid-template-columns: repeat(10, minmax(0, 1fr));
  gap: 6px;
  align-items: end;
  height: 120px;
  border-bottom: 1px solid var(--ink);
  background-image: linear-gradient(var(--line) 1px, transparent 1px);
  background-size: 100% 25%;
}
.bars .bar { background: var(--cobalt); min-height: 2px; }
.bars .bar.ok { background: var(--emeraude); }
.bars .goal { position: absolute; left: 0; right: 0; border-top: 2px dashed var(--ink); z-index: 1; pointer-events: none; }
.bars .goal em { position: absolute; right: 0; bottom: 4px; font-style: normal; font-family: var(--ui); font-size: 0.6875rem; background: var(--paper); padding: 0 6px; }
.chart-cap { color: var(--muted); font-size: 0.9375rem; margin-top: 10px; }
.weak { font-family: var(--ui); font-size: var(--step--1); display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.weak span { margin-right: 4px; }
.weak kbd {
  font-family: var(--ui);
  font-size: 0.875rem;
  min-width: 32px;
  text-align: center;
  padding: 4px 8px;
  border: 1px solid var(--ink);
  background: var(--hl-ko);
  color: var(--ink);
}
.recap {
  font-family: var(--ui);
  font-size: 0.9375rem;
  line-height: 1.9;
  background: var(--surface);
  padding: 16px 18px;
  max-height: 240px;
  overflow: auto;
}
.recap mark.e { background: var(--rose); color: var(--paper); padding: 1px 2px; }
@media (max-width: 600px) {
  .dl-result { padding: 20px; }
  .res-top { grid-template-columns: 1fr; }
  .note { width: 100%; height: auto; padding: 16px; grid-auto-flow: column; align-items: baseline; justify-content: start; gap: 12px; }
  .bars { gap: 3px; }
}

/* Progrès */
.note-chart {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  overflow-x: auto;
  padding-bottom: 8px;
  margin-bottom: 28px;
}
.nc-axis { display: grid; grid-template-rows: 2fr 4fr 6fr; height: 118px; font-family: var(--ui); font-size: 0.6875rem; color: var(--muted); align-self: flex-start; text-align: right; padding-right: 4px; }
.nc-col { display: grid; gap: 6px; justify-items: center; flex-shrink: 0; }
.nc-bar { display: grid; grid-template-rows: repeat(12, 8px); gap: 2px; width: 26px; }
.nc-bar i { background: var(--line); }
.nc-bar i.on { background: var(--c); }
.nc-bar i[data-seuil] { box-shadow: 0 -2px 0 var(--ink); }
.nc-col b { font-family: var(--display); font-size: 0.8125rem; font-variant-numeric: tabular-nums; }
.nc-col small { font-family: var(--ui); font-size: 0.625rem; color: var(--muted); }
.note-chart .vide, .hist .vide { color: var(--muted); font-style: italic; }
.hist-actions { margin-top: 16px; }

/* Historique */
.hist-wrap { overflow-x: auto; }
.hist { width: 100%; border-collapse: collapse; font-size: 1rem; min-width: 640px; }
.hist th {
  font-family: var(--ui);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  text-align: left;
  padding: 0 12px 10px 0;
  border-bottom: 1px solid var(--ink);
}
.hist td { padding: 12px 12px 12px 0; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.hist td.num, .hist th.num { text-align: right; }

/* Bandeau Dactylo sur la page Jeux */
.promo {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 32px 48px;
  align-items: center;
}
.promo .cover { aspect-ratio: 2 / 1; }
.promo-body { display: grid; gap: 16px; justify-items: start; }
@media (max-width: 860px) { .promo { grid-template-columns: 1fr; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
.stats.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 520px) { .stats.four { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.promo-body h2 { font-size: var(--step-3); }

/* ---------- Compte élève ---------- */

.btn-compte { flex-shrink: 0; }
.btn-compte.is-connecte::before {
  content: "";
  width: 12px;
  height: 12px;
  background:
    linear-gradient(var(--cobalt), var(--cobalt)) 0 0 / 50% 50% no-repeat,
    linear-gradient(var(--rose), var(--rose)) 100% 0 / 50% 50% no-repeat,
    linear-gradient(var(--safran), var(--safran)) 0 100% / 50% 50% no-repeat,
    linear-gradient(var(--emeraude), var(--emeraude)) 100% 100% / 50% 50% no-repeat;
}
.btn-compte[aria-current="page"] { background: var(--ink); color: var(--paper); }
@media (max-width: 920px) {
  .btn-compte { order: 2; margin-left: auto; padding: 8px 12px; }
  .menu-toggle { order: 3; margin-left: 0; }
  .nav { order: 4; }
}

.sauvegarde {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  font-family: var(--ui);
  font-size: 0.75rem;
  color: var(--muted);
  line-height: 1.5;
}
.sauvegarde::before { content: ""; width: 8px; height: 8px; background: var(--line); flex-shrink: 0; transform: translateY(-1px); }
.sauvegarde.is-ok::before { background: var(--emeraude); }
.sauvegarde a { color: var(--ink); }
.section-head .intro p + p { margin-top: 6px; }

.notice {
  padding: 16px 18px;
  background: var(--surface);
  border-left: 4px solid var(--safran);
  font-size: 1rem;
  line-height: 1.5;
  max-width: 72ch;
}
.notice b { font-family: var(--ui); font-weight: 600; font-size: 0.875rem; }

.auth-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  align-items: start;
}
@media (max-width: 820px) { .auth-grid { grid-template-columns: 1fr; } }
.panel {
  display: grid;
  gap: 18px;
  padding: 28px;
  border: 2px solid var(--ink);
  min-width: 0;
}
.panel.soft { border-color: var(--line); background: var(--surface); }
.panel h2 { font-size: var(--step-2); display: inline-flex; align-items: center; gap: 12px; }
.panel h2::before { content: ""; width: 16px; height: 16px; background: var(--c, var(--cobalt)); }
.panel > p { color: var(--muted); font-size: 1rem; }
@media (max-width: 520px) { .panel { padding: 20px; } }

.field { display: grid; gap: 6px; }
.field label { font-family: var(--ui); font-size: var(--step--1); font-weight: 500; }
.field .aide { font-size: 0.875rem; color: var(--muted); }
.field input {
  font: inherit;
  font-family: var(--ui);
  font-size: 1rem;
  color: var(--ink);
  background: var(--paper);
  border: 2px solid var(--ink);
  padding: 11px 14px;
  width: 100%;
  min-width: 0;
}
.field input:focus-visible { outline-offset: 1px; }
.field-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 520px) { .field-row { grid-template-columns: 1fr; } }
.form-status { font-family: var(--ui); font-size: var(--step--1); min-height: 1.4em; margin: 0; }
.form-status.is-error { color: var(--rose); }
.form-status.is-ok { color: var(--emeraude); }
.panel form { display: grid; gap: 14px; }

.hello { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 16px 24px; margin-bottom: 28px; }
.hello h2 { font-size: var(--step-3); }
.hello p { color: var(--muted); margin-top: 6px; font-size: 1rem; }

.resume {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}
@media (max-width: 960px) { .resume { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 480px) { .resume { grid-template-columns: 1fr; } }
.tuile {
  display: grid;
  gap: 8px;
  align-content: start;
  padding: 20px;
  background: var(--surface);
  text-decoration: none;
  border-top: 4px solid var(--c);
  min-width: 0;
}
.tuile .eyebrow { color: var(--muted); }
.tuile strong { font-family: var(--display); font-weight: 600; font-size: var(--step-2); line-height: 1.1; font-variant-numeric: tabular-nums; }
.tuile strong small { font-size: 0.875rem; font-weight: 400; color: var(--muted); }
.tuile p { color: var(--muted); font-size: 0.9375rem; line-height: 1.4; }
a.tuile:hover strong { text-decoration: underline; text-decoration-thickness: 2px; }
.tuile .pixbar { margin-top: 4px; }
.tuile .pixbar span { width: 10px; height: 10px; }

details.panel summary { cursor: pointer; font-family: var(--display); font-weight: 600; font-size: 1.0625rem; }
details.panel[open] summary { margin-bottom: 4px; }

/* ---------- Espace enseignant ---------- */

.prof-top {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}
@media (max-width: 960px) { .prof-top { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 480px) { .prof-top { grid-template-columns: 1fr; } }
.code-classe { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.code-classe code { font-family: var(--ui); font-weight: 600; font-size: 1.125rem; background: var(--paper); padding: 4px 10px; border: 1px dashed var(--ink); word-break: break-all; }

.toolbar { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.toolbar .field { flex: 1 1 260px; max-width: 420px; }
.toolbar .cmds { display: flex; gap: 8px; flex-wrap: wrap; }

.demo-banner {
  background: var(--safran);
  color: var(--p-noir);
  font-family: var(--ui);
  font-size: var(--step--1);
  font-weight: 500;
  padding: 10px 14px;
  margin-bottom: 20px;
}

.table-wrap { overflow-x: auto; }
.prof-table { width: 100%; border-collapse: collapse; min-width: 880px; font-size: 1rem; }
.prof-table th {
  font-family: var(--ui);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  text-align: left;
  padding: 0 14px 10px 0;
  border-bottom: 1px solid var(--ink);
  white-space: nowrap;
}
.prof-table td { padding: 14px 14px 14px 0; border-bottom: 1px solid var(--line); vertical-align: top; font-variant-numeric: tabular-nums; }
.prof-table .nom strong { font-family: var(--display); font-weight: 600; font-size: 0.9375rem; display: block; }
.prof-table .nom small { color: var(--muted); font-size: 0.875rem; word-break: break-all; }
.prof-table .chiffre { font-family: var(--ui); font-size: 0.875rem; }
.prof-table .sous { display: block; color: var(--muted); font-size: 0.8125rem; margin-top: 2px; }
.mini { display: flex; gap: 2px; margin-top: 6px; flex-wrap: wrap; max-width: 150px; }
.mini span { width: 7px; height: 7px; background: var(--line); }
.mini span.on { background: var(--c, var(--emeraude)); }
.prof-table tr.detail td { background: var(--surface); padding: 22px; }
.prof-table tr.is-open td { border-bottom-color: transparent; }
.detail-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 24px 36px; }
@media (max-width: 900px) { .detail-grid { grid-template-columns: 1fr; } }
.detail-grid h4 { margin: 0 0 10px; font-family: var(--display); font-size: 0.9375rem; font-weight: 600; }
.skills-recap { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.skills-recap li { display: grid; gap: 4px; }
.skills-recap .t { font-family: var(--ui); font-size: 0.75rem; font-weight: 500; }
.skills-recap .s { display: flex; flex-wrap: wrap; gap: 4px 6px; }
.skills-recap .s span { font-size: 0.8125rem; padding: 2px 8px; border: 1px solid var(--line); color: var(--muted); background: var(--paper); }
.skills-recap .s span.on { border-color: var(--emeraude); color: var(--ink); background: var(--hl-ok); }
.detail-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 18px; }
.nouveau-code { font-family: var(--ui); font-size: var(--step--1); }
.nouveau-code code { font-weight: 600; font-size: 1.125rem; background: var(--paper); padding: 2px 10px; border: 1px dashed var(--ink); letter-spacing: 0.1em; }
.mini-hist { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.mini-hist td, .mini-hist th { padding: 6px 8px 6px 0; border-bottom: 1px solid var(--line); text-align: left; font-variant-numeric: tabular-nums; }
.mini-hist th { font-family: var(--ui); font-size: 0.625rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); font-weight: 500; }
.btn-danger { background: var(--rose); border-color: var(--rose); color: var(--paper); }
.btn-danger:hover { background: transparent; color: var(--rose); }
#vue-eleve { display: grid; gap: 24px; }
#vue-eleve .hello, #vue-eleve .resume { margin-bottom: 0; }
@media (max-width: 520px) {
  .brand small { display: none; }
  .site-header .wrap { gap: 10px; }
}

/* ---------- Centre de jour : accueil ---------- */

.badge {
  display: inline-block;
  background: var(--cobalt);
  color: var(--paper);
  font-family: var(--ui);
  font-size: 0.6875rem;
  font-weight: 500;
  padding: 3px 8px;
  line-height: 1.3;
  vertical-align: middle;
}

/* À la une */
.feature {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: 40px;
  align-items: center;
  text-decoration: none;
}
.feature .cover { aspect-ratio: 5 / 4; }
.feature-body { display: grid; gap: 16px; justify-items: start; min-width: 0; }
.feature h3 { font-size: var(--step-3); }
.feature:hover h3 { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 0.12em; }
.feature-cta { margin-top: 6px; }
.feature:hover .feature-cta { background: transparent; color: var(--ink); }
@media (max-width: 800px) { .feature { grid-template-columns: 1fr; gap: 20px; } }

/* La semaine */
.semaine {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}
.jour {
  display: grid;
  grid-template-rows: auto 1fr;
  background: var(--surface);
  border-top: 4px solid var(--line);
  min-width: 0;
}
.jour.is-today { border-top-color: var(--cobalt); box-shadow: 0 0 0 2px var(--cobalt); }
.jour-tete { padding: 16px 16px 12px; display: grid; gap: 4px; border-bottom: 1px solid var(--line); }
.jour-tete h3 { font-size: 1.0625rem; display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.jour-tete h3 span { font-family: var(--ui); font-weight: 400; font-size: 0.75rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.jour-tete .badge { justify-self: start; }
.ouvert { font-family: var(--ui); font-size: 0.75rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.creneaux { list-style: none; margin: 0; padding: 8px 16px 16px; display: grid; gap: 0; align-content: start; }
.creneau { display: grid; gap: 2px; padding-block: 10px; border-bottom: 1px solid var(--line); }
.creneau:last-child { border-bottom: 0; }
.creneau time { font-family: var(--ui); font-size: 0.6875rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.creneau a {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  font-family: var(--display);
  font-weight: 600;
  font-size: 0.875rem;
  line-height: 1.3;
  text-decoration: none;
}
.creneau a::before { content: ""; width: 9px; height: 9px; background: var(--c, var(--line)); flex-shrink: 0; transform: translateY(-1px); }
.creneau a:hover { text-decoration: underline; }
.creneau.repas a { font-family: var(--text); font-weight: 400; font-style: italic; color: var(--muted); font-size: 0.9375rem; }
.creneau.repas a::before { background: transparent; border: 1px solid var(--muted); width: 7px; height: 7px; }
@media (max-width: 1000px) { .semaine { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 640px) { .semaine { grid-template-columns: 1fr; } }

/* Menus */
.menus {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0;
  border-top: 2px solid var(--ink);
}
.menu {
  display: grid;
  gap: 10px;
  align-content: start;
  padding: 18px 18px 20px;
  border-right: 1px solid var(--line);
  min-width: 0;
}
.menu:last-child { border-right: 0; }
.menu.is-today { background: var(--surface); box-shadow: inset 0 4px 0 var(--safran); }
.menu-jour { font-family: var(--ui); font-size: 0.75rem; font-weight: 500; color: var(--muted); display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.menu-plat { font-family: var(--display); font-weight: 600; font-size: 1.0625rem; line-height: 1.3; }
.menu-plus { margin: 0; display: grid; gap: 6px; }
.menu-plus dt { font-family: var(--ui); font-size: 0.625rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
.menu-plus dd { margin: 0; font-size: 0.9375rem; line-height: 1.35; }
@media (max-width: 1000px) {
  .menus { grid-template-columns: 1fr; }
  .menu { grid-template-columns: 9rem minmax(0, 1fr); border-right: 0; border-bottom: 1px solid var(--line); }
  .menu-jour { grid-row: span 2; align-self: start; }
}
@media (max-width: 520px) {
  .menu { grid-template-columns: 1fr; }
  .menu-jour { grid-row: auto; }
}

/* Cartes des ateliers */
.atelier-card .cover { aspect-ratio: 4 / 3; }
.atelier-card .quand { font-family: var(--ui); font-size: 0.75rem; color: var(--ink); }
a.atelier-card:hover h3 { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 0.15em; }

.a-completer {
  font-family: var(--ui);
  font-size: 0.875rem;
  font-weight: 400;
  color: var(--muted);
  border: 1px dashed var(--muted);
  padding: 2px 8px;
}

/* ---------- Page des ateliers ---------- */

.page-head .filters { margin-top: 8px; }
.page-head .filters .filter { text-decoration: none; }
.descriptifs { display: grid; gap: 0; }
.descriptif {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: 28px 48px;
  align-items: start;
  padding-block: 40px;
  border-bottom: 1px solid var(--line);
  scroll-margin-top: 80px;
}
.descriptif:first-child { padding-top: 0; }
.descriptif .cover { aspect-ratio: 4 / 3; }
.descriptif-body { display: grid; gap: 14px; min-width: 0; }
.descriptif-body h2 { font-size: var(--step-3); display: flex; align-items: center; gap: 14px; }
.descriptif-body h2::before { content: ""; width: 20px; height: 20px; background: var(--c); flex-shrink: 0; }
.descriptif-body > p { max-width: 60ch; font-size: 1.125rem; }
.descriptif .facts { margin-top: 6px; }
.descriptif .facts dd { font-size: 0.875rem; }
.descriptif:target .cover { box-shadow: 0 0 0 3px var(--c); }
@media (max-width: 800px) {
  .descriptif { grid-template-columns: 1fr; gap: 20px; }
  .descriptif .cover { aspect-ratio: 2 / 1; }
}
@media (max-width: 480px) {
  .descriptif .facts { grid-template-columns: 1fr; }
}
#infos-liste dd { font-size: 1.125rem; }
.infos-lien { margin-top: 18px; }
.selectable { user-select: all; -webkit-user-select: all; word-break: break-all; }

/* ---------- Semaine publiée ---------- */
.chargement { grid-column: 1 / -1; color: var(--muted); font-family: var(--ui); font-size: var(--step--1); padding: 24px 0; list-style: none; }
.semaine-message {
  margin: -8px 0 18px;
  padding: 12px 16px;
  background: var(--surface);
  border-left: 4px solid var(--emeraude);
  font-size: 1rem;
  max-width: 80ch;
}
.semaine-message.is-apercu { background: var(--safran); color: var(--p-noir); border-left-color: var(--p-noir); font-family: var(--ui); font-size: var(--step--1); font-weight: 500; }
.jour.is-ferme { opacity: 0.75; }
.jour-ferme, .jour-note { padding: 14px 16px 18px; font-size: 0.9375rem; color: var(--muted); font-style: italic; }
.jour-note { padding-top: 0; }
.creneau .nom { font-family: var(--display); font-weight: 600; font-size: 0.875rem; line-height: 1.3; display: inline-flex; gap: 8px; align-items: baseline; }
.creneau .nom::before { content: ""; width: 9px; height: 9px; background: var(--muted); flex-shrink: 0; }
.creneau .precision { font-size: 0.875rem; color: var(--muted); line-height: 1.35; }
.menu-vide { color: var(--muted); font-family: var(--text); font-weight: 400; font-style: italic; }
.menus.is-vide { border-top-color: var(--line); grid-template-columns: 1fr; }
.menus-vide { padding: 20px 0; color: var(--muted); font-style: italic; list-style: none; }
.semaine-onglets { margin: -12px 0 18px; }

/* ---------- Gestion de la semaine ---------- */

.g-head { padding-block: 36px 24px; }
.g-head h1 { font-size: var(--step-3); }
.g-app { padding-block: 28px 56px; }
.g-layout {
  display: grid;
  grid-template-columns: minmax(230px, 280px) minmax(0, 1fr);
  gap: 28px 40px;
  align-items: start;
}
@media (max-width: 960px) { .g-layout { grid-template-columns: 1fr; } }

.g-side { display: grid; gap: 14px; position: sticky; top: 92px; min-width: 0; }
@media (max-width: 960px) { .g-side { position: static; } }
.g-side .demo-banner { margin: 0; }
.g-side-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.g-side-head h2 { font-size: 1.125rem; }
.g-nouvelle { display: grid; gap: 12px; padding: 16px; background: var(--surface); }
.g-nouvelle select, .g-layout select {
  font: inherit;
  font-family: var(--ui);
  font-size: 0.875rem;
  color: var(--ink);
  background: var(--paper);
  border: 2px solid var(--ink);
  padding: 8px 10px;
  width: 100%;
  min-width: 0;
}
.g-liste { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.g-liste li { border-bottom: 1px solid var(--line); }
.g-liste-vide { padding: 14px 0; color: var(--muted); font-style: italic; }
.g-item {
  width: 100%;
  display: grid;
  gap: 6px;
  justify-items: start;
  padding: 12px 12px 12px 14px;
  background: transparent;
  border: 0;
  border-left: 4px solid transparent;
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.g-item:hover { background: var(--surface); }
.g-item[aria-current="true"] { background: var(--surface); border-left-color: var(--ink); }
.g-item strong { font-family: var(--display); font-weight: 600; font-size: 0.9375rem; }
.g-item.passee strong { color: var(--muted); }
.g-cette { font-family: var(--ui); font-size: 0.6875rem; color: var(--muted); }

.g-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--ui);
  font-size: 0.6875rem;
  font-weight: 500;
  padding: 3px 8px;
  border: 1px solid var(--line);
  color: var(--muted);
  background: var(--paper);
  line-height: 1.3;
}
.g-pill::before { content: ""; width: 7px; height: 7px; background: var(--line); }
.g-pill.enligne { border-color: var(--emeraude); color: var(--ink); }
.g-pill.enligne::before { background: var(--emeraude); }
.g-pill.programmee { border-color: var(--safran); color: var(--ink); }
.g-pill.programmee::before { background: var(--safran); }
.g-pill.brouillon { border-style: dashed; }

.g-main { min-width: 0; }
.g-vide { padding: 40px 28px; background: var(--surface); display: grid; gap: 8px; }
.g-vide h2 { font-size: var(--step-1); }
.g-vide p { color: var(--muted); }
#g-editeur { display: grid; gap: 22px; }
#g-editeur[hidden] { display: none; }
.g-titre { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 10px 20px; }
.g-titre h2 { font-size: var(--step-2); margin-top: 8px; }
.g-titre .eyebrow { text-transform: none; letter-spacing: 0; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.g-maj { font-family: var(--ui); font-size: 0.6875rem; color: var(--muted); }
.g-dirty { font-family: var(--ui); font-size: 0.75rem; font-weight: 500; background: var(--safran); color: var(--p-noir); padding: 4px 10px; }

.g-diffusion { border: 2px solid var(--ink); padding: 18px 20px 20px; margin: 0; display: grid; gap: 14px; min-width: 0; }
.g-diffusion legend { font-family: var(--display); font-weight: 600; font-size: 1rem; padding: 0 8px; margin-left: -8px; }
.g-radios { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 640px) { .g-radios { grid-template-columns: 1fr; } }
.g-radio {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 12px 14px;
  border: 1px solid var(--line);
  cursor: pointer;
  background: var(--paper);
}
.g-radio:has(input:checked) { border-color: var(--ink); background: var(--surface); box-shadow: inset 4px 0 0 var(--ink); }
.g-radio input { margin: 3px 0 0; width: 18px; height: 18px; accent-color: var(--ink); }
.g-radio span { display: grid; gap: 2px; }
.g-radio b { font-family: var(--ui); font-weight: 600; font-size: 0.875rem; }
.g-radio small { font-size: 0.875rem; color: var(--muted); line-height: 1.35; }
.g-quand { display: flex; flex-wrap: wrap; gap: 12px 16px; }
.g-quand .field { flex: 0 1 200px; }
.g-aide { font-size: 1rem; color: var(--ink); background: var(--surface); padding: 10px 14px; line-height: 1.45; }
.facultatif { font-weight: 400; color: var(--muted); font-size: 0.75rem; }
.field input[type="date"], .field input[type="time"] { font-variant-numeric: tabular-nums; }

.g-tabs { display: flex; gap: 0; border-bottom: 2px solid var(--ink); }
.g-tabs button {
  font-family: var(--ui);
  font-size: var(--step--1);
  font-weight: 500;
  padding: 12px 18px;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  margin-bottom: -2px;
  border-bottom: 4px solid transparent;
}
.g-tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--ink); }

.g-jours, .g-menus { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.g-jour, .g-menu {
  display: grid;
  gap: 12px;
  padding: 18px 20px 20px;
  background: var(--surface);
  min-width: 0;
}
.g-jour.is-ferme, .g-menu.is-ferme { background: transparent; border: 1px dashed var(--line); }
.g-jour-tete { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.g-jour h3, .g-menu h3 { font-size: 1.0625rem; }
.g-jour h3 span, .g-menu h3 span { font-family: var(--ui); font-weight: 400; font-size: 0.75rem; color: var(--muted); }
.g-note { max-width: 520px; }
.g-ouv { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-family: var(--ui); font-size: var(--step--1); }
.g-layout input[type="time"], .g-layout input[type="text"].g-precision {
  font: inherit;
  font-family: var(--ui);
  font-size: 0.875rem;
  color: var(--ink);
  background: var(--paper);
  border: 2px solid var(--ink);
  padding: 7px 8px;
  min-width: 0;
}
.g-creneaux { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.g-creneau {
  display: grid;
  grid-template-columns: auto minmax(160px, 1fr) minmax(140px, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 8px 8px 8px 12px;
  background: var(--paper);
  box-shadow: inset 4px 0 0 var(--c, var(--line));
}
.g-heures { display: flex; align-items: center; gap: 6px; }
.g-heures input { width: 8.6em; }
.g-retirer {
  font-family: var(--ui);
  font-size: 0.75rem;
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--line);
  padding: 7px 10px;
  cursor: pointer;
}
.g-retirer:hover { color: var(--rose); border-color: var(--rose); }
.g-ajouter { justify-self: start; }
@media (max-width: 760px) {
  .g-creneau { grid-template-columns: 1fr auto; }
  .g-creneau select, .g-creneau .g-precision { grid-column: 1 / -1; }
  .g-heures { grid-column: 1; }
  .g-retirer { grid-column: 2; grid-row: 1; }
}
.g-menu { grid-template-columns: 9rem repeat(3, minmax(0, 1fr)); align-items: end; }
.g-menu h3 { align-self: center; }
.g-ferme-txt { grid-column: 2 / -1; color: var(--muted); font-style: italic; }
@media (max-width: 900px) {
  .g-menu { grid-template-columns: 1fr; }
  .g-ferme-txt { grid-column: auto; }
}

.g-actions {
  position: sticky;
  bottom: 0;
  z-index: 5;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 10px 16px;
  padding: 14px 0 calc(14px + env(safe-area-inset-bottom, 0px));
  background: var(--paper);
  border-top: 1px solid var(--line);
}
.g-actions .form-status { flex-basis: 100%; }

/* =====================================================================
   STYLE MOZAIKMAG.CH
   Les règles ci-dessous reprennent l'allure de mozaikmag.ch et remplacent
   celles du dessus quand elles se recoupent.
   ===================================================================== */

body {
  font-family: var(--text);
  font-size: var(--step-0);
  line-height: 1.65;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { font-family: var(--display); font-weight: 500; letter-spacing: -0.015em; line-height: 1.12; }
a { text-decoration-thickness: 1.5px; text-underline-offset: 0.18em; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 6px; }

/* --- En-tête --- */
body::before { background: var(--paper); }
.site-header {
  background: rgba(250, 247, 242, 0.9);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--line);
  transition: background-color 0.25s, color 0.25s, border-color 0.25s;
}
.site-header .wrap { min-height: var(--header-h); }
.brand {
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.4rem;
  letter-spacing: -0.02em;
  gap: 10px;
  align-items: center;
}
.logo-mark { flex-shrink: 0; }
.logo-word em { font-style: italic; font-weight: 400; }
.brand small {
  font-family: var(--ui);
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: 0.02em;
  margin-left: 2px;
  transform: translateY(1px);
}
.nav { font-family: var(--ui); font-size: 0.94rem; font-weight: 500; gap: 4px 22px; }
.nav a { border-bottom-width: 2px; }
.nav a:hover, .nav a[aria-current="page"] { border-bottom-color: currentColor; }

/* En-tête posé sur l'article à la une (accueil) */
.site-header.sur-une:not(.is-solid) {
  background: transparent;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  border-bottom-color: transparent;
  color: #ffffff;
}
.site-header.sur-une:not(.is-solid) .brand small { color: rgba(255, 255, 255, 0.8); }
.site-header.sur-une:not(.is-solid) .btn { background: #ffffff; color: var(--ink); border-color: #ffffff; }
.site-header.sur-une:not(.is-solid) .btn-ghost { background: transparent; color: #ffffff; border-color: rgba(255, 255, 255, 0.7); }
.site-header.sur-une:not(.is-solid) .logo-word { text-shadow: 0 1px 12px rgba(0, 0, 0, 0.25); }
@media (max-width: 920px) {
  .site-header .wrap { padding-block: 10px; min-height: var(--header-h); }
  .nav.is-open a { font-family: var(--display); font-size: 1.35rem; font-weight: 500; }
}

/* --- Boutons --- */
.btn {
  border-radius: 999px;
  font-family: var(--ui);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 12px 22px;
  border: 2px solid var(--ink);
  background: var(--ink);
  color: #ffffff;
  transition: background-color 0.2s, color 0.2s, border-color 0.2s, transform 0.2s;
}
.btn:hover { background: var(--ink-2); border-color: var(--ink-2); color: #ffffff; }
.btn-ghost { background: transparent; color: var(--ink); border: 1.5px solid var(--line-strong); }
.btn-ghost:hover { background: var(--card); color: var(--ink); border-color: var(--ink); }
.btn-sm { padding: 8px 15px; font-size: 0.84rem; }
.btn-light { background: #ffffff; color: var(--ink); border-color: #ffffff; }
.btn-light:hover { background: #ffffff; color: var(--ink); border-color: #ffffff; transform: translateX(3px); }
.btn:disabled:hover { background: var(--ink); color: #ffffff; }
.btn-ghost:disabled:hover { background: transparent; color: var(--ink); }
.btn-danger { background: var(--rose); border-color: var(--rose); color: #ffffff; }
.btn-danger:hover { background: #b01f57; border-color: #b01f57; color: #ffffff; }
.link-more {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--ui);
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  padding: 6px 0;
  border-bottom: 2px solid var(--c, var(--ink));
  transition: gap 0.2s;
}
.link-more:hover { gap: 12px; }

/* --- Étiquettes de rubrique : pastilles arrondies --- */
.rubrique {
  padding: 0.35em 0.9em 0.35em 0.7em;
  border-radius: 999px;
  background: color-mix(in srgb, var(--c, var(--ink)) 14%, #ffffff);
  color: color-mix(in srgb, var(--c, var(--ink)) 58%, #141414);
  font-family: var(--ui);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  line-height: 1.3;
}
.rubrique::before { width: 8px; height: 8px; border-radius: 50%; }
.rubrique.on-image { background: #ffffff; color: var(--ink); }
.eyebrow { font-family: var(--ui); font-size: 0.75rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.meta { font-family: var(--ui); font-size: 0.84rem; color: var(--muted); }
.badge { border-radius: 999px; padding: 3px 10px; font-family: var(--ui); font-weight: 600; background: var(--ink); color: #ffffff; }
.lesson-when .badge { border-radius: 999px; background: var(--cobalt); }

/* --- Filtres --- */
.filter {
  border-radius: 999px;
  border: 1.5px solid var(--line-strong);
  background: var(--card);
  font-family: var(--ui);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 8px 15px;
}
.filter::before { border-radius: 50%; }
.filter:hover { border-color: var(--ink); }

/* --- Sections --- */
.section { padding-block: clamp(48px, 7vw, 88px); }
.section + .section { border-top: 0; }
.section-head { align-items: flex-end; margin-bottom: clamp(24px, 3vw, 40px); gap: 16px 24px; }
.section-head .titres { display: grid; gap: 4px; }
.section-head h2 { font-size: var(--step-3); font-weight: 500; gap: 16px; }
.section-head h2::before { width: clamp(28px, 3vw, 38px); height: clamp(28px, 3vw, 38px); border-radius: 50%; }
.section-head .intro { font-family: var(--display); font-style: italic; font-size: 1.12rem; color: var(--ink-2); max-width: 56ch; }
.section-head .titres .intro { padding-left: calc(clamp(28px, 3vw, 38px) + 16px); }
.page-head { border-bottom: 0; padding-block: clamp(40px, 6vw, 72px) 24px; }
.page-head h1 { font-weight: 450; letter-spacing: -0.03em; }
.page-head .chapo { font-family: var(--display); font-style: italic; color: var(--ink-2); }
.chapo { color: var(--ink-2); line-height: 1.5; }

/* --- Cartes et images --- */
.cover { border-radius: var(--radius); background: var(--surface); }
.card { gap: 16px; }
.card h3 { font-size: clamp(1.2rem, 1.6vw, 1.4rem); font-weight: 500; line-height: 1.2; }
.card.wide h3 { font-size: clamp(1.4rem, 2.2vw, 1.8rem); }
.card p { color: var(--ink-2); font-size: 0.98rem; line-height: 1.55; }
a.card:hover h3 { text-decoration: underline; text-decoration-color: var(--c, var(--ink)); text-decoration-thickness: 3px; text-underline-offset: 5px; }
a.card .cover canvas { transition: transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1); }
a.card:hover .cover canvas { transform: scale(1.04); }
.grid { gap: clamp(28px, 3vw, 40px) clamp(20px, 2.4vw, 32px); }

/* --- Formulaires --- */
.field input, .field select, .typing input, .form input[type="email"], .form input[type="text"], .form textarea,
.g-layout select, .g-nouvelle select, .g-layout input[type="time"], .g-layout input[type="text"].g-precision {
  border: 1.5px solid var(--line-strong);
  border-radius: 10px;
  background: var(--card);
  font-family: var(--ui);
  color: var(--ink);
}
.field input:focus, .field select:focus, .typing input:focus, .g-layout select:focus, .g-layout input:focus { border-color: var(--ink); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 22%, transparent); }
.field label { font-family: var(--ui); font-weight: 600; font-size: 0.875rem; }
.check { border-radius: 6px; border: 2px solid var(--line-strong); background: var(--card); }
.check:checked { border-color: var(--c, var(--cobalt)); }
.check::after { border-radius: 3px; }
.panel { border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--card); box-shadow: var(--shadow); }
.panel.soft { background: var(--surface); border-color: transparent; box-shadow: none; }
.panel h2 { font-weight: 500; }
.panel h2::before { border-radius: 50%; }
.notice { border-radius: 12px; border-left: 0; background: color-mix(in srgb, var(--safran) 18%, #ffffff); }
.demo-banner { border-radius: 12px; }
.status, .aside-box, .dl-tip, .g-aide, .semaine-message, .recap { border-radius: 12px; }
.aside-box { background: var(--card); border: 1px solid var(--line); }
.aside-box h4::before { border-radius: 50%; }

/* =====================================================================
   ACCUEIL DU CENTRE DE JOUR
   ===================================================================== */

/* Article à la une, en grand, comme sur mozaikmag.ch */
.une {
  position: relative;
  margin-top: calc(-1 * var(--header-h));
  min-height: clamp(460px, 66vh, 680px);
  display: grid;
  align-items: end;
  color: #ffffff;
  overflow: hidden;
  background: #1c1a1f;
}
.une-media { position: absolute; inset: 0; }
.une-media .cover { position: absolute; inset: 0; border-radius: 0; height: 100%; }
.une-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; max-width: none; }
.une-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(20, 20, 20, 0.55) 0%, rgba(20, 20, 20, 0.12) 32%, rgba(20, 20, 20, 0.35) 60%, rgba(20, 20, 20, 0.78) 100%);
}
.une-content {
  position: relative;
  width: 100%;
  display: grid;
  gap: 14px;
  justify-items: start;
  padding-top: calc(var(--header-h) + 56px);
  padding-bottom: clamp(40px, 6vw, 72px);
}
.une-kicker { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; }
.une-flag { font-family: var(--ui); font-size: 0.75rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: rgba(255, 255, 255, 0.92); }
.une-titre { font-size: clamp(2.4rem, 6vw, 4rem); font-weight: 450; letter-spacing: -0.028em; line-height: 1.02; max-width: 18ch; color: #ffffff; }
.une-titre a { color: inherit; text-decoration: none; }
.une-titre a:hover { text-decoration: underline; text-decoration-thickness: 3px; text-underline-offset: 6px; }
.une-dek { font-size: clamp(1.05rem, 1.6vw, 1.25rem); color: rgba(255, 255, 255, 0.92); max-width: 52ch; }
.une-meta { font-family: var(--ui); font-size: 0.9rem; color: rgba(255, 255, 255, 0.82); }
.une .btn-light { margin-top: 8px; }

/* Aujourd'hui */
.auj { position: relative; z-index: 2; margin-top: -32px; }
.auj-card {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) auto;
  gap: 18px 32px;
  align-items: center;
  background: var(--card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: clamp(20px, 3vw, 32px) clamp(20px, 3.4vw, 40px);
}
.auj-texte { display: grid; gap: 4px; }
.auj-texte .eyebrow { margin: 0; }
.auj-titre { font-family: var(--display); font-weight: 500; font-size: clamp(1.4rem, 2.2vw, 1.8rem); line-height: 1.15; }
#auj-texte { color: var(--ink-2); }
.auj-liens { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
@media (max-width: 820px) {
  .auj-card { grid-template-columns: 1fr; }
  .auj-liens { justify-content: flex-start; }
}
.issue { border-left-color: var(--cobalt); }

/* La semaine */
.semaine { gap: 14px; }
.jour { background: var(--card); border-top: 0; border-radius: var(--radius); box-shadow: 0 1px 2px rgba(20, 20, 20, 0.05); border: 1px solid var(--line); overflow: hidden; }
.jour.is-today { border-color: var(--cobalt); box-shadow: 0 0 0 2px var(--cobalt); }
.jour-tete { border-bottom-color: var(--line); padding: 18px 18px 12px; }
.jour-tete h3 { font-size: 1.25rem; }
.jour-tete h3 span { font-family: var(--ui); }
.creneaux { padding: 6px 18px 18px; }
.creneau a, .creneau .nom { font-family: var(--ui); font-weight: 600; font-size: 0.92rem; }
.creneau a::before, .creneau .nom::before { border-radius: 50%; width: 10px; height: 10px; }
.creneau.repas a { font-family: var(--display); font-style: italic; font-weight: 400; font-size: 1rem; }
.creneau.repas a::before { border-radius: 50%; }
.semaine-onglets .filter[aria-pressed="true"] { background: var(--ink); color: #ffffff; border-color: var(--ink); }
.semaine-message { background: color-mix(in srgb, var(--emeraude) 12%, #ffffff); border-left: 0; }

/* Menus */
.menus { border-top: 0; gap: 14px; }
.menu { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.menu:last-child { border-right: 1px solid var(--line); }
.menu.is-today { background: color-mix(in srgb, var(--safran) 14%, #ffffff); border-color: var(--safran); box-shadow: none; }
.menu-plat { font-family: var(--display); font-weight: 500; font-size: 1.2rem; line-height: 1.25; }
.menu-jour { font-family: var(--ui); font-weight: 700; font-size: 0.75rem; letter-spacing: 0.08em; text-transform: uppercase; }
@media (max-width: 1000px) {
  .menu { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
}

/* Ateliers : cartes « Explorer par rubrique » */
.ateliers-grille { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(14px, 1.6vw, 20px); }
@media (max-width: 1100px) { .ateliers-grille { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 800px) { .ateliers-grille { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 480px) { .ateliers-grille { grid-template-columns: 1fr; } }
.atelier-card {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 6px;
  min-height: 200px;
  padding: 24px 22px 20px;
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--c) 14%, #ffffff);
  color: var(--ink);
  text-decoration: none;
  transition: transform 0.25s cubic-bezier(0.2, 0.7, 0.2, 1), box-shadow 0.25s;
}
.atelier-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.atelier-card h3 { font-size: clamp(1.25rem, 1.7vw, 1.45rem); padding-right: 56px; }
.atelier-card p { font-size: 0.92rem; color: var(--ink-2); line-height: 1.45; }
.atelier-card .quand { margin-top: 6px; font-family: var(--ui); font-size: 0.8rem; font-weight: 700; color: color-mix(in srgb, var(--c) 58%, #141414); }
.atelier-card:hover .quand span { margin-left: 4px; }
.atelier-card .forme { position: absolute; top: 0; right: 0; width: 72px; height: 72px; background: var(--c); }
.forme-0 .forme { width: 92px; height: 92px; border-radius: 50%; top: -22px; right: -22px; }
.forme-1 .forme { width: 66px; height: 66px; border-radius: 14px; top: 0; right: 0; border-radius: 0 14px 0 14px; }
.forme-2 .forme { width: 76px; height: 76px; border-radius: 76px 0 0 0; top: 0; right: 0; transform: rotate(90deg); }
.forme-3 .forme { width: 84px; height: 42px; top: 0; right: 14px; border-radius: 0 0 42px 42px; }
.forme-4 .forme { width: 62px; height: 62px; top: -4px; right: 10px; transform: rotate(45deg); border-radius: 8px; }
.forme-5 .forme { width: 70px; height: 70px; top: 0; right: 0; clip-path: polygon(0 0, 100% 0, 100% 100%); }

/* Infos pratiques : panneau arrondi */
.infos { background: transparent; padding-block: clamp(24px, 4vw, 48px) clamp(56px, 7vw, 88px); }
.infos .wrap {
  width: min(100% - 32px, var(--wrap) - 32px);
  margin-inline: auto;
  padding: clamp(28px, 4vw, 56px);
  background: var(--surface);
  border-radius: var(--radius-lg);
}
.infos h2 { font-size: var(--step-3); font-weight: 500; }
.infos .intro { color: var(--ink-2); }
.contact-list dt { font-family: var(--ui); font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; font-size: 0.7rem; }
.contact-list dd { font-family: var(--display); font-weight: 500; }
.contact-list dd small { font-family: var(--ui); font-size: 0.9rem; }
.a-completer { border-radius: 999px; }

/* --- Pied de page --- */
.site-footer { border-top: 1px solid var(--line); background: var(--paper); padding-block: 56px 48px; }
.site-footer h2 { font-family: var(--ui); font-size: 0.75rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.site-footer a:hover { text-decoration: underline; text-decoration-color: var(--ink); }
.site-footer .fine { font-size: 0.9rem; }

/* --- Page des ateliers : composition de formes --- */
.formes {
  aspect-ratio: 4 / 3;
  max-width: 100%;
  border-radius: var(--radius-lg);
  background: color-mix(in srgb, var(--c) 14%, #ffffff);
  display: grid;
  place-items: center;
  overflow: hidden;
}
.formes-grille { width: 46%; aspect-ratio: 1; display: grid; grid-template-columns: 1fr 1fr; gap: 9%; }
.formes-grille span { display: block; aspect-ratio: 1; }
.formes-grille span:nth-child(1) { background: var(--c); border-radius: 50%; }
.formes-grille span:nth-child(2) { background: color-mix(in srgb, var(--c) 55%, #ffffff); border-radius: 0 100% 0 0; }
.formes-grille span:nth-child(3) { background: color-mix(in srgb, var(--c) 70%, #141414); clip-path: polygon(0 100%, 100% 100%, 100% 0); }
.formes-grille span:nth-child(4) { background: var(--c); border-radius: 18%; }
.formes-1 .formes-grille { transform: rotate(90deg); }
.formes-2 .formes-grille { transform: rotate(180deg); }
.formes-3 .formes-grille { transform: rotate(270deg); }
.descriptif { border-bottom-color: var(--line); }
.descriptif-body h2::before { border-radius: 50%; }
.descriptif:target .formes { box-shadow: 0 0 0 3px var(--c); }
@media (max-width: 800px) { .formes { aspect-ratio: 2 / 1; } .formes-grille { width: 30%; } }

/* =====================================================================
   PAGES DE L'ATELIER INFORMATIQUE ET ESPACES ÉQUIPE
   ===================================================================== */
.hero { border-bottom: 0; }
.hero-lede { font-family: var(--display); font-weight: 400; }
.issue-num { font-family: var(--display); font-weight: 500; }
.lesson h3 { font-weight: 500; }
.facts { border-color: var(--line); }
.facts dd { font-family: var(--display); font-weight: 500; font-size: 1.05rem; }
.steps-head h4 { font-weight: 600; }
.steps label::before { font-family: var(--display); }
.agenda time { font-family: var(--display); font-weight: 500; }
.agenda h3 { font-family: var(--display); font-weight: 500; }
.agenda li[aria-current="true"] h3 .open::after { border-radius: 999px; font-family: var(--ui); }
.carnet-top { border-radius: var(--radius); background: var(--card); border: 1px solid var(--line); }
.carnet-score { font-family: var(--display); font-weight: 500; }
.pixbar span { border-radius: 3px; }
.tracks .tile { gap: 3px; }
.tracks .tile span { border-radius: 3px; }
.track-head h3 { font-weight: 500; }
.links a { border-radius: var(--radius); background: var(--card); border-color: var(--line); }
.links strong { font-family: var(--display); font-weight: 500; font-size: 1.15rem; }
.promo-body h2 { font-weight: 500; }

/* Jeux */
.board { border-radius: var(--radius); overflow: hidden; gap: 5px; padding: 5px; background: var(--line); }
.cell { border-radius: 8px; }
.level { border-radius: 999px; font-family: var(--ui); font-weight: 600; }
.program { border-radius: var(--radius); border-color: var(--line-strong); }
.program button { border-radius: 999px; font-family: var(--ui); font-weight: 600; }
.status { font-family: var(--ui); }
.typing { border-radius: var(--radius-lg); background: var(--card); border: 1px solid var(--line); }
.word { font-family: var(--display); font-weight: 500; }
.stats dd { font-family: var(--display); font-weight: 500; }
.timebar { border-radius: 999px; overflow: hidden; }
.pixel-canvas { border-radius: var(--radius); }
.swatch { border-radius: 10px; }

/* Dactylo */
.seg { border: 1.5px solid var(--line-strong); border-radius: 999px; overflow: hidden; background: var(--card); }
.seg button { font-family: var(--ui); font-weight: 600; }
.seg button + button { border-left: 1.5px solid var(--line-strong); }
.seg button::before { border-radius: 50%; }
.dl-item { border-radius: 12px; border-left: 0; }
.dl-item[aria-current="true"] { background: var(--card); box-shadow: inset 4px 0 0 var(--c), 0 1px 2px rgba(20, 20, 20, 0.06); }
.dl-item strong { font-weight: 500; font-size: 1.05rem; }
.dl-list { border-top: 0; display: grid; gap: 4px; }
.dl-list li { border-bottom: 0; }
.pill { border-radius: 999px; }
.dl-stats dd { font-family: var(--display); font-weight: 500; }
.progress { border-radius: 999px; overflow: hidden; }
.texte-box { border-radius: var(--radius-lg); background: var(--card); border: 2px solid var(--line); }
.texte-box.is-focus { border-color: var(--ink); }
.texte-view::after { background: linear-gradient(to bottom, rgba(255, 255, 255, 0), var(--card)); }
.texte .ch.cur { border-radius: 3px; }
.pause { border-radius: var(--radius-lg); }
.pause span { border-radius: 999px; }
.key { border-radius: 7px; background: var(--card); }
.next-key b { border-radius: 6px; }
.legend li::before { border-radius: 50%; }
.dl-result { border-radius: var(--radius-lg); border: 1px solid var(--line); background: var(--card); box-shadow: var(--shadow); }
.note { border-radius: var(--radius); }
.note b { font-family: var(--display); font-weight: 600; }
.res-msg h2 { font-weight: 500; }
.bars .bar { border-radius: 6px 6px 0 0; }
.bars .goal em { background: var(--card); border-radius: 999px; }
.weak kbd { border-radius: 8px; border-color: var(--line-strong); }
.nc-bar i { border-radius: 2px; }

/* Comptes, suivi, gestion */
.tuile { border-top: 0; border-radius: var(--radius); background: color-mix(in srgb, var(--c) 12%, #ffffff); }
.tuile strong { font-family: var(--display); font-weight: 500; }
.code-classe code, .nouveau-code code { border-radius: 8px; }
.skills-recap .s span { border-radius: 999px; }
.prof-table tr.detail td { background: var(--card); }
.g-item { border-radius: 12px; border-left: 0; }
.g-item[aria-current="true"] { background: var(--card); box-shadow: inset 4px 0 0 var(--ink), 0 1px 2px rgba(20, 20, 20, 0.06); }
.g-liste { border-top: 0; display: grid; gap: 4px; }
.g-liste li { border-bottom: 0; }
.g-item strong { font-weight: 500; font-size: 1.05rem; }
.g-pill { border-radius: 999px; background: var(--card); }
.g-pill::before { border-radius: 50%; }
.g-vide { border-radius: var(--radius-lg); }
.g-diffusion { border: 1px solid var(--line-strong); border-radius: var(--radius-lg); background: var(--card); }
.g-radio { border-radius: 12px; }
.g-radio:has(input:checked) { box-shadow: inset 0 0 0 1.5px var(--ink); background: var(--paper); }
.g-jour, .g-menu { border-radius: var(--radius); background: var(--card); border: 1px solid var(--line); }
.g-jour.is-ferme, .g-menu.is-ferme { background: transparent; }
.g-creneau { border-radius: 10px; background: var(--paper); box-shadow: inset 4px 0 0 var(--c, var(--line)); }
.g-retirer { border-radius: 999px; }
.g-tabs { border-bottom: 1px solid var(--line-strong); }
.g-tabs button { font-family: var(--ui); font-weight: 600; margin-bottom: -1px; border-bottom-width: 3px; }
.g-dirty { border-radius: 999px; }
.g-nouvelle { border-radius: var(--radius); }
.g-titre h2 { font-weight: 500; }

/* Retouches */
.rubrique { width: fit-content; justify-self: start; }
.section { padding-block: clamp(40px, 6vw, 72px); }
.une-shade {
  background:
    linear-gradient(90deg, rgba(20, 20, 20, 0.6) 0%, rgba(20, 20, 20, 0.25) 55%, rgba(20, 20, 20, 0) 80%),
    linear-gradient(180deg, rgba(20, 20, 20, 0.5) 0%, rgba(20, 20, 20, 0.1) 30%, rgba(20, 20, 20, 0.35) 60%, rgba(20, 20, 20, 0.8) 100%);
}
.une-titre, .une-dek, .une-meta { text-shadow: 0 1px 18px rgba(0, 0, 0, 0.25); }

/* Neuf ateliers : trois colonnes, sans carte isolée */
.ateliers-grille { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 800px) { .ateliers-grille { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 480px) { .ateliers-grille { grid-template-columns: 1fr; } }
@media (min-width: 481px) and (max-width: 800px) { .ateliers-grille > :last-child:nth-child(odd) { grid-column: span 2; } }

/* Plat sur 3 lignes (gestion des menus) */
.g-layout textarea {
  font: inherit;
  font-family: var(--ui);
  font-size: 0.875rem;
  line-height: 1.45;
  color: var(--ink);
  background: var(--card);
  border: 1.5px solid var(--line-strong);
  border-radius: 10px;
  padding: 8px 10px;
  width: 100%;
  min-width: 0;
  resize: none;
}
.g-layout textarea:focus { border-color: var(--ink); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 22%, transparent); }
.g-menu { align-items: start; }
.g-menu h3 { align-self: start; padding-top: 28px; }
@media (max-width: 900px) { .g-menu h3 { padding-top: 0; } }

/* Atelier info : bouton du compte compact sur téléphone, pour garder l'en-tête sur une ligne */
@media (max-width: 920px) {
  .site-header .btn-compte { padding: 8px 14px; font-size: 0.84rem; }
  .site-header .btn-compte + .menu-toggle, .site-header .menu-toggle { padding: 8px 14px; font-size: 0.84rem; }
}
@media (max-width: 380px) {
  .site-header .brand small { display: none; }
}
@media (max-width: 920px) {
  .site-header .wrap:not(:has(.btn-compte)) .menu-toggle { margin-left: auto; }
}

/* Créations avec une vraie image (envoyée depuis la page Gestion de l'atelier) */
.cover-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; max-width: none; }

/* =====================================================================
   GESTION DE L'ATELIER (gestion.html du sous-domaine)
   ===================================================================== */
.ga-puces { margin: 0; padding-left: 1.1em; display: grid; gap: 6px; color: var(--ink-2); }
.ga-tabs { margin-bottom: 28px; overflow-x: auto; scrollbar-width: thin; }
.ga-tabs button { white-space: nowrap; }
.ga-point { color: var(--safran); font-size: 0.7em; vertical-align: 0.15em; margin-left: 2px; }
.ga-layout.ga-seul { grid-template-columns: minmax(0, 760px); }
.ga-aide-liste { margin: 0; font-size: 0.875rem; }
.ga-groupe { padding: 14px 0 6px; font-family: var(--ui); font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); border-bottom: 0 !important; }
.ga-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.g-pill.ga-pill-err { border-color: var(--rose); color: var(--ink); }
.g-pill.ga-pill-err::before { background: var(--rose); }
#ga-editeur { display: grid; gap: 20px; }
.ga-champs { display: grid; gap: 18px; }
.ga-champs .field-row { align-items: start; }
.ga-field textarea { resize: vertical; }
.ga-field .aide { margin: 0; }
.ga-field input[type="text"], .ga-field input[type="url"], .ga-field input[type="date"] { width: 100%; min-width: 0; }
.ga-label { font-family: var(--ui); font-weight: 600; font-size: 0.875rem; }
.ga-sprites { display: grid; grid-template-columns: repeat(auto-fill, minmax(52px, 1fr)); gap: 8px; max-width: 640px; }
.ga-sprite {
  position: relative;
  padding: 3px;
  border: 2px solid transparent;
  border-radius: 12px;
  background: transparent;
  cursor: pointer;
  line-height: 0;
}
.ga-sprite .cover { display: block; aspect-ratio: 1 / 1; border-radius: 8px; }
.ga-sprite:hover { border-color: var(--line-strong); }
.ga-sprite[aria-checked="true"] { border-color: var(--ink); box-shadow: 0 0 0 2px var(--paper) inset; }
.ga-image { display: grid; gap: 10px; justify-items: start; }
.ga-image img { max-width: min(100%, 360px); max-height: 260px; width: auto; height: auto; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); }
.ga-image-vide { width: min(100%, 240px); aspect-ratio: 4 / 3; display: grid; place-items: center; border: 1.5px dashed var(--line-strong); border-radius: var(--radius); color: var(--muted); font-family: var(--ui); font-size: 0.875rem; }
.ga-fichier { cursor: pointer; }
.ga-image input[type="file"]:focus-visible + .btn, .ga-fichier:focus-within { outline: 3px solid var(--focus); }
.ga-case-label { display: inline-flex; gap: 10px; align-items: center; font-family: var(--ui); font-size: 0.9375rem; cursor: pointer; }
.ga-comp { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; counter-reset: comp; }
.ga-comp li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: center; counter-increment: comp; }
.ga-comp li::before { content: counter(comp); font-family: var(--ui); font-size: 0.75rem; color: var(--muted); min-width: 1.4em; text-align: right; }
.ga-comp input { width: 100%; min-width: 0; padding: 9px 12px; font-size: 0.9375rem; border: 1.5px solid var(--line-strong); border-radius: 10px; background: var(--card); font-family: var(--ui); color: var(--ink); }
.ga-comp input:focus { border-color: var(--ink); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 22%, transparent); }
.ga-item-actions { border-top: 1px solid var(--line); padding-top: 16px; }
.ga-item-actions .ga-suppr { margin-left: auto; }
.ga-item-actions .ga-suppr.is-arme { background: var(--rose); border-color: var(--rose); color: #ffffff; }
.ga-barre { margin-top: 24px; }
.ga-maj { flex-basis: 100%; margin: 0; font-family: var(--ui); font-size: 0.75rem; color: var(--muted); }
@media (max-width: 640px) {
  .ga-champs .field-row { grid-template-columns: 1fr; }
  .ga-comp li { grid-template-columns: minmax(0, 1fr) auto; }
  .ga-comp li::before { display: none; }
}
#ga-editeur, .ga-champs, .ga-field { grid-template-columns: minmax(0, 1fr); min-width: 0; }
.ga-champs > *, .ga-champs .field-row > * { min-width: 0; }
.ga-sprite { min-width: 0; overflow: hidden; }
.ga-sprite .cover canvas { position: absolute; inset: 0; width: 100% !important; height: 100% !important; }
.ga-image { position: relative; }
.ga-image input[type="file"] { left: 0; top: 0; }
/* Pages de gestion : « Se déconnecter » et « Menu » côte à côte sur téléphone */
@media (max-width: 920px) {
  .site-header #btn-sortir { order: 2; margin-left: auto; padding: 7px 12px; font-size: 0.8rem; }
  .site-header .wrap:has(#btn-sortir:not([hidden])) .menu-toggle { margin-left: 0; }
}
