/* Réinitialisation (la page est servie seule, hors Claude) */
:root { color-scheme: light; }
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; }
[hidden] { display: none !important; }
img { max-width: 100%; }
/* Layout: barre de navigation pleine largeur, liste de projets en tableau, puis un board Kanban de trois colonnes grises avec des cartes blanches. */
:root {
  --bg: #FFFFFF;
  --nav: #FFFFFF;
  --sunken: #F1F2F4;
  --surface: #FFFFFF;
  --card-hover: #F7F8F9;
  --ink: #172B4D;
  --muted: #626F86;
  --line: #DCDFE4;
  --line-strong: #8590A2;
  --blue: #0C66E4;
  --blue-hover: #0055CC;
  --on-blue: #FFFFFF;
  --sel-bg: #E9F2FF;
  --btn: #F1F2F4;
  --btn-hover: #DCDFE4;
  --lozenge: #DCDFE4;
  --lozenge-ink: #44546F;
  --start: #1F845A;
  --stop: #C9372C;
  --cont: #6E5DC6;
  --on-stop: #FFFFFF;
  --focus: #388BFF;
  --shadow: 0 1px 1px rgba(9, 30, 66, 0.25), 0 0 1px rgba(9, 30, 66, 0.31);
  --gutter: clamp(16px, 4vw, 40px);
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1D2125;
    --nav: #1D2125;
    --sunken: #161A1D;
    --surface: #22272B;
    --card-hover: #2C333A;
    --ink: #B6C2CF;
    --muted: #8C9BAB;
    --line: #38414A;
    --line-strong: #738496;
    --blue: #579DFF;
    --blue-hover: #85B8FF;
    --on-blue: #1D2125;
    --sel-bg: #1C2B41;
    --btn: #2C333A;
    --btn-hover: #38414A;
    --lozenge: #38414A;
    --lozenge-ink: #B6C2CF;
    --start: #4BCE97;
    --stop: #F87168;
    --cont: #9F8FEF;
    --on-stop: #1D2125;
    --focus: #85B8FF;
    --shadow: 0 1px 1px rgba(3, 4, 4, 0.5), 0 0 1px rgba(3, 4, 4, 0.5);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #1D2125;
  --nav: #1D2125;
  --sunken: #161A1D;
  --surface: #22272B;
  --card-hover: #2C333A;
  --ink: #B6C2CF;
  --muted: #8C9BAB;
  --line: #38414A;
  --line-strong: #738496;
  --blue: #579DFF;
  --blue-hover: #85B8FF;
  --on-blue: #1D2125;
  --sel-bg: #1C2B41;
  --btn: #2C333A;
  --btn-hover: #38414A;
  --lozenge: #38414A;
  --lozenge-ink: #B6C2CF;
  --start: #4BCE97;
  --stop: #F87168;
  --cont: #9F8FEF;
  --on-stop: #1D2125;
  --focus: #85B8FF;
  --shadow: 0 1px 1px rgba(3, 4, 4, 0.5), 0 0 1px rgba(3, 4, 4, 0.5);
  color-scheme: dark;
}

* { box-sizing: border-box; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.5;
  padding-inline: var(--gutter);
  padding-block: 0 56px;
}
.wrap { max-width: 1240px; margin-inline: auto; display: flex; flex-direction: column; gap: 24px; }
body > .wrap { padding-top: 28px; }
h1, h2 { margin: 0; text-wrap: balance; overflow-wrap: anywhere; font-weight: 600; line-height: 1.25; letter-spacing: 0; }
p { margin: 0; }
.btn, .vote, .board-title, .author, .hint, .tip { overflow-wrap: anywhere; }
textarea, input, button { font-family: var(--font-body); }

/* Barre de navigation */
.topbar {
  display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap;
  background: var(--nav); border-bottom: 1px solid var(--line);
  margin-inline: calc(var(--gutter) * -1); padding: 10px var(--gutter);
}
.brand-wrap { display: flex; align-items: center; gap: 10px; }
.brand { display: flex; align-items: baseline; gap: 10px; }
.brand-name { font-weight: 700; font-size: 1.05rem; line-height: 1; }
.brand-tag { display: none; color: var(--muted); font-size: 0.8rem; }
@media (min-width: 620px) { .brand-tag { display: inline; } }
.mark {
  flex: none; width: 28px; height: 28px; border-radius: 4px; background: var(--blue);
  display: flex; align-items: flex-end; justify-content: center; gap: 2px; padding: 6px 5px;
}
.mark i { display: block; width: 4px; border-radius: 1px; background: var(--on-blue); }
.mark i:nth-child(1) { height: 8px; }
.mark i:nth-child(2) { height: 15px; }
.mark i:nth-child(3) { height: 11px; }
.me { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 0.85rem; min-width: 0; }
.me img { width: 28px; height: 28px; border-radius: 50%; display: block; }

.btn {
  font-size: 14px; font-weight: 500; line-height: 20px; cursor: pointer; text-align: center;
  background: var(--blue); color: var(--on-blue);
  border: 0; border-radius: 3px; padding: 6px 12px; min-height: 32px;
}
.btn:hover:not(:disabled) { background: var(--blue-hover); }
.btn.ghost, .btn.danger { background: var(--btn); color: var(--ink); }
.btn.ghost:hover:not(:disabled), .btn.danger:hover:not(:disabled) { background: var(--btn-hover); }
.btn.danger[data-armed="true"] { background: var(--stop); color: var(--on-stop); }
.btn[aria-pressed="true"] { background: var(--sel-bg); color: var(--blue); }
.btn:disabled { opacity: 0.5; cursor: default; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

.field {
  font-size: 14px; color: var(--ink); background: var(--surface);
  border: 1px solid var(--line-strong); border-radius: 3px; padding: 7px 10px; width: 100%; min-height: 32px;
}
.field:hover { background: var(--card-hover); }
.field:focus-visible { outline: 0; border-color: var(--blue); box-shadow: 0 0 0 1px var(--blue); background: var(--surface); }
.field::placeholder { color: var(--muted); }
textarea.field { resize: vertical; min-height: 64px; }

.notice { border: 1px solid var(--line); border-radius: 3px; background: var(--sunken); color: var(--ink); padding: 10px 14px; }

/* Fil d'Ariane */
.crumbs { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 0.85rem; flex-wrap: wrap; }
.crumb-link { border: 0; background: none; padding: 0; color: var(--blue); font-size: inherit; cursor: pointer; border-radius: 2px; }
.crumb-link:hover { text-decoration: underline; }
#crumb-title { overflow-wrap: anywhere; }

/* Liste des rétros */
.list-head { display: flex; flex-direction: column; gap: 6px; }
.list-head h1 { font-size: clamp(1.4rem, 3.4vw, 1.75rem); }
.list-head p { color: var(--muted); max-width: 62ch; }
.create { display: flex; gap: 8px; flex-wrap: wrap; }
.create .field { flex: 1 1 260px; min-width: 0; width: auto; }
.boards { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 3px; overflow: hidden; background: var(--surface); }
.boards > li + li { border-top: 1px solid var(--line); }
.board-row {
  width: 100%; display: flex; align-items: center; gap: 12px;
  font-size: inherit; color: var(--ink); text-align: left; cursor: pointer;
  background: transparent; border: 0; padding: 12px 16px;
}
.board-row:hover { background: var(--card-hover); }
.board-row:hover .board-title { color: var(--blue); text-decoration: underline; }
.board-info { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.board-title { font-weight: 600; font-size: 0.95rem; }
.board-meta { color: var(--muted); font-size: 0.8rem; }
.empty { color: var(--muted); padding: 24px 18px; max-width: 64ch; }

/* Board */
.board-head { display: flex; flex-direction: column; gap: 12px; }
.board-head h1 { font-size: clamp(1.4rem, 3.4vw, 1.75rem); }
.board-sub { color: var(--muted); font-size: 0.85rem; margin-top: 4px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.actions .spacer { flex: 1; }

.cols { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; align-items: start; }
@media (min-width: 700px) { .cols { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .cols { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.col-start { --accent: var(--start); }
.col-stop { --accent: var(--stop); }
.col-continue { --accent: var(--cont); }
.col-action { --accent: var(--blue); }
.col { background: var(--sunken); border-radius: 3px; padding: 12px 8px 10px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.col-head { display: flex; flex-direction: column; gap: 2px; padding-inline: 6px; }
.col-title { display: flex; align-items: center; gap: 8px; }
.col h2 { font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.col h2::before { content: ''; flex: none; width: 10px; height: 10px; border-radius: 2px; background: var(--accent); }
.count { font-size: 0.75rem; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }
.hint { color: var(--muted); font-size: 0.8rem; }
.composer { display: flex; flex-direction: column; gap: 8px; padding-inline: 2px; }
.composer-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.tip { color: var(--muted); font-size: 0.75rem; }
.cards { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.card { background: var(--surface); border-radius: 3px; padding: 12px; display: flex; flex-direction: column; gap: 10px; box-shadow: var(--shadow); }
.card:hover { background: var(--card-hover); }
.card-text { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; line-height: 1.5; }
.card-foot { display: flex; align-items: center; gap: 6px; }
.author { flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 0.75rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.avatar { flex: none; width: 24px; height: 24px; border-radius: 50%; display: block; }
.dot { flex: none; width: 24px; height: 24px; border-radius: 50%; background: var(--lozenge); }
.vote {
  display: inline-flex; align-items: center; gap: 4px; cursor: pointer;
  font-size: 0.75rem; font-weight: 700; font-variant-numeric: tabular-nums;
  background: var(--lozenge); color: var(--lozenge-ink); border: 0; border-radius: 3px; padding: 2px 8px; min-height: 22px;
}
.vote:hover:not(:disabled) { background: var(--btn-hover); }
.vote[aria-pressed="true"] { background: var(--blue); color: var(--on-blue); }
.vote:disabled { cursor: default; }
.x { border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 1.15rem; line-height: 1; padding: 2px 6px; border-radius: 3px; }
.x:hover { background: var(--btn-hover); color: var(--ink); }
.col-empty { color: var(--muted); font-size: 0.8rem; padding: 2px 6px; }

#toast {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 3px;
  max-width: calc(100% - 32px); z-index: 10; box-shadow: var(--shadow);
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* Sélecteur de thème, zone droite de la barre */
.top-right { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.theme { display: inline-flex; border: 1px solid var(--line); border-radius: 3px; overflow: hidden; }
.theme button { border: 0; background: var(--surface); color: var(--muted); font-size: 0.8rem; font-weight: 500; padding: 5px 11px; cursor: pointer; }
.theme button + button { border-left: 1px solid var(--line); }
.theme button:hover { background: var(--card-hover); color: var(--ink); }
.theme button[aria-pressed="true"] { background: var(--sel-bg); color: var(--blue); }

/* Avatars à initiale */
.avatar { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 24px; height: 24px; border-radius: 50%; color: #fff; font-size: 0.7rem; font-weight: 600; line-height: 1; }
button.me { background: none; border: 0; padding: 2px 4px; border-radius: 3px; cursor: pointer; color: var(--ink); font-size: 0.85rem; }
button.me:hover { background: var(--btn); }
.me .avatar { width: 28px; height: 28px; font-size: 0.8rem; }
.me-name { max-width: 14ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
a.crumb-link { text-decoration: none; }
a.crumb-link:hover { text-decoration: underline; }

/* Écran du prénom */
.gate { position: fixed; inset: 0; z-index: 20; background: rgba(9, 30, 66, 0.6); display: flex; align-items: center; justify-content: center; padding: 16px; }
.gate-card { background: var(--surface); color: var(--ink); width: min(420px, 100%); border-radius: 3px; padding: 24px; display: flex; flex-direction: column; gap: 10px; box-shadow: 0 8px 12px rgba(9, 30, 66, 0.15), 0 0 1px rgba(9, 30, 66, 0.31); }
.gate-card h2 { font-size: 1.25rem; }
.gate-msg { color: var(--muted); margin-bottom: 4px; }
.gate-card label { font-size: 0.75rem; font-weight: 700; color: var(--muted); margin-top: 4px; }
.gate-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }

/* Votes pour / contre, édition, actions à cocher */
.votes { display: inline-flex; gap: 4px; }
.vote.down[aria-pressed="true"] { background: var(--stop); color: var(--on-stop); }
.check { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; }
.check input { flex: none; width: 16px; height: 16px; margin: 3px 0 0; accent-color: var(--blue); cursor: pointer; }
.is-done { color: var(--muted); text-decoration: line-through; }
.card.editing { gap: 8px; }
.edit-actions { display: flex; justify-content: flex-end; gap: 8px; }

/* Déplacement des cartes */
.card.dragging { display: none; }
.drop-ph { list-style: none; border: 2px dashed var(--blue); border-radius: 3px; background: transparent; box-sizing: border-box; }
.card.ghost { position: fixed; left: 0; top: 0; z-index: 50; margin: 0; pointer-events: none; opacity: 0.95; box-shadow: 0 8px 24px rgba(9, 30, 66, 0.35); transform-origin: 0 0; cursor: grabbing; }
body.is-dragging { cursor: grabbing; user-select: none; -webkit-user-select: none; }
.col-action 
/* Chrono de discussion */
.timer-len { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 0.8rem; }
.timer-len .field { width: auto; min-height: 32px; padding: 2px 8px; }
.timer-bar { position: sticky; top: 8px; z-index: 20; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; background: var(--surface); border-radius: 3px; border-left: 4px solid var(--blue); padding: 10px 14px; box-shadow: 0 4px 12px rgba(9, 30, 66, 0.25), 0 0 1px rgba(9, 30, 66, 0.31); margin-block: 4px; }
.timer-bar[hidden] { display: none; }
.timer-main { flex: 1 1 220px; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.timer-label { color: var(--muted); font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; }
.timer-card { font-size: 0.9rem; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow-wrap: anywhere; }
.timer-clock { font-size: 1.9rem; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1; min-width: 4.5ch; text-align: center; }
.timer-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.timer-bar.paused { border-left-color: var(--line-strong); }
.timer-bar.paused .timer-clock { color: var(--muted); }
.timer-bar.warn { border-left-color: #E56910; }
.timer-bar.warn .timer-clock { color: #E56910; }
.timer-bar.over { border-left-color: var(--stop); }
.timer-bar.over .timer-clock { color: var(--stop); animation: timer-blink 1s steps(2, start) infinite; }
@keyframes timer-blink { to { opacity: 0.45; } }
@media (prefers-reduced-motion: reduce) { .timer-bar.over .timer-clock { animation: none; } }
.card.discussed { outline: 2px solid var(--blue); outline-offset: -2px; }
.card-foot { flex-wrap: wrap; row-gap: 4px; }
.author { flex: 1 1 96px; }

.card { cursor: grab; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.card .card-text { cursor: inherit; }
.card button, .card input, .card label.check { cursor: pointer; }

/* Carte épurée : texte + menu ⋯ en haut, auteur et votes en bas */
.card { position: relative; gap: 8px; }
.card:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.card-head { display: flex; align-items: flex-start; gap: 6px; }
.card-head > .card-text, .card-head > .check { flex: 1; min-width: 0; }
.card-head .more { flex: none; margin: -4px -6px 0 0; font-size: 1.1rem; letter-spacing: 1px; opacity: 0; transition: opacity 0.1s; }
.card:hover .more, .card:focus-within .more, .more[aria-expanded="true"] { opacity: 1; }
@media (hover: none) { .card-head .more { opacity: 1; } }
.card-foot { flex-wrap: nowrap; }
.menu { position: absolute; right: 8px; top: 34px; z-index: 30; list-style: none; margin: 0; padding: 4px 0; min-width: 180px; background: var(--surface); border-radius: 3px; box-shadow: 0 8px 12px rgba(9, 30, 66, 0.15), 0 0 1px rgba(9, 30, 66, 0.31); border: 1px solid var(--line); }
.menu-item { display: block; width: 100%; text-align: left; border: 0; background: transparent; color: var(--ink); font: inherit; font-size: 14px; padding: 8px 14px; cursor: pointer; }
.menu-item:hover, .menu-item:focus-visible { background: var(--btn-hover); outline: none; }
.menu-item.danger { color: var(--stop); }
