/* La Forge, design system : mêmes polices, même palette, mêmes formes que Cayenne et Meetscribe.
   Les polices sont servies depuis /fonts, jamais depuis Google : aucune page vue n'est annoncée à un tiers. */
@font-face {
  font-family: "Manrope"; font-style: normal; font-weight: 400 800; font-display: swap;
  src: url("/fonts/manrope-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Manrope"; font-style: normal; font-weight: 400 800; font-display: swap;
  src: url("/fonts/manrope-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Zalando Sans Expanded"; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url("/fonts/zalando-sans-expanded-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Zalando Sans Expanded"; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url("/fonts/zalando-sans-expanded-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --bg: #faf7f3;             /* la toile : chaude, pour que le blanc des cartes ressorte */
  --surface: #ffffff;
  --inset: #f7f7f6;          /* survol, en-têtes de tableau, rangées */
  --border: #dfdbd8;
  --text: #000000;
  --muted: #505764;
  --accent: #e06538;         /* brand-500 */
  --accent-strong: #c4512a;  /* sous du blanc : 4,61:1 */
  --accent-deep: #a5421f;    /* survol, et texte sur --accent-soft */
  --accent-ink: #b84d26;     /* liens */
  --accent-soft: #ffebd7;
  --accent-line: #ffc783;
  --ok: #26654b;
  --ok-bg: #eef7f2;
  --warn: #6b5000;
  --warn-bg: #fff9e6;
  --err: #c23028;
  --err-bg: #f9e3e1;
  --radius: 14px;            /* ce qui contient : les cartes */
  --radius-md: 10px;         /* ce qui est rangé dedans : rangées, menus, encadrés */
  --radius-sm: 4px;          /* ce qui se tape : champs, bouton principal */
  --pill: 999px;
  --shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 8px 24px -16px rgba(160, 70, 30, .18);
  --shadow-float: 0 6px 20px rgba(0, 0, 0, .09);
  --topbar-h: 56px;
  /* Un seul thème, le clair, quel que soit le réglage du système (comme Cayenne et Meetscribe). */
  color-scheme: light;

  /* Noms propres à l'application des tâches, rattachés à la charte. */
  --ink: var(--text);
  --line: var(--border);
  --accent-tint: var(--accent-soft);
  --overdue: var(--err);
  --p1: #c23028;
  --p2: #c77700;
  --p3: #2f6f9e;
  --p4: #767b83;
  --font: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-display: "Zalando Sans Expanded", "Manrope", system-ui, sans-serif;
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 var(--font);
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  min-height: 100dvh; display: flex; flex-direction: column;
}
body > main, body > #app { flex: 1 0 auto; width: 100%; }

h1, h2, h3, .brand-name { font-family: var(--font-display); font-weight: 600; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5rem; }
h2, h3 { font-weight: 500; }
h2 { font-size: 1.08rem; }
p { margin: 0 0 .75rem; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .9em; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border-radius: var(--radius-sm); border: 1px solid transparent; }
a { color: var(--accent-ink); text-underline-offset: 2px; text-decoration-thickness: from-font; }
a:hover { text-decoration: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
kbd {
  font: .75rem var(--font);
  padding: 1px 5px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  margin: 0 2px;
}

input[type="password"], input[type="text"], input[type="email"], input[type="search"], input[type="date"], select, textarea {
  display: block; width: 100%; padding: .55rem .75rem; font: inherit;
  color: var(--text); background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  transition: border-color .15s, box-shadow .15s;
}
input:hover, select:hover, textarea:hover { border-color: #bcbcbc; }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent);
}

.primary { background: var(--accent-strong); color: #fff; padding: .6rem 1.15rem; font-weight: 600; border: 1px solid transparent; border-radius: var(--radius-sm); }
.primary:hover { background: var(--accent-deep); }
.ghost {
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--pill);
  padding: .3rem .8rem; font-size: .85rem;
}
.ghost:hover { border-color: var(--accent-line); color: var(--accent-deep); }
.ghost.danger, .danger { color: var(--err); }
.link { background: none; border: 0; padding: 0; color: var(--accent-ink); text-decoration: underline; text-underline-offset: 2px; font: inherit; }
.link:hover { text-decoration: none; }

.badge {
  font-size: .7rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  padding: .18rem .6rem; border-radius: var(--pill); margin-left: .4rem;
  background: #f2f2f2; color: var(--muted); white-space: nowrap;
}
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.run { background: var(--accent-soft); color: var(--accent-deep); }
.badge.err { background: var(--err-bg); color: var(--err); }

.notice { padding: .65rem .95rem; border-radius: var(--radius-md); margin: 0; background: var(--ok-bg); color: var(--ok); font-size: .92rem; }
.notice.error { background: var(--err-bg); color: var(--err); }
.notice:empty { display: none; }

/* ---------- la barre du haut : la marque, la recherche, le compte au bout à droite ---------- */
.topbar {
  display: flex; align-items: center; gap: .3rem 1rem;
  height: var(--topbar-h); padding: 0 2.4rem;
  background: var(--surface); border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 20;
}
.brand { display: flex; align-items: center; gap: .55rem; flex: 0 0 auto; color: inherit; text-decoration: none; margin-right: .4rem; }
.brand-mark { display: block; width: 30px; height: 30px; }
.brand-name { font-size: 1.02rem; letter-spacing: -.005em; }
/* Les onglets : la même barre que Cayenne et Meetscribe, l'onglet actif passe au noir. */
.tabs { display: flex; align-items: center; gap: .3rem; min-width: 0; flex: 0 0 auto; }
.tabs a {
  display: inline-flex; align-items: center; gap: .42rem;
  padding: .3em .8em; border-radius: var(--radius-sm);
  font-size: .9rem; color: var(--muted); text-decoration: none;
}
.tabs a svg { flex: 0 0 auto; opacity: .65; }
.tabs a:hover { background: var(--inset); color: var(--text); }
.tabs a:hover svg, .tabs a.on svg { opacity: 1; }
.tabs a.on { background: var(--text); color: #fff; }
#search-form { flex: 1 1 auto; max-width: 28rem; min-width: 0; margin-left: auto; margin-right: .5rem; }
#search { padding: .4rem .8rem; border-radius: var(--pill); background: var(--inset); font-size: .9rem; }
#menu { display: none; padding: .3rem .4rem; background: none; color: var(--muted); }
#menu:hover { background: var(--inset); color: var(--text); }

/* Le compte : un picto, l'adresse dans le menu plutôt que sur la barre. */
.menu { position: relative; min-width: 0; }
.me { flex: 0 0 auto; }
.me-trigger {
  display: flex; align-items: center; gap: .35rem; list-style: none; cursor: pointer;
  padding: .3rem .45rem; border-radius: var(--radius-sm); color: var(--muted);
}
.me-trigger::-webkit-details-marker { display: none; }
.me-trigger::marker { content: ""; }
.me-trigger:hover, .me[open] .me-trigger { background: var(--inset); color: var(--text); }
.me-trigger:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.menu:not([open]) .menu-panel { display: none; }
.menu-panel {
  position: absolute; right: 0; top: calc(100% + .4rem); z-index: 20;
  min-width: 15rem; display: grid; gap: .1rem; padding: .25rem;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-md); box-shadow: var(--shadow-float);
}
.menu-panel a, .menu-panel button, .submenu-trigger {
  display: flex; align-items: center; gap: .55rem;
  width: 100%; padding: .375rem .5rem; border-radius: var(--radius-sm);
  font: inherit; font-size: .875rem; text-align: left; text-decoration: none;
  color: var(--muted); background: transparent; border: 0; cursor: pointer; list-style: none;
}
.menu-panel svg, .submenu-trigger svg { flex: 0 0 auto; width: 1rem; height: 1rem; opacity: .6; }
.menu-panel a:hover, .menu-panel button:hover, .submenu-trigger:hover,
.menu-panel a:focus-visible, .menu-panel button:focus-visible { background: var(--inset); color: var(--text); outline: none; }
.menu-panel a:hover svg, .menu-panel button:hover svg, .submenu-trigger:hover svg { opacity: 1; }
.menu-panel a.on { color: var(--text); font-weight: 600; }
.me-addr { margin: 0 0 .25rem; padding: .4rem .6rem .5rem; color: var(--muted); font-size: .8rem; overflow-wrap: anywhere; border-bottom: 1px solid var(--border); }
.menu-label { flex: 1 1 auto; min-width: 0; }
.menu-count {
  flex: 0 0 auto; margin-left: auto; background: var(--accent-strong); color: #fff;
  border-radius: var(--pill); padding: .05rem .45rem; min-width: 1.4em; text-align: center;
  font-size: .72rem; font-weight: 700; line-height: 1.5;
}
.me-trigger .menu-count { margin-left: 0; }
.apart { border-top: 1px solid var(--border); margin-top: .25rem; padding-top: .25rem; }

/* Un sous-menu (Administration) : une popup à gauche, un accordéon sur téléphone. */
.submenu { display: block; }
.submenu-trigger::marker, .submenu-trigger::-webkit-details-marker { content: ""; display: none; }
.submenu[open] > .submenu-trigger { background: var(--inset); color: var(--text); }
.submenu-trigger { color: var(--accent-deep); }
.submenu-panel { display: grid; gap: .1rem; margin: .1rem 0 .3rem .6rem; padding-left: .5rem; border-left: 2px solid var(--accent-line); }
@media (min-width: 541px) {
  .submenu-panel {
    position: absolute; right: 100%; top: auto; margin: 0; padding: .3rem; min-width: 15rem;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); box-shadow: var(--shadow-float);
  }
}

/* ---------- pages avant la porte : connexion ---------- */
.gate { display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; padding: 2rem 1rem 1rem; }
.gate > * { width: 100%; max-width: 23rem; }
.gate-head { display: flex; flex-direction: column; align-items: center; gap: .75rem; margin-bottom: .6rem; }
.gate-head img { width: 60px; height: 60px; }
.gate-head h1 { font-size: 1.75rem; margin: 0; }
.gate .sub { margin: 0 0 1.6rem; color: var(--muted); font-size: .95rem; }
.gate-form { display: grid; gap: .45rem; text-align: left; }
.gate-form label { font-weight: 600; font-size: .88rem; }
.gate-form input + label { margin-top: .35rem; }
.gate-form .primary { margin-top: .6rem; width: 100%; padding: .7em 1.15em; font-size: .95rem; }
.gate .after { margin: 1.6rem 0 0; font-size: .9rem; color: var(--muted); }
.or { display: flex; align-items: center; gap: .8rem; margin: 1.3rem 0; color: #767b83; font-size: .85rem; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.google-button {
  display: flex; align-items: center; justify-content: center; gap: .6rem;
  width: 100%; padding: .7em 1.15em; font-size: .95rem; font-weight: 600; text-decoration: none;
  background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: var(--radius-sm);
}
.google-button:hover { border-color: var(--accent-line); }

.signature { display: flex; align-items: center; justify-content: center; gap: .5rem; padding: 1.1rem 1rem 1.4rem; color: #767b83; font-size: .82rem; }
.signature img { display: block; flex: 0 0 auto; }
body:has(#app:not([hidden])) > .signature { display: none; }

/* ---------- pages (accès API, utilisateurs, statistiques) : des cartes blanches sur la toile ---------- */
.container { max-width: 920px; margin: 0 auto; padding: 1.6rem 1rem 2.5rem; display: grid; grid-template-columns: minmax(0, 1fr); gap: 1rem; align-content: start; }
.container.wide { max-width: none; }
.page-head { display: flex; align-items: center; flex-wrap: wrap; gap: .75rem; margin: .4rem 0 .2rem; }
.page-head h1 { font-size: 1.45rem; margin: 0; }
.ph-icon, .ch-icon { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; background: var(--accent-soft); color: var(--accent-deep); }
.ph-icon { width: 2.4rem; height: 2.4rem; border-radius: 11px; }
.ph-count { font-size: .8rem; font-weight: 600; color: var(--accent-deep); background: var(--accent-soft); border-radius: var(--pill); padding: .15em .65em; }
.page-head[data-tone="sun"] .ph-icon, .page-head[data-tone="sun"] .ph-count { background: var(--warn-bg); color: var(--warn); }
.page-lead { margin: -.4rem 0 .2rem; padding-left: 3.15rem; max-width: calc(62ch + 3.15rem); }
.card { min-width: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.2rem 1.35rem; }
.card-head { display: flex; align-items: center; gap: .6rem; font-size: 1.1rem; margin: 0 0 .9rem; }
.ch-icon { width: 2.05rem; height: 2.05rem; border-radius: var(--radius-md); }
.facts { display: grid; grid-template-columns: auto 1fr; gap: .3rem .9rem; margin: .75rem 0 0; }
.facts dt { color: var(--muted); font-size: .88rem; }
.facts dd { margin: 0; font-size: .88rem; word-break: break-word; }
.code-block { display: block; margin: .6rem 0 0; padding: .55rem .7rem; overflow-x: auto; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm); font: .8rem/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; user-select: all; word-break: break-all; }
#token-panel { margin-top: 1rem; display: grid; gap: .3rem; }
#token-panel p { margin: 0; }

.table-tools { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; margin-top: .6rem; }
.table-filter { flex: 1 1 16rem; min-width: 0; max-width: 26rem; padding: .45rem .8rem !important; font-size: .9rem; border-radius: var(--pill) !important; }
.table-scroll { overflow-x: auto; max-width: 100%; margin: .3rem -.2rem 0; padding: 0 .2rem; }
.grid { width: 100%; border-collapse: collapse; font-size: .88rem; }
.grid th, .grid td { text-align: left; padding: .5rem; border-bottom: 1px solid var(--border); vertical-align: top; }
.grid th { color: var(--muted); font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; background: var(--inset); }
.grid tbody tr:hover td { background: #fffaf5; }
.grid tr:last-child td { border-bottom: 0; }
.grid .num { font-variant-numeric: tabular-nums; text-align: right; }
.cell-main { font-weight: 600; word-break: break-word; }
.row-actions { display: flex; flex-wrap: wrap; gap: .3rem; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .75rem; margin: 1rem 0; }
.stats > div { background: var(--bg); border-radius: var(--radius-md); padding: .75rem .9rem; min-width: 0; }
.stats dt { color: var(--muted); font-size: .8rem; }
.stats dd { margin: .15rem 0 0; font-size: 1.5rem; font-weight: 700; }
.stats dd.small { font-size: .8rem; font-weight: 400; color: var(--muted); }
.bars { list-style: none; display: flex; align-items: flex-end; gap: 3px; height: 72px; margin: .5rem 0 0; padding: 0; }
.bars li { flex: 1; min-width: 0; height: 100%; display: flex; align-items: flex-end; }
.bars li span { display: block; width: 100%; min-height: 2px; background: var(--accent); border-radius: 2px 2px 0 0; }

/* ---------- structure ---------- */
#app { display: grid; grid-template-columns: 272px minmax(0, 1fr); height: calc(100dvh - var(--topbar-h)); }
#app.with-panel { grid-template-columns: 272px minmax(0, 1fr) 420px; }

#sidebar {
  background: var(--surface);
  border-right: 1px solid var(--line);
  padding: 16px 12px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.hints { margin: auto 0 0; padding: 8px 6px 0; color: var(--muted); font-size: 12px; }


#nav { display: grid; gap: 2px; }
#nav h2 {
  display: flex; align-items: center; justify-content: space-between;
  margin: 14px 6px 4px; font-size: 13px; font-weight: 600; color: var(--muted);
}
#nav h2 button { border: 0; background: none; color: var(--muted); font-size: 18px; line-height: 1; padding: 0 4px; border-radius: 4px; }
#nav h2 button:hover { color: var(--ink); background: var(--line); }

.item {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 8px; border-radius: 7px;
  color: var(--ink); text-decoration: none;
}
.item:hover { background: var(--line); }
.item.active { background: var(--accent-soft); color: var(--accent-deep); font-weight: 600; }
.item .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item .n { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.item.warn .n { color: var(--overdue); font-weight: 600; }
.caret { width: 18px; height: 18px; border: 0; background: none; padding: 0; color: var(--muted); border-radius: 4px; flex: none; }
.caret:hover { background: var(--line); color: var(--ink); }
.caret.leaf { visibility: hidden; }
.children { margin-left: 12px; display: grid; gap: 2px; }
.new-project { display: flex; gap: 6px; margin: 4px 0 4px 4px; }
.new-project input { flex: 1; min-width: 0; padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); }

#main { overflow-y: auto; padding: 28px 40px 80px; min-width: 0; }
#main > * { max-width: 780px; }

#head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
#head h1 { margin: 0; font-size: 1.45rem; }
#count { color: var(--muted); font-size: 14px; font-variant-numeric: tabular-nums; }
#head-actions { margin-left: auto; display: flex; gap: 6px; }
#head-actions button {
  border: 1px solid var(--border); background: var(--surface); border-radius: var(--pill); padding: .3rem .8rem; font-size: .85rem;
}
#head-actions button:hover { border-color: var(--accent-line); color: var(--accent-deep); }

/* ---------- saisie rapide ---------- */
#quick { margin-bottom: 18px; }
#quick-input {
  width: 100%; padding: 12px 14px; font-size: 16px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--surface);
}
#quick-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
#chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; min-height: 0; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 2px 9px; border-radius: 999px; font-size: 13px;
  background: var(--surface); border: 1px solid var(--line);
}
.chip::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
.chip.date::before, .chip.time::before { background: var(--accent); }
.chip.rec::before { background: var(--p3); }
.chip.p1::before { background: var(--p1); }
.chip.p2::before { background: var(--p2); }
.chip.p3::before { background: var(--p3); }
.chip.warn { border-color: var(--overdue); color: var(--overdue); }
.chip.warn::before { background: var(--overdue); }

/* ---------- liste ---------- */
.group { display: flex; align-items: baseline; gap: 8px; margin: 22px 0 4px; font-size: 14px; font-weight: 650; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.group:first-child { margin-top: 4px; }
.group .n { color: var(--muted); font-weight: 400; font-size: 13px; }
.group.late { color: var(--overdue); }

.tasks { list-style: none; margin: 0; padding: 0; }
.task { display: flex; gap: 12px; padding: 9px 4px; border-bottom: 1px solid var(--line); cursor: pointer; transition: opacity .2s, transform .2s; }
.task:hover { background: color-mix(in srgb, var(--surface) 70%, transparent); }
.task.sub { margin-left: 30px; }
.task.leaving { opacity: 0; transform: translateX(10px); }
.task.selected { background: var(--accent-tint); }
.task .body { flex: 1; min-width: 0; }
.task .content { overflow-wrap: anywhere; }
.task.done .content { text-decoration: line-through; color: var(--muted); }
.task .desc { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.meta { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 2px; font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.meta .due.today { color: var(--accent-ink); font-weight: 600; }
.meta .due.late { color: var(--overdue); font-weight: 600; }
.meta .proj { margin-left: auto; }

.check {
  flex: none; width: 20px; height: 20px; margin-top: 2px; padding: 0;
  border-radius: 50%; border: 2px solid var(--p4); background: color-mix(in srgb, var(--p4) 10%, transparent);
  display: grid; place-items: center; color: transparent; font-size: 12px; line-height: 1;
}
.check:hover, .check:focus-visible { color: currentColor; }
.task.p1 .check { border-color: var(--p1); color: var(--p1); background: color-mix(in srgb, var(--p1) 12%, transparent); }
.task.p2 .check { border-color: var(--p2); color: var(--p2); background: color-mix(in srgb, var(--p2) 12%, transparent); }
.task.p3 .check { border-color: var(--p3); color: var(--p3); background: color-mix(in srgb, var(--p3) 12%, transparent); }
.task.p4 .check { color: var(--p4); }
.task .check:not(:hover):not(:focus-visible) { color: transparent; }
.task.done .check { color: var(--muted); background: var(--line); border-color: var(--line); }

.empty { color: var(--muted); padding: 28px 4px; max-width: 46ch; }

/* ---------- panneau de détail ---------- */
#panel {
  background: var(--surface); border-left: 1px solid var(--border);
  overflow-y: auto; padding: 18px 20px 60px; display: flex; flex-direction: column; gap: 14px;
}
.p-top { display: flex; align-items: center; gap: 8px; }
.p-top .spacer { flex: 1; }
.p-title { width: 100%; font-size: 18px; font-weight: 600; border: 1px solid transparent; border-radius: 7px; padding: 6px 8px; margin: 0 -8px; background: transparent; resize: none; overflow: hidden; }
.p-title:hover, .p-title:focus { border-color: var(--line); outline: none; background: var(--bg); }
.field { display: grid; gap: 4px; }
.field > label, .field > .lab { font-size: 12.5px; color: var(--muted); }
.field input, .field select, .field textarea {
  width: 100%; padding: 7px 9px; border: 1px solid var(--line); border-radius: 7px; background: var(--bg);
}
.field textarea { min-height: 96px; resize: vertical; }
.row { display: flex; gap: 8px; flex-wrap: wrap; }
.row > input { flex: 1; min-width: 120px; }
.seg { display: flex; gap: 6px; }
.seg button { flex: 1; padding: 6px 0; border: 1px solid var(--line); border-radius: 7px; background: var(--bg); font-weight: 600; }
.seg button[aria-pressed="true"] { border-color: currentColor; background: color-mix(in srgb, currentColor 12%, transparent); }
.seg .s1 { color: var(--p1); } .seg .s2 { color: var(--p2); } .seg .s3 { color: var(--p3); } .seg .s4 { color: var(--p4); }
.quickdates { display: flex; gap: 6px; flex-wrap: wrap; }
.hint { font-size: 12.5px; color: var(--muted); min-height: 1.3em; }
.hint.bad { color: var(--overdue); }
.sublist, .comments { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.sublist li { display: flex; gap: 8px; align-items: flex-start; cursor: pointer; }
.comments li { background: var(--bg); border-radius: 8px; padding: 8px 10px; white-space: pre-wrap; overflow-wrap: anywhere; }
.comments time { display: block; font-size: 12px; color: var(--muted); margin-bottom: 2px; }
.danger { color: var(--overdue); }

/* ---------- toast ---------- */
#toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px);
  display: flex; gap: 14px; align-items: center;
  background: var(--text); color: #fff; padding: 10px 16px; border-radius: var(--radius-md); box-shadow: var(--shadow-float);
  opacity: 0; pointer-events: none; transition: opacity .18s, transform .18s; z-index: 50; max-width: min(520px, 92vw);
}
#toast.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
#toast.error { background: var(--err); color: #fff; }
#toast button { border: 0; background: none; color: inherit; font-weight: 700; text-decoration: underline; padding: 0; }

/* ---------- petits écrans ---------- */
@media (max-width: 1100px) {
  #app.with-panel { grid-template-columns: 272px minmax(0, 1fr); }
  #panel { position: fixed; inset: var(--topbar-h) 0 0 auto; width: min(440px, 100%); box-shadow: var(--shadow); z-index: 30; }
}
@media (max-width: 820px) {
  #app, #app.with-panel { grid-template-columns: minmax(0, 1fr); }
  #sidebar { position: fixed; inset: var(--topbar-h) auto 0 0; width: min(300px, 86vw); transform: translateX(-102%); transition: transform .2s; z-index: 40; box-shadow: var(--shadow); }
  body.nav-open #sidebar { transform: none; }
  #main { padding: 16px 16px 90px; }
  #menu { display: inline-flex; }
  .topbar { padding: 0 1rem; gap: .5rem; }
  .brand-name { display: none; }
  #panel { width: 100%; }
}

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


@media (max-width: 540px) {
  .menu-panel { position: fixed; right: .5rem; left: .5rem; top: calc(var(--topbar-h) + .3rem); min-width: 0; }
  .page-lead { padding-left: 0; }
}

/* ---------- page Assistant et écran de consentement ---------- */
.steps { margin: .6rem 0 0; padding-left: 1.3rem; display: grid; gap: .55rem; }
.examples { margin: 0; padding-left: 1.2rem; display: grid; gap: .5rem; }
.copy-line { display: inline-flex; align-items: center; gap: .5rem; flex-wrap: wrap; vertical-align: middle; }
.wrap-any { overflow-wrap: anywhere; }
.sub-head { margin: 1.1rem 0 .3rem; color: var(--muted); font-family: var(--font); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; font-size: .72rem; }
.card > .ghost { margin-top: .9rem; }
.consent { text-align: left; }
.consent p { margin: 0 0 .7rem; }
.consent-list { margin: 0 0 .9rem; padding-left: 1.2rem; display: grid; gap: .3rem; font-size: .92rem; }
.consent-actions { display: flex; gap: .6rem; margin-top: 1rem; }
.consent-actions .primary { flex: 1; }
.consent-actions .ghost { padding: .6rem 1.15rem; font-size: .95rem; }
@media (max-width: 540px) { .tab-label { display: none; } .tabs a { padding: .35em .55em; } }
