/* ===========================================================================
   Générateur de Gantt CPM : feuille de style
   Palette papier chaude, accordée au rendu « présentation ». Responsive 360 → 1280+.
   =========================================================================== */
:root {
  --bg: #f6f4ef;
  --panel: #fffefb;
  --ink: #25221e;
  --muted: #675f53;   /* ≥ 4,5:1 sur tous les fonds de l'appli */
  --line: #ebe6dc;
  --line-strong: #d8d0c1;
  --accent: #3a4b01;        /* vert Harrods (Pantone 574C) */
  --accent-ink: #2b3800;
  --accent-soft: #eff1e0;
  --critical: #8a2b30;
  --summary: #3a4653;
  --today: #c58a3d;
  --danger: #a8392f;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(40, 30, 15, .05), 0 8px 24px rgba(40, 30, 15, .05);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --serif: Georgia, "Iowan Old Style", Palatino, "Times New Roman", serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  font-size: 14px;
  line-height: 1.45;
}

/* ---------- barre supérieure ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 12px 18px; flex-wrap: wrap;
  padding: 10px 18px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 0 rgba(0,0,0,.02);
}
.brand { font-family: var(--serif); font-size: 19px; letter-spacing: .1px; white-space: nowrap; }
.brand strong { color: var(--accent-ink); }
.brand .tag {
  font-family: var(--font); font-size: 9.5px; text-transform: uppercase; letter-spacing: 2px;
  background: var(--accent); color: #fff; padding: 2px 7px; border-radius: 20px;
  vertical-align: middle; margin-left: 4px;
}
.tabs { display: flex; gap: 2px; background: var(--bg); border: 1px solid var(--line); padding: 3px; border-radius: 10px; }
.tab-btn {
  border: 1px solid transparent; background: transparent; color: var(--muted);
  padding: 7px 14px; border-radius: 8px; cursor: pointer; font: inherit; font-weight: 600;
}
.tab-btn { padding: 6px 14px; border-radius: 7px; }
.tab-btn:hover { color: var(--ink); }
.tab-btn.active { background: var(--panel); color: var(--ink); box-shadow: 0 1px 3px rgba(40,30,15,.12); }
.topbar-actions { display: flex; gap: 8px; }
.lang { margin-left: auto; display: inline-flex; border: 1px solid var(--line-strong); border-radius: 8px; overflow: hidden; }
.lang button {
  border: none; background: var(--panel); color: var(--muted); font: inherit; font-weight: 700;
  font-size: 12px; padding: 6px 10px; cursor: pointer;
}
.lang button + button { border-left: 1px solid var(--line-strong); }
.lang button.active { background: var(--accent); color: #fff; }
.lang button:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }

/* ---------- boutons ---------- */
.btn {
  border: 1px solid var(--line-strong); background: var(--panel); color: var(--ink);
  padding: 7px 13px; border-radius: 9px; transition: border-color .12s, background .12s, color .12s; cursor: pointer; font: inherit; font-weight: 600;
}
.btn:hover { border-color: var(--accent); color: var(--accent-ink); }
.btn:focus-visible, .tab-btn:focus-visible, input:focus-visible, select:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}
.btn.small { padding: 5px 10px; font-size: 13px; }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--danger); border-color: transparent; }
.btn.danger:hover { border-color: var(--danger); }
.file-label { display: inline-flex; align-items: center; }

/* ---------- mise en page ---------- */
main { padding: 18px; }
.wrap { max-width: 1120px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px; }
.card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 18px;
}
.card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; gap: 10px; flex-wrap: wrap; }
.card-head h2 { font-family: var(--serif); font-size: 19px; font-weight: 700; margin: 0; letter-spacing: .1px; }
.card-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.hint { color: var(--muted); font-size: 12.5px; margin: 12px 2px 0; }
.hint code { background: var(--bg); padding: 1px 5px; border-radius: 4px; font-size: 12px; }

/* ---------- formulaire paramètres ---------- */
.grid-form { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px 16px; }
.grid-form label { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; color: var(--muted); font-weight: 600; }
.grid-form .span2 { grid-column: span 2; }
.grid-form label.check { flex-direction: row; align-items: center; gap: 8px; color: var(--ink); align-self: end; padding-bottom: 8px; }
.grid-form label.check input { width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer; }
.grid-form input, .grid-form select, .grid-form textarea, .grid td input, .grid td select {
  font: inherit; color: var(--ink); background: #fff;
  border: 1px solid var(--line-strong); border-radius: 7px; padding: 7px 9px;
}
@media (max-width: 720px) { .grid-form { grid-template-columns: 1fr 1fr; } .grid-form .span2 { grid-column: span 2; } }
@media (max-width: 480px) { .grid-form { grid-template-columns: 1fr; } .grid-form .span2 { grid-column: auto; } }

/* ---------- tables de saisie ---------- */
.table-scroll { overflow-x: auto; }
table.grid { width: 100%; border-collapse: collapse; min-width: 560px; }
table.grid th {
  text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .6px;
  color: var(--muted); font-weight: 700; padding: 6px 8px; border-bottom: 1px solid var(--line);
}
table.grid td { padding: 4px 6px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.grid td input, table.grid td select { width: 100%; padding: 6px 7px; font-size: 13px; }
table.grid td input[type="color"] { padding: 2px; height: 32px; cursor: pointer; }
.row-del {
  border: none; background: transparent; color: var(--muted); cursor: pointer;
  font-size: 17px; line-height: 1; padding: 4px 6px; border-radius: 6px;
}
.row-del:hover { background: #fdecea; color: var(--danger); }
.row-actions { white-space: nowrap; text-align: right; }
.row-sub {
  border: 1px solid var(--line-strong); background: var(--panel); color: var(--accent-ink); cursor: pointer;
  font-size: 15px; font-weight: 700; line-height: 1; width: 26px; height: 26px; border-radius: 6px; padding: 0; margin-right: 2px;
}
.row-sub:hover { background: var(--accent); color: #fff; border-color: var(--accent); }
/* sous-tâches : trait de rattachement + fond léger */
tr.is-sub td:first-child { border-left: 2px solid var(--line-strong); }
tr.is-sub td { background: #fbf9f4; }
/* colonne « Tâche » : chevron de repli + indentation */
.name-wrap { display: flex; align-items: center; gap: 4px; }
.name-wrap input { flex: 1 1 auto; min-width: 0; }
.row-toggle {
  border: none; background: transparent; color: var(--muted); cursor: pointer;
  font-size: 11px; line-height: 1; padding: 2px 3px; border-radius: 4px; flex: 0 0 auto;
}
.row-toggle:hover { background: var(--bg); color: var(--ink); }
.status-sel { border-left-width: 4px !important; }

/* ---------- bannière d'erreur ---------- */
.banner {
  background: #fdecea; border: 1px solid #f3c0bb; color: #922;
  padding: 10px 14px; border-radius: 8px; margin-bottom: 14px; font-weight: 600;
}
.banner ul { margin: 6px 0 0; padding-left: 18px; font-weight: 500; }

/* ---------- synthèse (assumptions log) ---------- */
.summary { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 12px; }
.summary .stat {
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 14px; box-shadow: var(--shadow); min-width: 140px;
}
.summary .stat { padding: 12px 16px 13px; }
.summary .stat .k { font-size: 13px; letter-spacing: .1px; color: #5b5448; font-weight: 700; }
.summary .stat .v { font-family: var(--serif); font-size: 21px; font-weight: 700; margin-top: 3px; line-height: 1.2; }
.summary .stat .v small { display: block; font-family: var(--font); font-size: 11px; font-weight: 500; color: var(--muted); margin-top: 3px; }
.summary .stat .badge { display: inline-block; margin-top: 6px; font-size: 10.5px; font-weight: 600; padding: 2px 8px; border-radius: 20px; }
.summary .stat .badge.ok { background: #e7efe6; color: #2f5d3a; }
.summary .stat .badge.late { background: #f6e4e2; color: #8a2b30; }

/* ---------- légende ---------- */
.legend { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 12px; font-size: 12.5px; color: var(--muted); align-items: center; }
.legend .item { display: inline-flex; align-items: center; gap: 6px; }
.legend .swatch { width: 16px; height: 12px; border-radius: 3px; display: inline-block; }
.legend .swatch.dep { width: 20px; height: 0; border-top: 2px solid var(--muted); border-radius: 0; }

/* ---------- zone Gantt ---------- */
.gantt {
  display: flex; background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden;
}
.gantt-left { flex: 0 0 auto; border-right: 1px solid var(--line-strong); background: var(--panel); z-index: 2; }
.gantt-right { flex: 1 1 auto; overflow-x: auto; overflow-y: hidden; }
.gantt svg { display: block; }
.gantt-left svg { box-shadow: 4px 0 8px -6px rgba(0,0,0,.25); }

/* mode présentation : un seul SVG élégant, pleine largeur */
.gantt.elegant { display: block; background: transparent; border-color: var(--line); padding: 0; }
.gantt.elegant .gantt-left { display: none; }
.gantt.elegant .gantt-right { overflow: visible; }
.gantt.elegant svg { box-shadow: none; }

/* ---------- infobulle ---------- */
.tooltip {
  position: fixed; z-index: 50; pointer-events: none;
  background: #1f2733; color: #fff; padding: 9px 12px; border-radius: 8px;
  font-size: 12.5px; line-height: 1.5; max-width: 280px; box-shadow: 0 8px 26px rgba(0,0,0,.28);
}
.tooltip b { color: #fff; }
.tooltip .t-title { font-size: 13.5px; font-weight: 700; margin-bottom: 4px; }
.tooltip .t-row { color: #cdd6e0; }
.tooltip .t-row span { color: #fff; }
.tooltip .t-crit { color: #ffb4ab; font-weight: 700; }

.tab-panel[hidden] { display: none; }

/* ---------- bouton accent + options avancées ---------- */
.btn.accent { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn.accent:hover { background: var(--accent-ink); border-color: var(--accent-ink); color: #fff; }
.advanced { margin-top: 14px; border-top: 1px solid var(--line); }
.advanced > summary { cursor: pointer; font-size: 12.5px; font-weight: 700; color: var(--muted); padding: 10px 2px 4px; list-style: none; user-select: none; }
.advanced > summary::-webkit-details-marker { display: none; }
.advanced > summary::before { content: '▸  '; }
.advanced[open] > summary::before { content: '▾  '; }
.advanced .grid-form { margin-top: 10px; }
.advanced .hint { margin-top: 12px; }

/* ---------- fenêtre modale ---------- */
.modal { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; }
.modal[hidden] { display: none; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(30, 22, 12, .42); backdrop-filter: blur(2px); }
.modal-box { position: relative; background: var(--panel); border-radius: 14px; box-shadow: 0 20px 60px rgba(0, 0, 0, .3); width: min(720px, 92vw); max-height: 88vh; overflow: auto; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--panel); }
.modal-head h3 { margin: 0; font-family: var(--serif); font-size: 20px; }
.modal-x { border: none; background: transparent; font-size: 22px; line-height: 1; cursor: pointer; color: var(--muted); padding: 2px 9px; border-radius: 8px; }
.modal-x:hover { background: var(--bg); color: var(--ink); }
.modal-body { padding: 20px; }
.modal-actions { display: flex; justify-content: flex-end; margin-top: 4px; }

/* ---------- galerie de modèles ---------- */
.tpl-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
@media (max-width: 640px) { .tpl-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 420px) { .tpl-grid { grid-template-columns: 1fr; } }
.tpl-card { text-align: left; border: 1px solid var(--line-strong); background: var(--panel); border-radius: 12px; padding: 14px; cursor: pointer; font: inherit; display: flex; flex-direction: column; gap: 6px; transition: border-color .12s, box-shadow .12s, transform .12s; }
.tpl-card:hover { border-color: var(--accent); box-shadow: var(--shadow); transform: translateY(-1px); }
.tpl-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.tpl-ico { font-size: 26px; }
.tpl-name { font-weight: 700; color: var(--ink); }
.tpl-desc { font-size: 12.5px; color: var(--muted); }
.tpl-tip { color: var(--muted); font-size: 12px; margin: 16px 2px 0; }

/* ---------- assistant de lien ---------- */
.dep-form { display: flex; flex-direction: column; gap: 14px; }
.dep-form .field { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.dep-form .field select, .dep-form .field input { font: inherit; color: var(--ink); background: #fff; border: 1px solid var(--line-strong); border-radius: 8px; padding: 9px 10px; }
.pred-wrap { display: flex; align-items: center; gap: 4px; }
.pred-wrap input { flex: 1 1 auto; min-width: 0; }
.row-link { flex: 0 0 auto; border: 1px solid var(--line-strong); background: var(--panel); cursor: pointer; font-size: 13px; line-height: 1; width: 28px; height: 28px; border-radius: 6px; padding: 0; }
.row-link:hover { border-color: var(--accent); }

/* ---------- état vide (onboarding) ---------- */
.banner.empty { background: var(--panel); border: 1px solid var(--line); color: var(--ink); text-align: center; padding: 34px 20px; box-shadow: var(--shadow); }
.banner.empty .empty-title { font-family: var(--serif); font-size: 24px; font-weight: 700; margin-bottom: 6px; }
.banner.empty .empty-body { color: var(--muted); font-weight: 500; max-width: 560px; margin: 0 auto 16px; }
.banner.empty .empty-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* ---------- annuler / rétablir ---------- */
.history { display: inline-flex; gap: 4px; margin-left: auto; }
.btn.icon { padding: 5px 9px; font-size: 16px; line-height: 1; }
.btn.icon:disabled { opacity: .35; cursor: default; border-color: var(--line); color: var(--muted); }
.history + .lang { margin-left: 0; }

/* ---------- barre de vue (onglet Diagramme) ---------- */
.viewbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-bottom: 14px; padding: 10px 14px;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); font-size: 12.5px; }
.viewbar label { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-weight: 600; }
.viewbar select { font: inherit; color: var(--ink); background: #fff; border: 1px solid var(--line-strong); border-radius: 8px; padding: 5px 8px; }
.viewbar .check input { width: 15px; height: 15px; accent-color: var(--accent); }
.seg { display: inline-flex; background: var(--bg); border: 1px solid var(--line); border-radius: 9px; padding: 2px; }
.seg button { border: none; background: transparent; font: inherit; font-weight: 600; color: var(--muted); padding: 5px 11px; border-radius: 7px; cursor: pointer; }
.seg button.on { background: var(--panel); color: var(--ink); box-shadow: 0 1px 3px rgba(40,30,15,.12); }
.seg button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.viewbar .spacer { flex: 1 1 auto; }

/* ---------- déplacer une ligne ---------- */
.row-move { border: none; background: transparent; color: var(--muted); cursor: pointer; font-size: 12px; line-height: 1; padding: 4px 3px; border-radius: 5px; }
.row-move:hover { background: var(--bg); color: var(--ink); }

/* ---------- notification (toast) ---------- */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 12px); z-index: 200; background: var(--ink); color: #fff;
  padding: 11px 18px; border-radius: 12px; font-size: 13.5px; font-weight: 500; box-shadow: 0 12px 34px rgba(0,0,0,.25);
  opacity: 0; transition: opacity .2s, transform .2s; max-width: min(560px, 92vw); text-align: center; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
@media (prefers-reduced-motion: reduce) { .toast { transition: none; } }

/* ---------- studio d'export ---------- */
.modal-box.wide { width: min(1040px, 95vw); }
.xs { display: grid; grid-template-columns: minmax(300px, 400px) 1fr; gap: 22px; }
@media (max-width: 820px) { .xs { grid-template-columns: 1fr; } .xs-prev { order: -1; } }
.xs-sec { margin-bottom: 16px; }
.xs-label { font-size: 11px; text-transform: uppercase; letter-spacing: .8px; font-weight: 700; color: var(--muted); margin-bottom: 8px; }
.xs-fmts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.xs-fmt { display: grid; grid-template-columns: 28px 1fr; grid-template-rows: auto auto; column-gap: 8px; align-items: center; text-align: left;
  border: 1px solid var(--line-strong); background: var(--panel); border-radius: 10px; padding: 9px 10px; cursor: pointer; font: inherit; }
.xs-fmt:hover { border-color: var(--accent); }
.xs-fmt.on { border-color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
.xs-fmt:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.xs-ico { grid-row: span 2; font-size: 19px; text-align: center; }
.xs-fn { font-weight: 700; font-size: 13px; color: var(--ink); }
.xs-fd { font-size: 11.5px; color: var(--muted); }
.xs-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.xs-field { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.xs-field select, .xs-field input[type="text"], .xs-field input[type="number"] { font: inherit; color: var(--ink); background: #fff; border: 1px solid var(--line-strong); border-radius: 8px; padding: 7px 9px; }
.xs-field select:disabled { opacity: .5; }
.xs-check { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--ink); cursor: pointer; }
.xs-check input { width: 16px; height: 16px; accent-color: var(--accent); }
.xs-cap { display: grid; grid-template-columns: 90px 1fr; gap: 10px; margin-top: 10px; }
.xs-cap[hidden] { display: none; }
.xs-prev { background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.xs-prev .xs-stage { flex: 1 1 auto; display: flex; align-items: center; justify-content: center; min-height: 260px; }
.xs-prev img { max-width: 100%; max-height: 52vh; box-shadow: 0 6px 24px rgba(40,30,15,.18); border-radius: 3px; background: #fff; }
.xs-meta { font-size: 12px; color: var(--muted); text-align: center; }
.xs-go { width: 100%; padding: 11px 14px; font-size: 14.5px; margin-top: 4px; }
.xs-note { font-size: 12px; color: var(--muted); margin-top: 8px; }

/* ---------- pas de retour à la ligne dans la barre du haut ---------- */
.tab-btn, .topbar .btn, .lang button { white-space: nowrap; }
.history .btn.icon { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; }
.history .btn.icon .ic { font-size: 16px; line-height: 1; }
@media (max-width: 1100px) { .history .lbl { display: none; } }
@media (max-width: 720px) { .brand .tag { display: none; } .topbar { padding: 8px 12px; } }

/* ---------- auto-remplissage ---------- */
.inline-field { display: flex; gap: 6px; align-items: center; }
.inline-field input { flex: 1 1 auto; min-width: 0; }
select.status-sel.is-auto { color: var(--muted); font-style: italic; }
.hint kbd { font: 600 11px var(--font); background: var(--panel); border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: 4px; padding: 0 5px; }

/* ---------- notification : bouton « Annuler » ---------- */
.toast { display: inline-flex; align-items: center; gap: 14px; }
.toast[hidden] { display: none; }
.toast-undo { font: inherit; font-weight: 700; color: #fff; background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.35);
  border-radius: 8px; padding: 4px 10px; cursor: pointer; white-space: nowrap; }
.toast-undo:hover { background: rgba(255,255,255,.24); }
.toast-undo:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

/* ---------- menu « Afficher » ---------- */
.vb-menu { position: relative; }
.vb-menu > summary { list-style: none; cursor: pointer; user-select: none; font-weight: 700; color: var(--ink);
  border: 1px solid var(--line-strong); background: #fff; border-radius: 8px; padding: 5px 10px; }
.vb-menu > summary::-webkit-details-marker { display: none; }
.vb-menu > summary::after { content: ' ▾'; color: var(--muted); }
.vb-menu[open] > summary { border-color: var(--accent); }
.vb-menu > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.vb-pop { position: absolute; top: calc(100% + 6px); left: 0; z-index: 40; min-width: 260px; max-width: min(420px, calc(100vw - 32px));
  background: var(--panel); border: 1px solid var(--line-strong); border-radius: 12px; box-shadow: 0 14px 40px rgba(40,30,15,.18); padding: 12px 14px; }
.disp { display: flex; flex-direction: column; gap: 10px; }
.disp-group { display: flex; flex-direction: column; gap: 7px; }
.disp-group + .disp-group { border-top: 1px solid var(--line); padding-top: 10px; }
.disp-title { font-size: 11px; text-transform: uppercase; letter-spacing: .8px; font-weight: 700; color: var(--muted); }
.disp-check { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--ink); cursor: pointer; }
.disp-check input { width: 15px; height: 15px; accent-color: var(--accent); flex: 0 0 auto; }
.disp-check.is-off { color: var(--muted); opacity: .6; cursor: default; }
.xs-more > summary { cursor: pointer; list-style: none; }
.xs-more > summary::-webkit-details-marker { display: none; }
.xs-more > summary::before { content: '▸ '; }
.xs-more[open] > summary::before { content: '▾ '; }
.xs-more .disp { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; }
.xs-more .disp-group + .disp-group { border-top: none; padding-top: 0; }
@media (max-width: 480px) { .xs-more .disp { grid-template-columns: 1fr; } }

/* ---------- référence (baseline) ---------- */
.vb-bl { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.bl-chip { font-weight: 700; color: var(--accent-ink); background: var(--accent-soft); border-radius: 20px; padding: 3px 10px; white-space: nowrap; }

/* ---------- astuces (tableau des tâches) ---------- */
.tips-box { margin-top: 14px; }
.tips { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 8px 18px; }
.tip { display: flex; gap: 9px; align-items: baseline; line-height: 1.45; }
.tip > kbd, .tip > .ico { flex: 0 0 auto; min-width: 26px; text-align: center; }
.tip > .ico { font-style: normal; color: var(--accent-ink); background: var(--panel); border: 1px solid var(--line-strong); border-radius: 5px; padding: 0 4px; font-size: 12px; }
.tip-code { margin: 10px 0 0; color: var(--muted); }

/* ---------- coller une liste ---------- */
.paste { display: flex; flex-direction: column; gap: 12px; }
.paste-help { margin: 0; font-size: 13px; color: var(--muted); line-height: 1.55; }
.paste-help code { background: var(--bg); padding: 1px 5px; border-radius: 4px; font-size: 12px; }
.paste-ta { width: 100%; font: 13px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color: var(--ink); background: #fff;
  border: 1px solid var(--line-strong); border-radius: 10px; padding: 10px 12px; resize: vertical; min-height: 150px; tab-size: 4; }
.paste-ta:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.paste-opts { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; }
.paste-mode select { font: inherit; color: var(--ink); background: #fff; border: 1px solid var(--line-strong); border-radius: 8px; padding: 6px 8px; }
.paste-count { font-weight: 700; font-size: 13px; }
.paste-note { margin: -6px 0 0; font-size: 12px; color: var(--muted); }
.paste-note:empty { display: none; }
.paste-prev { max-height: 240px; overflow: auto; border: 1px solid var(--line); border-radius: 10px; }
.paste-prev:empty { display: none; }
.paste-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.paste-table th { position: sticky; top: 0; background: var(--bg); text-align: left; font-size: 10.5px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); padding: 6px 8px; }
.paste-table td { padding: 5px 8px; border-top: 1px solid var(--line); }
.paste-table td.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 11.5px; color: var(--muted); white-space: nowrap; }

/* ---------- galerie de modèles par catégorie ---------- */
.tpl-cat { font-family: var(--serif); font-size: 16px; margin: 18px 0 10px; color: var(--accent-ink); }
.tpl-wrap > .tpl-cat:first-child { margin-top: 0; }
.tpl-meta { margin-top: auto; padding-top: 4px; font-size: 11.5px; font-weight: 700; color: var(--accent-ink); letter-spacing: .2px; }
.tpl-card { min-height: 150px; }
.help-link { text-decoration: none; display: inline-flex; align-items: center; }
.topbar .help-link { margin-left: 4px; }
.tpl-wrap .tpl-grid { grid-template-columns: repeat(2, 1fr); }
@media (min-width: 1000px) { .tpl-wrap .tpl-grid { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 460px) { .tpl-wrap .tpl-grid { grid-template-columns: 1fr; } }
/* tableau des tâches : défile plutôt que de rogner les valeurs (ex. « 100 » coupé) */
#task-table { min-width: 940px; }
#task-table td input[type="number"] { padding-right: 4px; }
/* petits écrans : la barre du haut défile avec la page (elle occupait un quart de l'écran) */
@media (max-width: 720px) { .topbar { position: static; } .faq-search { top: 0 !important; } }

/* ---------- cartes de synthèse : titre en grand, valeur (sous-titre) en petit ---------- */
.summary .stat .k { font-family: var(--serif); font-size: 18px; font-weight: 700; color: var(--ink); letter-spacing: .1px; line-height: 1.25; }
.summary .stat .v { font-family: var(--font); font-size: 14px; font-weight: 600; color: #5b5448; margin-top: 4px; line-height: 1.35; }
.summary .stat .v small { font-size: 11px; font-weight: 500; color: var(--muted); margin-top: 2px; }

/* ---------- séparation tableau / planning (vue Détaillé) ---------- */
.gantt-left { overflow-x: auto; overflow-y: hidden; border-right: none; max-width: calc(100% - 220px); }
.gantt-split { flex: 0 0 9px; cursor: col-resize; position: relative; background: var(--panel); border-left: 1px solid var(--line-strong); border-right: 1px solid var(--line); touch-action: none; z-index: 3; }
.gantt-split::after { content: ''; position: absolute; left: 3px; top: 50%; width: 1px; height: 34px; transform: translateY(-50%);
  border-left: 1px solid var(--muted); border-right: 1px solid var(--muted); width: 1px; opacity: .55; }
.gantt-split:hover, .gantt-split.dragging { background: var(--accent-soft); }
.gantt-split:hover::after, .gantt-split.dragging::after { border-color: var(--accent); opacity: 1; }
.gantt-split:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.gantt.elegant .gantt-split { display: none; }
body.col-resizing, body.col-resizing * { cursor: col-resize !important; user-select: none !important; }

/* ---------- Mes projets ---------- */
.projects-btn { font-weight: 700; }
.save-state { font-size: 11.5px; color: var(--muted); align-self: center; white-space: nowrap; padding-left: 4px; }
.save-state::before { content: '●'; color: #5a7d52; margin-right: 5px; font-size: 9px; vertical-align: 1px; }
.save-state.bad { color: var(--danger); font-weight: 700; }
.save-state.bad::before { color: var(--danger); }
@media (max-width: 1100px) { .save-state { display: none; } .save-state.bad { display: inline; } }
.pj-head { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px; }
.pj-search { flex: 1 1 200px; min-width: 0; font: inherit; color: var(--ink); background: #fff; border: 1px solid var(--line-strong); border-radius: 9px; padding: 8px 11px; }
.pj-search:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.pj-add { display: flex; gap: 8px; margin-left: auto; }
.pj-list { display: flex; flex-direction: column; gap: 8px; }
.pj-item { display: flex; align-items: center; gap: 12px 16px; flex-wrap: wrap; border: 1px solid var(--line); background: var(--panel); border-radius: 12px; padding: 12px 14px; }
.pj-item.is-current { border-color: var(--accent); box-shadow: inset 3px 0 0 var(--accent); }
.pj-main { flex: 1 1 240px; min-width: 0; }
.pj-name { font-family: var(--serif); font-size: 16px; font-weight: 700; overflow-wrap: anywhere; }
.pj-meta { font-size: 12px; color: var(--muted); margin: 2px 0 6px; }
.pj-badge { display: inline-block; font-size: 11px; font-weight: 700; border-radius: 20px; padding: 2px 9px; }
.pj-badge.draft { background: #eeeae1; color: #5b5448; }
.pj-badge.ok { background: #e7efe6; color: #2f5d3a; }
.pj-badge.dirty { background: #f6ecd9; color: #7a5412; }
.pj-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.pj-empty { color: var(--muted); text-align: center; padding: 22px 0; }
.pj-note { font-size: 12px; color: var(--muted); margin: 14px 2px 0; }
.share { display: flex; flex-direction: column; gap: 12px; }
.share-help, .share-note { margin: 0; font-size: 13px; color: var(--muted); line-height: 1.5; }
.share-row { display: flex; gap: 8px; }
.share-url { flex: 1 1 auto; min-width: 0; font: 12.5px ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--ink); background: #fff; border: 1px solid var(--line-strong); border-radius: 9px; padding: 9px 10px; }
@media (max-width: 480px) { .share-row { flex-direction: column; } }
/* champ « date du jour » : le bouton est hors de l'étiquette (nom accessible propre) */
.grid-form .field { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; color: var(--muted); font-weight: 600; }
.grid-form .field input { font: inherit; color: var(--ink); background: #fff; border: 1px solid var(--line-strong); border-radius: 7px; padding: 7px 9px; }
/* notification : jamais « hidden », masquée visuellement (annonce fiable pour les lecteurs d'écran) */
.toast { visibility: hidden; }
.toast.show { visibility: visible; }
.toast { transition: opacity .2s, transform .2s, visibility .2s; }
/* voyant d'enregistrement : toujours visible, réduit à sa pastille sur écran moyen */
@media (max-width: 1100px) { .save-state { display: inline; font-size: 0; padding-left: 0; } .save-state::before { font-size: 11px; margin-right: 0; } .save-state.bad { font-size: 11.5px; } }

/* ---------- page d'accueil (connexion / première connexion) ---------- */
html.booting body > *:not(#gate) { visibility: hidden; }
body.gated > *:not(#gate):not(#toast):not(#modal) { display: none !important; }
.gate { min-height: 100vh; display: flex; flex-direction: column; background: var(--bg); padding: 16px; }
.gate[hidden] { display: none; }
.gate-top { display: flex; justify-content: flex-end; }
.gate-main { flex: 1 0 auto; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 28px 0 20px; }
.gate-brand { display: flex; flex-direction: column; align-items: center; gap: 12px; margin-bottom: 26px; }
.gate-mark { display: block; filter: drop-shadow(0 6px 16px rgba(58, 75, 1, .18)); }
.gate-word { font-family: var(--serif); font-size: 22px; }
.gate-word strong { color: var(--accent-ink); }
.gate-word .tag { font-family: var(--font); font-size: 9.5px; text-transform: uppercase; letter-spacing: 2px; background: var(--accent); color: #fff; padding: 2px 7px; border-radius: 20px; vertical-align: middle; margin-left: 4px; }
.gate-eyebrow { margin: 0 0 6px; font-size: 11.5px; letter-spacing: 1.8px; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.gate-title { margin: 0 0 6px; font-family: var(--serif); font-size: 34px; line-height: 1.15; text-align: center; }
.gate-sub { margin: 0 0 24px; color: var(--muted); text-align: center; max-width: 420px; font-size: 14.5px; }
.gate-form { width: min(380px, 100%); display: flex; flex-direction: column; gap: 6px; }
.gate-field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; color: #4a443b; margin-top: 8px; }
.gate-field[hidden] { display: none; }
.gate-form input { font: inherit; font-size: 15px; color: var(--ink); background: #fff; border: 1px solid var(--line-strong); border-radius: 10px; padding: 11px 12px; width: 100%; }
.gate-form input:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.gate-pass { display: flex; gap: 8px; align-items: stretch; }
.gate-pass[hidden] { display: none; }
.gate-pass input { flex: 1 1 auto; min-width: 0; }
.gate-pass .btn { flex: 0 0 auto; }
.gate-hint { margin: 2px 0 0; font-size: 12px; color: var(--muted); line-height: 1.45; }
.gate-hint:empty, .gate-msg:empty { display: none; }
.gate-msg { margin: 8px 0 0; font-size: 13px; line-height: 1.45; color: var(--accent-ink); background: var(--accent-soft); border-radius: 9px; padding: 9px 11px; }
.gate-msg.bad { color: #8a2b30; background: #f6e4e2; }
.gate-go { margin-top: 12px; padding: 12px 14px; font-size: 15px; width: 100%; }
.gate-switch { margin: 10px 0 0; text-align: center; font-size: 13.5px; color: var(--muted); }
.gate-switch[hidden] { display: none; }
.linkbtn { font: inherit; background: none; border: none; padding: 0; color: var(--accent-ink); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; font-weight: 600; }
.linkbtn:hover { color: var(--accent); }
.linkbtn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }
.gate-form.in-modal { width: min(380px, 100%); margin: 0 auto; }
.gate-form.in-modal .gate-field { margin-top: 0; }
.gate-foot { border-top: 1px solid var(--line); max-width: 600px; width: 100%; margin: 0 auto; padding-top: 14px; text-align: center; font-size: 12px; color: var(--muted); }
.gate-foot p { margin: 4px 0; }
.gate-foot a { color: var(--accent-ink); }
@media (max-width: 480px) { .gate-title { font-size: 28px; } .gate-main { justify-content: flex-start; padding-top: 14px; } }

/* ---------- compte, synchronisation, présence ---------- */
.account-btn[hidden], .sync-state[hidden], .presence[hidden] { display: none !important; }
.account-btn.on { border-color: var(--accent); color: var(--accent-ink); }
.sync-state, .presence { font-size: 11.5px; align-self: center; white-space: nowrap; border-radius: 20px; padding: 2px 8px; font-weight: 600; }
.sync-state.ok { background: var(--accent-soft); color: var(--accent-ink); }
.sync-state.busy { background: #f3efe6; color: #6f6858; }
.sync-state.offline { background: #f6ecd9; color: #7a5412; }
.sync-state.ro { background: #eeeae1; color: #5b5448; }
.presence { background: #e8eef5; color: #2a4a6a; cursor: default; }
@media (max-width: 1100px) { .sync-state { font-size: 0; padding: 4px; } .sync-state::before { content: '☁'; font-size: 12px; } }
body.read-only #tab-data .card { opacity: .92; }
.pj-badge.cloud { background: var(--accent-soft); color: var(--accent-ink); margin-left: 6px; }
.pj-badge.shared { background: #e8eef5; color: #2a4a6a; margin-left: 6px; }
.account-mail { font-weight: 700; font-size: 16px; margin: 0 0 8px; }
.login-help { font-size: 13px; color: var(--muted); line-height: 1.5; margin: 0 0 12px; }
.login-msg { font-size: 13px; margin: 8px 0; }
.login-msg:empty { display: none; }
.mb-form { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.mb-form select { font: inherit; border: 1px solid var(--line-strong); border-radius: 9px; padding: 7px 9px; background: #fff; }
.mb-list { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.mb-item { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; }
.mb-mail { flex: 1 1 200px; min-width: 0; overflow-wrap: anywhere; font-weight: 600; }
button.sync-state { border: none; font-family: inherit; cursor: default; }
.sync-state.local { background: #f6ecd9; color: #7a5412; cursor: pointer; }
.sync-state.local:hover { background: #efdfbf; }
.sync-state:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.pj-badge.local { background: #f6ecd9; color: #7a5412; margin-left: 6px; }
@media (max-width: 1100px) { .sync-state.local { font-size: 11px; padding: 2px 8px; } .sync-state.local::before { content: none; } }

/* ---------- accueil d'un projet vide ---------- */
.welcome[hidden] { display: none; }
.welcome { border-color: var(--accent); background: linear-gradient(180deg, var(--accent-soft), var(--panel) 70%); }
.wl-head h2 { font-family: var(--serif); font-size: 22px; margin: 0 0 4px; }
.wl-head p { margin: 0 0 14px; color: var(--muted); }
.wl-acts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
@media (max-width: 900px) { .wl-acts { grid-template-columns: 1fr 1fr; } }
@media (max-width: 460px) { .wl-acts { grid-template-columns: 1fr; } }
.wl-act { text-align: left; font: inherit; cursor: pointer; background: var(--panel); border: 1px solid var(--line-strong); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; transition: border-color .12s, transform .12s, box-shadow .12s; }
.wl-act:hover { border-color: var(--accent); box-shadow: var(--shadow); transform: translateY(-1px); }
.wl-act:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.wl-act.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.wl-act.primary .wl-s { color: rgba(255,255,255,.82); }
.wl-l { font-weight: 700; font-size: 14px; }
.wl-s { font-size: 12px; color: var(--muted); line-height: 1.4; }
@media (prefers-reduced-motion: reduce) { .wl-act { transition: none; } .wl-act:hover { transform: none; } }

/* ---------- accueil : reprendre un projet ; historique ---------- */
.wl-recent { display: flex; flex-direction: column; gap: 6px; margin-bottom: 6px; }
.wl-rec { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; text-align: left; font: inherit; cursor: pointer;
  background: var(--panel); border: 1px solid var(--line-strong); border-radius: 10px; padding: 10px 14px; }
.wl-rec:hover { border-color: var(--accent); }
.wl-rec:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.wl-rn { font-family: var(--serif); font-weight: 700; font-size: 15px; min-width: 0; overflow-wrap: anywhere; }
.wl-rm { font-size: 12px; color: var(--muted); white-space: nowrap; }
.wl-all { margin: 4px 0 0; font-size: 13px; }
.wl-sep { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.wl-sep h2 { font-size: 18px !important; }
.hs-list { display: flex; flex-direction: column; gap: 8px; }
.hs-item { display: flex; align-items: center; gap: 10px 16px; flex-wrap: wrap; border: 1px solid var(--line); border-radius: 12px; padding: 11px 14px; background: var(--panel); }
.hs-main { flex: 1 1 240px; min-width: 0; }
.hs-when { font-weight: 700; }
.invite-btn[hidden] { display: none !important; }
.invite-btn { border-color: var(--accent); color: var(--accent-ink); font-weight: 700; }
/* message de la page d'accueil : zone toujours présente (annonces fiables), invisible quand vide */
.gate-msg:empty { display: block; padding: 0; margin: 0; background: none; min-height: 0; }

/* =====================================================================
   BARRE LATÉRALE + BARRE DU HAUT ALLÉGÉE
   ===================================================================== */
.shell { display: flex; min-height: 100vh; }
.shell-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.sidebar { position: sticky; top: 0; height: 100vh; flex: 0 0 236px; width: 236px; display: flex; flex-direction: column; gap: 6px;
  background: var(--panel); border-right: 1px solid var(--line); padding: 14px 10px 12px; z-index: 35; overflow-y: auto; transition: width .18s, flex-basis .18s; }
.sb-top { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 2px 4px 12px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.sb-brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.sb-mark { flex: 0 0 auto; display: block; }
.sb-word { font-family: var(--serif); font-size: 16px; line-height: 1.15; white-space: nowrap; overflow: hidden; }
.sb-word strong { color: var(--accent-ink); }
.sb-collapse { flex: 0 0 auto; border: 1px solid var(--line); background: var(--bg); color: var(--muted); border-radius: 8px; width: 28px; height: 28px; cursor: pointer; font-size: 14px; line-height: 1; }
.sb-collapse:hover { color: var(--ink); border-color: var(--line-strong); }
.sb-collapse:focus-visible, .sb-item:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.sb-nav { display: flex; flex-direction: column; gap: 2px; }
.sb-item { display: flex; align-items: center; gap: 11px; width: 100%; text-align: left; font: inherit; font-size: 14px; font-weight: 600; color: var(--ink);
  background: transparent; border: none; border-radius: 9px; padding: 9px 10px; cursor: pointer; text-decoration: none; white-space: nowrap; }
.sb-item:hover { background: var(--accent-soft); color: var(--accent-ink); }
.sb-item:disabled { opacity: .45; cursor: default; background: none; }
.sb-ic { flex: 0 0 22px; width: 22px; text-align: center; font-size: 16px; line-height: 1; }
.sb-l { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.sb-sep { height: 1px; background: var(--line); margin: 8px 4px; }
.sb-title { font-size: 10.5px; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); font-weight: 700; padding: 2px 10px 4px; }
.sb-bottom { margin-top: auto; display: flex; flex-direction: column; gap: 8px; padding-top: 10px; border-top: 1px solid var(--line); }
.sidebar .lang { margin: 0 8px; align-self: flex-start; }
.sb-account[hidden] { display: none !important; }
.sb-account { border: 1px solid var(--line); padding: 8px 10px; }
.sb-account.on { border-color: var(--accent-soft); }
.sb-avatar { width: 28px; height: 28px; flex: 0 0 28px; border-radius: 50%; background: var(--accent); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; }
.sb-acc { display: flex; flex-direction: column; line-height: 1.25; }
.sb-acc-name { font-weight: 700; font-size: 13px; overflow: hidden; text-overflow: ellipsis; }
.sb-acc-mail { font-weight: 500; font-size: 11px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
.sb-acc-mail:empty { display: none; }
/* repliée : icônes seules */
body.sb-mini .sidebar { flex-basis: 64px; width: 64px; padding-left: 8px; padding-right: 8px; }
body.sb-mini .sb-word, body.sb-mini .sb-l, body.sb-mini .sb-title, body.sb-mini .sidebar .lang { display: none; }
body.sb-mini .sb-top { flex-direction: column; gap: 10px; }
body.sb-mini .sb-item { justify-content: center; padding: 10px 0; }
body.sb-mini .sb-account { border: none; }
/* barre du haut : projet en cours + actions essentielles */
.topbar { flex-wrap: nowrap; gap: 12px; padding: 10px 18px; }
.sb-open { display: none; }
.tb-project { display: flex; flex-direction: column; min-width: 0; flex: 1 1 auto; gap: 2px; }
.tb-name { font-family: var(--serif); font-size: 18px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 420px; }
.tb-name.empty { color: var(--muted); font-style: italic; font-weight: 400; }
.tb-status { display: flex; align-items: center; gap: 8px; min-height: 18px; flex-wrap: wrap; }
.tb-status .save-state { padding-left: 0; }
.topbar .history { margin-left: 0; }
.topbar .tabs { flex: 0 0 auto; }
.topbar-actions { flex: 0 0 auto; display: flex; gap: 8px; align-items: center; }
@media (max-width: 1250px) { .topbar #btn-copy { font-size: 0; padding: 7px 10px; } .topbar #btn-copy::before { content: '📋'; font-size: 15px; } }
@media (max-width: 1100px) { .tb-name { max-width: 240px; } }
/* téléphone / tablette : la barre latérale devient un tiroir */
@media (max-width: 1000px) {
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; transform: translateX(-105%); transition: transform .2s; box-shadow: 0 10px 40px rgba(0,0,0,.2); width: 260px; flex-basis: 260px; }
  body.sb-mini .sidebar { width: 260px; flex-basis: 260px; padding: 14px 10px 12px; }
  body.sb-mini .sb-word, body.sb-mini .sb-l, body.sb-mini .sb-title, body.sb-mini .sidebar .lang { display: revert; }
  body.sb-mini .sb-item { justify-content: flex-start; padding: 9px 10px; }
  body.sb-mini .sb-top { flex-direction: row; }
  .sb-collapse { display: none; }
  body.sb-drawer .sidebar { transform: none; }
  .sb-backdrop { position: fixed; inset: 0; background: rgba(30,22,12,.35); z-index: 34; }
  .sb-backdrop[hidden] { display: none; }
  .sb-open { display: inline-flex; flex: 0 0 auto; }
  .topbar { flex-wrap: wrap; gap: 8px 10px; padding: 8px 12px; }
  .tb-project { flex: 1 1 calc(100% - 60px); }
  .topbar .tabs { order: 3; }
  .topbar .history { order: 4; }
  .topbar-actions { order: 5; margin-left: auto; }
}
@media (max-width: 520px) { .topbar #btn-invite { font-size: 0; padding: 7px 10px; } .topbar #btn-invite::before { content: '👥'; font-size: 15px; } .history .btn.icon { padding: 5px 7px; } }
@media (prefers-reduced-motion: reduce) { .sidebar { transition: none; } }

.sb-word { white-space: normal; font-size: 15.5px; line-height: 1.2; }
.sb-brand { align-items: center; }
@media (max-width: 1000px) { .tb-name { max-width: none; } }
/* tableau des tâches vide : un encart plutôt que des en-têtes sans lignes */
.task-empty[hidden], .table-scroll[hidden], .tips-box[hidden], .card-actions .btn[hidden] { display: none !important; }
.task-empty { border: 1px dashed var(--line-strong); border-radius: 12px; padding: 20px; text-align: center; background: var(--bg); }
.te-t { margin: 0 0 4px; font-family: var(--serif); font-size: 17px; font-weight: 700; }
.te-s { margin: 0 0 14px; color: var(--muted); font-size: 13px; }
.te-acts { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.ms-empty { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.ms-empty[hidden] { display: none; }
/* « Reprendre où tu en étais » repliable */
.wl-toggle { font: inherit; font-family: var(--serif); font-size: 22px; font-weight: 700; color: var(--ink); background: none; border: none; padding: 0; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; }
.wl-toggle:hover .wl-chev { color: var(--accent); }
.wl-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
.wl-chev { font-size: 14px; color: var(--muted); width: 14px; display: inline-block; }
.wl-resume-body[hidden] { display: none; }
.wl-resume-sub { margin: 0 0 12px; color: var(--muted); }

/* =====================================================================
   TABLEAU DES TÂCHES : simple par défaut (tient en largeur), avancé à la demande
   ===================================================================== */
#task-table { min-width: 0; table-layout: fixed; width: 100%; }
#task-table .c-adv { display: none; }
#task-table.adv .c-adv { display: table-cell; }
#task-table.adv .c-simple { display: none; }
#task-table.adv { min-width: 980px; }
#task-table th.c-id { width: 58px; } #task-table th.c-owner { width: 128px; } #task-table th.c-dur { width: 76px; }
#task-table th.c-after { width: 210px; } #task-table th.c-pct { width: 70px; } #task-table th.c-act { width: 112px; }
#task-table th.c-status { width: 110px; } #task-table th.c-raci { width: 140px; } #task-table th.c-pred { width: 140px; }
#task-table td { overflow: hidden; }
#task-table select, #task-table input { min-width: 0; text-overflow: ellipsis; }
.cell-auto { font-size: 12px; color: var(--muted); font-style: italic; padding: 0 4px; white-space: nowrap; }
tr.is-phase td.c-task input { font-weight: 700; }
/* RACI en pastilles */
.raci-btn { width: 100%; min-height: 32px; font: inherit; font-size: 12px; text-align: left; background: #fff; border: 1px solid var(--line-strong); border-radius: 7px; padding: 4px 6px; cursor: pointer; display: flex; flex-wrap: wrap; gap: 3px; align-items: center; }
.raci-btn.empty { color: var(--muted); justify-content: center; }
.raci-btn:hover { border-color: var(--accent); }
.raci-chip { background: var(--accent-soft); color: var(--accent-ink); border-radius: 5px; padding: 1px 5px; white-space: nowrap; font-size: 11.5px; }
.raci-chip b { font-weight: 800; }
.raci-grid { display: flex; flex-direction: column; gap: 10px; }
.raci-row { display: grid; grid-template-columns: 170px 1fr; gap: 12px; align-items: start; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.raci-k { display: flex; flex-direction: column; }
.raci-k b { font-size: 18px; color: var(--accent-ink); line-height: 1; }
.raci-k span { font-weight: 700; margin-top: 2px; }
.raci-k small { color: var(--muted); font-size: 11.5px; }
.raci-roles { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.raci-role { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; cursor: pointer; }
.raci-role input { width: 16px; height: 16px; accent-color: var(--accent); }
.raci-actions { gap: 8px; margin-top: 14px; }
@media (max-width: 560px) { .raci-row { grid-template-columns: 1fr; } }
/* petit écran : une fiche par tâche, jamais de défilement horizontal */
@media (max-width: 820px) {
  #task-table:not(.adv) thead { display: none; }
  #task-table:not(.adv), #task-table:not(.adv) tbody { display: block; width: 100%; }
  #task-table:not(.adv) tr { display: grid; grid-template-columns: 64px 1fr 1fr; gap: 6px 8px; padding: 10px; margin-bottom: 8px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
  #task-table:not(.adv) tr.is-sub { margin-left: 14px; }
  #task-table:not(.adv) td { display: block; border: none; padding: 0; }
  #task-table:not(.adv) td.c-adv { display: none; }
  #task-table:not(.adv) td.c-task { grid-column: 2 / -1; }
  #task-table:not(.adv) td.c-after { grid-column: 1 / -1; }
  #task-table:not(.adv) td.c-act { grid-column: 1 / -1; text-align: right; }
  #task-table:not(.adv) td[data-label]:not(.c-id):not(.c-task)::before { content: attr(data-label); display: block; font-size: 10.5px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); font-weight: 700; margin-bottom: 3px; }
}
@media (max-width: 820px) {
  #task-table:not(.adv) tr { grid-template-columns: 58px 1fr 88px; align-items: end; }
  #task-table:not(.adv) td { background: transparent !important; overflow: visible; }
  #task-table:not(.adv) td.c-id { grid-column: 1; }
  #task-table:not(.adv) td.c-task { grid-column: 2 / -1; }
  #task-table:not(.adv) td.c-owner { grid-column: 1 / 3; }
  #task-table:not(.adv) td.c-dur { grid-column: 3; }
  #task-table:not(.adv) td.c-after { grid-column: 1 / -1; }
  #task-table:not(.adv) td.c-pct { grid-column: 1 / 2; }
  #task-table:not(.adv) td.c-act { grid-column: 2 / -1; align-self: end; }
  #task-table:not(.adv) tr.is-sub td:first-child { border-left: none; }
  #task-table:not(.adv) tr.is-sub { border-left: 3px solid var(--line-strong); }
}

/* ---------- entrée sans compte (toujours visible sur la page de connexion) ---------- */
.gate-try { margin-top: 12px; text-align: center; }
.gate-try[hidden] { display: none; }
.gate-try-btn { width: 100%; padding: 11px 14px; font-size: 15px; border-color: var(--line-strong); }
.gate-try-note { margin: 8px 4px 2px; font-size: 12.5px; line-height: 1.45; color: var(--muted); }

/* ---------- fenêtre de confirmation de l'appli ---------- */
.confirm { position: fixed; inset: 0; z-index: 300; display: flex; align-items: center; justify-content: center; padding: 16px; }
.confirm-backdrop { position: absolute; inset: 0; background: rgba(30, 22, 12, .5); backdrop-filter: blur(2px); }
.confirm-box { position: relative; background: var(--panel); border-radius: 14px; box-shadow: 0 20px 60px rgba(0,0,0,.32); width: min(440px, 100%); padding: 20px 22px 18px; }
.confirm-msg { margin: 0 0 6px; font-size: 15px; font-weight: 600; line-height: 1.45; overflow-wrap: anywhere; }
.confirm-sub { margin: 0 0 4px; font-size: 13px; line-height: 1.45; color: var(--muted); }
.confirm-acts { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.btn.danger-fill { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.danger-fill:hover { background: #8c2d24; border-color: #8c2d24; color: #fff; }

/* ---------- notification : contraste fort, bouton d'action bien lisible ---------- */
.toast { background: #17140f; box-shadow: 0 12px 34px rgba(0,0,0,.35), 0 0 0 1px rgba(255,255,255,.08); font-weight: 600; pointer-events: auto; }
.toast-undo { background: #fff; color: #17140f; border-color: #fff; padding: 6px 14px; min-height: 32px; font-weight: 800; }
.toast-undo:hover { background: #f1ecdf; }
.toast-undo:focus-visible { outline: 2px solid #f0c56a; outline-offset: 2px; }

/* ---------- petit « ? » d'aide (renvoie à la FAQ) ---------- */
.help-q { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; border-radius: 50%;
  border: 1px solid var(--line-strong); background: var(--panel); color: var(--accent-ink); font: 700 11px/1 var(--font); text-decoration: none;
  vertical-align: 1px; text-transform: none; letter-spacing: 0; flex: 0 0 auto; }
.help-q::after { content: ''; position: absolute; inset: -8px; }   /* zone tactile 34 px */
.help-q:hover { background: var(--accent); color: #fff; border-color: var(--accent); }
.help-q:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.disp-row { display: flex; align-items: center; gap: 8px; }
.disp-row .disp-check { flex: 0 1 auto; }
.legend .item .help-q { margin-left: 2px; }
.summary .stat .k .help-q { margin-left: 4px; }
.pred-read { flex: 1 1 auto; min-width: 0; font-size: 12.5px; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.pred-read.none { color: var(--muted); font-style: italic; }
.dep-hint { margin: -6px 0 0; font-size: 12.5px; line-height: 1.45; color: var(--muted); }
.share-live { margin-top: 14px; padding: 12px 14px; border-radius: 10px; background: var(--accent-soft); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 14px; }
.share-live p { margin: 0; font-size: 13px; line-height: 1.45; color: var(--accent-ink); flex: 1 1 240px; }
#task-table th.c-pred { width: 168px; white-space: nowrap; }

/* ---------- titre du projet modifiable en haut ---------- */
input.tb-name { font: 700 18px/1.3 var(--serif); color: var(--ink); background: transparent; border: 1px solid transparent; border-radius: 8px;
  padding: 1px 8px; margin-left: -8px; width: 100%; max-width: 420px; min-width: 0; text-overflow: ellipsis; overflow: visible; cursor: text; }
input.tb-name:hover { border-color: var(--line-strong); background: #fff; }
input.tb-name:focus { border-color: var(--accent); background: #fff; outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }
input.tb-name::placeholder { color: var(--muted); font-style: italic; font-weight: 400; opacity: 1; }
@media (max-width: 1100px) { input.tb-name { max-width: 240px; } }
@media (max-width: 1000px) { input.tb-name { max-width: none; } }
.name-input { width: 100%; font: inherit; font-size: 16px; color: var(--ink); background: #fff; border: 1px solid var(--line-strong); border-radius: 10px; padding: 11px 12px; }
.name-input:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.name-acts { gap: 8px; margin-top: 14px; }
.paste-count.empty { font-weight: 500; color: var(--muted); }
.paste-sample { align-self: flex-start; margin-top: -4px; }
.paste-sample[hidden] { display: none; }
.chain-note { margin: -4px 0 0; }

/* ---------- date de rendu : badge marge / retard (jours ouvrés) ---------- */
.due-line { margin: 12px 0 0; }
.due-line[hidden] { display: none; }
.due-line .badge { display: inline-block; font-size: 13px; font-weight: 700; padding: 5px 12px; border-radius: 20px; }
.due-line .badge.ok { background: #e7efe6; color: #2f5d3a; }
.due-line .badge.late { background: #f6e4e2; color: #8a2b30; }
#task-table th.c-dur { width: 108px; }
#task-table th.c-dur { line-height: 1.25; }

/* ---------- matrice RACI ---------- */
.raci-card { padding: 0; }
.raci-det > summary { cursor: pointer; list-style: none; user-select: none; padding: 16px 18px; display: flex; align-items: baseline; gap: 10px; }
.raci-det > summary::-webkit-details-marker { display: none; }
.raci-det > summary::before { content: '▸'; color: var(--muted); font-size: 14px; width: 14px; }
.raci-det[open] > summary::before { content: '▾'; }
.raci-det > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: 12px; }
.raci-sum-t { font-family: var(--serif); font-size: 19px; font-weight: 700; }
.raci-sum-s { font-size: 12.5px; color: var(--muted); }
.raci-det > .hint, .raci-det > #raci-matrix-box { margin-left: 18px; margin-right: 18px; }
.raci-det > #raci-matrix-box { margin-bottom: 16px; }
table.raci-matrix { min-width: 0; width: auto; }
.raci-matrix th.rm-task, .raci-matrix td.rm-task { text-align: left; min-width: 200px; max-width: 320px; position: sticky; left: 0; background: var(--panel); z-index: 1; }
.raci-matrix th.rm-role { text-align: center; white-space: nowrap; min-width: 56px; }
.rm-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 5px; vertical-align: 0; }
.rm-name { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.raci-matrix td.rm-td { text-align: center; padding: 3px; }
.rm-cell { width: 44px; height: 34px; border-radius: 8px; border: 1px dashed var(--line-strong); background: #fff; color: var(--ink); font: 800 14px/1 var(--font); cursor: pointer; }
.rm-cell:hover { border-color: var(--accent); background: var(--accent-soft); }
.rm-cell:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.rm-cell.on { border-style: solid; border-color: transparent; color: #fff; }
.rm-cell.l-R { background: var(--accent); }
.rm-cell.l-A { background: #3a4653; }
.rm-cell.l-C { background: #946a28; }
.rm-cell.l-I { background: #5d6a79; }
.rm-cell.multi { font-size: 12px; letter-spacing: -.5px; }
.rm-cell.ghost { background: transparent; color: var(--accent-ink); border: 1px dashed var(--accent); opacity: .75; }
.rm-legend { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 10px 0 0; font-size: 12.5px; color: var(--muted); }
.rm-legend b { color: var(--accent-ink); }

/* =====================================================================
   LOT USAGE : contraste, cibles tactiles, tableau des tâches, mobile
   ===================================================================== */
/* cibles tactiles : au moins 32 px sur les petits boutons */
.btn.small, .btn.icon { min-height: 32px; }
.row-del, .row-sub, .row-move, .row-toggle, .row-link, .sb-collapse, .modal-x {
  min-width: 32px; min-height: 32px; display: inline-flex; align-items: center; justify-content: center; }
.row-sub, .row-link { width: 32px; height: 32px; }
.row-move { font-size: 12px; padding: 0; }
.row-toggle { font-size: 13px; padding: 0; }
.row-del { font-size: 18px; padding: 0; }
.sb-collapse { width: 32px; height: 32px; }
.row-actions { display: flex; gap: 0; justify-content: flex-end; align-items: center; }
.row-sub { margin-right: 0; }
.raci-btn { min-height: 34px; }

/* tableau des tâches : le nom garde au moins 160 px, sinon on passe en cartes */
#task-table:not(.adv) { min-width: 842px; }
#task-table th.c-id { width: 58px; } #task-table th.c-owner { width: 120px; }
#task-table th.c-after { width: 190px; } #task-table th.c-pct { width: 64px; } #task-table th.c-act { width: 136px; }
#task-table th.c-task { min-width: 160px; }
#task-table.adv { min-width: 1060px; }

/* barre latérale : repliée d'office sur écran moyen (le choix manuel reste prioritaire, voir app.js) */
@media (max-width: 960px) {
  #task-table:not(.adv) { min-width: 0; }
  #task-table:not(.adv) thead { display: none; }
  #task-table:not(.adv), #task-table:not(.adv) tbody { display: block; width: 100%; }
  /* une carte par tâche : le nom sur toute la largeur, durée et « après » dessous */
  #task-table:not(.adv) tr { display: grid; grid-template-columns: 96px 1fr 84px; grid-template-areas: "name name name" "dur after after" "owner owner pct" "id act act";
    gap: 8px 10px; align-items: end; padding: 12px; margin-bottom: 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
  #task-table:not(.adv) tr.is-sub { margin-left: 14px; border-left: 3px solid var(--line-strong); }
  #task-table:not(.adv) td { display: block; border: none; padding: 0; background: transparent !important; overflow: visible; min-width: 0; }
  #task-table:not(.adv) td.c-adv { display: none; }
  #task-table:not(.adv) td.c-task { grid-area: name }
  #task-table:not(.adv) td.c-dur { grid-area: dur }
  #task-table:not(.adv) td.c-after { grid-area: after }
  #task-table:not(.adv) td.c-id { grid-area: id }
  #task-table:not(.adv) td.c-owner { grid-area: owner }
  #task-table:not(.adv) td.c-pct { grid-area: pct }
  #task-table:not(.adv) td.c-act { grid-area: act; align-self: end; display: flex; }
  #task-table:not(.adv) tr.is-sub td:first-child { border-left: none; }
  #task-table:not(.adv) td[data-label]:not(.c-task)::before { content: attr(data-label); display: block; font-size: 10.5px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); font-weight: 700; margin-bottom: 3px; line-height: 1.2; overflow-wrap: anywhere; }
  #task-table:not(.adv) td.c-task input { font-size: 15px; padding: 9px 10px; }
  #task-table:not(.adv) .row-actions { justify-content: flex-end; }
}

/* téléphone : le diagramme d'abord, cartes de stats et options derrière « Réglages » */
.settings-toggle { display: none; }
@media (max-width: 720px) {
  #tab-chart:not([hidden]) { display: flex; flex-direction: column; }
  #tab-chart > .banner { order: 0; }
  #tab-chart > .gantt { order: 1; }
  #tab-chart > .settings-toggle { display: inline-flex; order: 2; align-self: flex-start; align-items: center; gap: 8px; margin: 14px 0 12px; min-height: 40px; }
  #tab-chart > .settings-toggle::before { content: '▸'; font-size: 12px; }
  #tab-chart.show-settings > .settings-toggle::before { content: '▾'; }
  #tab-chart > .viewbar, #tab-chart > .summary, #tab-chart > .legend { order: 3; display: none; }
  #tab-chart.show-settings > .viewbar { display: flex; }
  #tab-chart.show-settings > .summary { display: flex; }
  #tab-chart.show-settings > .legend:not([hidden]) { display: flex; }
  #tab-chart > .summary .stat { flex: 1 1 calc(50% - 6px); min-width: 0; }
}

/* ---------- thèmes et styles (studio d'export, menu Afficher) ---------- */
.theme-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; }
.th-btn { display: flex; flex-direction: column; gap: 6px; align-items: stretch; text-align: left; font: inherit; color: var(--ink); background: var(--panel);
  border: 1px solid var(--line-strong); border-radius: 10px; padding: 7px; cursor: pointer; min-height: 44px; }
.th-btn:hover { border-color: var(--accent); }
.th-btn.on { border-color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
.th-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.th-sw { display: flex; gap: 3px; padding: 5px; border: 1px solid; border-radius: 6px; }
.th-sw i { flex: 1 1 0; height: 14px; border-radius: 4px; display: block; }
.th-nm { font-size: 12px; font-weight: 600; line-height: 1.2; }
.disp-style { display: grid; gap: 10px; }
.disp-hint { font-size: 11.5px; color: var(--muted); }
.disp-sel { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.disp-sel select { font: inherit; color: var(--ink); background: #fff; border: 1px solid var(--line-strong); border-radius: 8px; padding: 7px 9px; min-height: 36px; }
.xs-more .disp-style { grid-column: 1 / -1; }
.xs-field[hidden], .xs-pager[hidden], .xs-fold[hidden] { display: none; }
.xs-pager { display: flex; align-items: center; justify-content: center; gap: 12px; }
.xs-pager .xs-pn { min-width: 40px; min-height: 36px; font-size: 18px; line-height: 1; padding: 4px 10px; }
.xs-pl { font-size: 13px; font-weight: 700; color: var(--ink); min-width: 80px; text-align: center; }
.xs-fold { display: grid; gap: 6px; max-height: 160px; overflow: auto; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.xs-fold-i { font-weight: 500; font-size: 12.5px; }

/* téléphone : le diagramme garde sa taille, défilement horizontal, colonne des noms figée */
.g-scroll { overflow-x: auto; overflow-y: hidden; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; border-radius: var(--radius); }
.g-inner { position: relative; }
.g-inner > svg { display: block; position: relative; }
.g-sticky { position: sticky; left: 0; z-index: 3; overflow: hidden; box-shadow: 6px 0 8px -6px rgba(40,30,15,.28); }
.g-sticky > svg { display: block; }

/* ---------- avertissements, jours fériés, durée retenue ---------- */
.banner.warn { background: #fff7e6; border-color: #f0d9a8; color: #6b4a06; }
.banner.warn ul { margin: 0; }
.grid-form textarea { resize: vertical; min-height: 44px; }
.hol-box { display: flex; flex-direction: column; gap: 6px; }
.hol-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.field-warn { font-size: 12px; color: #922; font-weight: 600; }
.dur-note { display: block; font-size: 11px; color: var(--muted); margin-top: 2px; white-space: normal; }
.dur-note[hidden], .team-hint[hidden] { display: none; }

/* ---------- contrôle avant de rendre, charge par personne, phrase du chemin critique ---------- */
.ctl-btn { display: inline-flex; align-items: center; gap: 8px; }
.ctl-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; font: 700 12px/1 var(--font); border: 1px solid transparent; }
.ctl-badge[hidden] { display: none; }
.ctl-badge.warn { background: #f6e2b8; color: #5b3a04; border-color: #d9b56a; }
.ctl-badge.ok { background: #e0ecdd; color: #2a5a35; border-color: #b8d3b2; }
.ctl-status { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 12px; font: 700 20px/1.25 var(--serif); }
.ctl-status.ok { background: #eef4ec; color: #2a5a35; }
.ctl-status.warn { background: #fbf3e0; color: #5b3a04; }
.ctl-status .ctl-badge { min-width: 28px; height: 28px; border-radius: 14px; font-size: 15px; }
.ctl-intro { margin: 12px 2px 4px; color: var(--muted); max-width: 64ch; }
.ctl-group h4 { margin: 18px 0 2px; font: 700 12px/1.2 var(--font); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.ctl-list { list-style: none; margin: 0; padding: 0; }
.ctl-item { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.ctl-txt { min-width: 0; max-width: 62ch; }
.ctl-m { font-weight: 600; font-size: 14.5px; }
.ctl-w { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.ctl-acts { display: flex; gap: 6px; flex: 0 0 auto; }
.ctl-item.is-ign .ctl-m { color: var(--muted); font-weight: 500; }
.ctl-ign, .ctl-thr { margin-top: 18px; }
.ctl-ign > summary, .ctl-thr > summary { cursor: pointer; font-weight: 600; color: var(--muted); padding: 6px 0; }
.ctl-thr-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; margin: 8px 0 10px; }
.ctl-thr-grid .field span { font-size: 12.5px; color: var(--muted); }
.ctl-thr-grid input { width: 100%; max-width: 120px; }
.ctl-thr-foot { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.ctl-thr-foot .hint { margin: 0; }
.xs-ctl .ctl-btn { width: 100%; justify-content: center; }
.xs-checks { display: grid; gap: 8px; }
@media (max-width: 560px) { .ctl-item { flex-direction: column; align-items: flex-start; } .ctl-thr-grid { grid-template-columns: 1fr; } }
tr.ctl-flash td, .ctl-flash:not(tr) { animation: ctl-flash 2.4s ease-out; }
@keyframes ctl-flash { 0%, 55% { background-color: #fbeab8; box-shadow: 0 0 0 2px #d9b56a; } 100% { background-color: transparent; box-shadow: 0 0 0 0 transparent; } }
@media (prefers-reduced-motion: reduce) { tr.ctl-flash td, .ctl-flash:not(tr) { animation: none; background-color: #fbeab8; } }

.crit-note { margin: 0 0 12px; padding: 10px 14px; max-width: 78ch; border-left: 3px solid var(--accent); background: var(--accent-soft); border-radius: 0 10px 10px 0; font-size: 14px; }
.crit-note[hidden] { display: none; }

.load-sub { margin: 0; }
.load-sum { font: 600 20px/1.35 var(--serif); max-width: 62ch; margin: 2px 0 16px; }
.load-h { font: 700 17px/1.2 var(--serif); margin: 26px 0 2px; }
.load-hint { margin: 2px 0 10px; }
.load-table th.lt-n, .load-table td.lt-n { text-align: right; width: 12%; font-variant-numeric: tabular-nums; }
.lt-person { white-space: nowrap; font-weight: 600; }
.load-sw { display: inline-block; width: 12px; height: 12px; border-radius: 4px; margin-right: 8px; vertical-align: -1px; }
.load-sw.none { background: transparent; border: 1.5px dashed var(--muted); }
.lt-share { min-width: 190px; }
.lt-pct { display: inline-block; min-width: 44px; font-weight: 700; font-variant-numeric: tabular-nums; }
.load-bar { display: inline-block; vertical-align: middle; width: calc(100% - 52px); height: 8px; border-radius: 4px; background: var(--line); overflow: hidden; }
.load-bar i { display: block; height: 100%; border-radius: 4px; }
.lt-av { white-space: nowrap; width: 150px; }
.lt-av input { width: 72px; text-align: right; }
.lt-unit { margin-left: 4px; color: var(--muted); }
.lt-over { color: var(--critical); font-weight: 700; }
.lt-none td { color: var(--muted); font-style: italic; }
.load-legend { display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 12.5px; margin-bottom: 8px; }
.load-legend .item { display: inline-flex; align-items: center; gap: 7px; }
.load-chart { overflow-x: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 8px 6px 4px; }
.load-chart svg { display: block; }
.ctl-thr-grid .field { display: flex; flex-direction: column; gap: 4px; }
@media (max-width: 600px) {
  table.load-table { min-width: 0; }
  .load-table thead { display: none; }
  .load-table, .load-table tbody, .load-table tr, .load-table td { display: block; width: 100%; }
  .load-table tr { padding: 10px 0; border-bottom: 1px solid var(--line); }
  .load-table td { display: flex; justify-content: space-between; align-items: center; gap: 12px; border: 0; padding: 3px 4px; text-align: right; }
  .load-table td::before { content: attr(data-label); color: var(--muted); font-size: 12px; text-align: left; }
  .load-table td.lt-person { font-size: 15px; justify-content: flex-start; }
  .load-table td.lt-person::before { content: none; }
  .load-table td.lt-n { width: 100%; }
  .load-table .lt-share { min-width: 0; }
  .load-table .lt-share .load-bar { width: 90px; }
  .load-table td:empty { display: none; }
}

/* =====================================================================
   JALON : la mascotte, sa bulle, le halo de la visite guidée
   Mouvement : transform et opacité seulement. Rien ne bouge si l'on a demandé moins de mouvement.
   ===================================================================== */
.jalon, .jalon-bubble, .jalon-spot { position: fixed; left: 0; top: 0; }
.jalon { --jalon-size: 64px; z-index: 210; width: var(--jalon-size); pointer-events: none; opacity: 0;
  transition: transform .52s cubic-bezier(.22, 1, .36, 1), opacity .3s ease; will-change: transform; }
.jalon.is-ready { opacity: 1; }
.jalon[hidden] { display: none; }
.jalon.follow { transition-duration: .14s, .3s; }
.jalon-btn { pointer-events: auto; display: block; position: relative; width: 100%; padding: 0; border: 0; background: none; cursor: pointer;
  border-radius: 16px; -webkit-tap-highlight-color: transparent; }
.jalon-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.jalon-bob { display: block; animation: jalon-float 5s ease-in-out infinite; }
.jalon.is-sleep .jalon-bob { animation-duration: 8s; }
.jalon-fig { display: block; position: relative; width: 100%; aspect-ratio: 200 / 222; }
.jalon-layer { position: absolute; inset: 0; opacity: 0; scale: .96; transform-origin: 50% 80%;
  transition: opacity .16s ease, scale .22s cubic-bezier(.22, 1, .36, 1); }
.jalon-layer.in { opacity: 1; scale: 1; }
.jalon-layer.out { opacity: 0; }
.jalon-layer svg { display: block; width: 100%; height: 100%; overflow: visible; }
.jalon-shade { position: absolute; left: 22%; right: 22%; bottom: 0; height: 5.5%; border-radius: 50%; background: rgba(37, 34, 30, .17);
  animation: jalon-shade 5s ease-in-out infinite; }
.jalon.is-sleep .jalon-shade { animation-duration: 8s; }
.jalon-dot { position: absolute; top: 0; right: 0; width: 14px; height: 14px; border-radius: 50%; background: var(--today);
  border: 2px solid var(--panel); box-shadow: 0 0 0 1px rgba(40, 30, 15, .12); animation: jalon-pulse 2.4s ease-in-out infinite; }
.jalon-dot[hidden] { display: none; }
@keyframes jalon-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
@keyframes jalon-shade { 0%, 100% { transform: scaleX(1); opacity: 1; } 50% { transform: scaleX(.84); opacity: .65; } }
@keyframes jalon-pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.18); } }

.jalon-bubble { z-index: 211; width: min(304px, calc(100vw - 24px)); background: var(--panel); color: var(--ink);
  border: 1px solid var(--line-strong); border-radius: 14px; padding: 12px 14px; font-size: 13.5px; line-height: 1.45;
  box-shadow: 0 14px 40px rgba(40, 30, 15, .18), 0 2px 6px rgba(40, 30, 15, .08);
  opacity: 0; visibility: hidden; pointer-events: none; scale: .94; transform-origin: var(--ox, 50%) var(--oy, 100%);
  transition: opacity .12s ease, scale .12s ease, visibility 0s .12s; }
.jalon-bubble.in { opacity: 1; visibility: visible; pointer-events: auto; scale: 1;
  transition: transform .52s cubic-bezier(.22, 1, .36, 1) .04s, opacity .18s ease, scale .3s cubic-bezier(.22, 1, .36, 1), visibility 0s; }
.jalon-bubble::after { content: ''; position: absolute; width: 12px; height: 12px; background: var(--panel); border: 1px solid var(--line-strong); transform: rotate(45deg); }
.jalon-bubble[data-tail="bottom"]::after { bottom: -7px; left: calc(var(--tx, 50%) - 6px); border-top: 0; border-left: 0; }
.jalon-bubble[data-tail="top"]::after { top: -7px; left: calc(var(--tx, 50%) - 6px); border-bottom: 0; border-right: 0; }
.jalon-bubble[data-tail="right"]::after { right: -7px; top: calc(var(--ty, 50%) - 6px); border-bottom: 0; border-left: 0; }
.jalon-bubble[data-tail="none"]::after { display: none; }
.jalon-bubble[data-tail="left"]::after { left: -7px; top: calc(var(--ty, 50%) - 6px); border-top: 0; border-right: 0; }
.jalon-count { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0 0 6px; font-size: 11px; font-weight: 700;
  letter-spacing: .6px; text-transform: uppercase; color: var(--muted); }
.jalon-dots { display: inline-flex; gap: 4px; }
.jalon-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--line-strong); }
.jalon-dots i.past { background: var(--accent); opacity: .55; }
.jalon-dots i.on { background: var(--accent); }
.jalon-text { margin: 0 0 10px; }
.jalon-more { display: inline-block; margin: -4px 0 10px; font-weight: 600; font-size: 13px; color: var(--accent-ink); }
.jalon-more:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.jalon-acts { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.jalon-acts.vertical { flex-direction: column; align-items: stretch; }
.jalon-acts.vertical .jalon-act { text-align: left; }
.jalon-link { flex: 0 0 100%; text-align: left; font-size: 12.5px; padding: 3px 0 0; }
.jalon-acts.vertical .jalon-link { flex: 0 0 auto; }
.jalon-sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

.jalon-spot { z-index: 120; width: 0; height: 0; pointer-events: none; border-radius: 14px; opacity: 0;
  box-shadow: 0 0 0 100vmax rgba(37, 34, 30, .24);
  transition: transform .42s cubic-bezier(.22, 1, .36, 1), width .42s cubic-bezier(.22, 1, .36, 1), height .42s cubic-bezier(.22, 1, .36, 1), opacity .25s ease; }
.jalon-spot.on { opacity: 1; }
.jalon-spot.ring { border-radius: 12px; box-shadow: 0 0 0 3px rgba(197, 138, 61, .95), 0 0 0 9px rgba(197, 138, 61, .22), 0 0 0 100vmax rgba(37, 34, 30, .26); }
.jalon-spot.ring.on { animation: jalon-halo 2.6s ease-in-out infinite; }
@keyframes jalon-halo {
  0%, 100% { box-shadow: 0 0 0 3px rgba(197, 138, 61, .95), 0 0 0 9px rgba(197, 138, 61, .22), 0 0 0 100vmax rgba(37, 34, 30, .26); }
  50% { box-shadow: 0 0 0 3px rgba(197, 138, 61, .95), 0 0 0 13px rgba(197, 138, 61, .10), 0 0 0 100vmax rgba(37, 34, 30, .26); }
}
/* sous une fenêtre ouverte, derrière le tiroir de menu, ou pendant la saisie sur téléphone : Jalon s'efface */
.jalon.is-under, .jalon-bubble.is-under, .jalon-spot.is-under, .jalon.is-hush, .jalon-bubble.is-hush, .jalon-spot.is-hush { opacity: 0 !important; visibility: hidden; pointer-events: none !important; }
/* le bas de page reste toujours dégagé, Jalon ne cache jamais la fin d'un tableau */
body.has-jalon main { padding-bottom: 92px; padding-right: 76px; }   /* la marge de droite est à Jalon : il ne recouvre jamais un contrôle */

/* réglage dans la barre latérale */
.sb-jalon { display: flex; flex-direction: column; gap: 6px; }
.sb-jalon-head { padding: 0 10px; font-size: 10.5px; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); font-weight: 700; }
.sb-jalon-seg { display: grid; grid-template-columns: 1fr 1.45fr 1fr; gap: 2px; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 2px; margin: 0 6px; }
.sb-jalon-seg button { font: inherit; font-size: 12px; font-weight: 600; color: var(--muted); background: transparent; border: 0; border-radius: 8px; padding: 6px 4px; cursor: pointer; white-space: nowrap; }
.sb-jalon-seg button:hover { color: var(--ink); }
.sb-jalon-seg button.on { background: var(--panel); color: var(--ink); box-shadow: 0 1px 3px rgba(40, 30, 15, .12); }
.sb-jalon-seg button:focus-visible, .sb-jalon-cycle:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.sb-jalon-cycle { display: none; align-items: center; justify-content: center; width: 40px; height: 40px; margin: 0 auto; padding: 4px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); cursor: pointer; }
.sb-jalon-cycle svg { display: block; width: 100%; height: 100%; }
.sb-jalon-cycle.off { opacity: .45; }
body.sb-mini .sb-jalon-head, body.sb-mini .sb-jalon-seg { display: none; }
body.sb-mini .sb-jalon-cycle { display: flex; }
@media (max-width: 1000px) {
  body.sb-mini .sb-jalon-head { display: block; }
  body.sb-mini .sb-jalon-seg { display: grid; }
  body.sb-mini .sb-jalon-cycle { display: none; }
}

@media (max-width: 700px) {
  .jalon-bubble { font-size: 13px; padding: 11px 12px; }
  body.has-jalon main { padding-bottom: 70px; padding-right: 52px; }
}
@media (prefers-reduced-motion: reduce) {
  .jalon, .jalon-spot { transition: opacity .15s ease; }
  .jalon-bubble, .jalon-bubble.in { transition: opacity .15s ease; scale: 1; }
  .jalon-layer { transition: none; scale: 1; }
  .jalon-bob, .jalon-shade, .jalon-dot, .jalon-spot.on { animation: none; }
}

/* ===== Panneau de Jalon : Demande à Jalon, conseils chiffrés, aperçu avant / après, relecture prof ===== */
.jalon-veil { position: fixed; inset: 0; z-index: 205; background: rgba(37, 34, 30, .26); opacity: 0; transition: opacity .2s ease; }
.jalon-veil.in { opacity: 1; }
.jalon-veil[hidden], .jalon-panel[hidden] { display: none; }
.jalon-panel { position: fixed; z-index: 212; right: 92px; bottom: 16px; width: min(460px, calc(100vw - 120px)); max-height: calc(100vh - 32px); overflow-y: auto; overscroll-behavior: contain;
  background: var(--panel); color: var(--ink); border: 1px solid var(--line-strong); border-radius: 16px; padding: 14px 16px 18px; font-size: 13.5px; line-height: 1.45;
  box-shadow: 0 18px 50px rgba(40, 30, 15, .24), 0 2px 8px rgba(40, 30, 15, .1); opacity: 0; transform: translateY(10px); transition: opacity .18s ease, transform .3s cubic-bezier(.22, 1, .36, 1); }
.jalon-panel.in { opacity: 1; transform: none; }
.jalon-ph { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; }
.jalon-pt { margin: 0; font-size: 16px; font-weight: 700; flex: 1; }
.jalon-px { margin-left: auto; width: 34px; height: 34px; border: 0; border-radius: 10px; background: transparent; font-size: 22px; line-height: 1; color: var(--muted); cursor: pointer; }
.jalon-px:hover { background: var(--bg); color: var(--ink); }
.jalon-pb { border: 0; background: none; font: inherit; font-weight: 600; color: var(--accent-ink); cursor: pointer; padding: 6px 4px; }
.jalon-px:focus-visible, .jalon-pb:focus-visible, .jalon-chip:focus-visible, .jalon-q:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.jalon-ask { display: flex; gap: 8px; margin: 0 0 6px; }
.jalon-q { flex: 1; min-width: 0; font: inherit; font-size: 14px; padding: 9px 12px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--bg); color: var(--ink); }
.jalon-hint { margin: 4px 0 10px; font-size: 12.5px; color: var(--muted); }
.jalon-sh, .jalon-sh2 { margin: 12px 0 6px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .8px; color: var(--muted); }
.jalon-sh2 { margin-top: 14px; }
.jalon-chips { display: flex; flex-wrap: wrap; gap: 6px 8px; }
.jalon-chip { font: inherit; font-size: 13px; text-align: left; padding: 7px 12px; min-height: 34px; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--panel); color: var(--ink); cursor: pointer; }
.jalon-chip:hover { border-color: var(--accent); background: var(--bg); }
.jalon-card { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; background: var(--bg); margin: 8px 0; }
.jalon-ct { margin: 0 0 6px; font-size: 15px; }
.jalon-ca { margin: 0 0 8px; }
.jalon-ex { margin: 0 0 8px; padding: 8px 10px; border-left: 3px solid var(--accent); background: var(--panel); border-radius: 0 8px 8px 0; font-size: 13px; }
.jalon-steps { margin: 0 0 10px; padding-left: 20px; }
.jalon-steps li { margin: 2px 0; }
.jalon-pacts { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 8px; }
.jalon-nope { margin: 10px 0 4px; font-weight: 600; }
.jalon-nope.soft { font-weight: 500; color: var(--ink); }
.jalon-item { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin: 10px 0; background: var(--bg); }
.jalon-item.first { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.jalon-badge { display: inline-block; margin: 0 0 6px; padding: 2px 9px; border-radius: 999px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; background: var(--accent); color: #fff; }
.jalon-badge.warn { background: var(--today); }
.jalon-ip { margin: 0 0 8px; font-weight: 600; }
.jalon-fix { margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--line-strong); }
.jalon-fix:first-of-type { border-top: 0; padding-top: 0; }
.jalon-fp { margin: 0; }
.jalon-alt { margin: 0 0 4px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); }
.jalon-why { margin: 0; color: var(--ink); }
.jalon-suivi { border: 1px solid var(--today); border-radius: 12px; padding: 10px 14px; margin: 6px 0 10px; background: var(--bg); }
.jalon-plink { margin-top: 10px; }
.jalon-more-list > summary { cursor: pointer; font-weight: 600; margin: 8px 0; }
.jalon-ba { display: grid; gap: 2px; margin: 10px 0; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--bg); }
.jalon-ba-head, .jalon-ba-row { display: grid; grid-template-columns: 1.5fr 1fr 20px 1fr; gap: 6px; padding: 7px 12px; align-items: baseline; }
.jalon-ba-head { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); }
.jalon-ba-row { border-top: 1px solid var(--line); }
.jalon-ba-l { font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.jalon-ba-b { color: var(--muted); white-space: nowrap; }
.jalon-ba-a { font-weight: 700; white-space: nowrap; }
.jalon-ba-a.good { color: #1f6b43; }
.jalon-ba-a.bad { color: #a23b2a; }
.jalon-ba-sub { padding: 7px 12px 3px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); border-top: 1px solid var(--line); }
.jalon-changes { margin: 0 0 8px; padding-left: 18px; }
.jalon-score { display: flex; gap: 14px; align-items: center; margin: 4px 0 6px; }
.jalon-big { flex: 0 0 auto; font-size: 30px; font-weight: 800; letter-spacing: -.5px; color: var(--accent-ink); white-space: nowrap; padding: 4px 12px; border-radius: 12px; }
/* Note : rouge sous 10, jaune de 10 à 13,5, vert à partir de 14 */
.jalon-big.low { color: #a8392f; background: #f6e0dc; }
.jalon-big.mid { color: #8a6200; background: #fbefc8; }
.jalon-big.good { color: #2f6b3a; background: #e1eedf; }
.jalon-scale { display: grid; gap: 8px; }
.jalon-cr-h { display: flex; justify-content: space-between; gap: 10px; font-weight: 600; }
.jalon-cr-p { white-space: nowrap; color: var(--muted); font-variant-numeric: tabular-nums; }
.jalon-bar { height: 6px; border-radius: 99px; background: var(--line); overflow: hidden; margin: 3px 0; }
.jalon-bar i { display: block; height: 100%; background: var(--today); border-radius: 99px; }
.jalon-cr.full .jalon-bar i { background: #1f6b43; }
.jalon-cr-d { font-size: 12.5px; color: var(--muted); }
.jalon-good { margin: 0; padding-left: 18px; }
body.jalon-panel-open { overflow: auto; }
@media (max-width: 700px) {
  .jalon-panel { left: 0; right: 0; bottom: 0; width: auto; max-height: 86vh; max-height: 86dvh; border-radius: 18px 18px 0 0; padding: 14px 14px calc(18px + env(safe-area-inset-bottom)); font-size: 14px; }
  body.jalon-panel-open .jalon { visibility: hidden; }
  .jalon-q { font-size: 16px; }
  .jalon-chip, .jalon-px { min-height: 40px; }
  .jalon-ba-head, .jalon-ba-row { grid-template-columns: 1.3fr 1fr 16px 1fr; padding: 7px 10px; }
}
@media (prefers-reduced-motion: reduce) { .jalon-panel, .jalon-veil { transition: none; } }
.jalon-cap { margin: 6px 0 4px; padding: 8px 10px; border-radius: 10px; background: color-mix(in srgb, var(--warn, #b45309) 12%, transparent); font-size: 13px; }
