/* ============================================================
   Green and Go — styles
   Charte graphique de greenandgo.fr, en thème clair (sombre au choix) :
   vert forêt #548649, vert sauge #8CB369, pêche #FFBF69,
   orange #F9844A, crème #FFECD1 ; police Outfit (proche de MADE Okine Sans).
   ============================================================ */
@font-face { font-family: 'Outfit'; font-weight: 300; font-display: swap; src: url('fonts/outfit-latin-300-normal.woff2') format('woff2'); }
@font-face { font-family: 'Outfit'; font-weight: 400; font-display: swap; src: url('fonts/outfit-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Outfit'; font-weight: 500; font-display: swap; src: url('fonts/outfit-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'Outfit'; font-weight: 600; font-display: swap; src: url('fonts/outfit-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'Outfit'; font-weight: 700; font-display: swap; src: url('fonts/outfit-latin-700-normal.woff2') format('woff2'); }

:root {
  /* Couleurs de la marque */
  --forest: #548649;
  /* Même vert un peu plus soutenu, pour les cartes qui portent du texte blanc ou crème (contraste ≥ 4,5:1, WCAG AA) */
  --forest-card: #48763e;
  --sage: #8cb369;
  --peach: #ffbf69;
  --orange: #f9844a;
  --cream: #ffecd1;
  /* Thème clair (par défaut) : fond crème, cartes blanches, textes vert-nuit */
  --bg: #f6f1e7;
  --topbar: #ffffff;
  --surface: #ffffff;
  --surface-2: #efe8da;
  --border: #e2dacb;
  --text: #1b231c;
  --muted: #5b665c;
  --accent: #48763e; /* vert forêt un peu plus soutenu : texte blanc lisible dessus, lisible sur fond blanc (≥ 4,5:1) */
  --accent-strong: #3d6b33;
  --link: #3d6b33; /* liens et boutons-liens : contraste ≥ 4,5:1 sur fond blanc et crème */
  --accent-soft: rgba(84, 134, 73, .12);
  --accent-text: #ffffff;
  --chevron: #b86a00;
  --danger: #b3261e;
  --danger-soft: rgba(179, 38, 30, .09);
  --on-danger: #ffffff;
  --warn: #9a5a00;
  --warn-soft: rgba(255, 191, 105, .28);
  --ok: #3d6b33;
  --ok-soft: rgba(84, 134, 73, .13);
  --peach-text: #8f5400;
  --frozen: #2f5d8a;
  --hover: rgba(27, 35, 28, .05);
  --tabbar: rgba(255, 255, 255, .94);
  --shadow: 0 1px 2px rgba(27, 35, 28, .06), 0 0 0 1px rgba(27, 35, 28, .05);
  --radius: 16px;
  color-scheme: light;
}
/* Thème sombre : au choix dans « Moi », ou comme le téléphone */
:root[data-theme="dark"] {
  --bg: #141a15; --topbar: #0e130f; --surface: #1d251e; --surface-2: #273128; --border: #354137; --text: #fbf3e6; --muted: #a9b4a5;
  --accent: var(--sage); --accent-strong: var(--forest); --link: var(--sage); --accent-soft: rgba(140, 179, 105, .16); --accent-text: #142010;
  --chevron: var(--peach); --danger: #ff7b6b; --danger-soft: rgba(255, 123, 107, .15); --on-danger: #2a0d08;
  --warn: var(--peach); --warn-soft: rgba(255, 191, 105, .15); --ok: var(--sage); --ok-soft: rgba(140, 179, 105, .16);
  --peach-text: var(--peach); --frozen: #9ec8ff; --hover: rgba(255, 255, 255, .06); --tabbar: rgba(14, 19, 15, .94);
  --shadow: 0 1px 2px rgba(0, 0, 0, .3); color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root[data-theme="auto"] {
    --bg: #141a15; --topbar: #0e130f; --surface: #1d251e; --surface-2: #273128; --border: #354137; --text: #fbf3e6; --muted: #a9b4a5;
    --accent: var(--sage); --accent-strong: var(--forest); --link: var(--sage); --accent-soft: rgba(140, 179, 105, .16); --accent-text: #142010;
    --chevron: var(--peach); --danger: #ff7b6b; --danger-soft: rgba(255, 123, 107, .15); --on-danger: #2a0d08;
    --warn: var(--peach); --warn-soft: rgba(255, 191, 105, .15); --ok: var(--sage); --ok-soft: rgba(140, 179, 105, .16);
    --peach-text: var(--peach); --frozen: #9ec8ff; --hover: rgba(255, 255, 255, .06); --tabbar: rgba(14, 19, 15, .94);
    --shadow: 0 1px 2px rgba(0, 0, 0, .3); color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 15.5px/1.5 'Outfit', system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--link); }
h1, h2, h3 { margin: 0; line-height: 1.25; font-weight: 600; letter-spacing: .01em; }
h1 { font-size: 1.5rem; }
h2 { font-size: 1.1rem; }
h3 { font-size: 1rem; }
.boot { padding: 40px; text-align: center; color: var(--muted); }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.hidden { display: none !important; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.stack > * + * { margin-top: 12px; }


/* ---------- Mise en page : barre du haut + contenu centré ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30; background: var(--topbar);
  display: grid; grid-template-columns: 48px 1fr 48px; align-items: center;
  padding: env(safe-area-inset-top) 8px 0; min-height: calc(58px + env(safe-area-inset-top));
}
.topbar-title { text-align: center; font-weight: 600; font-size: 1.05rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar-logo { display: grid; place-items: center; color: var(--accent); }
.topbar .icon-btn { color: var(--text); }
.icon-btn {
  display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 12px;
  background: none; border: 0; color: inherit; cursor: pointer; text-decoration: none; padding: 0;
}
.icon-btn:hover { background: var(--hover); }
.ico { width: 24px; height: 24px; flex-shrink: 0; }
.ico.sm { width: 18px; height: 18px; vertical-align: -3px; }
.main { max-width: 1240px; margin: 0 auto; padding: 20px 24px calc(48px + env(safe-area-inset-bottom)); }
.main.home { max-width: 720px; padding-top: 0; }
.page-head { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 18px; }
.page-head > h1:not(.keep) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; } /* titre déjà dans la barre du haut : gardé pour VoiceOver */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.page-head > h1.keep { margin-right: auto; }
.back { display: none !important; }
.show-mobile { display: none; }
@media (max-width: 700px) {
  .hide-mobile { display: none !important; }
  .show-mobile { display: inline; }
}
@media (max-width: 700px) {
  .main { padding: 16px 16px calc(32px + env(safe-area-inset-bottom)); }
  h1 { font-size: 1.3rem; }
}

/* ---------- Logos de la marque ---------- */
.topbar-logo img { width: 34px; height: 34px; border-radius: 9px; display: block; }
.topbar-brand { display: flex; justify-content: center; }
.topbar-brand img { height: 26px; width: auto; display: block; }
.auth-logo { display: block; width: 210px; max-width: 70%; height: auto; margin: 0 auto 6px; }
.drawer-logo { height: 20px; width: auto; display: block; align-self: flex-start; margin: 14px 20px 6px; opacity: .9; }

/* ---------- Accueil : bandeau profil + liste des rubriques ---------- */
.profile-band {
  display: flex; align-items: center; gap: 16px; background: var(--forest-card); color: var(--cream);
  padding: 22px 20px; margin: 0 -24px 8px;
}
@media (min-width: 721px) { .profile-band { margin: 20px 0 12px; border-radius: var(--radius); } }
@media (max-width: 700px) { .profile-band { margin: 0 -16px 8px; } }
.profile-band .grow { flex: 1; min-width: 0; }
.profile-name { font-size: 1.2rem; font-weight: 700; }
.profile-sub { font-size: .85rem; opacity: .85; }
.profile-band .icon-btn { color: var(--cream); }
.profile-avatar {
  width: 58px; height: 58px; border-radius: 50%; background: var(--cream); color: var(--forest);
  display: grid; place-items: center; flex-shrink: 0; overflow: hidden;
}
.profile-avatar .ico { width: 40px; height: 40px; margin-top: 10px; stroke-width: 0; fill: currentColor; }
.menu-list { display: flex; flex-direction: column; }
.menu-item {
  display: flex; align-items: center; gap: 18px; padding: 16px 6px; color: var(--text); text-decoration: none;
  border-bottom: 1px solid rgba(255, 255, 255, .06); border-radius: 10px;
}
.menu-item:hover, .menu-item:focus-visible { background: var(--hover); }
.menu-icon { color: var(--accent); display: grid; place-items: center; width: 48px; }
.menu-icon .ico { width: 38px; height: 38px; stroke-width: 1.4; }
.menu-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.menu-label { font-size: 1.08rem; font-weight: 500; }
.menu-sub { font-size: .82rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.menu-chevron { color: var(--chevron); display: grid; }

/* ---------- Annonces épinglées (bandeau de l'accueil) ---------- */
.announce-banner { display: flex; flex-direction: column; gap: 8px; margin: 4px 0 12px; }
.pinned-announce {
  display: flex; gap: 14px; align-items: flex-start; padding: 14px 16px; border-radius: 12px; text-decoration: none;
  color: var(--text); background: rgba(255, 191, 105, .10); border: 1px solid rgba(255, 191, 105, .3);
  border-left: 5px solid var(--chevron);
}
.pinned-announce:hover { background: rgba(255, 191, 105, .16); }
.pa-icon { color: var(--chevron); display: grid; padding-top: 2px; }
.pa-icon .ico { width: 28px; height: 28px; }
.pa-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.pa-meta {
  font-size: .72rem; letter-spacing: .05em; text-transform: uppercase; color: var(--peach-text); font-weight: 700;
  display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
}
.pa-text { white-space: pre-wrap; font-size: 1rem; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; }
.pa-more { color: var(--chevron); font-size: .88rem; text-decoration: none; padding: 0 6px; }
.badge.new { background: var(--peach); color: #3a2508; text-transform: none; letter-spacing: 0; }
.announce.is-pinned { border-left: 4px solid var(--chevron); }
.announce.is-pinned .pa-meta { margin-bottom: 6px; }
.announce-filter { margin: 18px 0 4px; }
.announce-filter input { width: auto; }

/* ---------- Menu latéral (☰) ---------- */
.drawer-backdrop { position: fixed; inset: 0; z-index: 55; background: rgba(0, 0, 0, 0); transition: background .2s; }
.drawer-backdrop.open { background: rgba(0, 0, 0, .5); }
.drawer {
  position: absolute; top: 0; right: 0; bottom: 0; width: min(320px, 86vw); background: var(--topbar);
  display: flex; flex-direction: column; transform: translateX(100%); transition: transform .22s ease;
  padding-top: env(safe-area-inset-top); padding-bottom: env(safe-area-inset-bottom);
}
.drawer-backdrop.open .drawer { transform: none; }
.drawer-head { display: flex; align-items: center; gap: 12px; padding: 18px 12px 18px 18px; background: var(--forest-card); color: var(--cream); }
.drawer-head .grow { flex: 1; min-width: 0; }
.drawer-head .small { opacity: .85; }
.drawer-head .profile-avatar { width: 44px; height: 44px; }
.drawer-head .profile-avatar .ico { width: 30px; height: 30px; margin-top: 8px; }
.drawer-nav { padding: 8px; overflow-y: auto; flex: 1; }
.drawer-nav a, .drawer-logout {
  display: flex; align-items: center; gap: 14px; padding: 12px; border-radius: 10px; color: var(--text);
  text-decoration: none; font: inherit; font-size: 1rem; background: none; border: 0; width: 100%; cursor: pointer; text-align: left;
}
.drawer-nav a .ico { color: var(--accent); }
.drawer-nav a .badge { margin-left: auto; }
.drawer-nav a:hover, .drawer-logout:hover { background: var(--hover); }
.drawer-nav a.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.drawer-logout { border-top: 1px solid var(--border); border-radius: 0; padding: 16px 20px; color: var(--muted); }

/* ---------- Composants ---------- */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px; box-shadow: var(--shadow);
}
.card > h2 { margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.stats { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin-bottom: 16px; }
.stat { padding: 14px 16px; }
.stat .value { font-size: 1.6rem; font-weight: 700; }
.stat .label { color: var(--muted); font-size: .85rem; }
a.stat { text-decoration: none; color: inherit; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  padding: 8px 16px; border-radius: 999px; font: inherit; font-weight: 500; cursor: pointer;
  text-decoration: none; white-space: nowrap;
}
.btn:hover { background: var(--surface-2); }
.btn:disabled { opacity: .55; cursor: default; }
.btn.primary { background: var(--peach); border-color: var(--peach-text); color: #3a2508; font-weight: 600; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { color: var(--danger); }
.btn.sm { padding: 4px 10px; font-size: .85rem; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--surface-2); }
.icon-btn { padding: 6px 10px; }

.badge {
  display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: .75rem; font-weight: 600;
  background: var(--surface-2); color: var(--muted); white-space: nowrap;
}
.badge.accent { background: var(--accent); color: var(--accent-text); }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.danger { background: var(--danger-soft); color: var(--danger); }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  color: #142010; font-weight: 700; font-size: .85rem; flex-shrink: 0;
}

/* ---------- Formulaires ---------- */
label { display: block; font-size: .85rem; font-weight: 600; margin-bottom: 4px; }
input, select, textarea {
  width: 100%; font: inherit; color: var(--text); background: var(--surface);
  border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px;
}
input[type="color"] { padding: 2px; height: 38px; }
textarea { min-height: 70px; resize: vertical; }
input:focus, select:focus, textarea:focus, .btn:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 1px;
}
.field { margin-bottom: 12px; }
.fields { display: grid; gap: 0 12px; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.error-msg { color: var(--danger); font-size: .9rem; margin: 6px 0 10px; }
.hint { color: var(--muted); font-size: .8rem; margin-top: 4px; }
.search { max-width: 320px; }

/* ---------- Pages d'accès ---------- */
.brand { display: flex; gap: 12px; align-items: center; font-weight: 700; font-size: 1.3rem; }
.brand-logo {
  width: 46px; height: 46px; border-radius: 14px; background: var(--forest); color: var(--cream);
  display: grid; place-items: center; flex-shrink: 0;
}
.auth { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.auth .card { width: 100%; max-width: 400px; padding: 28px; }
.auth .brand { justify-content: center; padding-bottom: 10px; }
.auth p.lead { text-align: center; color: var(--muted); margin: 0 0 20px; }
.auth .switch { text-align: center; margin-top: 16px; font-size: .9rem; }
.auth .btn.primary { width: 100%; padding: 10px; }

/* ---------- Double authentification ---------- */
.auth .card.wide-card { max-width: 460px; }
.center { text-align: center; }
.step-tag { text-align: center; color: var(--peach-text); font-size: .78rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; margin: 4px 0 6px; }
.auth h2.center { margin-bottom: 8px; justify-content: center; }
.steps-list { padding-left: 20px; margin: 14px 0 16px; line-height: 1.5; }
.steps-list li + li { margin-top: 8px; }
.qr { display: block; width: 200px; height: 200px; margin: 14px auto; border-radius: 12px; background: #fff; padding: 6px; }
.manual-key { margin: 0 0 14px; }
.manual-key summary { cursor: pointer; color: var(--accent); font-size: .9rem; text-align: center; }
.manual-key .copy-box { margin-top: 10px; }
.code-input { font-size: 1.5rem; letter-spacing: .3em; text-align: center; font-variant-numeric: tabular-nums; }
.recovery-grid { list-style: none; padding: 14px; margin: 14px 0 10px; display: grid; grid-template-columns: 1fr 1fr; gap: 8px 16px;
  background: var(--surface-2); border-radius: 12px; }
.recovery-grid code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 1rem; letter-spacing: .04em; }
.link-btn { background: none; border: 0; color: var(--link); font: inherit; cursor: pointer; padding: 0; text-decoration: underline; }
.link-btn.muted { color: var(--muted); }
.auth .btn + .btn, .auth .btn + label.check { margin-top: 10px; }

/* ---------- Listes ---------- */
.list { list-style: none; margin: 0; padding: 0; }
.list > li { display: flex; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--border); }
.list > li:last-child { border-bottom: 0; }
.list .grow { flex: 1; min-width: 0; }
.list .title { font-weight: 600; }
.empty { color: var(--muted); padding: 18px 0; text-align: center; }
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; }
table.data th, table.data td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); }
table.data th { font-size: .8rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
table.data tr.clickable { cursor: pointer; }
table.data tr.clickable:hover td { background: var(--surface-2); }

/* ---------- Planning ---------- */
.week-nav { display: flex; gap: 6px; align-items: center; }
.week-nav .label { min-width: 190px; text-align: center; font-weight: 600; }
.planning-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
table.planning { border-collapse: separate; border-spacing: 0; width: 100%; min-width: 980px; }
table.planning th, table.planning td { border-bottom: 1px solid var(--border); border-right: 1px solid var(--border); vertical-align: top; }
table.planning th { padding: 8px; font-size: .8rem; font-weight: 600; text-align: left; background: var(--surface-2); }
table.planning th.today { color: var(--accent); }
table.planning td { padding: 6px; height: 64px; width: 12%; }
table.planning td.person, table.planning th.person {
  position: sticky; left: 0; z-index: 1; background: var(--surface); width: 180px; min-width: 160px; padding: 8px 10px;
}
table.planning th.person { background: var(--surface-2); }
table.planning tr.me td.person { box-shadow: inset 3px 0 0 var(--accent); }
table.planning td.today { background: color-mix(in srgb, var(--accent) 5%, transparent); }
table.planning td.total { width: 90px; font-size: .85rem; white-space: nowrap; }
table.planning tfoot td { height: auto; font-size: .8rem; color: var(--muted); padding: 8px; background: var(--surface-2); }
.person .name { font-weight: 600; display: flex; gap: 6px; align-items: center; }
.person .pos { font-size: .78rem; color: var(--muted); }
.cell { display: flex; flex-direction: column; gap: 4px; min-height: 50px; }
.cell.editable { cursor: pointer; border-radius: 6px; }
.cell.editable:hover { background: var(--surface-2); }
.cell .add { color: var(--muted); font-size: .8rem; text-align: center; opacity: 0; padding-top: 12px; }
.cell.editable:hover .add { opacity: 1; }
.chip {
  border-radius: 6px; padding: 3px 6px; font-size: .78rem; line-height: 1.3; cursor: default;
  border-left: 3px solid var(--chip, var(--accent)); background: color-mix(in srgb, var(--chip, var(--accent)) 14%, var(--surface));
}
.cell.editable .chip, .chip.clickable { cursor: pointer; }
.chip strong { display: block; font-weight: 600; }
.chip.draft { border-style: dashed; border-width: 1px 1px 1px 3px; border-color: var(--chip); background: transparent; }
.chip.absence { border-left-color: var(--muted); background: var(--surface-2); color: var(--muted); font-style: italic; }
.over { color: var(--danger); font-weight: 600; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: .8rem; color: var(--muted); margin-top: 10px; }
.legend .chip { display: inline-block; }
.agenda { display: none; }
.agenda-day { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px; margin-bottom: 10px; }
.agenda-day.today { border-color: var(--accent); }
.agenda-day .chip { margin-top: 6px; padding: 6px 8px; font-size: .85rem; }
.agenda-day .chip.mine { box-shadow: inset 0 0 0 1px var(--chip); }
.agenda-head { display: flex; align-items: center; justify-content: space-between; }

.agenda-head h2 { font-size: 1rem; }
.agenda-head h2::first-letter { text-transform: uppercase; }
@media (max-width: 700px) {
  .agenda { display: block; }
  .planning-wrap, .legend { display: none; }
  .week-nav .label { min-width: 0; flex: 1; }
  .week-nav { width: 100%; }
}
.presets { display: flex; gap: 6px; flex-wrap: wrap; margin: -4px 0 12px; }

/* ---------- Annonces ---------- */
.announce-text { white-space: pre-wrap; line-height: 1.5; }
.announce .by { font-size: .8rem; color: var(--muted); margin-top: 10px; display: flex; gap: 8px; align-items: center; white-space: normal; }

/* ---------- Fenêtre modale & notifications ---------- */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(0, 0, 0, .45); z-index: 50;
  display: grid; place-items: center; padding: 16px; overflow-y: auto;
}
.modal { background: var(--surface); border-radius: 14px; width: 100%; max-width: 520px; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.modal header { display: flex; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.modal header h2 { margin-right: auto; }
.modal .body { padding: 18px 20px; max-height: 70vh; overflow-y: auto; }
.modal footer { display: flex; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--border); flex-wrap: wrap; }
.modal footer .spacer { flex: 1; }
.copy-box { display: flex; gap: 6px; }
.copy-box input { font-family: ui-monospace, monospace; font-size: .8rem; }

#toasts { position: fixed; top: 16px; right: 16px; z-index: 60; display: flex; flex-direction: column; gap: 8px; }
.toast {
  background: var(--text); color: var(--bg); padding: 10px 14px; border-radius: 10px; font-size: .9rem;
  box-shadow: var(--shadow); max-width: 340px; animation: slide .2s ease-out;
}
.toast.error { background: var(--danger); color: #fff; }
/* Bandeau « Nouvelle adresse » : appli ouverte depuis l'ancienne adresse (DOMAINE.md) */
.moved-banner {
  display: flex; flex-direction: column; gap: 2px; font-size: .88rem; text-align: center;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px; background: var(--peach); color: #3a2508;
}
.moved-banner a { color: #3a2508; }
/* Bandeau « Hors connexion » (réseau coupé sur le téléphone) */
.offline-banner {
  position: fixed; top: 0; left: 0; right: 0; z-index: 60; text-align: center; font-size: .85rem; font-weight: 600;
  padding: calc(6px + env(safe-area-inset-top)) 16px 6px; background: var(--danger); color: #fff;
}
.boot .btn { margin-top: 12px; }
@keyframes slide { from { transform: translateY(-8px); opacity: 0; } }

/* ---------- Divers ajoutés ---------- */
label.check { display: flex; gap: 8px; align-items: center; font-weight: 500; margin: 8px 0; cursor: pointer; }
label.check input { width: auto; margin: 0; }
.success-msg { color: var(--ok); background: var(--ok-soft); padding: 10px 12px; border-radius: 8px; margin-top: 0; }
.back { display: inline-block; margin-bottom: 10px; text-decoration: none; font-size: .9rem; }
.list.menu li { padding: 0; }
.list.menu a, .list.menu button.link {
  display: flex; gap: 12px; align-items: center; width: 100%; padding: 14px 4px; color: var(--text);
  text-decoration: none; background: none; border: 0; font: inherit; cursor: pointer; text-align: left;
}
.list.menu .ico { width: 24px; text-align: center; }

/* ---------- Documentation ---------- */
.search.wide { max-width: none; width: 100%; margin-bottom: 8px; }
.cat-list li { gap: 8px; }
.cat-list input { flex: 1; }

/* ---------- Congés payés ---------- */
.balance-card {
  display: grid; grid-template-columns: 1fr auto; gap: 10px 20px; align-items: center;
  background: var(--forest-card); color: var(--cream); border-radius: var(--radius); padding: 20px 22px; margin-bottom: 14px;
}
.balance-value { font-size: 2.6rem; font-weight: 800; line-height: 1; }
.balance-label { margin-top: 4px; }
.balance-detail { grid-column: 1 / -1; display: flex; gap: 18px; flex-wrap: wrap; font-size: .9rem; }
.balance-btn { grid-row: 1; grid-column: 2; background: var(--peach); color: #3a2508; border-color: var(--peach-text); font-weight: 600; }
.balance-btn:hover { background: #ffcb85; }
@media (max-width: 520px) {
  .balance-card { grid-template-columns: 1fr; }
  .balance-btn { grid-row: auto; grid-column: 1; width: 100%; }
}
.segmented.tabs { margin-bottom: 14px; }
.warn-text { color: var(--warn); }
.leave-preview { background: var(--surface-2); border-radius: 10px; padding: 10px 12px; margin: 2px 0 14px; font-size: .92rem; }
label.check.small { font-size: .82rem; margin: 6px 0 0; }

/* ---------- Bibliothèque ---------- */
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.chip-btn {
  border: 1px solid var(--border); background: var(--surface); color: var(--text); border-radius: 999px;
  padding: 6px 12px; font: inherit; font-size: .88rem; cursor: pointer;
}
.chip-btn.small { font-size: .8rem; padding: 4px 10px; }
.chip-btn span { color: var(--muted); margin-left: 2px; }
.chip-btn.on { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.chip-btn.on span { color: inherit; opacity: .8; }
.group-title { margin: 22px 0 10px; font-size: .95rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.doc-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.doc-transfer { margin-top: 24px; }
.doc-transfer label.btn { margin: 0; font: inherit; font-weight: 500; }
.doc-card {
  display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden; text-decoration: none; color: inherit; box-shadow: var(--shadow);
  transition: transform .12s ease, border-color .12s ease;
}
.doc-card:hover { transform: translateY(-2px); border-color: var(--accent); }
.doc-card img { width: 100%; height: 140px; object-fit: cover; display: block; }
.doc-icon { height: 90px; display: grid; place-items: center; font-size: 2.2rem; background: var(--surface-2); }
.doc-body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 4px; }
.doc-title { font-weight: 700; font-size: 1.02rem; }
.doc-summary { color: var(--muted); font-size: .88rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.doc-meta { margin: -8px 0 14px; }
.doc-lead { font-size: 1.05rem; margin: 0 0 16px; }
.doc-photo { width: 100%; max-height: 420px; object-fit: cover; border-radius: var(--radius); margin-bottom: 16px; display: block; }
.stat input { font-size: 1.4rem; font-weight: 700; padding: 2px 8px; max-width: 120px; }
.recipe-grid { grid-template-columns: minmax(240px, 1fr) 2fr; align-items: start; }
@media (max-width: 760px) { .recipe-grid { grid-template-columns: 1fr; } }
.ingredients { list-style: none; padding: 0; margin: 0; }
.ingredients li { padding: 7px 0; border-bottom: 1px dashed var(--border); }
.ingredients li:last-child { border-bottom: 0; }
.ingredients li.group { font-weight: 700; padding-top: 14px; border-bottom: 0; color: var(--accent); }
.ingredients li.ing { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.ingredients .qty, .bowl-legend .qty { font-weight: 600; text-align: right; white-space: nowrap; }

/* Schéma de dressage (bol vu du dessus) */
.bowl-card { margin-bottom: 16px; }
.bowl { display: grid; gap: 20px; align-items: center; grid-template-columns: minmax(0, 340px) 1fr; }
.bowl-svg { width: 100%; max-width: 340px; height: auto; display: block; margin: 0 auto; }
.bowl-legend { display: grid; gap: 14px; }
.bowl-legend-title { font-size: .78rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); margin-bottom: 4px; }
.bowl-legend ul { list-style: none; margin: 0; padding: 0; }
.bowl-legend li { display: flex; align-items: center; gap: 8px; padding: 5px 0; border-bottom: 1px dashed var(--border); }
.bowl-legend li:last-child { border-bottom: 0; }
.bowl-legend .swatch { width: 14px; height: 14px; border-radius: 50%; flex: none; box-shadow: 0 0 0 1px rgba(0, 0, 0, .35) inset; }
.bowl-legend .num { width: 20px; height: 20px; border-radius: 50%; flex: none; display: inline-grid; place-items: center;
  font-size: .72rem; font-weight: 700; background: #141A15; color: #FBF3E6; border: 1.5px solid #FBF3E6; }
.bowl-legend .name { flex: 1; }
.layout-panel { border: 1px solid var(--border); border-radius: 14px; padding: 14px; margin: 4px 0 12px; display: grid; gap: 12px; }
.layout-zones li { gap: 10px; padding: 6px 0; }
.layout-zones select { width: auto; min-width: 150px; }
@media (max-width: 720px) { .bowl { grid-template-columns: 1fr; } }
.rich { line-height: 1.65; }
.rich > :first-child { margin-top: 0; }
.rich h3 { margin: 18px 0 6px; }
.rich ol, .rich ul { padding-left: 22px; }
.rich ol li { margin-bottom: 8px; padding-left: 4px; }
.rich ol li::marker { font-weight: 700; color: var(--accent); }
.editor { max-width: 760px; }
.editor textarea { font-family: inherit; }
.segmented { display: flex; gap: 6px; flex-wrap: wrap; }
.segmented label { margin: 0; font-weight: 500; }
.segmented input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.segmented span { display: inline-block; padding: 8px 14px; border: 1px solid var(--border); border-radius: 8px; cursor: pointer; }
.segmented input:checked + span { background: var(--accent-soft); border-color: var(--accent); color: var(--text); font-weight: 600; }
.segmented input:focus-visible + span { outline: 2px solid var(--accent); }
.photo-edit img { max-width: 260px; max-height: 180px; border-radius: 8px; object-fit: cover; display: block; margin-bottom: 8px; }

/* ---------- Températures ---------- */
.temp-banners { display: flex; flex-direction: column; gap: 8px; margin: 4px 0 12px; }
.temp-banner, .temp-alert {
  display: flex; gap: 12px; align-items: center; padding: 14px 16px; border-radius: 14px; text-decoration: none;
  color: #2b1a06; background: var(--peach); border: 1px solid var(--peach);
}
.temp-banner .ico { width: 28px; height: 28px; flex: none; }
.temp-banner .grow, .temp-alert .grow { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.temp-list .grow { flex: 1; min-width: 0; }
.temp-banner-btn { background: #2b1a06; color: var(--cream); border-color: #2b1a06; flex: none; }
.temp-banner.danger, .temp-alert.danger { background: var(--danger-soft); border-color: rgba(255, 123, 107, .45); color: var(--text); }
.temp-banner.danger .ico { color: var(--danger); }
.temp-banner.warn, .temp-alert.warn { background: var(--warn-soft); border-color: rgba(255, 191, 105, .4); color: var(--text); }
.temp-alert { margin-bottom: 10px; }
.temp-alert .ico { width: 20px; height: 20px; color: var(--chevron); flex: none; }
.temp-alert.static { margin: 0 0 6px; }
.temp-note { background: var(--surface-2); border-radius: 12px; padding: 10px 14px; margin-bottom: 10px; font-size: .93rem; }
.danger-text { color: var(--danger); }
.center { text-align: center; }

.slot-tabs {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: 4px; margin: 6px 0 10px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 4px;
}
.slot-tab {
  display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 4px; border-radius: 12px;
  text-decoration: none; color: var(--text); text-align: center; min-width: 0;
}
.slot-name { font-size: .88rem; font-weight: 600; line-height: 1.15; }
.slot-state { font-size: .75rem; color: var(--muted); }
.slot-tab.state-done .slot-state { color: var(--ok); }
.slot-tab.state-missed .slot-state { color: var(--danger); font-weight: 600; }
.slot-tab.state-justified .slot-state { color: var(--warn); }
.slot-tab.active { background: var(--peach); color: #2b1a06; }
.slot-tab.active .slot-state { color: #2b1a06; }
.temp-list { list-style: none; margin: 0; padding: 0; }
.temp-list li { display: flex; align-items: center; gap: 12px; padding: 11px 16px; border-bottom: 1px solid var(--border); }
.temp-list li:last-child { border-bottom: 0; }
.temp-list li.is-ecart { background: rgba(249, 132, 74, .1); }
.temp-eq { font-weight: 500; font-size: 1.02rem; }

.temp-entry { max-width: 460px; margin: 0 auto; display: flex; flex-direction: column; gap: 14px; }
.temp-entry h1 { margin: 0; }
.temp-entry p { margin: 2px 0 0; }
.temp-reading { display: flex; flex-direction: column; gap: 12px; }
.temp-display { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
/* Toujours sur une ligne : « −18,5 °C » ne passe plus à la ligne et le pavé ne saute plus pendant la frappe */
.temp-display output { font-size: clamp(2rem, 10vw, 3.4rem); font-weight: 600; letter-spacing: -.02em; font-variant-numeric: tabular-nums; text-align: center; flex: 1;
  min-width: 0; white-space: nowrap; overflow: hidden; }
.temp-step {
  width: 56px; height: 56px; border-radius: 50%; border: 1px solid var(--border); background: var(--surface-2);
  color: var(--text); font: inherit; font-size: 1.7rem; cursor: pointer; flex: none;
}
.temp-gauge { position: relative; height: 10px; border-radius: 999px; background: rgba(255, 123, 107, .25); overflow: hidden; }
.temp-gauge .zone { position: absolute; top: 0; bottom: 0; background: var(--forest); }
.temp-gauge .mark { position: absolute; top: 0; bottom: 0; width: 4px; border-radius: 2px; background: var(--text); }
.temp-gauge-labels { display: flex; justify-content: space-between; margin-top: -6px; }
/* Hauteur réservée au badge : son apparition au premier chiffre ne décale pas le pavé */
.temp-status { display: flex; align-items: center; justify-content: center; min-height: 2.4rem; }
.temp-status .badge { font-size: .95rem; padding: 5px 14px; }
/* iPhone : pas d'attente du double-tap (zoom), pas de sélection ni de loupe sur appui long, pas de voile gris ;
   « pressed » donne le retour visuel dès que le doigt touche (« :active » n'est pas fiable sur iOS) */
.keypad, .temp-display { touch-action: manipulation; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.keypad button, .temp-step { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.temp-gauge { contain: layout paint; }
.temp-step:active, .temp-step.pressed { background: var(--surface); }
.keypad { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.keypad button {
  height: 54px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface); color: var(--text);
  font: inherit; font-size: 1.4rem; cursor: pointer;
}
.keypad button:active, .keypad button.pressed { background: var(--surface-2); }
.keypad .keypad-del { grid-column: 3; }
.temp-ecart { border-color: rgba(255, 123, 107, .45); }
.temp-ecart h2 { font-size: 1.05rem; }
.chip-check { margin: 0; font-weight: 500; }
.chip-check input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.chip-check span {
  display: inline-block; border: 1px solid var(--border); background: var(--surface-2); border-radius: 999px;
  padding: 8px 13px; font-size: .9rem; cursor: pointer;
}
.chip-check input:checked + span { background: var(--accent-soft); border-color: var(--accent); }
.chip-check input:checked + span::before { content: '✓ '; color: var(--accent); font-weight: 700; }
.chip-check input:focus-visible + span { outline: 2px solid var(--accent); }
.temp-save { padding: 15px; font-size: 1.05rem; border-radius: 999px; background: var(--peach); border-color: var(--peach-text); color: #2b1a06; font-weight: 700; }
.temp-save:disabled { opacity: .5; }
.temp-justify { max-width: 520px; margin: 0 auto; display: flex; flex-direction: column; gap: 14px; }
.temp-reasons { border: 0; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 4px; }
.temp-reasons legend { font-weight: 600; margin-bottom: 6px; }

.temp-reg-tools { gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.temp-sheet { background: #fff; color: #1b231c; border-radius: 8px; padding: 22px 24px; }
.temp-sheet header { border-bottom: 2px solid var(--forest); padding-bottom: 8px; margin-bottom: 12px; }
.temp-sheet h1 { font-size: 1.3rem; margin: 0 0 4px; color: #1b231c; }
.temp-sheet h2 { font-size: .95rem; margin: 0 0 6px; color: #1b231c; }
.temp-sheet p { margin: 2px 0; color: #4a554b; font-size: .85rem; }
.sheet-scroll { overflow-x: auto; }
.temp-table { border-collapse: collapse; width: 100%; font-size: .8rem; font-variant-numeric: tabular-nums; }
.temp-table th { background: #eef3e9; font-weight: 600; padding: 6px 5px; border: 1px solid #c9d3c4; text-align: center; white-space: nowrap; }
.temp-table td { padding: 4px 5px; border: 1px solid #e2e8de; text-align: center; white-space: nowrap; }
.temp-table td:nth-child(-n+2), .temp-table th:nth-child(-n+2) { text-align: left; }
.temp-table td:first-child { font-weight: 600; }
.temp-table td.out { background: #ffe1da; color: #a3261a; font-weight: 700; }
.temp-table tr.missing td { background: #fff4e0; }
.temp-table tr.missing td:nth-child(3) { color: #8a4b00; }
.temp-table tr.closed td, .temp-table tr.upcoming td { background: #f3f5f1; color: #6a756b; font-style: italic; }
.temp-table tr.closed td:first-child { font-style: normal; color: #1b231c; }
.temp-table .empty-cell { color: #9aa596; }
.temp-table sup { font-size: .7em; margin-left: 1px; }
.temp-table .th-range { display: block; font-weight: 400; font-size: .72rem; color: #4a554b; white-space: nowrap; }
.temp-sheet footer { display: grid; grid-template-columns: minmax(0, 1fr) 220px; gap: 24px; margin-top: 16px; font-size: .85rem; }
.sheet-notes { margin: 0 0 8px; padding-left: 22px; display: flex; flex-direction: column; gap: 4px; }
.visa-line { border-bottom: 1px solid #9aa596; height: 40px; }
@media (max-width: 640px) { .temp-sheet footer { grid-template-columns: 1fr; } .temp-sheet { padding: 16px; } }

.temp-settings-list li { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.slot-row input[name=name] { flex: 1 1 140px; min-width: 0; }
.slot-row select { flex: 0 1 160px; width: auto; }
.slot-hours { display: inline-flex; align-items: center; gap: 6px; }
.slot-hours input { width: auto; }
.temp-schedule { border-collapse: collapse; margin-bottom: 14px; }
.temp-schedule th { text-align: left; padding: 4px 12px 4px 0; font-weight: 500; }
.temp-schedule thead th { color: var(--muted); font-size: .85rem; text-align: center; }
.temp-schedule td { padding: 3px 4px; text-align: center; }
.temp-schedule .chip-btn { min-width: 84px; }
.card > h2 .btn { margin-left: auto; }

/* ---------- Réceptions ---------- */
.rec-new {
  display: flex; align-items: center; justify-content: center; gap: 10px; padding: 18px; border-radius: 18px;
  background: var(--peach); color: #2b1a06; text-decoration: none; font-weight: 700; font-size: 1.1rem; margin-bottom: 6px;
}
.rec-new .ico { width: 26px; height: 26px; }
.rec-row { display: flex; align-items: center; gap: 12px; flex: 1; color: var(--text); text-decoration: none; min-width: 0; }
.rec-row .grow { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.rec-row .ico { color: var(--chevron); width: 20px; height: 20px; flex: none; }
.ok-text { color: var(--ok); }
.rec-tips ol { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 4px; }
.rec-form { max-width: 620px; margin: 0 auto; display: flex; flex-direction: column; gap: 14px; }
.rec-form .card h2 { font-size: 1.08rem; gap: 10px; }
.step-num {
  display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; flex: none;
  background: var(--surface-2); color: var(--peach-text); font-size: .9rem;
}
.rec-photo-row { display: flex; align-items: center; gap: 12px; padding: 8px 0; }
.rec-photo-row .grow { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.rec-photo-row > img, .rec-photo-empty { width: 64px; height: 64px; border-radius: 10px; object-fit: cover; flex: none; }
.rec-photo-empty { display: grid; place-items: center; background: var(--surface-2); color: var(--muted); }
.rec-thumbs { display: flex; gap: 6px; flex-wrap: wrap; }
.rec-thumbs img { width: 48px; height: 48px; border-radius: 8px; object-fit: cover; }
.rec-thumbs.big img { width: 96px; height: 96px; }
.rec-checks { list-style: none; margin: 8px 0 0; padding: 0; }
.rec-checks li { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--border); }
.rec-checks li:last-child { border-bottom: 0; }
.rec-checks .grow { flex: 1; }
.yes-no { display: inline-flex; border: 1px solid var(--border); border-radius: 999px; overflow: hidden; flex: none; }
.yes-no button { border: 0; background: transparent; color: var(--muted); font: inherit; font-size: .92rem; padding: 8px 16px; cursor: pointer; }
.yes-no button.on.yes { background: var(--forest); color: var(--text); }
.yes-no button.on.no { background: var(--danger); color: var(--on-danger); font-weight: 600; }
.rec-family { border-top: 1px solid var(--border); padding: 12px 0 6px; display: flex; flex-direction: column; gap: 8px; }
.rec-family-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.rec-family-head strong { font-size: 1rem; }
.rec-family-head .btn { margin-left: auto; }
.rec-measure { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.rec-measure input[data-product] { flex: 1 1 150px; min-width: 0; }
.rec-measure .temp-input { width: 84px; flex: none; text-align: right; }
.sign-btn { width: 40px; flex: none; font-size: 1.1rem; }
.rec-nc-list li { display: flex; align-items: center; gap: 8px; }
.rec-nc-list .grow { flex: 1; display: flex; flex-direction: column; }
.rec-nc { border-color: rgba(255, 123, 107, .45); }
.rec-table td.rec-temps { text-align: left; white-space: normal; min-width: 220px; }
.rec-table .out-text, .rec-table .no { color: #a3261a; font-weight: 700; }
.rec-table tr.missing td:nth-child(3) { color: inherit; }

/* ---------- Nettoyage ---------- */
.clean-section { padding: 0; }
.clean-section > summary { display: flex; align-items: center; gap: 12px; padding: 14px 16px; cursor: pointer; list-style: none; }
.clean-section > summary::-webkit-details-marker { display: none; }
.clean-section > summary .grow { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.clean-section-title { font-weight: 600; font-size: 1.05rem; }
.clean-section[open] > summary { border-bottom: 1px solid var(--border); }
.clean-zone { padding: 6px 0 4px; }
.clean-zone-head { display: flex; align-items: center; gap: 8px; padding: 8px 16px 2px; color: var(--accent); }
.clean-zone-head .btn { margin-left: auto; }
.clean-row { align-items: flex-start !important; }
.clean-row details summary { list-style: none; cursor: pointer; display: flex; flex-direction: column; gap: 2px; }
.clean-row details summary::-webkit-details-marker { display: none; }
.clean-name { font-weight: 500; }
.clean-row.is-done .clean-name { color: var(--muted); }
.clean-row.is-late { background: var(--danger-soft); }
.clean-detail { padding: 8px 0 4px; }
.clean-steps { margin: 6px 0; padding-left: 20px; display: flex; flex-direction: column; gap: 3px; font-size: .92rem; }
.temp-list .clean-steps li { display: list-item; padding: 0; border: 0; background: none; }
.clean-reg td:nth-child(2) { width: 110px; }
.clean-check { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; background: var(--ok-soft); color: var(--ok); font-weight: 700; flex: none; }
.clean-do { flex: none; min-width: 64px; }
.clean-plan section { margin-bottom: 14px; break-inside: auto; }
.clean-plan h2, .clean-reg-zone h2 { font-size: 1rem; margin: 14px 0 6px; color: #1b231c; }
.clean-table td { white-space: normal; text-align: left; vertical-align: top; }
.clean-table td:nth-child(1) { width: 20%; }
.clean-table td:nth-child(2) { width: 24%; }
.clean-table td:nth-child(3) { width: 12%; }
.clean-table ol { margin: 0; padding-left: 16px; }
.clean-note { margin: 4px 0 0 !important; color: #a3261a !important; font-weight: 600; }
.clean-reg td { white-space: normal; text-align: center; font-size: .78rem; }
.clean-reg td:first-child { text-align: left; font-weight: 500; min-width: 180px; }
.clean-reg td:nth-child(2) { text-align: left; color: #4a554b; font-weight: 400; }
.clean-reg td.closed-day { background: #f3f5f1; }
.clean-mark { display: block; }
.clean-miss { display: block; color: #a3261a; font-weight: 700; }
@media print { .clean-reg-zone, .clean-plan section { break-inside: avoid; } }

/* ---------- Produits d'entretien ---------- */
.prod-mix { background: var(--danger-soft); border: 1px solid var(--danger); border-radius: 14px; padding: 14px 16px; margin-bottom: 18px; }
.prod-mix-title { display: block; color: var(--danger); font-size: 1.05rem; margin-bottom: 10px; }
.prod-mix-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.prod-mix-cols > div { background: var(--surface); border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; }
.prod-mix-cols b { color: var(--warn); }
.prod-mix p { margin: 10px 0 0; font-size: .93rem; }
.temp-sheet .prod-mix.on-paper { background: #fdecea; border: 2px solid #c0392b; border-radius: 8px; color: #1b231c; margin: 0 0 10px; padding: 8px 12px; font-size: .9rem; }
.prod-mix.on-paper strong { color: #a12a1e; }
.prod-family { margin-bottom: 18px; }
.prod-family-title { font-size: .8rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 0 0 8px; }
.prod-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; }
.prod-card { display: flex; flex-direction: column; gap: 6px; color: var(--text); text-decoration: none; margin: 0; }
.prod-card:hover { border-color: var(--accent); }
.prod-card-head { display: flex; gap: 8px; align-items: flex-start; }
.prod-card-head .badge { white-space: nowrap; }
.prod-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.prod-chip { background: var(--surface-2); border-radius: 8px; padding: 4px 8px; font-size: .8rem; }
.prod-todo li { flex-direction: column; align-items: flex-start; gap: 2px; }
.prod-files li { gap: 10px; }
.prod-file-name { display: block; overflow-wrap: anywhere; }
.prod-detail { display: flex; flex-direction: column; gap: 14px; max-width: 760px; }
.prod-detail .card { margin: 0; }
.prod-head { display: flex; flex-direction: column; gap: 6px; }
.prod-title { font-size: 1.5rem; margin: 0; line-height: 1.2; }
.prod-facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 8px; }
.prod-fact { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; gap: 4px; }
.prod-warn { border-color: var(--danger); background: var(--danger-soft); }
.prod-warn h2 { color: var(--danger); }
.prod-warn ul { margin: 0; padding-left: 20px; }
.prod-table td { white-space: normal; text-align: left; vertical-align: top; }
.prod-table td:first-child { width: 18%; }
.prod-table td:nth-child(2) { width: 22%; }
.prod-hz { color: #a3261a; font-weight: 600; }
.prod-poster-foot { margin-top: 8px !important; }
@media (max-width: 640px) { .prod-mix-cols { grid-template-columns: 1fr 1fr; } .prod-grid { grid-template-columns: 1fr; } }
@media print {
  .prod-poster header { margin-bottom: 6px; padding-bottom: 4px; }
  .prod-poster .temp-table { font-size: 7.5pt; line-height: 1.25; }
  .prod-poster .temp-table th, .prod-poster .temp-table td { padding: 2px 4px; }
}

/* ---------- Impression du planning ---------- */
@media print {
  :root {
    --bg: #fff; --surface: #fff; --surface-2: #f1f3f5; --border: #d0d4d9; --text: #000; --muted: #555;
    --accent: #548649; --accent-strong: #548649; --forest: #548649; --cream: #fff; --accent-soft: #eef4e8; --accent-text: #fff; color-scheme: light;
  }
  .topbar, .no-print, .back, #toasts { display: none !important; }
  .temp-sheet { padding: 0; border-radius: 0; }
  .temp-sheet footer { break-inside: avoid; }
  .temp-table tr { break-inside: avoid; }
  .temp-table thead { display: table-header-group; }
  .temp-table { font-size: 9pt; }
  .sheet-scroll { overflow: visible; }
  .card { box-shadow: none; break-inside: avoid; }
  .recipe-grid { grid-template-columns: 1fr 2fr; }
  .main { padding: 0; }
  body { background: #fff; color: #000; }
  .planning-wrap { overflow: visible; border: 0; }
  table.planning { min-width: 0; font-size: 10px; }
  .cell .add { display: none; }
}

/* ---------- Allergènes ---------- */
.al-meta { margin: -8px 0 12px; }
.al-filter h2 { font-size: 1rem; margin: 0 0 10px; }
.al-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.al-chip { min-height: 40px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--border); background: transparent; color: var(--text); font: inherit; font-size: .9rem; cursor: pointer; }
.al-chip.on { background: var(--danger); border-color: var(--danger); color: var(--on-danger); font-weight: 600; }
.al-summary { margin: 10px 0 0; color: var(--ok); }
.al-cat { margin-bottom: 16px; }
.al-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.al-row { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; }
.al-row.is-contains { opacity: .55; }
.al-row-head { display: flex; align-items: center; gap: 8px; }
.al-name { flex: 1; font-weight: 500; text-align: left; }
.al-row .link-btn.al-name { color: var(--text); text-decoration: none; min-height: 28px; }
.al-frozen { font-size: .72rem; color: var(--frozen); border: 1px solid currentColor; border-radius: 6px; padding: 1px 6px; }
.al-pills { display: flex; flex-wrap: wrap; gap: 4px; font-size: .78rem; }
.al-pill { background: var(--peach); color: #3a2508; border-radius: 6px; padding: 2px 7px; font-weight: 600; }
.al-pill.trace { background: transparent; border: 1px dashed var(--peach); color: var(--peach-text); font-weight: 400; }
.al-grid { border: 1px solid var(--border); border-radius: 12px; padding: 4px 12px 8px; margin: 12px 0; }
.al-grid legend { padding: 0 6px; font-weight: 600; }
.al-grid-row { display: flex; align-items: center; gap: 8px; min-height: 44px; border-top: 1px solid var(--surface-2); }
.al-grid-row:first-of-type { border-top: 0; }
.al-grid-row > span { flex: 1; }
.al-seg { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); width: 210px; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.al-opt { display: flex; align-items: center; justify-content: center; min-height: 36px; font-size: .8rem; color: var(--muted); cursor: pointer; border-left: 1px solid var(--border); }
.al-opt:first-child { border-left: 0; }
.al-opt input { position: absolute; opacity: 0; pointer-events: none; }
.al-opt:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: -2px; }
.al-opt.none:has(input:checked) { background: var(--surface-2); color: var(--text); }
.al-opt.traces:has(input:checked) { background: var(--peach); color: #3a2508; font-weight: 700; }
.al-opt.contains:has(input:checked) { background: var(--danger); color: var(--on-danger); font-weight: 700; }

.al-poster { background: #fff; color: #1b231c; border-radius: 8px; padding: 18px 20px; overflow-x: auto; }
.al-poster h1 { text-align: center; color: #548649; font-size: 2rem; margin: 0 0 12px; }
.al-poster-cols { display: grid; grid-template-columns: repeat(2, minmax(640px, 1fr)); gap: 28px; align-items: start; }
.al-poster-table { border-collapse: collapse; width: 100%; table-layout: fixed; font-size: 8.5pt; }
.al-poster-table th, .al-poster-table td { border: 1px solid #c9d3c4; padding: 0 2px; height: 17px; text-align: center; }
.al-poster-table thead th { background: #6aa857; color: #fff; border-color: #fff; height: 104px; vertical-align: bottom; padding-bottom: 6px; font-size: 7pt; font-weight: 600; letter-spacing: .03em; }
.al-poster-table thead th span { writing-mode: vertical-rl; transform: rotate(180deg); text-transform: uppercase; }
.al-poster-table thead th.al-brand { width: 37%; font-size: 14pt; vertical-align: middle; }
.al-poster-table td:first-child { text-align: left; padding-left: 6px; text-transform: uppercase; font-size: 7.5pt; letter-spacing: .01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.al-cat-row th { background: #6aa857; color: #fff; text-align: left; padding-left: 8px; font-size: 9pt; letter-spacing: .06em; text-transform: uppercase; height: 18px; }
.al-dot { color: #548649; font-size: 10pt; line-height: 1; }
.al-trace { color: #548649; font-size: 5pt; letter-spacing: 0; }
.al-snow { color: #2f5d8a; }
.al-poster footer { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 28px; margin-top: 12px; font-size: 8pt; color: #4a554b; align-items: end; }
.al-poster footer p { margin: 0; }
.al-legend { display: flex; flex-direction: column; gap: 3px; color: #548649; }
.al-legend .al-date { color: #4a554b; }
@media print {
  .al-poster { padding: 0; border-radius: 0; overflow: visible; }
  .al-poster-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .al-poster-table thead th, .al-cat-row th { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ---------- Traçabilité ---------- */
.tr-pick { border: 2px solid var(--accent); display: flex; flex-direction: column; gap: 8px; }
.tr-pick p { margin: 0; }
.tr-pick-head { display: flex; align-items: center; gap: 8px; font-size: 1.1rem; }
.tr-date { display: flex; flex-direction: column; gap: 2px; background: var(--surface-2); border-radius: 12px; padding: 12px 14px; }
.tr-date-big { font-size: 1.9rem; font-weight: 700; color: var(--peach-text); line-height: 1.15; }
.tr-group { margin-bottom: 14px; }
.tr-list { display: flex; flex-direction: column; gap: 6px; }
.tr-item { display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 8px 14px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.tr-item.on { border: 2px solid var(--accent); background: var(--surface-2); }
.tr-days { font-weight: 600; color: var(--peach-text); white-space: nowrap; }
.tr-rules ul { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 4px; font-size: .92rem; }
.tr-rules { border-color: var(--warn); }
.tr-actions { border: 0; padding: 0; margin: 0 0 8px; }
.tr-actions legend { font-weight: 500; margin-bottom: 4px; }
.tr-item[hidden], .tr-group[hidden] { display: none; }
.tr-item .grow { flex: 1; }

/* ---------- Cuisson et service ---------- */
.cook-hint { margin: -4px 0 10px; }
.cook-run { border: 2px solid var(--warn); display: flex; flex-direction: column; gap: 6px; }
.cook-run.late { border-color: var(--danger); }
.cook-run p { margin: 0; }
.cook-run-head { display: flex; align-items: center; gap: 8px; font-size: 1.1rem; }
.cook-left { display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px; background: var(--surface-2); border-radius: 12px; padding: 10px 12px; }
.cook-left-big { font-size: 1.5rem; font-weight: 700; color: var(--peach-text); }
.cook-run.late .cook-left-big { color: var(--danger); }
.cook-chip { display: inline-flex; cursor: pointer; }
.cook-chip input { position: absolute; opacity: 0; pointer-events: none; }
.cook-chip span { display: inline-flex; align-items: center; min-height: 40px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--border); }
.cook-chip input:checked + span { background: var(--accent); color: var(--accent-text); border-color: var(--accent); font-weight: 600; }
.cook-chip input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.cook-temp { display: flex; align-items: center; gap: 8px; }
.cook-temp input { font-size: 1.4rem; font-weight: 600; }
.cook-temp span { color: var(--muted); font-size: 1.1rem; }
.cook-preview { border-radius: 10px; font-size: .92rem; }
.cook-preview:not(:empty) { padding: 10px 12px; margin-bottom: 10px; }
.cook-preview.ok { background: var(--ok-soft); color: var(--ok); }
.cook-preview.continue { background: var(--warn-soft); color: var(--warn); }
.cook-preview.nok { background: var(--danger-soft); color: var(--danger); }
.cook-hot { display: flex; flex-direction: column; gap: 8px; padding: 10px 0; border-top: 1px solid var(--surface-2); }
.cook-hot:first-of-type { border-top: 0; }
.cook-hot p { margin: 0; }
.cook-hot-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.cook-cell { display: flex; flex-direction: column; gap: 2px; align-items: flex-start; background: var(--surface-2); border-radius: 10px; padding: 8px 10px; }
.cook-val { font-size: 1.15rem; font-weight: 700; }
.cook-val.ok { color: var(--ok); }
.cook-val.bad { color: var(--danger); }
.cook-sub { font-size: .95rem; margin: 10px 0 4px; }
.cook-table td { white-space: normal; text-align: left; }
.cook-table tr.cook-nok td { background: #ffe9e4; }

/* ---------- Documents du PMS ---------- */
.pms-counters { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 14px; }
.pms-counter { border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; font-size: .8rem; color: var(--muted); }
.pms-counter strong { font-size: 1.5rem; line-height: 1.1; }
.pms-counter.ok { background: var(--ok-soft); } .pms-counter.ok strong { color: var(--ok); }
.pms-counter.warn { background: var(--warn-soft); } .pms-counter.warn strong { color: var(--warn); }
.pms-counter.danger { background: var(--danger-soft); } .pms-counter.danger strong { color: var(--danger); }
.pms-links { margin-bottom: 16px; }
.pms-files { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; font-size: .9rem; }
.pms-files li { display: flex; gap: 10px; align-items: center; }
.pms-files a { overflow-wrap: anywhere; }
.pms-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.pms-contract { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.pms-next { display: flex; flex-direction: column; gap: 2px; border: 1px dashed var(--warn); }
.pms-next.late { border: 2px solid var(--danger); }
.pms-next-date { font-size: 1.3rem; color: var(--peach-text); }
.pms-rules ul { padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
.pms-rules.todo { border: 2px solid var(--accent); }

/* ---------- Plan HACCP ---------- */
.haccp-status { margin: -6px 0 14px; }
.haccp-alert { display: flex; flex-direction: column; gap: 4px; border: 1px dashed var(--warn); background: var(--surface-2); }
.haccp-alert strong { color: var(--peach-text); }
.haccp-sign.todo { border: 2px solid var(--accent); }
.haccp-sign form { display: flex; flex-direction: column; gap: 10px; }
.haccp-sign h2 { margin: 0; }
.haccp-probe { display: flex; flex-direction: column; gap: 6px; }
.haccp-probe.late { border: 2px solid var(--danger); }
.haccp-filters { margin: 4px 0 8px; }
.haccp-legend { display: flex; flex-wrap: wrap; gap: 4px 12px; margin: 0 0 10px; }
.haccp-legend strong { color: var(--text); }
.haccp-steps { list-style: none; margin: 0 0 16px; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.haccp-step { background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--ok); border-radius: 12px; overflow: hidden; }
.haccp-step[hidden] { display: none; }
.haccp-step.ccp { border-left-color: var(--danger); }
.haccp-step.watch { border-left-color: var(--warn); }
.haccp-step summary { list-style: none; display: flex; align-items: center; gap: 10px; min-height: 56px; padding: 10px 12px; cursor: pointer; }
.haccp-step summary::-webkit-details-marker { display: none; }
.haccp-step summary:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.haccp-num { width: 24px; flex: none; font-weight: 600; color: var(--muted); font-size: .9rem; }
.haccp-name { display: block; font-weight: 600; line-height: 1.25; }
.haccp-meta { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
.haccp-meta .badge { font-size: .72rem; }
.haccp-letters { font-size: .8rem; color: var(--muted); letter-spacing: .08em; }
.haccp-toggle { flex: none; font-size: 1.2rem; color: var(--muted); width: 20px; text-align: center; }
.haccp-step details[open] .haccp-toggle { transform: rotate(45deg); }
.haccp-step details > .row { padding: 0 12px 12px 46px; flex-wrap: wrap; }
.haccp-fields { margin: 0; padding: 0 14px 10px 46px; display: flex; flex-direction: column; gap: 8px; font-size: .92rem; line-height: 1.45; }
.haccp-fields dt { color: var(--muted); font-size: .8rem; }
.haccp-fields dd { margin: 0; }
.haccp-limit { color: var(--danger); font-weight: 600; }
.haccp-limit.big { font-size: 1.1rem; }
.haccp-validate { width: 100%; margin-top: 8px; }
.haccp-versions { margin-top: 10px; }
.haccp-versions summary { cursor: pointer; color: var(--muted); min-height: 40px; display: flex; align-items: center; }
.haccp-kicker { margin: 0; font-size: .8rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ok); }
.haccp-kicker.ccp { color: var(--danger); }
.haccp-kicker.watch { color: var(--warn); }
.haccp-title { margin: 2px 0 4px; }
.haccp-live { display: flex; flex-direction: column; gap: 8px; }
.haccp-live h2 { margin: 0; }
.haccp-live-row { display: flex; align-items: center; gap: 10px; }
.haccp-field h2 { font-size: .8rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 0 0 4px; }
.haccp-field p { margin: 0; line-height: 1.45; }
.haccp-howto { margin: 0 0 12px; padding-left: 20px; display: flex; flex-direction: column; gap: 4px; font-size: .92rem; }
.haccp-step summary .grow { flex: 1; min-width: 0; }
.haccp-live p { margin: 0; }
.haccp-live, .haccp-field { margin-bottom: 10px; }
.haccp-sign > p { margin: 0; }

/* ---------- Le PMS en livre ---------- */
.book { position: fixed; inset: 0; z-index: 20; display: flex; flex-direction: column; background: var(--bg); color: var(--text); }
.book-loading { margin: auto; color: var(--muted); }
.book-bar { display: flex; align-items: center; gap: 4px; padding: 6px 8px; padding-top: max(6px, env(safe-area-inset-top)); background: var(--topbar); border-bottom: 1px solid var(--border); }
.book-bar-title { flex: 1; min-width: 0; text-align: center; font-size: .9rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.book-stage { flex: 1; min-height: 0; display: flex; justify-content: center; gap: 0; padding: 14px; overflow: hidden; }
.book-page {
  --ink: #1b231c; --ink-muted: #4a554b; --paper-line: #e3dccd;
  position: relative; flex: 1; max-width: 640px; min-width: 0; overflow-y: auto; overscroll-behavior: contain;
  background: #fbf3e6; color: var(--ink); border-radius: 6px 14px 14px 6px; padding: 24px 22px 40px 26px;
  box-shadow: inset 10px 0 14px -10px rgba(0, 0, 0, .35), 0 2px 10px rgba(0, 0, 0, .45);
  display: flex; flex-direction: column; gap: 10px; line-height: 1.45;
}
.book-stage.spread .book-page { max-width: 600px; border-radius: 0 12px 12px 0; }
.book-stage.spread .book-page:first-child { border-radius: 12px 0 0 12px; box-shadow: inset -12px 0 16px -12px rgba(0, 0, 0, .35), 0 2px 10px rgba(0, 0, 0, .45); }
.book-page.blank { background: #efe6d6; }
.book-page a:not(.btn) { color: #2f5a27; font-weight: 600; }
.book-page .btn { align-self: flex-start; }
.book-page .muted, .book-page .small { color: var(--ink-muted); }
.book-page .small { display: block; font-size: .82rem; }
.book-page .badge.ok { background: #e1ecd8; color: #2f5a27; }
.book-page .badge.warn { background: #ffe1c2; color: #8a4b00; }
.book-page .badge.danger { background: #ffe1dc; color: #a3261a; }
.book-page hr { width: 100%; border: 0; border-top: 2px solid var(--forest); margin: 10px 0; }
.book-kicker { font-size: .75rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #2f5a27; }
.book-page.ccp .book-kicker { color: #a3261a; }
.book-h1 { margin: 0; font-size: 1.4rem; line-height: 1.2; color: var(--ink); }
.book-body { display: flex; flex-direction: column; gap: 10px; }
.book-body p { margin: 0; }
.book-folio { position: absolute; bottom: 12px; left: 0; right: 0; text-align: center; font-size: .75rem; color: var(--ink-muted); }
.book-page.cover .book-body, .book-page.divider .book-body { flex: 1; justify-content: center; }
.book-label { font-size: .75rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-muted); margin-top: 6px; }
.book-label.green { color: #2f5a27; font-size: .8rem; letter-spacing: .12em; }
.book-title { font-size: 2.4rem; font-weight: 700; line-height: 1.05; }
.book-sub { color: var(--ink-muted); }
.book-big { font-size: 4.5rem; font-weight: 700; line-height: 1; color: var(--forest); }
.book-list { margin: 0; padding-left: 18px; }
.book-dl { margin: 0; display: grid; grid-template-columns: minmax(96px, 30%) minmax(0, 1fr); gap: 8px 12px; font-size: .93rem; }
.book-dl dt { color: var(--ink-muted); }
.book-dl dd { margin: 0; }
.book-todo { display: inline-block; font-size: .75rem; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: #ffe1c2; color: #8a4b00; }
.book-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.book-table th { text-align: left; font-weight: 600; color: var(--ink-muted); font-size: .78rem; padding: 4px 6px 6px 0; border-bottom: 1px solid var(--paper-line); }
.book-table td { padding: 7px 6px 7px 0; border-bottom: 1px solid var(--paper-line); vertical-align: top; }
.book-rows, .book-toc, .book-haccp { list-style: none; margin: 0; padding: 0; }
.book-rows li { display: flex; align-items: flex-start; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--paper-line); font-size: .93rem; }
.book-days { font-weight: 700; white-space: nowrap; color: #2f5a27; }
.book-steps { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 8px; }
.book-haccp li { display: flex; gap: 10px; padding: 7px 0 7px 12px; border-bottom: 1px solid var(--paper-line); border-left: 4px solid var(--forest); font-size: .92rem; }
.book-haccp li.watch { border-left-color: #d98a00; }
.book-haccp li.ccp { border-left-color: #c0392b; }
.book-limit { background: #ffe9e4; color: #a3261a; border-radius: 10px; padding: 10px 12px; font-weight: 600; }
.book-proof { background: #eef3e9; border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; font-size: .9rem; }
.book-files { list-style: none; margin: 4px 0 0; padding: 0; font-size: .85rem; }
.book-doc { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.book-toc button { width: 100%; display: flex; align-items: center; gap: 10px; min-height: 46px; padding: 4px 0; background: none; border: 0; border-bottom: 1px solid var(--paper-line); color: var(--ink); font: inherit; text-align: left; cursor: pointer; }
.book-toc button:focus-visible { outline: 2px solid var(--forest); outline-offset: 2px; }
.book-toc-n { width: 22px; font-weight: 700; color: #2f5a27; }
.book-toc-p { min-width: 24px; text-align: right; color: var(--ink-muted); font-size: .85rem; }
.book-nav { padding: 0 14px 14px; padding-bottom: max(14px, env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 10px; }
.book-progress { height: 4px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.book-progress span { display: block; height: 4px; background: var(--accent); }
.book-nav-row { display: flex; gap: 10px; max-width: 1220px; width: 100%; margin: 0 auto; }
.book-nav-row .btn { flex: 1; min-height: 48px; }
@media print { .book-bar, .book-nav { display: none; } .book { position: static; } }
.book-page .grow { flex: 1; min-width: 0; }
.book-todo { white-space: nowrap; }
.book-page { padding-bottom: 14px; }
.book-folio { position: static; margin-top: auto; padding-top: 12px; }

/* ---------- Tablette client : allergènes ---------- */
.guest {
  --g-ink: #1b231c; --g-muted: #4a554b; --g-line: #e3dccd; --g-paper: #fbf3e6;
  position: fixed; inset: 0; z-index: 30; display: flex; flex-direction: column; background: var(--g-paper); color: var(--g-ink); color-scheme: light;
  user-select: none; -webkit-user-select: none;
}
.guest button { font: inherit; cursor: pointer; }
.guest-head { display: flex; align-items: center; gap: 18px; padding: 14px 28px; padding-top: max(14px, env(safe-area-inset-top)); background: var(--forest); color: #fff; }
.guest-head h1 { margin: 0; font-size: 1.7rem; line-height: 1.1; }
.guest-head p { margin: 2px 0 0; font-size: .95rem; }
.guest-langs { display: flex; gap: 6px; }
.guest-langs button { min-width: 52px; min-height: 44px; border-radius: 10px; border: 1px solid rgba(255, 255, 255, .75); background: transparent; color: #fff; font-weight: 600; }
.guest-langs button.on { background: #fff; color: #2f5a27; border-color: #fff; }
.guest-main { flex: 1; min-height: 0; display: flex; }
.guest-side { width: 330px; flex: none; box-sizing: border-box; padding: 20px 20px 16px 28px; border-right: 1px solid var(--g-line); display: flex; flex-direction: column; gap: 12px; overflow-y: auto; }
.guest-side h2 { margin: 0; font-size: 1.15rem; }
.guest-allergens { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.guest-allergens button { min-height: 46px; padding: 0 10px; border-radius: 12px; border: 1px solid #c9bfae; background: #fff; color: var(--g-ink); text-align: left; display: flex; align-items: center; gap: 8px; font-weight: 500; }
.guest-allergens button.on { background: var(--g-ink); border-color: var(--g-ink); color: #fff; }
.guest-box { width: 18px; height: 18px; flex: none; border-radius: 5px; border: 1.5px solid #9aa596; }
.guest-allergens button.on .guest-box { border: 0; background: var(--peach) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231b231c' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l5 5L20 7'/%3E%3C/svg%3E") center / 12px no-repeat; }
.guest-clear { min-height: 46px; border-radius: 12px; border: 1px solid #c9bfae; background: transparent; color: var(--g-ink); }
.guest-clear:disabled { opacity: .45; cursor: default; }
.guest-notice { margin: auto 0 0; font-size: .8rem; color: var(--g-muted); line-height: 1.45; }
.guest-list { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 12px; padding: 16px 28px 0 24px; }
.guest-cats { display: flex; flex-wrap: wrap; gap: 8px; }
.guest-cats button { min-height: 44px; padding: 0 16px; border-radius: 999px; border: 1px solid #c9bfae; background: #fff; color: var(--g-ink); font-weight: 500; }
.guest-cats button.on { background: var(--forest); border-color: var(--forest); color: #fff; }
.guest-summary { min-height: 46px; box-sizing: border-box; border-radius: 12px; padding: 10px 14px; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; background: #f1ebe0; font-size: 1rem; }
.guest-summary.active { background: #e1ecd8; }
.guest-summary span { color: var(--g-muted); font-size: .9rem; }
.guest-scroll { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding-bottom: 70px; }
.guest-cat-title { margin: 8px 0 8px; font-size: .8rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--g-muted); }
.guest-grid { list-style: none; margin: 0 0 10px; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.guest-card { background: #fff; border: 1px solid var(--g-line); border-radius: 12px; padding: 10px 12px; min-height: 66px; box-sizing: border-box; display: flex; flex-direction: column; gap: 6px; }
.guest-card.ok { border: 2px solid var(--sage); }
.guest-card-head { display: flex; align-items: flex-start; gap: 8px; }
.guest-name { flex: 1; font-weight: 600; line-height: 1.2; }
.guest-badge { font-size: .75rem; font-weight: 700; padding: 3px 8px; border-radius: 999px; white-space: nowrap; }
.guest-badge.ok { background: #e1ecd8; color: #2f5a27; }
.guest-badge.trace { background: #ffe1c2; color: #8a4b00; }
.guest-detail { font-size: .82rem; color: var(--g-muted); line-height: 1.3; }
.guest-empty { margin: 30px auto; color: var(--g-muted); text-align: center; }
.guest-staff { position: absolute; right: 16px; bottom: max(14px, env(safe-area-inset-bottom)); min-height: 40px; padding: 0 14px; border-radius: 999px; border: 1px solid #c9bfae; background: rgba(251, 243, 230, .92); color: var(--g-muted); font-size: .85rem; }
.guest-code { font-size: 1.4rem; letter-spacing: .4em; text-align: center; }
.guest-settings form.row { align-items: flex-end; flex-wrap: wrap; }
@media (max-width: 860px) {
  .guest-main { flex-direction: column; overflow-y: auto; }
  .guest-side { width: auto; border-right: 0; border-bottom: 1px solid var(--g-line); overflow: visible; padding: 16px; }
  .guest-allergens { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
  .guest-notice { margin-top: 4px; }
  .guest-list { padding: 16px; }
  .guest-scroll { overflow: visible; }
  .guest-head { padding: 12px 16px; flex-wrap: wrap; }
}

/* ============================================================
   Navigation par onglets (comme sur iPhone), accueil « Aujourd'hui »
   ============================================================ */
.topbar { border-bottom: 1px solid var(--border); }
.on-dark { display: none; }
:root[data-theme="dark"] .on-dark { display: block; }
:root[data-theme="dark"] .on-light { display: none; }
@media (prefers-color-scheme: dark) { :root[data-theme="auto"] .on-dark { display: block; } :root[data-theme="auto"] .on-light { display: none; } }
.main { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
.main.tab-root { padding-top: calc(22px + env(safe-area-inset-top)); max-width: 760px; }
.main.home { padding-top: calc(22px + env(safe-area-inset-top)); }
.view-enter { animation: view-in .18s ease-out; }
@keyframes view-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .view-enter { animation: none; } .pin-dots.shake { animation: none !important; } }

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr));
  padding: 6px max(6px, env(safe-area-inset-right)) calc(6px + env(safe-area-inset-bottom)) max(6px, env(safe-area-inset-left));
  background: var(--tabbar); border-top: 1px solid var(--border); backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px);
}
.tabbar a { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 50px;
  color: var(--muted); text-decoration: none; font-size: .7rem; font-weight: 600; border-radius: 12px; }
.tabbar a.on { color: var(--accent-strong); }
:root[data-theme="dark"] .tabbar a.on { color: var(--sage); }
@media (prefers-color-scheme: dark) { :root[data-theme="auto"] .tabbar a.on { color: var(--sage); } }
.tabbar a:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.tabbar .ico { width: 25px; height: 25px; }
.tab-badge { position: absolute; top: 3px; left: calc(50% + 6px); min-width: 17px; height: 17px; padding: 0 5px; border-radius: 999px;
  background: var(--orange); color: #2b1a06; font-size: .66rem; font-weight: 700; display: flex; align-items: center; justify-content: center; }
@media (min-width: 900px) { .tabbar { left: 50%; right: auto; transform: translateX(-50%); width: 560px; bottom: 14px; border: 1px solid var(--border); border-radius: 22px; box-shadow: var(--shadow); padding-bottom: 6px; } }

.large-title { font-size: 1.9rem; font-weight: 700; line-height: 1.1; margin: 0 0 14px; text-wrap: balance; }
.hello { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.hello .large-title { margin: 0; }
.hello > .grow { flex: 1; min-width: 0; }
.hello-date { display: block; font-size: .9rem; color: var(--muted); }
.hello-avatar { width: 46px; height: 46px; flex: none; border-radius: 50%; background: var(--cream); color: #142010; display: grid; place-items: center;
  font-weight: 700; text-decoration: none; }

.shift-card { display: flex; flex-direction: column; gap: 6px; background: var(--forest-card); color: #fff; border-radius: 22px; padding: 16px 18px;
  text-decoration: none; margin-bottom: 18px; box-shadow: var(--shadow); }
.shift-card.empty { background: var(--surface); color: var(--text); border: 1px solid var(--border); }
.shift-card-top { display: flex; align-items: center; gap: 8px; font-size: .8rem; font-weight: 600; }
.shift-when { background: rgba(0, 0, 0, .2); border-radius: 999px; padding: 3px 9px; letter-spacing: .05em; }
.shift-hours { font-size: 2rem; font-weight: 700; line-height: 1.05; }
.shift-with { display: flex; align-items: center; gap: 8px; font-size: .92rem; }
.shift-with .grow { flex: 1; }

.home-block { margin-bottom: 18px; }
.home-block-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 8px; }
.home-block-head h2 { flex: 1; font-size: 1.15rem; font-weight: 700; }
.todo-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.todo, .todo-done, .leave-card, .res-list a { display: flex; align-items: center; gap: 12px; min-height: 62px; padding: 10px 14px; border-radius: 18px;
  background: var(--surface); color: var(--text); text-decoration: none; box-shadow: var(--shadow); border: 1px solid var(--border); }
.todo:hover, .leave-card:hover, .res-list a:hover { background: var(--surface-2); }
.todo .grow, .todo-done .grow, .leave-card .grow, .res-list .grow { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.todo-title { font-weight: 600; }
.todo-sub { font-size: .82rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.todo-done { background: var(--ok-soft); border-color: transparent; box-shadow: none; }
.todo-more { margin-top: 8px; }
.todo-icon { width: 40px; height: 40px; flex: none; border-radius: 13px; display: grid; place-items: center; }
.todo-icon .ico { width: 21px; height: 21px; }
.tone-orange { background: rgba(249, 132, 74, .18); color: #b5461a; }
.tone-peach { background: rgba(255, 191, 105, .3); color: #8a4b00; }
.tone-green { background: rgba(84, 134, 73, .14); color: #3d6b33; }
.tone-cream { background: rgba(84, 134, 73, .08); color: #4a554b; }
:root[data-theme="dark"] .todo-icon.tone-orange { color: var(--orange); } :root[data-theme="dark"] .todo-icon.tone-peach { color: var(--peach); background: rgba(255, 191, 105, .18); }
:root[data-theme="dark"] .todo-icon.tone-green { color: #b5d595; background: rgba(140, 179, 105, .2); } :root[data-theme="dark"] .todo-icon.tone-cream { color: var(--cream); background: rgba(255, 236, 209, .14); }
@media (prefers-color-scheme: dark) {
:root[data-theme="auto"] .todo-icon.tone-orange { color: var(--orange); } :root[data-theme="auto"] .todo-icon.tone-peach { color: var(--peach); background: rgba(255, 191, 105, .18); }
:root[data-theme="auto"] .todo-icon.tone-green { color: #b5d595; background: rgba(140, 179, 105, .2); } :root[data-theme="auto"] .todo-icon.tone-cream { color: var(--cream); background: rgba(255, 236, 209, .14); }
}
.shortcuts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-bottom: 18px; }
.shortcuts a { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; font-size: .8rem; line-height: 1.2; color: var(--text); text-decoration: none; }
.shortcut-icon { width: 60px; height: 60px; border-radius: 19px; display: grid; place-items: center; transition: transform .12s; }
.shortcuts a:active .shortcut-icon { transform: scale(.94); }
.shortcut-icon .ico { width: 27px; height: 27px; }
.shortcut-icon.tone-cream { background: var(--cream); color: #142010; }
.shortcut-icon.tone-peach { background: var(--peach); color: #2b1a06; }
.shortcut-icon.tone-green { background: var(--sage); color: #142010; }
.shortcut-icon.tone-orange { background: var(--orange); color: #2b1a06; }
.home-announce { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 18px; background: var(--warn-soft); color: var(--text); text-decoration: none; }
.home-announce-tag { font-size: .72rem; font-weight: 700; letter-spacing: .06em; color: var(--peach-text); padding-top: 2px; }
.home-announce .grow { flex: 1; font-size: .92rem; }

.section-label { font-size: .78rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); margin: 18px 0 8px; }
.day-progress { display: flex; flex-direction: column; gap: 6px; }
.day-progress-head { display: flex; align-items: baseline; gap: 8px; }
.day-progress-head strong { flex: 1; }
.day-progress-bar { height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.day-progress-bar span { display: block; height: 8px; border-radius: 999px; background: var(--sage); }
.hub-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.hub-tile { position: relative; display: flex; flex-direction: column; gap: 8px; min-height: 108px; padding: 12px; border-radius: 20px;
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); color: var(--text); text-decoration: none; }
.hub-tile:hover { background: var(--surface-2); }
.hub-tile-label { font-weight: 600; line-height: 1.15; }
.hub-tile-sub { font-size: .8rem; color: var(--muted); }
.hub-tile-sub.is-todo { color: var(--peach-text); font-weight: 600; }
.hub-dot { position: absolute; top: 12px; right: 12px; width: 10px; height: 10px; border-radius: 50%; }
.hub-dot.is-todo { background: var(--orange); } .hub-dot.is-ok { background: var(--sage); }
.group-list { display: flex; flex-direction: column; border-radius: 18px; overflow: hidden; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); }
.group-list a { display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 0 14px; color: var(--text); text-decoration: none; border-bottom: 1px solid var(--border); }
.group-list a:last-child { border-bottom: 0; }
.group-list a:hover { background: var(--surface-2); }
.group-list .grow { flex: 1; }
.res-list { display: flex; flex-direction: column; gap: 8px; }

.segmented { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 4px; padding: 4px; border-radius: 12px; background: var(--surface-2); margin-bottom: 14px; }
.segmented button { min-height: 40px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); font: inherit; font-weight: 600; cursor: pointer; padding: 0 8px; }
.segmented button.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(27, 35, 28, .14); }
.my-week { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.my-shift { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 18px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); }
.my-shift.today { background: var(--forest); color: #fff; border-color: var(--forest); }
.my-shift.today .small { color: rgba(255, 255, 255, .9); }
.my-shift.past { opacity: .8; box-shadow: none; }
.my-shift .grow { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.my-shift-day { width: 46px; display: flex; flex-direction: column; align-items: center; font-size: .72rem; font-weight: 600; opacity: .85; }
.my-shift-day strong { font-size: 1.3rem; line-height: 1.1; }
.my-shift-hours { font-size: 1.05rem; }
.leave-card { margin: 4px 0 14px; }

/* ---------- Verrouillage : code ou Face ID ---------- */
.lock { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: space-between; gap: 20px;
  padding: calc(48px + env(safe-area-inset-top)) 24px calc(24px + env(safe-area-inset-bottom)); background: var(--bg); }
.lock-box { display: flex; flex-direction: column; align-items: center; gap: 20px; width: 100%; max-width: 340px; }
.lock-head { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.lock-head h1 { font-size: 1.5rem; }
.lock-sub { margin: 0; color: var(--muted); min-height: 1.4em; }
.lock-avatar { width: 72px; height: 72px; border-radius: 50%; background: var(--cream); color: #142010; display: grid; place-items: center; font-weight: 700; font-size: 1.5rem; margin-bottom: 6px; }
.pin-dots { display: flex; gap: 16px; }
.pin-dot { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--forest); transition: background .1s; }
.pin-dot.on { background: var(--forest); }
.pin-dots.shake { animation: shake .35s; }
@keyframes shake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }
.pin-keys { display: grid; grid-template-columns: repeat(3, 74px); gap: 16px 26px; }
.pin-key { width: 74px; height: 74px; border-radius: 50%; border: 0; background: var(--surface); color: var(--text); font: 500 1.75rem 'Outfit', system-ui, sans-serif;
  box-shadow: var(--shadow); cursor: pointer; }
.pin-key:active { background: var(--surface-2); }
.pin-key.del { background: transparent; box-shadow: none; font-size: 1.4rem; }
.lock-face { gap: 10px; }
.lock-links { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.lock-pw { display: flex; flex-direction: column; gap: 10px; width: 100%; }
.account-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; width: 100%; }
.account { display: flex; flex-direction: column; align-items: center; gap: 4px; background: none; border: 0; color: var(--text); font: inherit; font-weight: 600; cursor: pointer; padding: 6px 0; border-radius: 14px; }
.account:disabled { opacity: .55; cursor: default; }
.account .lock-avatar { width: 64px; height: 64px; font-size: 1.25rem; color: #fff; }
.device-accounts { display: flex; flex-direction: column; align-items: center; gap: 8px; margin: 0 0 18px; padding-bottom: 16px; border-bottom: 1px solid var(--border); }
.device-avatars { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.device-avatar { display: flex; flex-direction: column; align-items: center; gap: 2px; background: none; border: 0; color: var(--text); cursor: pointer; font: inherit; }
.device-avatar .lock-avatar { width: 48px; height: 48px; font-size: 1rem; color: #fff; margin: 0; }
.settings-list select { width: auto; }

/* ---------- Preuves de commande ---------- */
.proof-form { display: flex; flex-direction: column; gap: 4px; margin-bottom: 14px; }
.proof-form .label { display: block; font-weight: 600; margin-bottom: 6px; }
.proof-platforms { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.proof-platforms button { min-height: 56px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; font-size: 1.05rem; font-weight: 600; cursor: pointer; }
.proof-platforms button.on { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.proof-photos { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-bottom: 8px; }
.proof-photo { position: relative; aspect-ratio: 1; max-width: 100%; border-radius: 10px; overflow: hidden; background: var(--surface-2); }
.proof-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.proof-photo button { position: absolute; top: 3px; right: 3px; width: 30px; height: 30px; border-radius: 50%; border: 0; background: rgba(0, 0, 0, .55); color: #fff; display: grid; place-items: center; cursor: pointer; }
.proof-photo button .ico { width: 16px; height: 16px; }
.proof-add { width: 100%; min-height: 52px; border-style: dashed; border-color: var(--accent); color: var(--link); gap: 8px; }
.proof-send { min-height: 52px; font-size: 1rem; margin-top: 6px; }
.proof-sent { display: flex; flex-direction: column; gap: 4px; background: var(--ok-soft); border-color: transparent; margin-bottom: 14px; }

/* ---------- Écran tactile : cibles d'au moins 44 px (recommandation Apple), gants et mains mouillées en cuisine ---------- */
@media (pointer: coarse) {
  .btn { min-height: 44px; }
  .btn.sm { min-height: 40px; min-width: 40px; padding: 6px 12px; }
  .chip-btn { min-height: 40px; }
  .link-btn.todo-more, .switch .link-btn, .lock-links .link-btn, .link-btn[data-file-del] { min-height: 44px; }
}
