/* ============================================================
   Boîte à outils de l'éducatrice spécialisée — feuille de style
   Style « argile 3D » : crème, sauge, turquoise, corail, moutarde ;
   reliefs doux, grands rayons, cibles tactiles larges, mode sombre,
   mode « lecture facile ». Aucune ressource externe (CSP stricte).
   ============================================================ */

:root {
  /* Palette « argile » : crème, sauge, turquoise, corail, moutarde */
  --clay-cream: #f3e4cf;
  --clay-sage: #a1ad8b;
  --clay-teal: #6e9691;
  --clay-coral: #da7d68;
  --clay-mustard: #e59f50;

  --bg: #faf2e7;
  --surface: #fffaf2;
  --surface-2: #f3e4cf;
  --ink: #2e2219;            /* brun très foncé : 13:1 sur --bg */
  --ink-soft: #55453a;
  --muted: #62514a;          /* >= 5.5:1 sur --bg et sur --surface-2 */
  --line: #e2cfb4;           /* séparateurs décoratifs */
  --field-line: #7d6a5c;     /* bordures de champs : >= 3:1 */
  --focus: #1b4fc4;          /* anneau de focus : >= 3:1 sur les fonds clairs */

  --primary: #2f6560;        /* turquoise profond : texte blanc 6.6:1 */
  --primary-ink: #ffffff;
  --primary-soft: #dcebe7;
  --accent: #a8402b;         /* corail profond : texte blanc 6.4:1 */
  --accent-ink: #ffffff;
  --accent-soft: #fbe1d7;

  --ok: #2b6e3f;
  --ok-ink: #ffffff;
  --ok-soft: #e0f0d9;
  --warn: #d9941f;
  --warn-soft: #fcebc6;
  --warn-ink: #6e4a00;
  --danger: #b0303f;
  --danger-ink: #ffffff;
  --danger-soft: #fadcd9;
  --info: #2a5a8f;
  --info-soft: #dde9f3;

  --emo-vert: #4caf72;
  --emo-jaune: #f3c548;
  --emo-orange: #f0893f;
  --emo-rouge: #e04b4b;
  --emo-bleu: #4f8fd9;

  /* Bandeau de rubrique (modifié par body[data-nav]) */
  --band: var(--clay-cream);
  --band-ink: #2e2219;

  --radius: 26px;
  --radius-sm: 16px;
  /* Relief argile : reflet en haut, ombre propre en bas, ombre portée douce */
  --relief: inset 0 2px 0 rgba(255, 255, 255, 0.75), inset 0 -5px 10px rgba(140, 95, 50, 0.13);
  --shadow: 0 14px 30px rgba(120, 80, 40, 0.16), 0 3px 0 rgba(140, 95, 50, 0.08);
  --shadow-sm: 0 6px 14px rgba(120, 80, 40, 0.13), 0 2px 0 rgba(140, 95, 50, 0.07);
  --btn-relief: inset 0 2px 0 rgba(255, 255, 255, 0.38), inset 0 -4px 8px rgba(0, 0, 0, 0.16), 0 5px 0 rgba(0, 0, 0, 0.2), 0 9px 16px rgba(120, 80, 40, 0.22);
  --btn-relief-down: inset 0 2px 6px rgba(0, 0, 0, 0.22), 0 1px 0 rgba(0, 0, 0, 0.2);

  /* Pile de polices système : aucune requête vers un service tiers */
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Liberation Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji";
  --font-scale: 1;
  --tap: 48px;
}

:root[data-theme="dark"] {
  --bg: #1d1814;
  --surface: #2a231d;
  --surface-2: #3a3027;
  --ink: #f7ecdc;
  --ink-soft: #dccdb9;
  --muted: #bcaa95;
  --line: #4a3d31;
  --field-line: #9a8873;
  --focus: #8ab4ff;
  --primary: #7fbab3;
  --primary-ink: #11201e;
  --primary-soft: #263f3b;
  --accent: #f0a083;
  --accent-ink: #26120a;
  --accent-soft: #4b3025;
  --ok: #86cf91;
  --ok-ink: #0d1c11;
  --ok-soft: #26402b;
  --warn: #e8b04a;
  --warn-soft: #4b3d1c;
  --warn-ink: #f3d98b;
  --danger: #f08a96;
  --danger-ink: #26090d;
  --danger-soft: #4b252b;
  --info: #9cc3f2;
  --info-soft: #243a52;
  --band: #3a3027;
  --band-ink: #f7ecdc;
  --relief: inset 0 2px 0 rgba(255, 235, 210, 0.1), inset 0 -5px 10px rgba(0, 0, 0, 0.28);
  --shadow: 0 14px 30px rgba(0, 0, 0, 0.45), 0 3px 0 rgba(0, 0, 0, 0.25);
  --shadow-sm: 0 6px 14px rgba(0, 0, 0, 0.38), 0 2px 0 rgba(0, 0, 0, 0.22);
  --btn-relief: inset 0 2px 0 rgba(255, 255, 255, 0.28), inset 0 -4px 8px rgba(0, 0, 0, 0.22), 0 5px 0 rgba(0, 0, 0, 0.45), 0 9px 16px rgba(0, 0, 0, 0.4);
  --btn-relief-down: inset 0 2px 6px rgba(0, 0, 0, 0.4), 0 1px 0 rgba(0, 0, 0, 0.4);
}

/* Bandeaux par rubrique : Outils turquoise, Suivi corail, Activités moutarde, Documents sauge, Ressources crème/brun */
body[data-nav="outils"] { --band: var(--clay-teal); --band-ink: #11211f; }
body[data-nav="suivi"] { --band: var(--clay-coral); --band-ink: #2a120b; }
body[data-nav="activites"] { --band: var(--clay-mustard); --band-ink: #2b1a05; }
body[data-nav="documents"] { --band: var(--clay-sage); --band-ink: #1c2412; }
body[data-nav="ressources"] { --band: #e6cfae; --band-ink: #3b2614; }
body[data-nav="aide"], body[data-nav="accueil"] { --band: var(--clay-cream); --band-ink: #2e2219; }
:root[data-theme="dark"] body[data-nav="outils"] { --band: #3b5b57; --band-ink: #f2f8f6; }
:root[data-theme="dark"] body[data-nav="suivi"] { --band: #7a3f32; --band-ink: #fff3ee; }
:root[data-theme="dark"] body[data-nav="activites"] { --band: #805418; --band-ink: #fff6e8; }
:root[data-theme="dark"] body[data-nav="documents"] { --band: #56603f; --band-ink: #f6f9ee; }
:root[data-theme="dark"] body[data-nav="ressources"] { --band: #5b4631; --band-ink: #fbefdc; }
:root[data-theme="dark"] body[data-nav="aide"], :root[data-theme="dark"] body[data-nav="accueil"] { --band: #3a3027; --band-ink: #f7ecdc; }

:root[data-dys="1"] {
  --font: Verdana, Tahoma, "DejaVu Sans", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji";
}
:root[data-dys="1"] body {
  letter-spacing: 0.04em;
  word-spacing: 0.12em;
  line-height: 1.75;
}

* { box-sizing: border-box; }

html { font-size: calc(16px * var(--font-scale)); scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--primary); }
a:hover { text-decoration-thickness: 2px; }

h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 0.5em; font-weight: 800; letter-spacing: -0.01em; }
h1 { font-size: 2rem; }
h2 { font-size: 1.45rem; }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; }
.lead { font-size: 1.1rem; color: var(--ink-soft); max-width: 65ch; }
.muted { color: var(--muted); }
.small { font-size: 0.9rem; }
.center { text-align: center; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ---------- Skip link + focus ---------- */
.skip-link { position: absolute; left: -999px; top: 8px; background: var(--accent); color: var(--accent-ink); padding: 10px 16px; border-radius: var(--radius-sm); z-index: 1000; font-weight: 700; }
.skip-link:focus { left: 8px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
main:focus { outline: none; }

/* ---------- Header / nav ---------- */
.site-header {
  background: linear-gradient(180deg, var(--surface), var(--surface-2));
  border-bottom: 3px solid var(--band);
  box-shadow: 0 6px 16px rgba(120, 80, 40, 0.14);
  position: sticky; top: 0; z-index: 50;
}
.site-header .wrap { width: min(1400px, 100% - 32px); display: flex; align-items: center; gap: 16px; min-height: 68px; }
.brand { white-space: nowrap; display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); font-weight: 800; font-size: 1.1rem; }
.brand .logo, .brand .logo-fb { width: 44px; height: 44px; border-radius: 16px; background: linear-gradient(145deg, var(--clay-teal), var(--clay-coral)); display: grid; place-items: center; color: #fff; font-size: 1.3rem; box-shadow: var(--relief), var(--shadow-sm); flex-shrink: 0; }
.nav { display: flex; gap: 4px; margin-left: auto; flex-wrap: wrap; }
.nav a { text-decoration: none; color: var(--ink-soft); padding: 6px 10px; border-radius: 999px; font-weight: 700; min-height: 48px; display: inline-flex; align-items: center; gap: 8px; border: 2px solid transparent; transition: background 0.15s, box-shadow 0.15s, transform 0.1s; }
.nav a:hover { background: var(--surface); color: var(--ink); box-shadow: var(--relief), var(--shadow-sm); }
.nav a:active { transform: translateY(1px); }
.nav a[aria-current="page"] { background: var(--band); color: var(--band-ink); box-shadow: var(--relief), var(--shadow-sm); }
.nav .ico { width: 1.6em; height: 1.6em; border-radius: 8px; }
.nav-toggle.btn { display: none; margin-left: auto; }
.header-tools { display: flex; gap: 8px; align-items: center; }

/* Le menu se replie en bouton dès que les sept rubriques ne tiennent plus sur une ligne */
@media (max-width: 1320px) {
  .nav-toggle.btn { display: inline-flex; }
  .nav { display: none; position: absolute; left: 0; right: 0; top: 68px; background: var(--surface); border-bottom: 3px solid var(--band); padding: 10px 16px 16px; flex-direction: column; box-shadow: var(--shadow); border-radius: 0 0 var(--radius) var(--radius); }
  .nav.open { display: flex; }
  .nav a { width: 100%; }
}
@media (max-width: 900px) {
  .header-tools { display: none; }
}

/* ---------- Layout ---------- */
.wrap { width: min(1180px, 100% - 32px); margin-inline: auto; }
main { flex: 1; padding: 28px 0 56px; }
.page-head { margin-bottom: 26px; background: var(--band); color: var(--band-ink); border-radius: var(--radius); padding: 22px 26px 20px; box-shadow: var(--relief), var(--shadow); position: relative; overflow: hidden; }
.page-head h1 { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; text-shadow: 0 1px 0 rgba(255, 255, 255, 0.28); }
.page-head h1 .h-ico, .page-head h1 .ico { font-size: 1em; }
.page-head h1 .ico { width: 1.7em; height: 1.7em; }
.page-head .lead { color: inherit; }
.page-head .crumbs { font-size: 0.9rem; color: inherit; margin-bottom: 8px; }
.page-head .crumbs a { color: inherit; }
.page-head a { color: inherit; }
.page-head .btn, .page-head .chip { color: var(--ink); }
.page-head.has-cover { background-size: cover; background-position: center; padding-top: 70px; }
.page-head.has-cover::before { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, var(--band) 78%); z-index: 0; }
.page-head.has-cover > * { position: relative; z-index: 1; }
@media (max-width: 600px) { .page-head.has-cover { background-size: auto 100%; background-position: right center; } .page-head.has-cover::before { background: linear-gradient(180deg, color-mix(in srgb, var(--band) 55%, transparent) 0%, var(--band) 62%); } }
@media (max-width: 600px) { .page-head { padding: 16px 16px 14px; } }
.grid { display: grid; gap: 18px; }
.grid > * { min-width: 0; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.row.between { justify-content: space-between; }
.stack > * + * { margin-top: 14px; }

/* ---------- Cards ---------- */
.card {
  background: linear-gradient(180deg, color-mix(in srgb, var(--surface) 88%, #fff), var(--surface));
  background-color: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--relief), var(--shadow-sm);
}
.card h2, .card h3 { margin-top: 0; }
.card.pad-lg { padding: 30px; }
a.card { text-decoration: none; color: inherit; display: block; transition: transform 0.15s, box-shadow 0.15s; }
a.card:hover { transform: translateY(-4px); box-shadow: var(--relief), var(--shadow); }
a.card:active { transform: translateY(0); box-shadow: var(--btn-relief-down); }
a.card:focus-visible { outline-offset: 4px; }
.card .icon { font-size: 2rem; line-height: 1; margin-bottom: 12px; display: block; }
.card .icon .ico { width: 1.7em; height: 1.7em; filter: drop-shadow(0 4px 4px rgba(120, 80, 40, 0.25)); }
.card .tag { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); font-weight: 800; }
.tile { text-align: center; padding: 24px 16px; }
.tile .icon { font-size: 2.6rem; }
.tile .icon .ico { width: 1.5em; height: 1.5em; }

.callout { border-left: 8px solid var(--info); background: var(--info-soft); padding: 14px 18px; border-radius: var(--radius-sm); margin: 16px 0; box-shadow: var(--relief); }
.callout.warn { border-color: var(--warn); background: var(--warn-soft); }
.callout.ok { border-color: var(--ok); background: var(--ok-soft); }
.callout.danger { border-color: var(--danger); background: var(--danger-soft); }
.callout.accent { border-color: var(--accent); background: var(--accent-soft); }
.callout p:last-child { margin-bottom: 0; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: var(--tap); padding: 10px 20px;
  border-radius: 999px; border: 2px solid transparent;
  background: var(--primary); color: var(--primary-ink);
  background-image: linear-gradient(180deg, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0) 55%);
  box-shadow: var(--btn-relief);
  margin-bottom: 5px; /* place pour l'épaisseur du relief */
  font: inherit; font-weight: 800; cursor: pointer; text-decoration: none;
  transition: transform 0.1s, box-shadow 0.1s, filter 0.15s;
}
.btn:hover { filter: brightness(1.07); transform: translateY(-1px); }
.btn:active { transform: translateY(4px); box-shadow: var(--btn-relief-down); filter: brightness(0.96); }
.btn:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; filter: none; }
.btn.secondary { background-color: var(--surface-2); color: var(--ink); border-color: var(--line); }
.btn.outline { background-color: var(--surface); border-color: var(--primary); color: var(--primary); }
:root[data-theme="dark"] .btn.outline { color: var(--ink); }
.btn.accent { background-color: var(--accent); color: var(--accent-ink); }
.btn.danger { background-color: var(--danger); color: var(--danger-ink); }
.btn.ok { background-color: var(--ok); color: var(--ok-ink); }
.btn.ghost { background-color: transparent; background-image: none; box-shadow: none; color: var(--ink-soft); margin-bottom: 0; }
.btn.ghost:hover { background-color: var(--surface-2); }
.btn.ghost:active { box-shadow: none; transform: translateY(1px); }
.btn.sm { min-height: 44px; padding: 6px 14px; font-size: 0.92rem; }
.btn.lg { min-height: 60px; padding: 14px 28px; font-size: 1.15rem; }
.btn.xl { min-height: 80px; padding: 18px 36px; font-size: 1.5rem; }
.btn.icon-only { width: var(--tap); padding: 0; }
.btn.block { width: 100%; }
.btn { max-width: 100%; }
.btn .ico { width: 1.4em; height: 1.4em; }
@media (max-width: 480px) {
  .btn.xl { padding: 14px 20px; font-size: 1.25rem; min-height: 64px; }
  .btn.lg { padding: 12px 18px; }
}

/* ---------- Forms ---------- */
label { font-weight: 700; display: block; margin-bottom: 6px; }
.field { margin-bottom: 14px; }
.field .help { font-size: 0.85rem; color: var(--muted); margin-top: 4px; }
input[type="text"], input[type="number"], input[type="date"], input[type="time"], input[type="email"], input[type="tel"], input[type="search"], select, textarea {
  width: 100%; font: inherit; color: var(--ink); background: var(--surface);
  border: 2px solid var(--field-line); border-radius: var(--radius-sm);
  padding: 10px 14px; min-height: 48px;
  box-shadow: inset 0 3px 6px rgba(120, 80, 40, 0.12);
}
textarea { min-height: 96px; resize: vertical; }
input:focus-visible, select:focus-visible, textarea:focus-visible { border-color: var(--focus); outline: 3px solid var(--focus); outline-offset: 1px; }
input[type="checkbox"], input[type="radio"] { width: 22px; height: 22px; accent-color: var(--primary); vertical-align: middle; }
.check { display: flex; align-items: center; gap: 10px; font-weight: 600; min-height: 40px; cursor: pointer; }
.check input { margin: 0; flex-shrink: 0; }
input[type="range"] { width: 100%; accent-color: var(--primary); }
fieldset { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px 16px; margin: 0 0 16px; box-shadow: var(--relief); }
legend { font-weight: 800; padding: 0 6px; }

/* ---------- Tables ---------- */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: var(--surface-2); font-weight: 800; }
.table-wrap { overflow-x: auto; }

/* ---------- Chips / badges ---------- */
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 999px; background: var(--surface-2); font-size: 0.85rem; font-weight: 700; box-shadow: var(--relief); }
.chip.primary { background: var(--primary-soft); color: var(--primary); }
.chip.ok { background: var(--ok-soft); color: var(--ok); }
.chip.warn { background: var(--warn-soft); color: var(--warn-ink); }
.chip.danger { background: var(--danger-soft); color: var(--danger); }
.chip.info { background: var(--info-soft); color: var(--info); }
:root[data-theme="dark"] .chip.primary, :root[data-theme="dark"] .chip.ok, :root[data-theme="dark"] .chip.warn, :root[data-theme="dark"] .chip.danger, :root[data-theme="dark"] .chip.info { color: var(--ink); }

/* ---------- Picto cards ---------- */
.picto {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  background: var(--surface); border: 3px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--relief), var(--shadow-sm);
  padding: 12px; text-align: center; min-height: 120px; cursor: pointer; user-select: none;
  color: var(--ink); font: inherit; /* les cartes <button> n'héritent pas la couleur du thème par défaut */
  transition: transform 0.1s, border-color 0.15s;
}
.picto { position: relative; }
.picto:hover { border-color: var(--primary); }
/* Carte à deux actions : conteneur neutre + bouton principal + bouton frère (pas de bouton dans un bouton) */
.picto.has-main { padding: 0; cursor: default; }
.picto.has-main > .picto-main { flex: 1 1 auto; align-self: stretch; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 12px; background: transparent; border: 0; border-radius: inherit; font: inherit; color: inherit; text-align: center; cursor: pointer; }
.picto.has-main > .picto-aside { position: absolute; top: 6px; right: 6px; }
.picto:active { transform: translateY(2px) scale(0.98); box-shadow: var(--btn-relief-down); }
.picto:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.picto .emoji { font-size: 3rem; line-height: 1; }
.picto .label { font-weight: 800; font-size: 0.95rem; }
.picto.selected { border-color: var(--accent); background: var(--accent-soft); }
.picto.has-main:hover { border-color: var(--primary); }
.picto.done { opacity: 0.45; filter: grayscale(0.6); }
.picto.lg .emoji { font-size: 4.5rem; }
.picto.lg { min-height: 180px; }
.picto-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 12px; }
.picto-grid.lg { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }

/* ---------- Child selector ---------- */
.child-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; background: var(--surface-2); border-radius: var(--radius-sm); padding: 10px 14px; margin-bottom: 20px; }
.child-bar select { width: auto; min-width: 200px; }

/* ---------- Toast ---------- */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px); background: var(--ink); color: var(--bg); padding: 12px 22px; border-radius: 999px; box-shadow: var(--shadow); opacity: 0; pointer-events: none; transition: all 0.25s; z-index: 1000; font-weight: 700; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast { max-width: min(92vw, 640px); text-align: center; border-radius: 26px; }
.toast.error { background: var(--danger); color: var(--danger-ink); }

/* ---------- Modal ---------- */
dialog { border: none; border-radius: var(--radius); padding: 0; max-width: min(640px, 92vw); width: 100%; background: var(--surface); color: var(--ink); box-shadow: var(--relief), var(--shadow); }
dialog::backdrop { background: rgba(40, 25, 12, 0.5); }
dialog .dlg-body { padding: 24px; }
dialog .dlg-actions { display: flex; gap: 10px; justify-content: flex-end; padding: 0 24px 24px; flex-wrap: wrap; }

dialog .dlg-body h2 { font-size: 1.15rem; margin: 0 0 8px; }
dialog .dlg-body p { margin: 0; white-space: pre-line; }
.file-warning { margin: 0 0 16px; }

/* ---------- Footer ---------- */
.site-footer { border-top: 3px solid var(--band); padding: 26px 0; color: var(--muted); font-size: 0.9rem; background: linear-gradient(180deg, var(--surface-2), var(--surface)); margin-top: 12px; }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 12px 24px; justify-content: space-between; align-items: center; }
.site-footer .ico { width: 1.5em; height: 1.5em; }

/* ---------- Document (printable) ---------- */
.doc { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--relief), var(--shadow-sm); padding: 32px; max-width: 900px; margin-inline: auto; }
.doc-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; border-bottom: 3px solid var(--primary); padding-bottom: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.doc-head h1 { font-size: 1.6rem; margin: 0; }
.doc-section { margin-bottom: 22px; break-inside: avoid; }
.doc-section h2 { font-size: 1.1rem; color: var(--primary); border-bottom: 1px solid var(--line); padding-bottom: 4px; margin-bottom: 10px; }
.doc .lines { border-bottom: 1px dashed var(--line); min-height: 28px; }
.doc .box { border: 1px solid var(--line); border-radius: var(--radius-sm); min-height: 80px; padding: 8px; }
.doc textarea { min-height: 80px; }
.doc-toolbar { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; margin-bottom: 16px; }
.confidential { font-size: 0.8rem; color: var(--danger); font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; }

/* ---------- Print ---------- */
@media print {
  @page { margin: 14mm; }
  /* Palette d'impression explicite : fonds blancs, encre noire, quel que soit le thème de l'écran */
  :root, :root[data-theme="dark"] {
    --bg: #fff; --surface: #fff; --surface-2: #f2f2f2; --ink: #000; --ink-soft: #222; --muted: #444;
    --line: #999; --field-line: #666; --focus: #000;
    --primary: #1c5754; --primary-ink: #fff; --primary-soft: #e6f2f1;
    --accent: #8f3515; --accent-ink: #fff; --accent-soft: #f6e3d9;
    --ok: #1f5a33; --ok-ink: #fff; --ok-soft: #e5f3e9;
    --warn-soft: #fbf1d6; --warn-ink: #5c4100;
    --danger: #8f1f30; --danger-ink: #fff; --danger-soft: #f8e2e6;
    --info: #1f4478; --info-soft: #e3ecf8;
    --shadow: none; --shadow-sm: none;
  }
  html { font-size: 100%; }
  body { background: #fff; color: #000; font-size: 11pt; }
  .site-header, .site-footer, .doc-toolbar, .no-print, .child-bar, .toast, .nav, .skip-link, .page-head .crumbs { display: none !important; }
  main { padding: 0; }
  .wrap { width: 100%; }
  .doc, .card { border: 1px solid #999; box-shadow: none; border-radius: 4px; page-break-inside: avoid; background-image: none; }
  /* rendu noir et blanc propre : aucun relief ni dégradé à l'impression */
  .btn, .chip, .picto, .callout, .page-head, fieldset, .progress, .progress > span, .accordion details { box-shadow: none !important; background-image: none !important; text-shadow: none !important; }
  .page-head { background: none !important; color: #000 !important; padding: 0; border-radius: 0; margin-bottom: 12px; }
  .page-head::before { display: none !important; }
  .ico, .card .icon .ico { filter: grayscale(1) !important; }
  .doc { padding: 0; border: none; max-width: none; }
  input, textarea, select { border: 1px solid #999 !important; background: #fff !important; color: #000 !important; box-shadow: none !important; }
  textarea { resize: none; }
  a { color: #000; text-decoration: none; }
  .print-only { display: block !important; }
  .picto { border-color: #333; break-inside: avoid; }
  .picto-grid { grid-template-columns: repeat(4, 1fr); }
}
.print-only { display: none; }

/* ---------- Misc tool widgets ---------- */
.big-number { font-size: 4rem; font-weight: 900; line-height: 1; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.progress { height: 18px; background: var(--surface-2); border-radius: 999px; overflow: hidden; box-shadow: inset 0 3px 6px rgba(120, 80, 40, 0.2); }
.progress > span { display: block; height: 100%; background: var(--primary); background-image: linear-gradient(180deg, rgba(255, 255, 255, 0.35), rgba(255, 255, 255, 0)); border-radius: 999px; transition: width 0.3s; box-shadow: inset 0 -3px 5px rgba(0, 0, 0, 0.18); }
.kpi { display: flex; flex-direction: column; gap: 4px; }
.kpi .value { font-size: 2rem; font-weight: 900; line-height: 1; }
.kpi .label { color: var(--muted); font-weight: 700; font-size: 0.85rem; }
.empty { text-align: center; padding: 32px 16px; color: var(--muted); border: 2px dashed var(--line); border-radius: var(--radius); }
.empty .icon { font-size: 2.5rem; display: block; margin-bottom: 8px; }
.list { list-style: none; padding: 0; margin: 0; }
.list li { padding: 12px 0; border-bottom: 1px solid var(--line); display: flex; gap: 12px; align-items: flex-start; }
.list li:last-child { border-bottom: none; }
.list .grow { flex: 1; }
.accordion details { border: 1px solid var(--line); border-radius: var(--radius-sm); margin-bottom: 10px; background: var(--surface); box-shadow: var(--relief), var(--shadow-sm); }
.accordion summary { padding: 14px 18px; font-weight: 800; cursor: pointer; list-style: none; display: flex; align-items: center; gap: 10px; min-height: 48px; }
.accordion summary::-webkit-details-marker { display: none; }
.accordion summary::after { content: "+"; margin-left: auto; font-size: 1.4rem; color: var(--muted); }
.accordion details[open] summary::after { content: "–"; }
.accordion .body { padding: 0 16px 16px; }
.search { position: relative; }
.search input { padding-left: 42px; }
.search::before { content: "🔍"; position: absolute; left: 12px; top: 50%; transform: translateY(-50%); }

/* Full-screen tool mode (tablette face à l'enfant) */
body.focus-mode .site-header, body.focus-mode .site-footer, body.focus-mode .page-head, body.focus-mode .no-focus { display: none !important; }
body.focus-mode main { padding: 12px 0; }
.focus-exit { position: fixed; top: 10px; right: 10px; z-index: 60; display: none; }
body.focus-mode .focus-exit { display: inline-flex; }

/* ---------- Illustrations ---------- */
.logo-img { width: 44px; height: 44px; border-radius: 16px; object-fit: cover; display: block; }
.illus { width: 100%; height: auto; display: block; border-radius: var(--radius); background: var(--surface-2); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); gap: 28px; align-items: center; }
@media (max-width: 800px) { .hero-grid { grid-template-columns: minmax(0, 1fr); } }
.card .illus { height: auto; object-fit: contain; margin-bottom: 12px; border-radius: var(--radius-sm); }

/* ---------- Icônes et pictogrammes en image (avec repli emoji) ---------- */
.ico { width: 1.25em; height: 1.25em; object-fit: contain; vertical-align: -0.28em; display: inline-block; }
.ico-fb { display: inline-block; line-height: 1; }
.picto-img { width: 1em; height: 1em; object-fit: contain; vertical-align: middle; display: inline-block; border-radius: 12%; }
.emoji .picto-img, .pic .picto-img, .emo .picto-img { width: 1.15em; height: 1.15em; }
.picto .emoji, .key .emoji { display: inline-flex; align-items: center; justify-content: center; }
.hero-img { box-shadow: var(--relief), var(--shadow); border: 4px solid var(--surface); }
.hero-img.hidden-fb { display: none; }
.emotion-img { max-height: 160px; width: auto; height: auto; object-fit: contain; filter: drop-shadow(0 6px 6px rgba(120, 80, 40, 0.25)); }

/* ---------- Accueil : héros argile ---------- */
.hero-card { background: linear-gradient(135deg, var(--clay-cream), var(--surface)); }
:root[data-theme="dark"] .hero-card { background: linear-gradient(135deg, #3a3027, var(--surface)); }

/* ---------- Symboles d'interface (emoji remplacés) : tuiles argile ---------- */
.eico { display: inline-block; position: relative; width: 1.25em; height: 1.25em; vertical-align: -0.25em; line-height: 1; flex-shrink: 0; }
.eico > .ico, .eico > svg { width: 100%; height: 100%; display: block; }
.eico-ch { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.eico-tile { width: 1.5em; height: 1.5em; vertical-align: -0.36em; border-radius: 34%; padding: 0.26em; color: #fffaf2;
  --t1: #5f9a93; --t2: #2f6560;
  background: linear-gradient(160deg, var(--t1), var(--t2));
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.45), inset 0 -3px 5px rgba(0, 0, 0, 0.25), 0 2px 0 rgba(0, 0, 0, 0.2), 0 4px 6px rgba(120, 80, 40, 0.22); }
.eico-tile > svg { filter: drop-shadow(0 1px 0 rgba(0, 0, 0, 0.28)); }
.eico-tile[data-tone="coral"] { --t1: #e07a64; --t2: #a8402b; }
.eico-tile[data-tone="mustard"] { --t1: #e8a24f; --t2: #b06a10; }
.eico-tile[data-tone="sage"] { --t1: #94a37c; --t2: #566343; }
:root[data-theme="dark"] .eico-tile { color: #fff7ea; }
/* emoji sans icône intégrée : l'emoji reste visible, posé sur une pastille argile */
.eico-off { width: 1.5em; height: 1.5em; vertical-align: -0.36em; display: inline-grid; place-items: center; border-radius: 34%; background: linear-gradient(160deg, #fff8ec, var(--clay-cream)); box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.8), inset 0 -3px 5px rgba(140, 95, 50, 0.2), 0 2px 0 rgba(140, 95, 50, 0.2), 0 4px 6px rgba(120, 80, 40, 0.18); }
:root[data-theme="dark"] .eico-off { background: linear-gradient(160deg, #4a3d31, #382e25); }
.eico-off .eico-ch { position: static; width: auto; height: auto; overflow: visible; clip: auto; font-size: 0.95em; }
@media print {
  .eico-tile, .eico-off { background: none !important; box-shadow: none !important; color: #000 !important; }
  .eico-tile > svg { filter: none; }
}

/* ---------- Recherche dans le site ---------- */
.search-btn { gap: 8px; margin-left: auto; }
.nav + .search-btn, .search-btn + .header-tools { margin-left: 0; }
@media (max-width: 520px) { .search-btn .search-lbl { display: none; } .brand { white-space: normal; line-height: 1.15; font-size: 1rem; } .site-header .wrap { gap: 10px; } }
.sbox { position: relative; display: flex; align-items: center; }
.sbox input[type="search"] { min-height: 60px; font-size: 1.15rem; border-radius: 999px; padding: 12px 56px 12px 56px; border-width: 3px; box-shadow: inset 0 4px 8px rgba(120, 80, 40, 0.14); -webkit-appearance: none; appearance: none; }
.sbox input[type="search"]::-webkit-search-cancel-button { display: none; }
.sbox-ico { position: absolute; left: 20px; width: 24px; height: 24px; color: var(--primary); pointer-events: none; }
.sbox-clear { position: absolute; right: 10px; width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--surface-2); color: var(--ink); font: inherit; font-weight: 800; cursor: pointer; box-shadow: var(--relief); }
.sbox-clear:hover { filter: brightness(0.95); }
.sfilters { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 4px; }
.sfilters .chip { border: 0; cursor: pointer; font: inherit; font-size: 0.85rem; font-weight: 700; min-height: 40px; padding: 4px 14px; color: var(--ink); }
.sfilters .chip.primary { background: var(--primary); color: var(--primary-ink); }
.sstatus { margin: 8px 4px 0; min-height: 1.3em; }
.sres { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 8px; }
.sr-item a { display: grid; gap: 2px; padding: 10px 16px; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--line); border-left: 8px solid var(--clay-cream); text-decoration: none; color: var(--ink); box-shadow: var(--relief), var(--shadow-sm); }
.sr-item[aria-selected="true"] a, .sr-item a:hover { border-color: var(--primary); box-shadow: var(--relief), var(--shadow); transform: translateY(-1px); }
.sr-item a:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.sr-top { display: flex; gap: 8px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.sr-k { font-size: 0.72rem; padding: 2px 10px; }
.sr-d { color: var(--ink-soft); font-size: 0.92rem; }
.sr-r { color: var(--muted); font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; }
.sr-item mark { background: var(--warn-soft); color: inherit; border-radius: 4px; padding: 0 2px; box-shadow: inset 0 -2px 0 var(--warn); }
.res-outils a { border-left-color: var(--clay-teal); } .res-suivi a { border-left-color: var(--clay-coral); } .res-activites a { border-left-color: var(--clay-mustard); }
.res-documents a { border-left-color: var(--clay-sage); } .res-ressources a { border-left-color: #c9a878; }
.sr-more { text-align: center; margin-top: 4px; }
.sempty { margin-top: 12px; }
.sex { border: 0; cursor: pointer; font: inherit; font-weight: 700; min-height: 40px; padding: 4px 14px; color: var(--ink); }
.sex:hover { background: var(--primary-soft); }
dialog.search-dlg { max-width: min(720px, 94vw); margin-top: 6vh; }
dialog.search-dlg .sres { max-height: 52vh; overflow: auto; padding: 4px; }
.search-card { margin-bottom: 22px; }
.tasks { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)); gap: 14px; }
.task { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 14px; align-items: center; text-align: left; padding: 14px 16px; }
.task .icon { margin: 0; font-size: 2.2rem; }
.task strong { display: block; font-size: 1.02rem; }
.task span.d { color: var(--muted); font-size: 0.88rem; }
.recent { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 22px; }
.recent a { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; padding: 8px 16px; min-height: 48px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--relief), var(--shadow-sm); color: var(--ink); font-weight: 700; }
.recent a:hover { box-shadow: var(--relief), var(--shadow); }

/* ---------- Guide « Comment utiliser cette page » ---------- */
.guide { margin: -8px 0 22px; background: var(--surface); border: 1px dashed var(--field-line); border-radius: var(--radius-sm); box-shadow: var(--relief); }
.guide > summary { cursor: pointer; list-style: none; padding: 12px 18px; font-weight: 800; min-height: 48px; display: flex; align-items: center; gap: 10px; border-radius: var(--radius-sm); }
.guide > summary::-webkit-details-marker { display: none; }
.guide > summary::after { content: "Afficher"; margin-left: auto; font-size: 0.85rem; font-weight: 700; color: var(--muted); }
.guide[open] > summary::after { content: "Masquer"; }
.guide-body { padding: 0 20px 14px; }
.guide-body ol { margin: 0 0 10px; padding-left: 22px; }
.guide-body li { margin-bottom: 4px; }
.guide-tip, .guide-next { margin: 6px 0; font-size: 0.95rem; }
body.focus-mode .guide { display: none; }
@media print { .guide { display: none !important; } }

/* ---------- Infobulles ---------- */
#eduTip { position: fixed; z-index: 2000; max-width: min(300px, calc(100vw - 16px)); padding: 9px 14px; border-radius: 14px; background: #2e2219; color: #fff7ea; font-size: 0.88rem; font-weight: 600; line-height: 1.35; box-shadow: 0 8px 18px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.18); pointer-events: none; }
:root[data-theme="dark"] #eduTip { background: #fbefdc; color: #2e2219; }
#eduTip[hidden] { display: none; }
@media print { #eduTip { display: none !important; } }

/* ---------- Affinage : boutons plus légers, police plus lisible (clair et sombre) ---------- */
:root, :root:not([data-theme="light"]), :root[data-theme="dark"] {
  --relief: inset 0 1px 0 rgba(255, 255, 255, 0.5);
  --btn-relief: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 2px 4px rgba(60, 40, 20, 0.14);
  --btn-relief-down: inset 0 1px 2px rgba(0, 0, 0, 0.18);
  --shadow-sm: 0 1px 3px rgba(60, 40, 20, 0.1);
  --font: "Segoe UI", Verdana, Tahoma, Arial, sans-serif;
}
body { letter-spacing: 0.005em; line-height: 1.6; }
.btn { font-weight: 600; letter-spacing: 0.01em; }
h1, h2, h3, h4 { letter-spacing: 0; }
