/* Kanban BizNC (/outils-pratiques/tableau-kanban et /kanban/).
   Surface « outils pratiques » : jetons de satellite.css uniquement
   (--card, --card-2, --hair, --ink, --soft, --muted, --gold, --gold-ink, --w).
   Monochrome : la couleur ne sert qu'aux repères utiles (étiquettes,
   priorité haute, retard, blocage, progression), toujours doublée d'un texte. */

:root {
  --kb-gold: #d4a017; --kb-blue: #6ea8fe; --kb-green: #5cc28a; --kb-red: #f07a6a; --kb-purple: #b69cf5; --kb-grey: #9aa39f;
  --kb-late: #f07a6a; --kb-ok: #5cc28a;
}
:root[data-theme="light"] {
  --kb-gold: #8d7b22; --kb-blue: #2563c9; --kb-green: #1f7a4a; --kb-red: #b4382a; --kb-purple: #6b4bc4; --kb-grey: #6b716a;
  --kb-late: #b4382a; --kb-ok: #1f7a4a;
}

.kb-sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.kb-loading { color: var(--muted); padding: 24px 0; }
.kb-alert { margin: 0; padding: 12px 14px; border: 1px solid var(--hair); border-left: 3px solid var(--muted); border-radius: 10px; background: var(--card-2); color: var(--ink); font-size: .9rem; line-height: 1.5; }
.kb-alert.is-error { border-left-color: var(--kb-red); }
.kb-alert.is-ok { border-left-color: var(--kb-green); }
.kb-alert.is-warn { border-left-color: var(--kb-gold); }
.kb-alert strong { display: block; margin-bottom: 2px; }
.kb-alert .kb-alert-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }

/* Boutons */
.kb-link-btn { justify-self: start; min-height: 36px; padding: 0; border: 0; background: none; color: var(--soft); font: inherit; font-size: .86rem; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.kb-link-btn:hover { color: var(--ink); }
.kb-link-btn:focus-visible, .kb-icon-btn:focus-visible, .kb-card:focus-visible, .kb-chip:focus-visible, .kb-coltab:focus-visible, .kb-tile:focus-within { outline: 2px solid var(--gold); outline-offset: 2px; }
:root[data-theme="light"] .kb-link-btn:focus-visible, :root[data-theme="light"] .kb-icon-btn:focus-visible, :root[data-theme="light"] .kb-card:focus-visible, :root[data-theme="light"] .kb-chip:focus-visible, :root[data-theme="light"] .kb-coltab:focus-visible { outline-color: var(--gold-ink); }
.kb-icon-btn { display: inline-grid; place-items: center; width: 40px; height: 40px; flex: 0 0 auto; padding: 0; border: 1px solid transparent; border-radius: 8px; background: transparent; color: var(--soft); cursor: pointer; }
.kb-icon-btn:hover { background: rgba(var(--w), .06); color: var(--ink); }
.kb-icon-btn svg, .btn-ghost svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.kb-icon-btn[aria-pressed="true"] svg.kb-star { fill: currentColor; }
.btn-ghost.is-danger { color: var(--kb-red); border-color: rgba(var(--w), .16); }
.btn-ghost[disabled], .kb-icon-btn[disabled] { opacity: .45; cursor: not-allowed; transform: none; }
.kb-btn-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* Formulaire de démarrage */
.kb-start textarea, .kb-field textarea, .kb-panel textarea {
  width: 100%; min-width: 0; padding: 10px 12px; border: 1px solid rgba(var(--w), .18); border-radius: 8px;
  background: var(--card-2); color: var(--ink); font: inherit; font-size: 1rem; line-height: 1.5; resize: vertical;
}
.kb-start textarea:focus, .kb-panel textarea:focus, .kb-panel input:focus, .kb-panel select:focus, .kb-toolbar input:focus, .kb-toolbar select:focus, .kb-add-form input:focus, .kb-inline-input:focus {
  outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(212, 160, 23, .22);
}
:root[data-theme="light"] .kb-start textarea:focus, :root[data-theme="light"] .kb-panel textarea:focus, :root[data-theme="light"] .kb-panel input:focus, :root[data-theme="light"] .kb-panel select:focus, :root[data-theme="light"] .kb-toolbar input:focus, :root[data-theme="light"] .kb-toolbar select:focus, :root[data-theme="light"] .kb-add-form input:focus, :root[data-theme="light"] .kb-inline-input:focus { border-color: var(--gold-ink); box-shadow: 0 0 0 3px rgba(141, 123, 34, .18); }
.kb-start-row { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.kb-span-2 { grid-column: span 2; }
@media (max-width: 560px) { .kb-span-2 { grid-column: auto; } }
/* Les champs .sim-field sont en grid : sans ceci, l’attribut hidden ne masque rien. */
.kb-start[hidden], .kb-check[hidden], .kb-start [hidden], .kb-wrap [hidden], .kb-panel [hidden] { display: none !important; }
.kb-signed-as { margin: 0; color: var(--soft); font-size: .88rem; }
.kb-signed-as strong { color: var(--ink); }
.kb-more { display: grid; gap: 14px; padding-top: 4px; }
.kb-templates { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 8px; margin: 0; padding: 0; border: 0; min-width: 0; }
.kb-templates legend, .kb-cols-title { margin: 0 0 6px; padding: 0; color: var(--soft); font-size: .86rem; font-weight: 600; }
.kb-template { display: flex; gap: 10px; align-items: flex-start; min-height: 44px; padding: 10px 12px; border: 1px solid var(--hair); border-radius: 9px; background: var(--card-2); cursor: pointer; }
.kb-template:has(input:checked) { border-color: var(--ink); }
.kb-template input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--gold); flex: 0 0 auto; }
.kb-template strong { display: block; color: var(--ink); font-size: .9rem; }
.kb-template small { display: block; margin-top: 2px; color: var(--muted); font-size: .78rem; line-height: 1.4; }
.kb-cols-list { display: grid; gap: 6px; margin: 0 0 8px; padding: 0; list-style: none; counter-reset: kbcol; }
.kb-cols-list li { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; gap: 8px; align-items: center; counter-increment: kbcol; }
.kb-cols-list li::before { content: counter(kbcol); color: var(--muted); font-size: .8rem; text-align: right; font-variant-numeric: tabular-nums; }
.kb-inline-input { width: 100%; min-width: 0; height: 44px; padding: 0 12px; border: 1px solid rgba(var(--w), .18); border-radius: 8px; background: var(--card-2); color: var(--ink); font: inherit; font-size: 1rem; }
.kb-cols-list .kb-done-tag { color: var(--muted); font-size: .76rem; }
.kb-form-error { margin: 0; color: var(--kb-red); font-size: .88rem; font-weight: 600; }
.kb-turnstile:empty { display: none; }
.kb-steps { display: grid; gap: 10px; margin: 0; padding-left: 20px; color: var(--soft); line-height: 1.6; }
.kb-steps strong { color: var(--ink); }

/* Écran « Vérifiez votre boîte e-mail » */
.kb-check { display: grid; gap: 14px; outline: none; scroll-margin-top: 96px; }
.kb-check h3 { margin: 0; color: var(--ink); font-size: 1.15rem; font-weight: 800; letter-spacing: -.01em; }
.kb-check p { margin: 0; color: var(--soft); line-height: 1.6; }
.kb-check .kb-code-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; }
.kb-check .kb-code-row .sim-field { flex: 0 1 220px; }
.kb-check input[name="code"] { letter-spacing: .2em; font-size: 1.2rem; font-weight: 700; }

/* Espace /kanban/ : la page s'élargit pour le tableau */
body[data-page-type="espace-kanban"] main.fiche { width: min(1480px, calc(100% - 40px)); padding-bottom: 40px; }
body[data-page-type="espace-kanban"] .breadcrumb { width: min(1480px, calc(100% - 40px)); }
@media (max-width: 720px) {
  body[data-page-type="espace-kanban"] main.fiche, body[data-page-type="espace-kanban"] .breadcrumb { width: calc(100% - 20px); }
}
.kb-wrap { display: grid; gap: 14px; min-width: 0; }
.kb-wrap > *, #kb-root { min-width: 0; }
#kb-root > * + * { margin-top: 12px; }
#kb-root > .kb-coltabs + .kb-columns { margin-top: 6px; }
.kb-page-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; }
.kb-page-head h1, .kb-board-title { margin: 0; color: var(--ink); font-size: clamp(1.4rem, 3.4vw, 2rem); font-weight: 820; letter-spacing: -.025em; line-height: 1.1; overflow-wrap: anywhere; }
.kb-page-sub { margin: 4px 0 0; color: var(--muted); font-size: .86rem; }

/* Liste des tableaux */
.kb-section { display: grid; gap: 10px; }
.kb-section > h2 { margin: 4px 0 0; color: var(--soft); font-size: .92rem; font-weight: 700; }
.kb-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px; margin: 0; padding: 0; list-style: none; }
.kb-tile { position: relative; display: grid; gap: 6px; min-height: 96px; padding: 14px 52px 14px 16px; border: 1px solid var(--hair); border-radius: 12px; background: var(--card); }
.kb-tile a { color: var(--ink); font-weight: 700; font-size: 1rem; text-decoration: none; overflow-wrap: anywhere; }
.kb-tile a::after { content: ""; position: absolute; inset: 0; border-radius: 12px; }
.kb-tile a:focus-visible { outline: none; }
.kb-tile:hover { border-color: rgba(var(--w), .22); }
.kb-tile .kb-tile-meta { color: var(--muted); font-size: .8rem; line-height: 1.45; }
.kb-tile .kb-tile-meta strong { color: var(--soft); font-weight: 600; }
.kb-tile .kb-icon-btn { position: absolute; top: 8px; right: 8px; z-index: 1; }
.kb-tasks { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.kb-task { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; padding: 12px 14px; border: 1px solid var(--hair); border-radius: 10px; background: var(--card); }
.kb-task a { color: var(--ink); font-weight: 650; text-decoration: none; overflow-wrap: anywhere; }
.kb-task a:hover { text-decoration: underline; }
.kb-task .kb-meta { grid-column: 1 / -1; }
.kb-empty { margin: 0; padding: 18px; border: 1px dashed var(--hair); border-radius: 12px; color: var(--muted); text-align: center; line-height: 1.5; }
.kb-invite-card { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; padding: 12px 14px; border: 1px solid var(--hair); border-left: 3px solid var(--ink); border-radius: 10px; background: var(--card); color: var(--soft); }
.kb-invite-card strong { color: var(--ink); }
.kb-new { padding: 18px; border: 1px solid var(--hair); border-radius: 14px; background: var(--card); }
.kb-new > h2 { margin: 0 0 12px; font-size: 1.02rem; color: var(--ink); }

/* Segments (Tableaux / Mes tâches) */
.kb-seg { display: inline-flex; padding: 3px; border: 1px solid rgba(var(--w), .16); border-radius: 9px; background: var(--card-2); }
.kb-seg button { min-height: 38px; padding: 0 14px; border: 0; border-radius: 6px; background: transparent; color: var(--soft); font: inherit; font-size: .88rem; font-weight: 600; cursor: pointer; }
.kb-seg button[aria-pressed="true"] { background: var(--ink); color: var(--card); }
.kb-seg button:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

/* En-tête d'un tableau */
.kb-board-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px 14px; align-items: center; }
.kb-board-name { display: flex; align-items: center; gap: 6px; min-width: 0; }
.kb-board-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: flex-end; }
.kb-board-desc { grid-column: 1 / -1; margin: -4px 0 0; color: var(--muted); font-size: .88rem; line-height: 1.5; max-width: 80ch; }
@media (max-width: 720px) {
  .kb-board-head { grid-template-columns: minmax(0, 1fr); }
  .kb-board-actions { justify-content: flex-start; }
}
.kb-avatars { display: inline-flex; align-items: center; padding: 0; border: 0; background: none; cursor: pointer; min-height: 40px; }
.kb-avatar { display: inline-grid; place-items: center; width: 30px; height: 30px; margin-left: -6px; border: 2px solid var(--card); border-radius: 50%; background: var(--card-2); color: var(--ink); font-size: .68rem; font-weight: 800; letter-spacing: .02em; box-shadow: inset 0 0 0 1px rgba(var(--w), .22); }
.kb-avatars .kb-avatar:first-child { margin-left: 0; }
.kb-avatar.is-small { width: 22px; height: 22px; font-size: .58rem; margin-left: -4px; border-width: 1px; }
.kb-save { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; color: var(--muted); font-size: .78rem; white-space: nowrap; }
.kb-save::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--kb-ok); }
.kb-save[data-state="saving"]::before { background: var(--muted); animation: kb-pulse 1s ease-in-out infinite; }
.kb-save[data-state="error"], .kb-save[data-state="offline"] { color: var(--kb-red); font-weight: 700; }
.kb-save[data-state="error"]::before, .kb-save[data-state="offline"]::before { background: var(--kb-red); }
.kb-save button { padding: 0; border: 0; background: none; color: inherit; font: inherit; text-decoration: underline; cursor: pointer; min-height: 32px; }
@keyframes kb-pulse { 50% { opacity: .3; } }
@media (prefers-reduced-motion: reduce) { .kb-save[data-state="saving"]::before { animation: none; } }

/* Barre de recherche et filtres */
.kb-toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.kb-search { position: relative; flex: 1 1 220px; max-width: 340px; }
.kb-search input { width: 100%; height: 40px; padding: 0 12px 0 36px; border: 1px solid rgba(var(--w), .18); border-radius: 8px; background: var(--card-2); color: var(--ink); font: inherit; font-size: 1rem; }
.kb-search svg { position: absolute; left: 11px; top: 11px; width: 18px; height: 18px; fill: none; stroke: var(--muted); stroke-width: 1.8; }
.kb-filters { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.kb-chip { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 12px; border: 1px solid rgba(var(--w), .18); border-radius: 999px; background: transparent; color: var(--soft); font: inherit; font-size: .82rem; font-weight: 600; cursor: pointer; }
.kb-chip:hover { border-color: rgba(var(--w), .32); color: var(--ink); }
.kb-chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--card); }
.kb-toolbar select { height: 36px; max-width: 170px; padding: 0 28px 0 10px; border: 1px solid rgba(var(--w), .18); border-radius: 999px; background-color: var(--card-2); color: var(--soft); font: inherit; font-size: .82rem; font-weight: 600; }
.kb-toolbar select.is-active { border-color: var(--ink); color: var(--ink); }
.kb-filter-count { color: var(--muted); font-size: .8rem; }
@media (max-width: 720px) {
  .kb-search { max-width: none; flex-basis: 100%; }
  .kb-filters { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
  .kb-filters::-webkit-scrollbar { display: none; }
  .kb-filters > * { flex: 0 0 auto; }
}

/* Onglets de colonnes (téléphone) */
.kb-coltabs { display: none; gap: 6px; overflow-x: auto; padding: 2px 0 4px; scrollbar-width: none; position: sticky; top: 68px; z-index: 5; background: var(--bg); }
.kb-coltabs::-webkit-scrollbar { display: none; }
.kb-coltab { flex: 0 0 auto; display: inline-flex; gap: 6px; align-items: center; min-height: 40px; padding: 0 12px; border: 1px solid var(--hair); border-radius: 999px; background: var(--card); color: var(--soft); font: inherit; font-size: .84rem; font-weight: 650; cursor: pointer; }
.kb-coltab[aria-current="true"] { background: var(--ink); border-color: var(--ink); color: var(--card); }
.kb-coltab .kb-count { color: inherit; opacity: .75; }

/* Colonnes */
.kb-columns { display: flex; gap: 12px; align-items: flex-start; overflow-x: auto; padding: 2px 2px 14px; min-height: 280px; scroll-padding: 0 2px; }
.kb-col { flex: 0 0 300px; display: flex; flex-direction: column; max-height: calc(100vh - 180px); min-height: 160px; border: 1px solid var(--hair); border-radius: 12px; background: var(--card); }
.kb-col.is-drop-target { border-color: rgba(var(--w), .45); }
.kb-col.is-dragging { opacity: .5; }
.kb-col-head { display: flex; align-items: center; gap: 4px; padding: 8px 6px 6px 12px; cursor: default; }
.kb-col-name { flex: 1 1 auto; min-width: 0; margin: 0; color: var(--ink); font-size: .95rem; font-weight: 750; letter-spacing: -.005em; overflow-wrap: anywhere; }
.kb-col-name button { padding: 4px 0; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: text; }
.kb-col-head .kb-inline-input { height: 36px; font-size: .95rem; font-weight: 700; }
.kb-count { flex: 0 0 auto; min-width: 22px; color: var(--muted); font-size: .8rem; font-weight: 700; text-align: center; font-variant-numeric: tabular-nums; }
.kb-done-badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 7px; border: 1px solid var(--hair); border-radius: 999px; color: var(--soft); font-size: .7rem; font-weight: 700; white-space: nowrap; }
.kb-done-badge svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 2.4; }
.kb-cards { flex: 1 1 auto; display: grid; align-content: start; gap: 8px; min-height: 12px; margin: 0; padding: 4px 8px 8px; list-style: none; overflow-y: auto; }
.kb-col-foot { padding: 0 8px 8px; }
.kb-add-btn { width: 100%; justify-content: flex-start; min-height: 44px; border-style: dashed; }
.kb-add-form { display: grid; gap: 8px; }
.kb-add-form input { width: 100%; height: 44px; padding: 0 12px; border: 1px solid rgba(var(--w), .22); border-radius: 8px; background: var(--card-2); color: var(--ink); font: inherit; font-size: 1rem; }
.kb-col-new { flex: 0 0 260px; padding: 10px; border: 1px dashed var(--hair); border-radius: 12px; }

/* Cartes */
.kb-card { position: relative; display: grid; gap: 6px; padding: 10px 44px 10px 12px; border: 1px solid var(--hair); border-radius: 9px; background: var(--card-2); color: var(--ink); cursor: pointer; touch-action: manipulation; user-select: none; -webkit-user-select: none; }
.kb-card:hover { border-color: rgba(var(--w), .26); }
.kb-card.is-dragging { opacity: .35; }
.kb-card.is-ghost { position: fixed; z-index: 1200; pointer-events: none; width: 280px; box-shadow: 0 18px 40px rgba(0, 0, 0, .45); transform: rotate(1.5deg); opacity: .95; }
.kb-card.is-flash { animation: kb-flash 1.2s ease-out; }
@keyframes kb-flash { 0% { box-shadow: 0 0 0 3px rgba(212, 160, 23, .55); } 100% { box-shadow: 0 0 0 0 rgba(212, 160, 23, 0); } }
.kb-card-title { margin: 0; font-size: .92rem; font-weight: 600; line-height: 1.35; overflow-wrap: anywhere; }
.kb-card.is-done .kb-card-title { color: var(--soft); }
.kb-card .kb-move { position: absolute; top: 4px; right: 4px; width: 36px; height: 36px; }
@media (hover: hover) and (pointer: fine) {
  .kb-card .kb-move { opacity: 0; }
  .kb-card:hover .kb-move, .kb-card:focus-within .kb-move, .kb-card .kb-move:focus-visible { opacity: 1; }
}
.kb-drop-line { height: 3px; margin: -3px 2px; border-radius: 2px; background: var(--ink); }
.kb-meta { display: flex; flex-wrap: wrap; gap: 5px 8px; align-items: center; color: var(--muted); font-size: .76rem; line-height: 1.3; }
.kb-meta > span { display: inline-flex; align-items: center; gap: 4px; }
.kb-meta svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.kb-label { padding: 1px 7px 1px 6px; border: 1px solid var(--hair); border-radius: 999px; color: var(--soft); font-weight: 600; }
.kb-dot { width: 8px; height: 8px; flex: 0 0 auto; border-radius: 50%; background: var(--kb-grey); }
.kb-dot[data-c="gold"] { background: var(--kb-gold); } .kb-dot[data-c="blue"] { background: var(--kb-blue); } .kb-dot[data-c="green"] { background: var(--kb-green); }
.kb-dot[data-c="red"] { background: var(--kb-red); } .kb-dot[data-c="purple"] { background: var(--kb-purple); } .kb-dot[data-c="grey"] { background: var(--kb-grey); }
.kb-due.is-late { color: var(--kb-late); font-weight: 700; }
.kb-due.is-soon { color: var(--ink); font-weight: 650; }
.kb-blocked { color: var(--kb-red); font-weight: 700; }
.kb-prio-high, .kb-prio-urgent { color: var(--ink); font-weight: 700; }
.kb-progress { font-variant-numeric: tabular-nums; }
.kb-progress.is-complete { color: var(--kb-ok); font-weight: 700; }
.kb-meta .kb-who { margin-left: auto; display: inline-flex; }

@media (max-width: 720px) {
  .kb-coltabs { display: flex; }
  .kb-columns { gap: 10px; scroll-snap-type: x mandatory; padding-bottom: 8px; -webkit-overflow-scrolling: touch; }
  .kb-col { flex-basis: calc(100vw - 40px); max-width: 420px; scroll-snap-align: start; max-height: none; }
  .kb-cards { overflow: visible; }
  .kb-col-foot { position: sticky; bottom: 0; padding-top: 8px; background: var(--card); border-radius: 0 0 12px 12px; }
  .kb-col-new { flex-basis: calc(100vw - 40px); scroll-snap-align: start; }
}

/* Panneau (détails d'une carte, réglages) et feuille (déplacer, inviter) */
.kb-backdrop { position: fixed; inset: 0; z-index: 1040; background: rgba(0, 0, 0, .62); }
:root[data-theme="light"] .kb-backdrop { background: rgba(235, 235, 231, .78); }
.kb-panel { position: fixed; z-index: 1050; top: 0; right: 0; bottom: 0; display: flex; flex-direction: column; width: min(580px, 100%); border-left: 1px solid var(--hair); background: var(--bg); color: var(--ink); box-shadow: 0 35px 100px rgba(0, 0, 0, .65); }
:root[data-theme="light"] .kb-panel { box-shadow: 0 22px 60px rgba(28, 31, 26, .26); }
.kb-panel.is-sheet { top: auto; left: 50%; right: auto; bottom: 50%; transform: translate(-50%, 50%); width: min(480px, calc(100% - 24px)); max-height: min(640px, calc(100% - 40px)); border: 1px solid var(--hair); border-radius: 12px; }
@media (max-width: 720px) {
  .kb-panel { top: 6vh; left: 0; width: 100%; border-left: 0; border-top: 1px solid var(--hair); border-radius: 14px 14px 0 0; }
  .kb-panel.is-sheet { top: auto; left: 0; bottom: 0; transform: none; width: 100%; max-height: 86vh; border-radius: 14px 14px 0 0; }
}
.kb-panel-head { display: flex; align-items: center; gap: 8px; padding: 10px 10px 10px 18px; border-bottom: 1px solid var(--hair); }
.kb-panel-head h2 { flex: 1 1 auto; min-width: 0; margin: 0; font-size: 1rem; font-weight: 750; overflow-wrap: anywhere; }
.kb-panel-body { flex: 1 1 auto; display: grid; align-content: start; gap: 18px; padding: 16px 18px 28px; overflow-y: auto; overscroll-behavior: contain; }
.kb-panel-foot { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 18px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--hair); }
.kb-panel input[type="text"], .kb-panel input[type="email"], .kb-panel input[type="date"], .kb-panel input[type="url"], .kb-panel select {
  width: 100%; min-width: 0; height: 44px; padding: 0 12px; border: 1px solid rgba(var(--w), .18); border-radius: 8px; background: var(--card-2); color: var(--ink); font: inherit; font-size: 1rem;
}
.kb-panel input.kb-title-input { height: auto; min-height: 48px; padding: 8px 12px; font-size: 1.15rem; font-weight: 750; }
.kb-field { display: grid; gap: 6px; min-width: 0; }
.kb-field > span, .kb-field > legend, .kb-group-title { color: var(--soft); font-size: .84rem; font-weight: 650; }
.kb-field-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.kb-group { display: grid; gap: 8px; margin: 0; padding: 0; border: 0; min-width: 0; }
.kb-group > summary { cursor: pointer; color: var(--soft); font-size: .86rem; font-weight: 700; min-height: 36px; display: flex; align-items: center; }
.kb-checks { display: flex; flex-wrap: wrap; gap: 6px; }
.kb-toggle { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 10px; border: 1px solid rgba(var(--w), .18); border-radius: 999px; color: var(--soft); font-size: .84rem; font-weight: 600; cursor: pointer; }
.kb-toggle:has(input:checked) { border-color: var(--ink); color: var(--ink); background: rgba(var(--w), .06); }
.kb-toggle input { width: 16px; height: 16px; margin: 0; accent-color: var(--gold); }
.kb-list { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.kb-list li { display: flex; gap: 8px; align-items: center; min-height: 40px; }
.kb-list li > label { display: flex; gap: 10px; align-items: center; flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.kb-list li > label input[type="checkbox"] { width: 18px; height: 18px; flex: 0 0 auto; accent-color: var(--gold); }
.kb-list li.is-done > label span { color: var(--muted); text-decoration: line-through; }
.kb-list a { color: var(--ink); overflow-wrap: anywhere; }
.kb-bar { height: 6px; border-radius: 99px; background: rgba(var(--w), .1); overflow: hidden; }
.kb-bar > span { display: block; height: 100%; background: var(--ink); }
.kb-bar.is-complete > span { background: var(--kb-ok); }
.kb-blocked-box { display: grid; gap: 8px; padding: 12px; border: 1px solid var(--hair); border-left: 3px solid var(--kb-red); border-radius: 10px; background: var(--card-2); }
.kb-comment { display: grid; gap: 4px; padding: 10px 12px; border: 1px solid var(--hair); border-radius: 10px; background: var(--card); }
.kb-comment header { display: flex; gap: 8px; align-items: center; color: var(--muted); font-size: .78rem; }
.kb-comment header strong { color: var(--ink); font-size: .84rem; }
.kb-comment p { margin: 0; color: var(--soft); line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
.kb-mention { color: var(--ink); font-weight: 700; }
.kb-history { display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; color: var(--muted); font-size: .8rem; line-height: 1.45; }
.kb-history time { color: var(--soft); font-variant-numeric: tabular-nums; }
.kb-conflict { display: grid; gap: 8px; }
.kb-mention-list { display: grid; gap: 2px; margin: 4px 0 0; padding: 4px; border: 1px solid var(--hair); border-radius: 8px; background: var(--card); list-style: none; }
.kb-mention-list button { width: 100%; min-height: 36px; padding: 0 10px; border: 0; border-radius: 6px; background: none; color: var(--ink); font: inherit; text-align: left; cursor: pointer; }
.kb-mention-list button:hover, .kb-mention-list button:focus-visible { background: rgba(var(--w), .08); outline: none; }

/* Menus */
.kb-menu { display: grid; gap: 2px; margin: 0; padding: 0; list-style: none; }
.kb-menu button, .kb-menu a { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 46px; padding: 0 12px; border: 0; border-radius: 8px; background: none; color: var(--ink); font: inherit; font-size: .92rem; text-align: left; text-decoration: none; cursor: pointer; }
.kb-menu button:hover, .kb-menu a:hover, .kb-menu button:focus-visible, .kb-menu a:focus-visible { background: rgba(var(--w), .07); outline: none; }
.kb-menu .is-danger { color: var(--kb-red); }
.kb-menu hr { margin: 6px 0; border: 0; border-top: 1px solid var(--hair); }
.kb-menu small { margin-left: auto; color: var(--muted); font-size: .76rem; }
.kb-choice { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.kb-choice button { display: flex; justify-content: space-between; align-items: center; gap: 10px; width: 100%; min-height: 48px; padding: 0 14px; border: 1px solid var(--hair); border-radius: 9px; background: var(--card); color: var(--ink); font: inherit; font-weight: 650; text-align: left; cursor: pointer; }
.kb-choice button[aria-current="true"] { border-color: var(--ink); }
.kb-choice button:hover, .kb-choice button:focus-visible { border-color: rgba(var(--w), .4); outline: none; }
.kb-people { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.kb-people li { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 8px 0; border-top: 1px solid var(--hair); }
.kb-people li:first-child { border-top: 0; }
.kb-people .kb-person { min-width: 0; overflow-wrap: anywhere; font-size: .9rem; }
.kb-people .kb-person small { display: block; color: var(--muted); font-size: .78rem; }
.kb-people .kb-person .is-error { color: var(--kb-red); font-weight: 600; }
.kb-people select { width: auto; height: 38px; font-size: .86rem; }
.kb-people .kb-btn-row { justify-content: flex-end; }

/* Notification en bas d'écran, avec « Annuler » */
.kb-toast { position: fixed; z-index: 1100; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom)); transform: translateX(-50%); display: flex; gap: 12px; align-items: center; width: max-content; max-width: min(560px, calc(100% - 24px)); padding: 10px 10px 10px 16px; border: 1px solid var(--hair); border-radius: 10px; background: var(--ink); color: var(--card); font-size: .9rem; font-weight: 600; box-shadow: 0 18px 50px rgba(0, 0, 0, .4); }
.kb-toast.is-error { background: var(--card); color: var(--ink); border-left: 3px solid var(--kb-red); }
.kb-toast button { min-height: 36px; padding: 0 12px; border: 1px solid currentColor; border-radius: 7px; background: transparent; color: inherit; font: inherit; font-weight: 700; cursor: pointer; white-space: nowrap; }

.kb-archived-banner { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; }
.kb-help { color: var(--muted); font-size: .78rem; line-height: 1.5; }
.kb-help kbd { padding: 1px 5px; border: 1px solid var(--hair); border-radius: 4px; font: inherit; font-size: .74rem; color: var(--soft); }

/* Garde-fou : toute icône sans taille dédiée reste à la taille du texte
   (spécificité nulle, les règles ci-dessus l'emportent). */
:where(#kb-root, .kb-panel, .kb-toast, .kb-menu) svg { width: 1.1em; height: 1.1em; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; vertical-align: -.2em; flex: 0 0 auto; }
