/* ===========================================================================
   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: #756d61;
  --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 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); }
}
