:root {
  --bg: #eef0f4;
  --surface: #ffffff;
  --surface-2: #f6f7fa;
  --ink: #14213d;
  --ink-2: #4a5570;
  --ink-3: #8a93a8;
  --line: #dde1ea;
  --brand: #14213d;
  --accent: #fca311;
  --accent-ink: #1b1300;
  --vp: #3557d6;
  --vp-bg: #e7ecff;
  --cqi: #0e8a7e;
  --cqi-bg: #ddf4f1;
  --doc: #7445d6;
  --doc-bg: #efe8ff;
  --visite: #c25a00;
  --visite-bg: #ffecd9;
  --k-tache: #c3cad9; --k-doc: #b38cff; --k-visite: #ffa24d; --k-VP: #7d97ff; --k-CQI: #34c9b9;
  --late: #c8341f;
  --late-bg: #fde9e5;
  --today: #b45f00;
  --today-bg: #fff1d9;
  --ok: #1d7a46;
  --shadow: 0 1px 2px rgba(20, 33, 61, .06), 0 2px 8px rgba(20, 33, 61, .06);
  --shadow-lg: 0 10px 40px rgba(20, 33, 61, .22);
  --r: 12px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}
:root[data-theme="dark"] {
    --bg: #0d1424; --surface: #172036; --surface-2: #1d2742; --ink: #e8ecf5; --ink-2: #b2bad0; --ink-3: #7a84a0;
    --line: #2a3553; --brand: #0d1424; --vp: #8ea6ff; --vp-bg: #22305e; --cqi: #4fd1c1; --cqi-bg: #123c3a;
    --doc: #c4a6ff; --doc-bg: #34245e; --visite: #ffb36b; --visite-bg: #4a2c10;
    --late: #ff8a73; --late-bg: #4a1e18; --today: #ffbf5e; --today-bg: #46310f; --ok: #5bd08e;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3); --shadow-lg: 0 10px 40px rgba(0, 0, 0, .5);
    color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d1424; --surface: #172036; --surface-2: #1d2742; --ink: #e8ecf5; --ink-2: #b2bad0; --ink-3: #7a84a0;
    --line: #2a3553; --brand: #0d1424; --vp: #8ea6ff; --vp-bg: #22305e; --cqi: #4fd1c1; --cqi-bg: #123c3a;
    --doc: #c4a6ff; --doc-bg: #34245e; --visite: #ffb36b; --visite-bg: #4a2c10;
    --late: #ff8a73; --late-bg: #4a1e18; --today: #ffbf5e; --today-bg: #46310f; --ok: #5bd08e;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3); --shadow-lg: 0 10px 40px rgba(0, 0, 0, .5);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--ink); -webkit-font-smoothing: antialiased; display: flex; flex-direction: column; overflow: hidden; }
button { font: inherit; color: inherit; cursor: pointer; }
input, textarea, select { font: inherit; color: inherit; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
[hidden] { display: none !important; }

/* ---------- barre du haut ---------- */
.topbar {
  background: var(--brand); color: #fff; display: flex; align-items: center; justify-content: space-between;
  padding: calc(10px + env(safe-area-inset-top, 0px)) 16px 10px; gap: 12px;
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.logo { width: 28px; height: 28px; stroke: none; fill: var(--accent); }
.logo rect:nth-child(2) { opacity: .75; } .logo rect:nth-child(3) { opacity: .5; }
h1 { font-size: 17px; margin: 0; letter-spacing: -.01em; font-weight: 700; }
h1 span { color: var(--accent); font-weight: 800; }
.today-date { margin: 1px 0 0; font-size: 12px; opacity: .7; text-transform: capitalize; }
.top-actions { display: flex; gap: 4px; }
.icon-btn { background: transparent; border: 0; width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; color: #fff; }
.icon-btn:hover { background: rgba(255, 255, 255, .1); }
.icon-btn.spin svg { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- ajout rapide ---------- */
.composer-wrap { background: var(--brand); padding: 0 16px 14px; display: flex; gap: 20px; align-items: flex-start; }
.composer-col { flex: 1; min-width: 0; max-width: 820px; }
.composer { display: flex; gap: 8px; background: var(--surface); border-radius: 14px; padding: 6px; box-shadow: var(--shadow); max-width: 820px; }
.composer input { flex: 1; min-width: 0; border: 0; background: transparent; outline: none; padding: 8px 10px; font-size: 16px; }
.composer input::placeholder { color: var(--ink-3); }
.composer .mic, .composer .add { border: 0; width: 42px; height: 42px; border-radius: 10px; display: grid; place-items: center; }
.composer .mic { background: var(--surface-2); color: var(--ink-2); }
.composer .mic.rec { background: var(--late); color: #fff; animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px rgba(200, 52, 31, .25); } }
.composer .add { background: var(--accent); color: var(--accent-ink); }
.composer .add svg { stroke-width: 2.6; }
.preview { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; min-height: 0; max-width: 820px; }
.preview:empty { display: none; }
.listening { display: flex; align-items: center; gap: 10px; margin-top: 10px; color: #fff; font-size: 14px; }
.wave { display: inline-flex; gap: 3px; align-items: center; height: 18px; }
.wave i { width: 3px; height: 6px; background: var(--accent); border-radius: 2px; animation: wave 0.9s ease-in-out infinite; }
.wave i:nth-child(2) { animation-delay: .15s; } .wave i:nth-child(3) { animation-delay: .3s; } .wave i:nth-child(4) { animation-delay: .45s; }
@keyframes wave { 50% { height: 18px; } }

/* ---------- radar « ma quinzaine » ---------- */
.radar { flex: none; width: 760px; background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .1); border-radius: 18px; padding: 12px; color: #fff; display: grid; grid-template-columns: 1fr 250px; gap: 14px; }
.r-main { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.r-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.r-stat { display: flex; align-items: center; gap: 10px; background: rgba(255, 255, 255, .07); border: 0; color: #fff; padding: 8px 12px; border-radius: 12px; text-align: left; min-width: 0; }
.r-stat:hover { background: rgba(255, 255, 255, .12); }
.r-stat b { font-size: 28px; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.r-stat span { font-size: 12px; line-height: 1.2; opacity: .8; }
.r-stat.late { background: rgba(255, 90, 61, .2); } .r-stat.late b { color: #ff8a73; }
.r-stat.today { background: rgba(252, 163, 17, .18); } .r-stat.today b { color: var(--accent); }
.r-stat.zero { background: rgba(255, 255, 255, .05); } .r-stat.zero b { color: #fff; opacity: .35; }
.r-chart { display: flex; align-items: stretch; gap: 3px; min-width: 0; }
.r-day { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 3px; background: none; border: 0; color: #fff; padding: 4px 1px 2px; border-radius: 8px; cursor: pointer; }
.r-day.we { flex-grow: .55; }
.r-day:hover { background: rgba(255, 255, 255, .08); }
.r-day.sel { background: rgba(255, 255, 255, .16); }
.r-day.is-today { background: rgba(252, 163, 17, .13); }
.r-stack { display: flex; flex-direction: column-reverse; gap: 2px; height: 64px; width: 100%; align-items: center; justify-content: flex-start; border-bottom: 1px solid rgba(255, 255, 255, .18); padding-bottom: 2px; }
.r-sq { width: min(100%, 24px); height: 9px; border-radius: 3px; background: var(--k-tache); flex: none; }
.r-sq.doc { background: var(--k-doc); } .r-sq.visite { background: var(--k-visite); } .r-sq.VP { background: var(--k-VP); } .r-sq.CQI { background: var(--k-CQI); }
.r-sq.prio { box-shadow: 0 0 0 1.5px #ff5a3d; }
.r-sq.wait { opacity: .4; }
.r-more { font-size: 10px; font-weight: 800; line-height: 9px; }
.r-lbl { font-size: 9.5px; line-height: 1.1; text-align: center; opacity: .6; text-transform: uppercase; }
.r-lbl b { display: block; font-size: 12px; text-transform: none; }
.r-day.we .r-lbl { opacity: .3; }
.r-day.is-today .r-lbl { opacity: 1; color: var(--accent); }
.r-day.late-col { flex-grow: .8; }
.r-day.late-col .r-lbl { color: #ff8a73; opacity: 1; }
.r-sep { width: 1px; background: rgba(255, 255, 255, .14); margin: 6px 2px 4px; flex: none; }
.r-focus { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.r-focus h4 { margin: 0 0 1px; font-size: 11px; text-transform: uppercase; letter-spacing: .07em; opacity: .65; font-weight: 700; background: none; border: 0; color: #fff; padding: 0; text-align: left; }
.r-item { display: flex; gap: 8px; align-items: flex-start; background: rgba(255, 255, 255, .07); border: 0; color: #fff; border-radius: 10px; padding: 6px 9px; text-align: left; min-width: 0; width: 100%; }
.r-item:hover { background: rgba(255, 255, 255, .14); }
.r-item .rank { font-size: 11px; font-weight: 800; color: var(--accent); width: 12px; flex: none; margin-top: 1px; }
.r-item i { width: 4px; align-self: stretch; border-radius: 2px; flex: none; background: var(--k-tache); }
.r-item i.doc { background: var(--k-doc); } .r-item i.visite { background: var(--k-visite); } .r-item i.VP { background: var(--k-VP); } .r-item i.CQI { background: var(--k-CQI); }
.r-item div { min-width: 0; flex: 1; }
.r-item b { display: block; font-size: 12.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.r-item small { display: block; font-size: 11px; opacity: .7; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.r-item small.late { color: #ff9b8a; opacity: 1; }
.r-empty { font-size: 12.5px; opacity: .6; padding: 6px 0; }
.r-legend { display: flex; gap: 10px; font-size: 10.5px; opacity: .65; flex-wrap: wrap; }
.r-legend span { display: inline-flex; align-items: center; gap: 4px; }
.r-legend .r-sq { width: 9px; height: 9px; }

/* ---------- le point du jour (sous la saisie) ---------- */
.brief { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; margin-top: 12px; }
.brief:empty { display: none; }
.b-item { background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .08); color: #fff; border-radius: 12px; padding: 9px 12px; text-align: left; min-width: 0; }
.b-item:hover { background: rgba(255, 255, 255, .11); }
.b-item small { display: flex; align-items: center; gap: 6px; font-size: 10.5px; text-transform: uppercase; letter-spacing: .07em; opacity: .65; font-weight: 700; }
.b-item small i { width: 8px; height: 8px; border-radius: 2px; background: var(--dotc, #fff); }
.b-item b { display: block; font-size: 13.5px; font-weight: 600; margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.b-item span { display: block; font-size: 12px; opacity: .7; margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.preview:not(:empty) ~ .brief, .listening:not([hidden]) ~ .brief { display: none; }
@media (max-width: 1360px) {
  .composer-wrap { flex-direction: column; gap: 12px; }
  .composer-col { width: 100%; }
  .radar { width: 100%; max-width: 980px; }
}
.pv { font-size: 12.5px; padding: 3px 9px; border-radius: 99px; background: rgba(255, 255, 255, .12); color: #fff; display: inline-flex; align-items: center; gap: 5px; }
.pv b { font-weight: 600; }
.pv svg { width: 13px; height: 13px; }
.pv.prio { background: var(--late); }
.pv.title { background: transparent; padding-left: 0; opacity: .85; }

/* ---------- filtres ---------- */
.filters { display: flex; align-items: center; gap: 10px; padding: 10px 16px 6px; justify-content: space-between; flex-wrap: wrap; }
.chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 0 16px; }
.chips::-webkit-scrollbar { display: none; }
.chip { border: 1px solid var(--line); background: var(--surface); border-radius: 99px; padding: 5px 12px; font-size: 13.5px; white-space: nowrap; color: var(--ink-2); }
.chip.on { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.chip.kind-VP.on { background: var(--vp); border-color: var(--vp); color: #fff; }
.chip.kind-CQI.on { background: var(--cqi); border-color: var(--cqi); color: #fff; }
.chip.kind-doc.on { background: var(--doc); border-color: var(--doc); color: #fff; }
.chip.kind-visite.on { background: var(--visite); border-color: var(--visite); color: #fff; }
.day-chip { display: inline-flex; align-items: center; gap: 6px; }
.day-chip svg { width: 13px; height: 13px; }
.chip.warn.on { background: var(--late); border-color: var(--late); color: #fff; }
.filter-right { display: flex; gap: 6px; align-items: center; }
#search { border: 1px solid var(--line); background: var(--surface); border-radius: 10px; padding: 6px 10px; font-size: 14px; width: 170px; outline: none; }
#search:focus { border-color: var(--vp); }
.sort { border: 1px solid var(--line); background: var(--surface); border-radius: 10px; padding: 6px 10px; font-size: 13px; color: var(--ink-2); white-space: nowrap; }

/* ---------- onglets colonnes (mobile) ---------- */
.coltabs { display: none; }

/* ---------- tableau ---------- */
.board { flex: 1; display: grid; grid-template-columns: repeat(var(--ncols, 4), minmax(240px, 1fr)); gap: 14px; padding: 8px 16px calc(16px + var(--safe-b)); overflow: auto; min-height: 0; }
.column { background: var(--surface-2); border: 1px solid var(--line); border-radius: 16px; display: flex; flex-direction: column; min-height: 0; max-height: 100%; }
.col-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px 8px; }
.col-head h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; margin: 0; color: var(--ink-2); display: flex; align-items: center; gap: 8px; }
.col-head h2::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--dot, var(--ink-3)); }
.col-head .count { margin-left: auto; }
.col-menu { border: 0; background: transparent; color: var(--ink-3); width: 26px; height: 22px; border-radius: 6px; font-size: 16px; line-height: 1; margin-left: 4px; opacity: 0; transition: opacity .15s; }
.column:hover .col-menu { opacity: 1; }
.col-menu:hover { background: var(--line); color: var(--ink); }
.count { font-size: 12px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.cards { list-style: none; margin: 0; padding: 2px 10px 12px; display: flex; flex-direction: column; gap: 8px; overflow-y: auto; flex: 1; min-height: 60px; }
.empty { font-size: 13px; color: var(--ink-3); text-align: center; padding: 18px 8px; border: 1.5px dashed var(--line); border-radius: 12px; }

.card { background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow); padding: 10px 12px; border: 1px solid transparent; cursor: pointer; position: relative; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.card:hover { border-color: var(--line); }
.card.prio { box-shadow: inset 3px 0 0 var(--late), var(--shadow); }
.card.is-done .c-title { color: var(--ink-3); text-decoration: line-through; text-decoration-color: var(--line); }
.c-top { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-bottom: 4px; }
.badge { font-size: 11px; font-weight: 700; letter-spacing: .03em; padding: 2px 7px; border-radius: 6px; }
.badge.VP { color: var(--vp); background: var(--vp-bg); }
.badge.CQI { color: var(--cqi); background: var(--cqi-bg); }
.badge.doc { color: var(--doc); background: var(--doc-bg); }
.badge.visite { color: var(--visite); background: var(--visite-bg); }
.badge.removed { color: var(--late); background: var(--late-bg); font-weight: 600; letter-spacing: 0; }
.client { font-size: 12px; color: var(--ink-2); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.c-title { font-size: 14.5px; line-height: 1.35; font-weight: 500; word-break: break-word; }
.c-meta { display: flex; gap: 10px; align-items: center; margin-top: 7px; font-size: 12px; color: var(--ink-3); flex-wrap: wrap; }
.c-meta span { display: inline-flex; align-items: center; gap: 4px; }
.c-meta svg { width: 13px; height: 13px; }
.due.late { color: var(--late); font-weight: 600; }
.due.today { color: var(--today); font-weight: 600; }
.prog { display: inline-flex; align-items: center; gap: 6px; }
.bar { width: 42px; height: 5px; border-radius: 99px; background: var(--line); overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--ok); border-radius: 99px; }
.src-agenda svg { color: var(--vp); }

.next-step { display: flex; align-items: center; gap: 8px; margin-top: 8px; padding: 6px 8px; border-radius: 9px; background: var(--surface-2); font-size: 13px; color: var(--ink-2); }
.next-step span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.next-step small { color: var(--ink-3); font-variant-numeric: tabular-nums; }
.tick { flex: none; width: 22px; height: 22px; border-radius: 7px; border: 2px solid var(--ink-3); background: var(--surface); display: grid; place-items: center; padding: 0; }
.tick svg { width: 13px; height: 13px; stroke-width: 3; opacity: 0; color: #fff; }
.tick:hover { border-color: var(--ok); }
.tick:hover svg { opacity: .5; color: var(--ok); }
.tick.done { background: var(--ok); border-color: var(--ok); }
.tick.done svg { opacity: 1; color: #fff; }

.sortable-ghost { opacity: .35; }
.sortable-chosen { box-shadow: var(--shadow-lg); transform: rotate(1deg); }
.sortable-drag { opacity: 1 !important; }

/* ---------- feuille (détail, réglages) ---------- */
.sheet-backdrop { position: fixed; inset: 0; background: rgba(8, 14, 28, .45); z-index: 40; animation: fade .15s; }
@keyframes fade { from { opacity: 0; } }
.sheet {
  position: fixed; z-index: 50; background: var(--surface); box-shadow: var(--shadow-lg); overflow-y: auto;
  left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 48px);
  border-radius: 18px; padding: 18px 20px 20px; animation: pop .18s ease-out; overflow-x: hidden;
}
@keyframes pop { from { opacity: 0; transform: translate(-50%, -48%); } }
.sheet-head { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 12px; }
.sheet-head .grab { display: none; }
.sheet-title { flex: 1; font-size: 19px; font-weight: 650; border: 0; background: transparent; outline: none; padding: 4px 0; resize: none; line-height: 1.3; width: 100%; }
.sheet h3 { font-size: 18px; margin: 4px 0 0; flex: 1; }
.close { border: 0; background: var(--surface-2); width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex: none; color: var(--ink-2); }
.btn.close { width: auto; height: auto; display: inline-block; background: var(--ink); color: var(--surface); }
.seg { display: grid; grid-template-columns: repeat(4, 1fr); background: var(--surface-2); padding: 3px; border-radius: 11px; gap: 2px; margin-bottom: 14px; }
.seg button { border: 0; background: transparent; padding: 7px 4px; border-radius: 8px; font-size: 13px; color: var(--ink-2); }
.seg button.on { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: var(--shadow); }
.seg.kinds { grid-template-columns: repeat(5, 1fr); margin: 0; }
.seg.kinds button { padding: 7px 2px; font-size: 12.5px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; }
.field.kind-field { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; min-width: 0; }
.field.full { grid-column: 1 / -1; }
.field > span { font-size: 12px; font-weight: 600; color: var(--ink-3); text-transform: uppercase; letter-spacing: .05em; }
.field input, .field textarea, .field select { border: 1px solid var(--line); background: var(--surface-2); border-radius: 10px; padding: 9px 11px; outline: none; width: 100%; font-size: 15px; }
.field input:focus, .field textarea:focus { border-color: var(--vp); background: var(--surface); }
.field textarea { resize: vertical; min-height: 80px; line-height: 1.45; }
.row { display: flex; gap: 8px; align-items: center; }
.toggle { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; padding: 9px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface-2); user-select: none; }
.toggle input { accent-color: var(--late); width: 17px; height: 17px; margin: 0; }
.checklist { list-style: none; padding: 0; margin: 0 0 6px; display: flex; flex-direction: column; gap: 2px; }
.checklist li { display: flex; align-items: center; gap: 10px; padding: 6px 4px; border-radius: 8px; }
.checklist li:hover { background: var(--surface-2); }
.checklist input[type=checkbox] { width: 20px; height: 20px; accent-color: var(--ok); margin: 0; flex: none; }
.checklist .ct { flex: 1; border: 0; background: transparent; outline: none; font-size: 15px; padding: 2px 0; min-width: 0; }
.checklist li.done .ct { color: var(--ink-3); text-decoration: line-through; }
.checklist .rm { border: 0; background: transparent; color: var(--ink-3); width: 28px; height: 28px; border-radius: 6px; display: grid; place-items: center; }
.checklist .rm svg { width: 15px; height: 15px; }
.add-step { border: 0; background: transparent; color: var(--vp); font-size: 14px; padding: 6px 4px; font-weight: 600; }
.info { font-size: 12.5px; color: var(--ink-3); line-height: 1.5; margin: 6px 0 0; }
.info.warn { color: var(--late); background: var(--late-bg); padding: 8px 10px; border-radius: 10px; }
.sheet-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 16px; gap: 10px; flex-wrap: wrap; }
.btn { border: 1px solid var(--line); background: var(--surface-2); border-radius: 10px; padding: 9px 14px; font-size: 14px; font-weight: 600; }
.btn.primary { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.btn.danger { color: var(--late); }
.btn.danger.armed { background: var(--late); color: #fff; border-color: var(--late); }
.saved { font-size: 12.5px; color: var(--ok); opacity: 0; transition: opacity .2s; }
.saved.show { opacity: 1; }
.section-title { font-size: 12px; font-weight: 700; color: var(--ink-3); text-transform: uppercase; letter-spacing: .06em; margin: 18px 0 8px; padding-top: 14px; border-top: 1px solid var(--line); }
.section-title:first-of-type { border-top: 0; padding-top: 0; margin-top: 4px; }
.copy { display: flex; gap: 6px; }
.copy input { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px !important; }
.arch-item { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.arch-item div { flex: 1; min-width: 0; }
.arch-item small { color: var(--ink-3); display: block; margin-top: 2px; }

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(20px + var(--safe-b)); z-index: 60;
  background: var(--ink); color: var(--surface); padding: 11px 14px 11px 16px; border-radius: 12px; box-shadow: var(--shadow-lg);
  display: flex; gap: 14px; align-items: center; font-size: 14px; max-width: calc(100vw - 32px); animation: up .2s ease-out;
}
@keyframes up { from { opacity: 0; transform: translate(-50%, 10px); } }
.toast button { border: 0; background: transparent; color: var(--accent); font-weight: 700; padding: 2px 4px; }

/* ---------- mobile ---------- */
@media (max-width: 760px) {
  .topbar { padding-left: 14px; padding-right: 8px; }
  .composer-wrap { padding: 0 12px 12px; gap: 10px; }
  .radar { grid-template-columns: 1fr; padding: 8px; gap: 8px; border-radius: 14px; }
  .r-stat { padding: 6px 8px; gap: 6px; border-radius: 10px; }
  .r-stat b { font-size: 21px; }
  .r-stat span { font-size: 10.5px; }
  .r-stack { height: 44px; }
  .r-sq { height: 7px; }
  .r-lbl { font-size: 8.5px; } .r-lbl b { font-size: 11px; }
  .r-focus.collapsed .r-item, .r-focus.collapsed .r-empty { display: none; }
  .r-focus h4 { cursor: pointer; padding: 2px 2px; }
  .r-legend, .brief { display: none; }
  .filters { padding: 10px 12px 4px; }
  .filter-right { width: 100%; }
  #search { flex: 1; width: auto; }
  .coltabs { display: grid; grid-template-columns: repeat(var(--ncols, 4), minmax(0, 1fr)); gap: 4px; padding: 6px 12px 4px; }
  .coltabs button { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border: 0; background: transparent; padding: 7px 2px 8px; font-size: 13px; color: var(--ink-3); border-bottom: 2.5px solid transparent; font-weight: 600; }
  .coltabs button b { display: inline-block; min-width: 20px; padding: 0 5px; border-radius: 99px; background: var(--line); color: var(--ink-2); font-size: 11.5px; margin-left: 3px; }
  .coltabs button.on { color: var(--ink); border-bottom-color: var(--accent); }
  .board { display: flex; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; gap: 10px; padding: 6px 12px calc(12px + var(--safe-b)); scrollbar-width: none; }
  .board::-webkit-scrollbar { display: none; }
  .column { flex: 0 0 calc(100vw - 36px); scroll-snap-align: center; background: transparent; border: 0; }
  .col-head { display: none; }
  .cards { padding: 4px 2px 80px; }
  .sheet { left: 0; right: 0; top: auto; bottom: 0; transform: none; width: 100%; max-height: 92vh; border-radius: 20px 20px 0 0; padding: 8px 16px calc(20px + var(--safe-b)); animation: slide .22s ease-out; }
  @keyframes slide { from { transform: translateY(40%); opacity: 0; } }
  .sheet-head .grab { display: block; position: absolute; left: 50%; top: 7px; width: 40px; height: 4px; margin-left: -20px; background: var(--line); border-radius: 99px; }
  .sheet-head { padding-top: 12px; }
  .grid2 { grid-template-columns: 1fr 1fr; }
}

/* ---------- mode dictée plein écran ---------- */
.voice-overlay { position: fixed; inset: 0; z-index: 70; background: var(--brand); color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; padding: 32px 24px calc(32px + var(--safe-b)); text-align: center; animation: fade .15s; }
.vo-close { position: absolute; top: calc(14px + env(safe-area-inset-top, 0px)); right: 14px; width: 44px; height: 44px; border-radius: 12px; border: 0; background: rgba(255, 255, 255, .1); color: #fff; display: grid; place-items: center; }
.vo-mic { width: 148px; height: 148px; border-radius: 50%; border: 0; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; box-shadow: 0 0 0 12px rgba(252, 163, 17, .15); }
.vo-mic svg { width: 60px; height: 60px; stroke-width: 1.8; }
.vo-mic.rec { background: var(--late); color: #fff; animation: pulse-big 1.2s ease-in-out infinite; }
@keyframes pulse-big { 50% { box-shadow: 0 0 0 26px rgba(200, 52, 31, .22); } }
.vo-text { font-size: 22px; font-weight: 600; line-height: 1.35; max-width: 560px; margin: 0; min-height: 60px; }
.vo-hint { font-size: 14px; opacity: .6; max-width: 420px; margin: 0; line-height: 1.5; }

/* ---------- gestion des colonnes ---------- */
.col-row { display: grid; grid-template-columns: 26px 34px minmax(0, 1fr) 170px 32px; gap: 8px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.col-row .mv { display: flex; flex-direction: column; gap: 2px; }
.col-row .mv button { border: 0; background: var(--surface-2); border-radius: 5px; width: 26px; height: 18px; font-size: 10px; line-height: 1; color: var(--ink-2); padding: 0; }
.col-row .mv button:disabled { opacity: .3; }
.col-row input[type=color] { width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 9px; padding: 2px; background: var(--surface-2); }
.col-row input[type=text], .col-row select { border: 1px solid var(--line); background: var(--surface-2); border-radius: 9px; padding: 8px 10px; font-size: 14.5px; width: 100%; min-width: 0; outline: none; }
.col-row .del { border: 0; background: transparent; color: var(--ink-3); width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; }
.col-row .del:hover { background: var(--late-bg); color: var(--late); }
.col-row .del:disabled { opacity: .25; }
@media (max-width: 760px) {
  .col-row { grid-template-columns: 26px 34px 1fr 32px; }
  .col-row select { grid-column: 3 / 5; }
  .col-menu { opacity: 1; }
}

/* ---------- couleurs de carte ---------- */
.card.has-color { border-top: 4px solid var(--cc); padding-top: 8px; }
.card.has-color .c-title { color: var(--cc); font-weight: 650; }
.card.has-color.is-done .c-title { color: var(--ink-3); }
:root[data-theme="dark"] .card.has-color .c-title { color: color-mix(in srgb, var(--cc) 60%, white); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .card.has-color .c-title { color: color-mix(in srgb, var(--cc) 60%, white); } }
.swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.sw { width: 28px; height: 28px; border-radius: 50%; border: 2px solid transparent; background: var(--sw); padding: 0; box-shadow: inset 0 0 0 2px var(--surface); outline: 1px solid var(--line); }
.sw.none { background: repeating-linear-gradient(45deg, var(--surface-2) 0 4px, var(--line) 4px 6px); }
.sw.on { border-color: var(--ink); outline-color: var(--ink); }

/* ---------- aperçu « carte simulée » ---------- */
.preview { flex-direction: column; align-items: flex-start; gap: 6px; }
.pv-label { font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: rgba(255, 255, 255, .6); font-weight: 700; display: flex; gap: 10px; }
.pv-label span { text-transform: none; letter-spacing: 0; font-weight: 500; opacity: .8; }
.pv-card { list-style: none; margin: 0; padding: 0; width: min(380px, 100%); }
.pv-card .card { cursor: pointer; box-shadow: 0 6px 24px rgba(0, 0, 0, .25); }
.pv-card .tick { pointer-events: none; }
.pv-more { border: 0; background: none; color: var(--accent); font-size: 13px; font-weight: 600; padding: 2px 0; }
.pv-more:hover { text-decoration: underline; }
.cmp-preview { background: var(--bg); border-radius: 14px; padding: 14px; margin-bottom: 14px; display: flex; justify-content: center; }
.cmp-preview .pv-card { width: min(340px, 100%); }
.cmp-preview .card { cursor: default; }
.checklist input[type=checkbox]:disabled { opacity: .35; }

/* pas de débordement horizontal dans les fiches (champs date/heure, segments) */
.grid2 > * { min-width: 0; }
.field input, .field select, .field textarea { min-width: 0; max-width: 100%; }
.seg.kinds { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.seg button { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 760px) { .seg.kinds button { font-size: 12px; padding: 7px 1px; } }

.sort { display: inline-flex; align-items: center; gap: 6px; }
.sort .ic { width: 15px; height: 15px; }
@media (max-width: 760px) {
  .filter-right { flex-wrap: nowrap; }
  .chips { margin: 0 -12px; padding: 0 12px; }
  #search { min-width: 0; }
  .sort .lg { display: none; }
  .sort { padding: 6px 9px; }
}

/* ---------- types personnalisables ---------- */
.badge.k { color: var(--kc); background: color-mix(in srgb, var(--kc) 14%, transparent); }
:root[data-theme="dark"] .badge.k { color: color-mix(in srgb, var(--kc) 55%, white); background: color-mix(in srgb, var(--kc) 30%, transparent); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .badge.k { color: color-mix(in srgb, var(--kc) 55%, white); background: color-mix(in srgb, var(--kc) 30%, transparent); } }
.chip.kchip.on { background: var(--kc); border-color: var(--kc); color: #fff; }
.chip.add-kind { border-style: dashed; color: var(--ink-3); }
.seg.kinds { display: flex; flex-wrap: wrap; }
.seg.kinds button { flex: 1 0 auto; }
.seg.kinds button.on { box-shadow: inset 0 -3px 0 var(--kc), var(--shadow); }

/* ---------- étapes en phases ---------- */
.ns-txt { display: flex; flex-direction: column; min-width: 0; }
.ns-txt em { font-style: normal; font-size: 10.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.next-step .ns-txt { flex: 1; overflow: hidden; }
.next-step .ns-txt { white-space: nowrap; text-overflow: ellipsis; }
.phases { display: flex; gap: 3px; margin-top: 6px; }
.phases i { flex: 1; height: 5px; border-radius: 99px; background: var(--line); position: relative; overflow: hidden; }
.phases i::before { content: ""; position: absolute; inset: 0; width: var(--p); background: var(--ok); border-radius: 99px; }
.phases i.cur { outline: 1.5px solid var(--accent); outline-offset: 1px; }
.checklist .cl-sec { display: flex; align-items: center; gap: 8px; padding: 12px 4px 4px; margin-top: 4px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-2); border-bottom: 1px solid var(--line); border-radius: 0; }
.checklist .cl-sec:hover { background: none; }
.checklist .cl-sec:first-child { margin-top: 0; padding-top: 2px; }
.checklist .cl-sec span { flex: 1; }
.checklist .cl-sec small { color: var(--ink-3); font-weight: 600; }
.checklist .add-in { border: 0; background: var(--surface-2); color: var(--vp); width: 24px; height: 24px; border-radius: 7px; font-size: 16px; line-height: 1; padding: 0; }
.checklist li.in-sec { padding-left: 10px; }

/* ---------- gestionnaire de types ---------- */
.kind-row { border-bottom: 1px solid var(--line); padding: 8px 0; }
.kr-head { display: flex; align-items: center; gap: 8px; }
.kr-head .mv { display: flex; flex-direction: column; gap: 2px; width: 26px; flex: none; }
.kr-head .mv button { border: 0; background: var(--surface-2); border-radius: 5px; width: 26px; height: 18px; font-size: 10px; line-height: 1; color: var(--ink-2); padding: 0; }
.kr-head .mv button:disabled { opacity: .3; }
.kr-head input[type=color] { width: 32px; height: 32px; border: 1px solid var(--line); border-radius: 9px; padding: 2px; background: var(--surface-2); flex: none; }
.kr-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; }
.kr-sum { color: var(--ink-3); font-size: 12px; white-space: nowrap; }
.kr-edit { padding: 6px 10px; font-size: 13px; }
.kr-body { padding: 12px 0 4px 34px; }
.kr-body textarea { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px !important; line-height: 1.5; }
.btn.danger.armed { background: var(--late); color: #fff; border-color: var(--late); }
@media (max-width: 760px) { .kr-sum { display: none; } .kr-body { padding-left: 0; } }
.column, .cards, .card, .next-step { min-width: 0; }
@media (max-width: 760px) { .column { width: calc(100vw - 36px); max-width: calc(100vw - 36px); } }

/* lien vers Outils ASCND */
a.go { flex: none; display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 7px; background: color-mix(in srgb, #0E7C7B 14%, transparent); color: #0E7C7B; font-weight: 800; text-decoration: none; font-size: 14px; }
a.go:hover { background: #0E7C7B; color: #fff; }
:root[data-theme="dark"] a.go { color: #4fd1c1; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) a.go { color: #4fd1c1; } }
