@font-face {
  font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("/assets/inter.woff2") format("woff2");
}

:root {
  --bg: #f4f5f7;
  --surface: #ffffff;
  --sunken: #f7f8fa;
  --text: #353c45;
  --heading: #2b3139;
  --muted: #5b636d;
  --border: #d9dde2;
  --border-strong: #8c959f;
  --accent: #1d4ed8;
  --accent-hover: #1e40af;
  --accent-soft: #e8eefc;
  --ok: #17703a;
  --ok-soft: #e6f4ea;
  --warn: #a8430a;
  --warn-soft: #fdf0e4;
  --danger: #b42318;
  --danger-soft: #fdecea;
  --neutral: #4b535c;
  --neutral-soft: #eceef1;
  --project: #5b3db0;
  --project-soft: #f0ecfa;
  --idea: #0f6e66;
  --idea-soft: #e2f3f1;
  --highlight: #fde68a;
  --type-task: #8c959f;
  --type-bug: #b82626;
  --type-quick: #f7d522;
  --type-wait: #c3c9d0;
  --focus: #1d4ed8;
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --radius: 8px;
  --radius-sm: 6px;
  --shadow: 0 1px 2px rgba(31, 41, 55, 0.06), 0 1px 3px rgba(31, 41, 55, 0.04);
  --tap: 44px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text); font: 16px/1.55 var(--font);
  font-feature-settings: "cv11", "ss01"; -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { color: var(--heading); font-weight: 650; letter-spacing: -0.012em; line-height: 1.25; margin: var(--space-5) 0 var(--space-3); }
h1 { font-size: 1.65rem; letter-spacing: -0.02em; }
h2 { font-size: 1.2rem; }
h3 { font-size: 1.02rem; }
p, ul, ol, dl, pre, table, fieldset { margin: 0 0 var(--space-4); }
a { color: var(--accent); text-underline-offset: 2px; }
a:hover { color: var(--accent-hover); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 2px; }
::selection { background: var(--accent-soft); }
time { font-variant-numeric: tabular-nums; }

/* Header */
.site-header {
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-4);
  padding: var(--space-2) var(--space-4); background: var(--surface); border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.brand { font-weight: 700; color: var(--heading); text-decoration: none; margin-right: auto; letter-spacing: -0.01em; }
.brand::before {
  content: ""; display: inline-block; width: 0.7rem; height: 0.7rem; margin-right: var(--space-2);
  border-radius: 3px; background: var(--accent);
}
.brand:hover { color: var(--heading); }
.site-nav { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1) var(--space-3); }
.site-nav > a, .brand {
  display: inline-flex; align-items: center; min-height: var(--tap); padding: 0 var(--space-1);
}
.site-nav > a { color: var(--muted); text-decoration: none; font-weight: 500; }
.site-nav > a:hover { color: var(--heading); }
.site-nav > a[aria-current="page"] { font-weight: 600; color: var(--heading); box-shadow: inset 0 -2px 0 var(--accent); }
.nav-icon { display: none; flex: none; }
.nav-count { font-weight: 600; color: var(--accent); }
.new-request { gap: var(--space-2); }
.new-request .plus { font-size: 1.15rem; line-height: 1; }
.new-request[aria-current="page"] { background: var(--accent-hover); box-shadow: inset 0 -3px 0 #0b1f66; }
/* The menu: email, Paramètres, Se déconnecter, folded under the top right */
.site-menu { position: relative; }
.site-menu > summary { padding: 0 var(--space-2); font-weight: 500; }
.site-menu-panel {
  position: absolute; right: 0; top: 100%; z-index: 20; min-width: 14rem; max-width: calc(100vw - 2rem);
  display: flex; flex-direction: column; align-items: stretch; gap: var(--space-2); padding: var(--space-3);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
}
.site-menu-panel > a { display: inline-flex; align-items: center; min-height: var(--tap); text-decoration: none; font-weight: 500; }
.site-menu-panel > a[aria-current="page"] { font-weight: 600; color: var(--heading); }
.site-menu-panel form { margin: 0; }
.site-menu-panel button { width: 100%; }
.site-user { margin: 0; color: var(--muted); font-size: 0.9rem; overflow-wrap: anywhere; }

/* Phone: the screens become a bottom bar (icon over label), Nouvelle demande a round + above it */
@media (max-width: 37.5rem) {
  body:has(.site-nav) { padding-bottom: calc(4.5rem + env(safe-area-inset-bottom)); }
  .site-nav {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
    gap: 0; padding: 0 0 env(safe-area-inset-bottom); background: var(--surface); border-top: 1px solid var(--border);
    box-shadow: 0 -1px 3px rgba(31, 41, 55, 0.06);
  }
  .site-nav > a {
    flex-direction: column; justify-content: center; gap: 2px; min-height: 3.75rem; padding: var(--space-1);
    font-size: 0.75rem; line-height: 1.2; text-align: center;
  }
  .site-nav > a[aria-current="page"] { color: var(--accent); box-shadow: inset 0 3px 0 var(--accent); }
  .nav-icon { display: block; }
  .new-request {
    position: fixed; right: var(--space-4); bottom: calc(4.5rem + env(safe-area-inset-bottom)); z-index: 11;
    width: 3.5rem; height: 3.5rem; padding: 0; border-radius: 50%; box-shadow: 0 2px 6px rgba(31, 41, 55, 0.25);
  }
  .new-request .plus { font-size: 1.75rem; }
  .new-request-label {
    position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
  }
}

/* Page body */
main {
  max-width: 76rem; margin: 0 auto; padding: var(--space-4) var(--space-4) var(--space-6);
  overflow-wrap: anywhere;
}
main.narrow { max-width: 28rem; }
.tagline { margin-top: calc(-1 * var(--space-1)); color: var(--muted); }
form[data-resend] { margin-top: var(--space-2); }
main > h1:first-child, main > .back + h1 { margin-top: var(--space-3); }
section { margin-bottom: var(--space-6); }
ul { padding-left: var(--space-5); }
li { margin: var(--space-1) 0; }
/* A priority question in place of the picker (item pages): its label on the question's first line */
dt:has(+ dd > form.priority-question) { align-self: start; }
dd > form.priority-question { margin: 0; }
dd > form.priority-question > p:first-of-type { margin-top: 0; }
dd > form.priority-question > p:last-child { margin-bottom: 0; }
.back { margin: 0; }
.back a { display: inline-flex; align-items: center; min-height: var(--tap); text-decoration: none; font-weight: 500; }
.back a:hover { text-decoration: underline; }

/* Badges: one colour per state (PR, a wait Task, idea state) */
.badge {
  display: inline-block; padding: 0.1rem 0.55rem; font-size: 0.78rem; font-weight: 600; line-height: 1.45;
  color: var(--neutral); background: var(--neutral-soft); border: 1px solid transparent; border-radius: 999px;
  vertical-align: 0.08em; white-space: nowrap;
}
.badge.type { color: var(--text); background: var(--surface); border-color: var(--border); }
/* Task types: one --type-<type> colour each, shared by the pill, the card's and list item's left border and the board's dots */
.badge.type-task { color: var(--neutral); background: var(--neutral-soft); border-color: var(--border); }
.badge.type-bug { color: var(--surface); background: var(--type-bug); }
.badge.type-quick { color: var(--heading); background: var(--type-quick); }
.badge.type-wait { color: var(--text); background: var(--surface); border-color: var(--border-strong); border-style: dashed; }
.badge.kind { color: var(--accent-hover); background: var(--surface); border-color: #b9c8f3; }
.badge.project { color: var(--project); background: var(--project-soft); white-space: normal; overflow-wrap: anywhere; }
.badge.state-je_veux_lancer { color: var(--accent-hover); background: var(--accent-soft); }
.badge.state-pr { color: var(--warn); background: var(--warn-soft); }
.badge.state-lancee { color: var(--ok); background: var(--ok-soft); }
.badge.state-wait { color: var(--neutral); background: var(--neutral-soft); border-color: var(--border); }
.badge.state-proposee { color: var(--idea); background: var(--idea-soft); }
.badges { display: inline-flex; flex-wrap: wrap; gap: var(--space-1); }

/* Item lists: a card, one row per item, title then badges */
ul:has(> li.item) {
  list-style: none; padding: 0; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden;
}
li.item {
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1) var(--space-3);
  margin: 0; padding: var(--space-2) var(--space-4); min-height: 3rem;
}
li.item + li.item { border-top: 1px solid var(--border); }
li.item:hover { background: var(--sunken); }
li.item > :first-child { flex: 1 1 14rem; min-width: 0; font-weight: 500; }
li.item > a:first-child { color: var(--heading); text-decoration: none; }
li.item > a:first-child:hover { color: var(--accent); text-decoration: underline; }
li.item form { margin: 0; }
li.item .badges { justify-content: flex-end; }

/* Demandes: a Demande per row, its title, stage tracker or state sentence, then its buttons */
li.item.demande { display: block; padding-top: var(--space-3); padding-bottom: var(--space-3); }
li.item.demande > p { margin: 0 0 var(--space-1); }
.demande-title > a { font-weight: 500; color: var(--heading); text-decoration: none; }
.demande-title > a:hover { color: var(--accent); text-decoration: underline; }
.author, .where, .idea-state, .created-by { color: var(--muted); font-weight: 400; }
ol.tracker { display: flex; flex-wrap: wrap; gap: var(--space-1); list-style: none; padding: 0; margin: var(--space-1) 0; font-size: 0.8rem; }
ol.tracker > li { padding: 0.15rem 0.55rem; border-radius: 999px; background: var(--sunken); color: var(--muted); }
ol.tracker > li.done { color: var(--heading); }
ol.tracker > li.current { background: var(--accent-soft); color: var(--accent-hover); font-weight: 600; }
li.item.demande .actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); margin-top: var(--space-2); }
li.item.demande .actions:empty { display: none; }

/* Feuille de route: chips (as in Historique) and text filter, then En ce moment | Priorité 1 | 2 | 3, then 4 | 5 under Plus tard (dimmed);
   one column on phones, two in between */
.board-filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--space-3) var(--space-5); margin-bottom: var(--space-4); }
.board-filter { flex: 1 1 14rem; margin: 0; }
.board-filter label { margin-bottom: 0; }
details.later > summary, details.done > summary { min-height: var(--tap); display: flex; align-items: center; font-weight: 600; cursor: pointer; }
details.later > .board-row { margin-top: var(--space-2); }
.board { display: grid; gap: var(--space-4); margin-bottom: var(--space-5); }
.board-row { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-3); }
.column {
  display: flex; flex-direction: column; min-width: 0; margin: 0; background: var(--neutral-soft);
  border: 1px solid var(--border); border-radius: var(--radius);
}
.column > h2 {
  margin: 0; padding: var(--space-2) var(--space-3); font-size: 0.85rem; font-weight: 700;
  letter-spacing: 0.06em; color: var(--heading); border-bottom: 1px solid var(--border);
}
.board-row.low .column { background: var(--sunken); border-style: dashed; }
.board-row.low .column > h2 { color: var(--muted); }
ul.cards { list-style: none; display: flex; flex-direction: column; gap: var(--space-2); margin: 0; padding: var(--space-2); }
ul.cards:empty { min-height: 3rem; }
li.card {
  display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-1); margin: 0;
  padding: var(--space-2) var(--space-3); background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); box-shadow: var(--shadow);
  /* In a full column that scrolls, a card keeps its height instead of being squeezed */
  flex-shrink: 0;
}
li.card[hidden] { display: none; }
li.item[class*="type-"] { border-left-style: solid; }
.card.type-task, li.item.type-task { border-left-width: 3px; border-left-color: var(--type-task); }
.card.type-bug, li.item.type-bug { border-left-width: 3px; border-left-color: var(--type-bug); }
.card.type-quick, li.item.type-quick { border-left-width: 3px; border-left-color: var(--type-quick); }
.card.type-wait { border-left-width: 3px; border-left-color: var(--type-wait); border-style: dashed; opacity: 0.85; }
li.item.type-wait { border-left-width: 3px; border-left-color: var(--type-wait); border-left-style: dashed; opacity: 0.85; }
li.card > a { font-weight: 500; color: var(--heading); text-decoration: none; }
li.card > a:hover { color: var(--accent); text-decoration: underline; }
.board-row.low li.card { box-shadow: none; }
.column[data-priority="0"] { background: var(--accent-soft); }
li.card > .card-title { font-weight: 500; color: var(--heading); text-decoration: none; overflow-wrap: anywhere; }
li.card > .card-title:hover { color: var(--accent); text-decoration: underline; }
.card-title .mention { color: var(--accent); background: var(--accent-soft); padding: 0.05em 0.3em; border-radius: 4px; }
/* A Project card: « 2 tâches sur 7 terminées » over its bar, the Override sentence, the fold of open Tasks */
.progress { display: flex; flex-direction: column; gap: 2px; width: 100%; font-size: 0.8rem; color: var(--muted); }
.progress progress { width: 100%; height: 0.4rem; accent-color: var(--ok); }
p.overrides { margin: 0; font-size: 0.8rem; color: var(--muted); }
p.due-date { margin: 0; font-size: 0.8rem; color: var(--muted); }
details.fold { width: 100%; font-size: 0.85rem; }
details.fold > summary { min-height: var(--tap); display: flex; align-items: center; color: var(--accent); cursor: pointer; }
details.fold .more { margin: 2px 0 0; color: var(--muted); }
ul.next-tasks li.override, ul.next-tasks li.override a { color: var(--muted); }
ul.next-tasks .moved { flex: none; white-space: nowrap; }
ul.next-tasks li[hidden] { display: none; }
.news-count { align-self: center; font-size: 0.8rem; font-weight: 600; color: var(--accent-hover); white-space: nowrap; }
/* A Project card's next open Tasks: one line each after a dot of its Task type's colour */
ul.next-tasks { list-style: none; margin: 0; padding: 0; font-size: 0.85rem; display: flex; flex-direction: column; gap: 2px; max-width: 100%; }
ul.next-tasks li { display: flex; align-items: baseline; gap: var(--space-1); min-width: 0; color: var(--muted); }
ul.next-tasks a { color: var(--text); overflow-wrap: anywhere; }
.dot { flex: none; width: 0.55rem; height: 0.55rem; border-radius: 50%; background: var(--neutral); }
.dot.type-task { background: var(--type-task); }
.dot.type-bug { background: var(--type-bug); }
.dot.type-quick { background: var(--type-quick); }
.dot.type-wait { background: var(--type-wait); }
/* Drag and drop (boardScript.ts): the placeholder of a card in the column it's over */
.board li.card.card-ghost { opacity: 0.4; border-style: dashed; box-shadow: none; }
/* A card that can move is dragged from anywhere on it */
.board li.card[data-move] { cursor: grab; }
p.drag-hint { margin: 0 0 var(--space-3); font-size: 0.9rem; color: var(--muted); }
p.drag-hint[hidden] { display: none; }
/* After a drop: « Talon clinique passé en P2. Annuler » above the board, the card highlighted in its column */
#annuler-priorite { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); margin: 0 0 var(--space-3); }
#annuler-priorite[hidden] { display: none; }
li.card.card-moved { animation: refresh-new 2s ease-out; }
@media (prefers-reduced-motion: reduce) { li.card.card-moved { animation: none; background: var(--highlight); } }
/* The question a drop needs answered, over the board */
dialog#question-priorite, dialog.confirm {
  width: min(32rem, calc(100vw - 2 * var(--space-4))); padding: var(--space-4) var(--space-5);
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: inherit;
  box-shadow: 0 10px 30px rgba(31, 41, 55, 0.18);
}
dialog#question-priorite::backdrop, dialog.confirm::backdrop { background: rgba(31, 41, 55, 0.35); }
dialog.confirm p:first-child { margin-top: 0; }
dialog.confirm .actions { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-bottom: 0; }
dialog#question-priorite > h2 { margin-top: 0; }
details.done { margin-bottom: var(--space-5); }
details.done > ul.cards { padding: var(--space-2) 0 0; }
@media (min-width: 37.5rem) {
  .board-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 52rem) {
  .board-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .board-row.now, .board-row.low { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .board-row .column { height: 70vh; }
  .board-row.low .column { height: 35vh; }
  .board-row ul.cards { flex: 1; overflow-y: auto; }
  /* The top band sizes to its few cards (up to 35vh), laid out side by side across its width. */
  .board-row.now .column { height: auto; max-height: 35vh; }
  .board-row.now ul.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr)); align-content: start; }
}
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* Historique and Nouveautés: one card per list, dates in a column */
ul.journal {
  list-style: none; padding: var(--space-1) 0; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
}
li.entry {
  display: grid; grid-template-columns: 5.5rem 1fr; gap: var(--space-3); align-items: baseline;
  margin: 0; padding: var(--space-2) var(--space-4);
}
li.entry + li.entry { border-top: 1px solid var(--border); }
li.entry time { color: var(--muted); font-size: 0.9rem; white-space: nowrap; }
li.entry a { font-weight: 500; }
/* Nouveautés: « Lu » at the end of an entry */
li.entry:has(> form.read-one) { grid-template-columns: 5.5rem 1fr auto; align-items: center; }
form.read-one { margin: 0; }
form.read-one button { padding: 0 var(--space-3); }

/* Historique filters: the chips, then the Projet select */
.history-filters {
  display: flex; flex-wrap: wrap; gap: var(--space-3) var(--space-5); align-items: center; margin-bottom: var(--space-5);
}
.chips { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.chip {
  display: inline-flex; align-items: center; min-height: var(--tap); padding: 0 var(--space-4);
  border: 1px solid var(--border-strong); border-radius: 999px; background: var(--surface);
  color: var(--text); font-weight: 500; text-decoration: none;
}
.chip:hover { border-color: var(--accent); color: var(--accent); }
.chip[aria-current="true"], .chip[aria-current="page"] { background: var(--accent); border-color: var(--accent); color: #fff; }
.history-project {
  display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; margin: 0; flex: 1 1 20rem; min-width: 0;
}
.history-project label { margin: 0; }
.history-project select { flex: 1 1 12rem; width: auto; min-width: 0; max-width: 24rem; margin: 0; }

/* Pour vous: « Tout marquer comme lu » above the Nouveautés */
form.mark-all { margin: 0 0 var(--space-3); }

/* Pour vous: one card per entry; head line, a muted lead, the action under it */
ul.pour-vous { list-style: none; margin: 0 0 var(--space-6); padding: 0; display: flex; flex-direction: column; gap: var(--space-3); }
li.card-entry {
  margin: 0; padding: var(--space-3) var(--space-4); background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow); overflow-wrap: anywhere;
}
li.card-entry > * { margin: 0 0 var(--space-2); }
li.card-entry > :last-child { margin-bottom: 0; }
li.card-entry .entry-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--space-1) var(--space-2); }
li.card-entry .entry-title { color: var(--heading); font-weight: 600; }
li.card-entry .since, li.card-entry time { color: var(--muted); font-size: 0.9rem; white-space: nowrap; }
li.card-entry .lead { color: var(--muted); }
li.card-entry form { display: block; margin: 0; }
li.card-entry details > summary { font-weight: 600; }
li.card-entry details[open] textarea { margin: var(--space-1) 0 var(--space-2); }
li.card-entry .entry-actions { display: flex; flex-wrap: wrap; align-items: flex-start; gap: var(--space-2) var(--space-4); }
li.card-entry .entry-actions form:has(details[open]) { flex-basis: 100%; }
.video-thumb {
  display: inline-flex; align-items: center; gap: var(--space-2); padding: var(--space-2) var(--space-3);
  color: var(--heading); background: var(--sunken); border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: 0.9rem;
}
.video-thumb .play { color: var(--accent); }
.sent { color: var(--ok); font-weight: 500; }
.md.inline { display: inline; }

/* Rendered markdown (descriptions, comments) */
img { max-width: 100%; height: auto; }
code { font-family: var(--mono); font-size: 0.88em; background: var(--neutral-soft); padding: 0.1em 0.3em; border-radius: 4px; }
pre { overflow-x: auto; padding: var(--space-3) var(--space-4); background: var(--sunken); border: 1px solid var(--border); border-radius: var(--radius-sm); overflow-wrap: normal; line-height: 1.45; }
pre code { background: none; padding: 0; font-size: 0.85rem; }
table { display: block; max-width: 100%; overflow-x: auto; border-collapse: collapse; overflow-wrap: normal; }
th, td { border: 1px solid var(--border); padding: var(--space-2) var(--space-3); text-align: left; vertical-align: top; }
th { background: var(--sunken); font-weight: 600; color: var(--heading); }
blockquote { margin: 0 0 var(--space-4); padding: var(--space-2) var(--space-4); border-left: 3px solid #b9c8f3; background: var(--sunken); color: var(--muted); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.md > :last-child, blockquote > :last-child { margin-bottom: 0; }
.md h1, .md h2, .md h3, .md h4, .md h5, .md h6 { margin: var(--space-5) 0 var(--space-2); }
.md > :first-child { margin-top: 0; }
.md h1 { font-size: 1.3rem; }
.md h2 { font-size: 1.15rem; }
.md h3 { font-size: 1.02rem; }
.md h4, .md h5, .md h6 { font-size: 0.95rem; }
.md ul, .md ol { padding-left: var(--space-5); }
.md li { margin: 0.15rem 0; }
.md li > ul, .md li > ol { margin: 0; }
.md img { border: 1px solid var(--border); border-radius: var(--radius-sm); }
.md hr { border: 0; border-top: 1px solid var(--border); margin: var(--space-5) 0; }
.md tr:nth-child(even) td { background: var(--sunken); }
section > .md {
  padding: var(--space-4); background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
}

/* The Video player in a Description, and the Answer form */
.video { max-width: 960px; margin: 0 auto var(--space-4); }
.video iframe { display: block; width: 100%; aspect-ratio: 16 / 9; border: 0; border-radius: var(--radius-sm); background: var(--neutral-soft); }
.answer-panel {
  padding: var(--space-4); margin-bottom: var(--space-6); background: var(--surface);
  border: 1px solid var(--border); border-left: 4px solid var(--warn); border-radius: var(--radius); box-shadow: var(--shadow);
}
.answer-panel > h2 { margin-top: 0; }
.answer-panel.answered { border-left-color: var(--ok); }
.answer-panel.answered > p { margin: 0; font-weight: 500; }
/* Valider and À reprendre side by side; an unfolded comment field takes the whole width */
.answer-actions { display: flex; flex-wrap: wrap; align-items: flex-start; gap: var(--space-3); }
.answer-actions > form, .answer-actions > details { margin: 0; }
.answer-actions > form:has(details[open]), .answer-actions > details[open] { flex-basis: 100%; }
.answer-form { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); margin: 0; }
.answer-form > details, .answer-form > label { flex-basis: 100%; margin: 0; }
.answer-form > details[open] label { margin: var(--space-2) 0 0; }
.answer-form > button.approve { order: -1; }
.answer-form > details:not([open]) { flex-basis: auto; }
summary.rework {
  justify-content: center; padding: var(--space-2) var(--space-4); font-weight: 600; line-height: 1.2; list-style: none;
  color: #fff; background: var(--danger); border: 1px solid var(--danger); border-radius: var(--radius-sm);
}
summary.rework::-webkit-details-marker { display: none; }
summary.rework:hover { background: #912018; border-color: #912018; }
.rework-fold[open] > summary.rework { margin-bottom: var(--space-3); }

/* Item page header: what it is, the state sentence, the 1–5 Priority control */
.item-header { margin-bottom: var(--space-5); }
.item-header > h1 { margin-bottom: var(--space-2); }
.item-kind { display: flex; flex-wrap: wrap; align-items: center; gap: 0 var(--space-1); margin: 0 0 var(--space-2); color: var(--muted); }
.item-kind a { display: inline-flex; align-items: center; min-height: var(--tap); font-weight: 500; }
.state-sentence { margin: 0 0 var(--space-3); font-size: 1.1rem; color: var(--heading); font-weight: 500; }
.priority-control, .due-date-control { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); margin: 0; }
.due-date-control { margin-top: var(--space-2); }
.priority-label, .due-date-label { color: var(--muted); font-size: 0.9rem; }
.due-date-value { font-weight: 500; }
.priority-buttons, .due-date-buttons { display: inline-flex; gap: var(--space-1); }
.due-date-buttons { flex-wrap: wrap; }
.priority-buttons button, .due-date-buttons button {
  min-width: var(--tap); padding: 0 var(--space-2); color: var(--accent); background: var(--surface); border-color: var(--border);
}
.priority-buttons button:hover, .due-date-buttons button:hover { background: var(--accent-soft); color: var(--accent-hover); }
.priority-buttons button[aria-pressed="true"], .due-date-buttons button[aria-pressed="true"] {
  color: #fff; background: var(--accent); border-color: var(--accent);
}
.priority-note { color: var(--muted); font-size: 0.9rem; }
.priority-control .saved, .due-date-control .saved { flex-basis: 100%; margin: 0; color: var(--ok); font-weight: 500; }

/* A long Description: the rest under « Lire la suite » */
.read-more { margin-top: var(--space-2); }
.read-more > .md {
  margin-top: var(--space-2); padding: var(--space-4); background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
}
.task-group > h3 { margin-bottom: var(--space-1); font-size: 1rem; color: var(--muted); }
.task-group { margin-bottom: var(--space-4); }

/* Forms and buttons */
label { display: block; margin-bottom: var(--space-3); font-weight: 500; }
input:not([type="radio"]):not([type="checkbox"]):not([type="hidden"]), select, textarea {
  display: block; width: 100%; max-width: 32rem; min-height: var(--tap); margin-top: var(--space-1);
  padding: var(--space-2) var(--space-3); font: inherit; font-weight: 400; color: var(--text); background: var(--surface);
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
}
input:not([type="radio"]):not([type="checkbox"]):hover, select:hover, textarea:hover { border-color: var(--muted); }
textarea { max-width: none; resize: vertical; }
fieldset { border: 1px solid var(--border); border-radius: var(--radius); padding: var(--space-2) var(--space-4); background: var(--surface); }
legend { font-weight: 500; padding: 0 var(--space-1); }
fieldset label { display: inline-flex; align-items: center; gap: var(--space-2); min-height: var(--tap); margin: 0 var(--space-4) 0 0; font-weight: 400; }
input[type="radio"], input[type="checkbox"] { width: 1.15rem; height: 1.15rem; accent-color: var(--accent); }

/* Nouvelle demande: each answer is a large card, the script hides the fields that don't apply */
.request-form [hidden] { display: none; }
.request-form fieldset { padding: 0; border: 0; background: none; }
.request-form legend { padding: 0; margin-bottom: var(--space-2); font-size: 1.05rem; font-weight: 600; color: var(--heading); }
fieldset label.choice-card {
  display: flex; align-items: flex-start; gap: var(--space-3); max-width: 32rem; margin: 0 0 var(--space-2);
  padding: var(--space-3) var(--space-4); background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: var(--radius); cursor: pointer;
}
fieldset label.choice-card:hover { border-color: var(--accent); }
fieldset label.choice-card:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 1px var(--accent); }
.choice-card input { flex: none; margin-top: 0.15rem; }
.choice-text { display: flex; flex-direction: column; gap: 0.1rem; }
.choice-help { color: var(--muted); }
details.preview { margin-bottom: var(--space-4); }
.preview-body { padding: var(--space-3) var(--space-4); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
button, .button {
  display: inline-flex; align-items: center; justify-content: center; min-height: var(--tap);
  padding: var(--space-2) var(--space-4); font: inherit; font-weight: 600; line-height: 1.2;
  color: #fff; background: var(--accent); border: 1px solid var(--accent); border-radius: var(--radius-sm);
  text-decoration: none; cursor: pointer; box-shadow: 0 1px 1px rgba(31, 41, 55, 0.08);
  transition: background-color 0.12s, border-color 0.12s, color 0.12s;
}
button:hover, .button:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: #fff; }
button.secondary, .button.secondary { color: var(--accent); background: var(--surface); border-color: var(--border); }
button.secondary:hover, .button.secondary:hover { background: var(--accent-soft); color: var(--accent-hover); }
button.danger { color: var(--danger); background: var(--surface); border-color: var(--border); }
button.danger:hover { background: var(--danger-soft); color: var(--danger); }
button.approve { background: var(--ok); border-color: var(--ok); }
button.approve:hover { background: #115c2f; border-color: #115c2f; }
button.rework { background: var(--danger); border-color: var(--danger); }
button.rework:hover { background: #912018; border-color: #912018; }
.actions { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; }
li form { display: inline-block; margin: var(--space-1) 0 var(--space-1) var(--space-2); vertical-align: middle; }
details > summary { display: inline-flex; align-items: center; min-height: var(--tap); cursor: pointer; color: var(--accent); }
@media (prefers-reduced-motion: reduce) { button, .button { transition: none; } }

/* Messages */
.empty { color: var(--muted); font-style: italic; }
.hint { color: var(--muted); font-size: 0.9rem; margin-top: calc(-1 * var(--space-2)); }
form + section { margin-top: var(--space-6); }
[role="alert"], .alert {
  padding: var(--space-3) var(--space-4); color: var(--danger); background: var(--danger-soft);
  border: 1px solid #f1b2ab; border-radius: var(--radius);
}
[role="status"] { padding: var(--space-3) var(--space-4); background: var(--accent-soft); border-radius: var(--radius); }
#alerte { max-width: 76rem; margin: var(--space-4) auto 0; }
#alerte[hidden] { display: none; }
.error-page h1 { margin-top: var(--space-6); }

/* Comments: a card each; author, date, "modifié" on one line; small edit/delete controls */
.comment {
  padding: var(--space-3) var(--space-4); margin-bottom: var(--space-3); background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
}
.comment > header {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 var(--space-2);
  color: var(--muted); font-size: 0.85rem; margin-bottom: var(--space-2);
}
.comment > header strong { color: var(--heading); font-weight: 600; font-size: 0.9rem; }
.comment > header .edited { font-style: italic; }
.md .mention { color: var(--accent); background: var(--accent-soft); font-weight: 500; padding: 0.05em 0.3em; border-radius: 4px; }
.comment > :last-child { margin-bottom: 0; }
.comment-actions {
  display: flex; flex-wrap: wrap; align-items: flex-start; gap: 0 var(--space-1);
  margin-top: var(--space-2); padding-top: var(--space-1); border-top: 1px solid var(--border);
}
.comment-actions form { margin: 0; }
.comment-actions summary, .comment-actions button.danger {
  min-height: var(--tap); padding: 0 var(--space-2); font-size: 0.85rem; font-weight: 500;
  background: none; border: 0; box-shadow: none; border-radius: var(--radius-sm);
}
.comment-actions summary { color: var(--accent); }
.comment-actions summary:hover { background: var(--accent-soft); }
.comment-actions button.danger:hover { background: var(--danger-soft); }
.comment-actions form:has(details[open]) { flex-basis: 100%; order: 2; }
.comment-actions details[open] textarea { margin: var(--space-1) 0 var(--space-2); }
/* The Fil: comments and small grey event lines, the « Nouveau » divider, the fold, @ suggestions */
ol.fil { list-style: none; padding: 0; margin: 0 0 var(--space-3); }
ol.fil > li { margin: 0; }
.fil-event { color: var(--muted); font-size: 0.85rem; padding: var(--space-1) var(--space-4); margin-bottom: var(--space-2); }
.fil-nouveau {
  display: flex; align-items: center; gap: var(--space-2); margin: var(--space-2) 0 var(--space-3);
  color: var(--accent); font-size: 0.8rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em;
}
.fil-nouveau::before, .fil-nouveau::after { content: ""; flex: 1; border-top: 2px solid var(--accent); }
.fil-plus { margin-bottom: var(--space-3); }
.fil-plus a { display: inline-flex; align-items: center; min-height: var(--tap); font-weight: 500; }
.item-links { display: flex; flex-wrap: wrap; align-items: center; gap: 0 var(--space-2); font-size: 0.9rem; }
.item-links a { display: inline-flex; align-items: center; min-height: var(--tap); }
.mention-suggestions {
  list-style: none; margin: var(--space-1) 0 0; padding: var(--space-1) 0; max-width: 16rem;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); box-shadow: var(--shadow);
}
.mention-suggestions li { padding: var(--space-1) var(--space-3); cursor: pointer; }
.mention-suggestions li[aria-selected="true"] { background: var(--accent-soft); color: var(--accent); }
/* Uploads: Ajouter des fichiers, the preview row (thumbnails, file chips, remove buttons), the errors */
.upload-box { margin-bottom: var(--space-3); }
.upload-box > p { margin-bottom: var(--space-2); }
.upload-tools { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1) var(--space-3); margin: var(--space-1) 0 var(--space-2); }
.upload-tools[hidden] { display: none; }
label.upload-button { position: relative; margin: 0; }
.upload-button input { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
.upload-button:focus-within { outline: 2px solid var(--focus); outline-offset: 2px; }
.upload-hint { color: var(--muted); font-size: 0.85rem; }
.upload-previews { display: flex; flex-wrap: wrap; gap: var(--space-2); list-style: none; padding: 0; margin: 0 0 var(--space-2); }
.upload-previews:empty, .upload-error:empty { display: none; }
.upload-previews li {
  display: flex; align-items: center; gap: var(--space-1); margin: 0; padding: var(--space-1);
  background: var(--sunken); border: 1px solid var(--border); border-radius: var(--radius-sm);
}
.upload-previews img { display: block; width: 4rem; height: 4rem; object-fit: cover; border-radius: 4px; }
.file-chip { padding: 0 var(--space-2); font-size: 0.9rem; max-width: 16rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
button.upload-remove {
  min-height: var(--tap); min-width: var(--tap); padding: 0; font-size: 1.2rem; line-height: 1;
  color: var(--muted); background: none; border: 0; box-shadow: none;
}
button.upload-remove:hover { color: var(--danger); background: var(--danger-soft); }
.upload-error { margin: 0 0 var(--space-2); }
#commentaires form[id^="nouveau-commentaire-"] {
  padding: var(--space-3) var(--space-4); background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
}

/* Refresh: entries a refresh just brought in */
.refresh-new { animation: refresh-new 3s ease-out; }
@keyframes refresh-new { from { background: var(--highlight); } to { background: transparent; } }
@media (prefers-reduced-motion: reduce) { .refresh-new { animation: none; background: var(--highlight); } }

/* Narrow screens: tighter cards */
@media (max-width: 30rem) {
  main { padding-left: var(--space-3); padding-right: var(--space-3); }
  li.item { padding: var(--space-2) var(--space-3); }
  li.item .badges { justify-content: flex-start; }
  .comment, .answer-panel, section > .md, .read-more > .md, dl { padding-left: var(--space-3); padding-right: var(--space-3); }
  li.entry { grid-template-columns: 4.6rem 1fr; gap: var(--space-2); padding: var(--space-2) var(--space-3); }
  li.entry.notification { grid-template-columns: 4.6rem 1fr auto; }
}
