/* Horizon Insertion — design system */
:root {
  --bg: #f5f6fa;
  --card: #ffffff;
  --line: #e6e8ef;
  --line-strong: #d4d9e5;
  --ink: #0b1224;
  --muted: #6b7690;
  --brand: #3b46d6;
  --brand-dark: #1e2470;
  --sidebar: #0a1122;
  --ok: #0e9f6e;
  --warn: #d97706;
  --danger: #e11d48;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.05), 0 1px 3px rgba(16, 24, 40, 0.07);
  --shadow-lg: 0 18px 40px -12px rgba(15, 23, 42, 0.28);
}

* { -webkit-tap-highlight-color: transparent; }
html { scroll-behavior: smooth; }
body { font-family: Inter, "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif; }
::selection { background: var(--surface-2); color: #1e2470; }

/* --------------------------------------------------------------- layout */
.sidebar {
  width: 252px;
  flex: 0 0 252px;
  background: linear-gradient(180deg, #0c1427 0%, #0a1122 55%, #0a0f1d 100%);
  color: #dfe4f2;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  z-index: 30;
}
.main-col { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--card);
  border-bottom: 1px solid var(--line);
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 64px;
}
.view { flex: 1 1 auto; padding: 22px 24px 56px; max-width: 1560px; width: 100%; margin: 0 auto; }
.view:focus { outline: none; }

/* --------------------------------------------------------- notifications */
.notif-wrap { position: relative; flex: none; }
.notif-btn { position: relative; }
.notif-btn[aria-expanded="true"] { background: var(--surface-2); color: var(--ink); }
.notif-count {
  position: absolute; top: -4px; right: -4px; min-width: 17px; height: 17px;
  padding: 0 4px; border-radius: 99px; display: grid; place-items: center;
  background: #4f5ce8; color: #fff; font-size: 11px; font-weight: 800;
  line-height: 1; border: 2px solid var(--card); box-shadow: 0 1px 4px rgba(15, 23, 42, 0.22);
}
.notif-count.late { background: #e11d48; }
.notif-count.today { background: #d97706; }
.notif-count.soon { background: #4f5ce8; }
.notif-panel {
  position: absolute; right: 0; top: calc(100% + 10px); z-index: 60;
  width: min(400px, calc(100vw - 24px)); background: var(--card);
  border: 1px solid var(--line); border-radius: 14px; overflow: hidden;
  box-shadow: var(--shadow-lg); text-align: left;
}
.notif-panel[hidden] { display: none; }
.notif-panel:focus { outline: none; }
.notif-head { display: flex; align-items: flex-start; gap: 10px; padding: 13px 14px 11px; border-bottom: 1px solid var(--line); }
.notif-title { font-size: 13px; font-weight: 700; color: var(--ink); letter-spacing: -0.01em; }
.notif-sub { font-size: 11px; color: var(--t-ink-400); margin-top: 2px; line-height: 1.35; }
.notif-close { margin-left: auto; flex: none; width: 28px; height: 28px; }
.notif-close svg { width: 14px; height: 14px; }
.notif-list { max-height: min(58vh, 460px); overflow-y: auto; overscroll-behavior: contain; }
.notif-group-head {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 9px 14px 3px; font-size: 11px; font-weight: 800;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--t-ink-400);
}
.notif-group-head b { font-size: 11px; font-weight: 800; color: var(--ink-2); }
.notif-group-head.late { color: var(--danger); }
.notif-group-head.today { color: var(--warn); }
.notif-group-head.soon { color: var(--brand); }
.notif-row { display: flex; align-items: stretch; border-top: 1px solid var(--line); }
.notif-row:first-of-type { border-top: 0; }
.notif-main { display: flex; gap: 9px; align-items: flex-start; flex: 1; min-width: 0; padding: 8px 6px 8px 14px; }
.notif-main:hover { background: var(--surface); }
.notif-when {
  flex: none; width: 43px; padding-top: 1px; font-size: 11px; font-weight: 800;
  font-variant-numeric: tabular-nums; color: var(--t-ink-500);
}
.notif-when.late { color: var(--danger); }
.notif-when.today { color: var(--warn); }
.notif-when.soon { color: var(--brand); }
.notif-copy { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.notif-row-title { font-size: 12px; font-weight: 600; color: var(--ink); line-height: 1.3; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.notif-row-meta { font-size: 11px; color: var(--t-ink-400); line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.notif-done {
  flex: none; width: 30px; margin: 7px 9px 7px 0; border: 1px solid var(--line);
  border-radius: 8px; display: grid; place-items: center; background: var(--card);
  color: #64748b; transition: background 0.14s, color 0.14s, border-color 0.14s;
}
.notif-done:hover { background: var(--ok-soft); color: var(--ok); border-color: #a7f3d0; }
.notif-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 9px 14px; border-top: 1px solid var(--line); background: var(--surface);
  font-size: 11px; color: var(--t-ink-400);
}
.notif-foot .link { font-weight: 600; color: var(--brand); white-space: nowrap; }
.notif-empty { padding: 24px 18px; text-align: center; }
.notif-empty-ico { width: 26px; height: 26px; color: var(--ok); margin: 0 auto 6px; display: block; }
.notif-empty-title { font-size: 12px; font-weight: 700; color: var(--ink); }
.notif-empty-text { font-size: 11px; color: var(--t-ink-400); margin-top: 3px; line-height: 1.4; }

@media (max-width: 640px) {
  .notif-panel { position: fixed; left: 10px; right: 10px; top: 62px; width: auto; max-height: calc(100vh - 74px); }
  .notif-list { max-height: calc(100vh - 190px); }
}


@media (max-width: 1023px) {
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    transform: translateX(-100%);
    transition: transform 0.22s ease;
    box-shadow: var(--shadow-lg);
  }
  .sidebar.open { transform: translateX(0); }
  .view { padding: 16px 16px 48px;
  padding-bottom: 100px;}
  .topbar { padding: 10px 14px; gap: 10px; }
  .scrim {
    position: fixed;
    inset: 0;
    background: rgba(9, 14, 28, 0.45);
    z-index: 25;
  }
}

/* -------------------------------------------------------------- sidebar */
.brand { display: flex; gap: 11px; align-items: center; padding: 18px 18px 14px; }
.brand-mark {
  width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center;
  background: linear-gradient(140deg, #4f5ce8, #7c5cf0 55%, #e11d48 140%);
  color: #fff; font-weight: 800; font-size: 15px; letter-spacing: -0.5px;
  box-shadow: 0 6px 16px -6px rgba(79, 92, 232, 0.9);
  flex: none;
}
.brand-title { font-size: 14px; font-weight: 700; color: #fff; letter-spacing: -0.2px; line-height: 1.15; }
.brand-sub { font-size: 11px; color: #8e9ab8; letter-spacing: 0.06em; text-transform: uppercase; margin-top: 3px; }

.nav-section { padding: 0 10px; }
.nav-label {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.12em; color: #6b7897;
  padding: 16px 10px 7px; font-weight: 600;
}
.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 9px;
  color: #b9c3d8; font-size: 13px; font-weight: 500; margin-bottom: 2px;
  transition: background 0.14s, color 0.14s; position: relative;
}
.nav-item:hover { background: rgba(255, 255, 255, 0.06); color: #fff; }
.nav-item.active { background: rgba(79, 92, 232, 0.18); color: #fff; }
.nav-item.active::before {
  content: ""; position: absolute; left: -10px; top: 8px; bottom: 8px; width: 3px;
  border-radius: 0 3px 3px 0; background: #7c8cff;
}
.nav-item svg { width: 17px; height: 17px; opacity: 0.85; flex: none; }
.nav-item.active svg { opacity: 1; }
.nav-count {
  margin-left: auto; font-size: 12px; font-weight: 600; padding: 1px 7px; border-radius: 20px;
  background: rgba(255, 255, 255, 0.1); color: #d6dcec; min-width: 22px; text-align: center;
}
.nav-count.alert { background: rgba(225, 29, 72, 0.9); color: #fff; }
.sidebar-foot { margin-top: auto; padding: 14px 16px 16px; border-top: 1px solid rgba(255, 255, 255, 0.07); }
.sidebar-foot .src { font-size: 12px; color: #8d99b6; line-height: 1.5; }
.sidebar-foot .src strong { color: #cdd5e8; font-weight: 600; }
.save-pill { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; color: #9aa6c2; margin-top: 8px; }
.save-dot { width: 6px; height: 6px; border-radius: 50%; background: #34d399; box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.12); }
.save-dot.saving { background: #fbbf24; }
.save-dot.error { background: #f43f5e; }

/* --------------------------------------------------------------- cards */
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card-pad { padding: 18px 18px; }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 16px 18px 0; }
.card-title { font-size: 14px; font-weight: 650; color: var(--ink); letter-spacing: -0.1px; display: flex; align-items: center; gap: 7px; }
.card-sub { font-size: 12px; color: var(--muted); margin-top: 3px; line-height: 1.45; }
.card-link { font-size: 12px; color: var(--brand); font-weight: 600; white-space: nowrap; }
.card-link:hover { text-decoration: underline; }

/* ------------------------------------------------------------- buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  font-size: 13px; font-weight: 600; border-radius: 9px; padding: 8px 13px;
  border: 1px solid var(--line-strong); background: var(--card); color: var(--t-ink-600);
  transition: all 0.14s ease; white-space: nowrap; cursor: pointer; line-height: 1.2;
}
.btn:hover { background: var(--surface); border-color: #c3cad9; }
.btn:active { transform: translateY(0.5px); }
.btn:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: 0 6px 14px -8px rgba(59, 70, 214, 0.9); }
.btn-primary:hover { background: #3038bd; border-color: #3038bd; }
.btn-dark { background: #111a30; border-color: #111a30; color: #fff; }
.btn-dark:hover { background: #1b2743; }
.btn-ghost { border-color: transparent; background: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: var(--surface); }
.btn-danger { color: var(--danger); border-color: #fecdd3; background: var(--danger-soft); }
.btn-danger:hover { background: var(--surface-2); }
.btn-sm { padding: 5px 9px; font-size: 12px; border-radius: 7px; gap: 5px; }
.btn-xs { padding: 3px 7px; font-size: 12px; border-radius: 6px; }
.btn-icon { padding: 7px; width: 34px; height: 34px; }
.btn[disabled] { opacity: 0.5; pointer-events: none; }
.btn svg { width: 15px; height: 15px; }
.btn-sm svg { width: 13px; height: 13px; }

/* -------------------------------------------------------------- badges */
.badge {
  display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600;
  padding: 2.5px 8px; border-radius: 20px; border: 1px solid transparent; white-space: nowrap; line-height: 1.35;
}
.badge .dot { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.badge-neutral { background: var(--surface); color: var(--t-ink-500); border-color: #e7eaf1; }
.badge-ok { background: var(--ok-soft); color: var(--ok); border-color: #c7f0dd; }
.badge-info { background: var(--info-soft); color: var(--info); border-color: #d8e6ff; }
.badge-warn { background: var(--warn-soft); color: var(--warn); border-color: #fde9b8; }
.badge-danger { background: var(--danger-soft); color: var(--danger); border-color: #fecdd3; }
.badge-ghost { background: var(--card); color: var(--t-ink-500); border-color: #e6e8ef; }

.chip {
  display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 600;
  padding: 2px 7px; border-radius: 6px; background: var(--surface); color: #4b5771; border: 1px solid #e9edf4;
  white-space: nowrap;
  max-width: 100%;}
.chip-clip { max-width: 124px; overflow: hidden; text-overflow: ellipsis; display: inline-block; line-height: 1.5; }
.chip-danger { background: var(--danger-soft); color: var(--danger); border-color: #fbd5dc; }
.chip-warn { background: var(--warn-soft); color: #a16207; border-color: #fcecc0; }
.chip-ok { background: var(--ok-soft); color: var(--ok); border-color: #c8f0dd; }
.chip-info { background: var(--surface); color: var(--info); border-color: #d9e5ff; }

/* -------------------------------------------------------------- inputs */
.field-label { display: block; font-size: 12px; font-weight: 600; color: var(--t-ink-500); margin-bottom: 5px; letter-spacing: 0.01em; }
.input, .select, .textarea {
  width: 100%; font-size: 13px; color: var(--ink); background: var(--card);
  border: 1px solid var(--line-strong); border-radius: 8px; padding: 7px 10px; line-height: 1.35;
  transition: border-color 0.14s, box-shadow 0.14s;
}
.input::placeholder, .textarea::placeholder { color: var(--muted-soft); }
.input:focus, .select:focus, .textarea:focus {
  outline: none; border-color: #8e97ef; box-shadow: 0 0 0 3px rgba(79, 92, 232, 0.13);
}
.select {
  appearance: none; padding-right: 28px; cursor: pointer;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%236b7690' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 9px center;
}
.textarea { resize: vertical; min-height: 76px; }

/* --------------------------------------------------------------- table */
.table-wrap { overflow: auto; border-radius: 0 0 var(--radius) var(--radius); }
table.data { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
table.data thead th {
  position: sticky; top: 0; z-index: 5; background: var(--card); text-align: left;
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); font-weight: 650;
  padding: 9px 12px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
table.data thead th.sortable { cursor: pointer; user-select: none; }
table.data thead th.sortable:hover { color: var(--brand); }
table.data tbody td { padding: 9px 12px; border-bottom: 1px solid #f0f2f7; vertical-align: middle; }
table.data tbody tr { background: var(--card); transition: background 0.1s; cursor: pointer; }
table.data tbody tr:hover { background: var(--card); }
table.data tbody tr:last-child td { border-bottom: none; }
table.data tbody tr.selected { background: var(--brand-soft); }
.td-strong { font-weight: 600; color: var(--t-ink-800); }
.td-muted { color: var(--t-ink-400); font-size: 12px; }

/* ------------------------------------------------------------ avatars */
.avatar {
  width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; flex: none;
  font-size: 12px; font-weight: 700; letter-spacing: 0.02em; color: #fff;
  background: linear-gradient(135deg, #6473ea, #9a6bf0);
}
.avatar-lg { width: 52px; height: 52px; border-radius: 14px; font-size: 17px; }

.avatar-sm { width: 26px; height: 26px; border-radius: 8px; font-size: 11px; }
.avatar-xs { width: 20px; height: 20px; border-radius: 6px; font-size: 11px; }

/* --------------------------------------------------------------- kpi */
.kpi { position: relative; overflow: hidden; }
.kpi-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.07em; color: var(--muted); font-weight: 650; }
.kpi-value { font-size: 27px; font-weight: 700; letter-spacing: -0.8px; line-height: 1.05; color: var(--ink); font-variant-numeric: tabular-nums; }
.kpi-value small { font-size: 13px; font-weight: 600; color: var(--t-ink-400); letter-spacing: 0; }
.kpi-foot { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.kpi-icon { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; flex: none; }
.kpi-icon svg { width: 16px; height: 16px; }

/* -------------------------------------------------------------- charts */
.donut-wrap { position: relative; }
.donut { transform: rotate(-90deg); }
.donut-center { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; }
.donut-center .n { font-size: 24px; font-weight: 700; letter-spacing: -0.7px; line-height: 1; }
.donut-center .l { font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--t-ink-400); margin-top: 4px; }

.legend-row { display: flex; align-items: center; gap: 8px; padding: 5px 0; border-radius: 6px; cursor: pointer; }
.legend-row:hover { background: var(--surface); }
.legend-dot { width: 8px; height: 8px; border-radius: 3px; flex: none; }
.legend-name { font-size: 12px; color: var(--t-ink-600); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.legend-val { font-size: 12px; font-weight: 650; color: var(--t-ink-800); font-variant-numeric: tabular-nums; }
.legend-pct { font-size: 11px; color: var(--t-ink-400); width: 40px; text-align: right; font-variant-numeric: tabular-nums; }

.hbar { height: 7px; border-radius: 999px; background: var(--surface); overflow: hidden; }
.hbar > span { display: block; height: 100%; border-radius: 999px; transition: width 0.5s cubic-bezier(0.2, 0.8, 0.2, 1); }

.mini-bar { position: relative; height: 5px; border-radius: 999px; background: var(--surface); width: 62px; overflow: hidden; }
.mini-bar > span { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 999px; }


.crit-row { display: grid; grid-template-columns: 1fr 44px; gap: 6px 10px; align-items: center; padding: 5px 0; }
.crit-label { font-size: 12px; color: var(--t-ink-600); display: flex; align-items: center; gap: 5px; }
.crit-val { font-size: 12px; color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }
.crit-bar { grid-column: 1 / -1; height: 5px; border-radius: 999px; background: var(--surface); overflow: hidden; }
.crit-bar > span { display: block; height: 100%; border-radius: 999px; }

/* ------------------------------------------------------------ timeline */
.tl { position: relative; padding-left: 18px; }
.tl::before { content: ""; position: absolute; left: 5px; top: 4px; bottom: 4px; width: 1px; background: var(--surface-2); }
.tl-item { position: relative; padding-bottom: 13px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-dot {
  position: absolute; left: -17px; top: 4px; width: 9px; height: 9px; border-radius: 50%;
  background: var(--card); border: 2px solid #c7cde0;
}
.tl-dot.ok { border-color: #10b981; }
.tl-dot.warn { border-color: #f59e0b; }
.tl-dot.danger { border-color: #f43f5e; }
.tl-dot.info { border-color: #3b82f6; }
.tl-title { font-size: 12px; font-weight: 600; color: var(--t-ink-600); line-height: 1.35; }
.tl-meta { font-size: 11px; color: var(--t-ink-400); margin-top: 1px; }

/* --------------------------------------------------------------- tasks */
.task {
  display: flex; gap: 9px; padding: 9px 10px; border-radius: 9px; border: 1px solid var(--line);
  background: var(--card); transition: border-color 0.14s, box-shadow 0.14s; align-items: flex-start;
}
.task:hover { border-color: #cdd4e4; box-shadow: 0 2px 6px -2px rgba(16, 24, 40, 0.08); }
.task.done { opacity: 0.62; background: var(--card); }
.task-title { font-size: 12px; font-weight: 550; color: var(--t-ink-600); line-height: 1.4; }
.task.done .task-title { text-decoration: line-through; text-decoration-color: #b9c1d4; }
.task-meta { font-size: 11px; color: var(--t-ink-400); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 3px; }
.check {
  width: 16px; height: 16px; border-radius: 5px; border: 1.5px solid #c9cfdd; flex: none; margin-top: 1px;
  display: grid; place-items: center; cursor: pointer; background: var(--card); transition: all 0.14s;
}
.check:hover { border-color: var(--brand); }
.check.on { background: #10b981; border-color: #10b981; color: #fff; }
.check svg { width: 10px; height: 10px; }

/* --------------------------------------------------------------- modal */
.modal-scrim {
  position: fixed; inset: 0; background: rgba(9, 14, 28, 0.5); z-index: 60;
  display: flex; align-items: flex-start; justify-content: center; padding: 6vh 16px 24px;
  animation: fade 0.16s ease; overflow-y: auto;
}
.modal {
  background: var(--card); border-radius: 16px; box-shadow: var(--shadow-lg); width: 100%; max-width: 560px;
  animation: pop 0.18s cubic-bezier(0.2, 0.9, 0.3, 1.1); overflow: hidden;
}
.modal-lg { max-width: 880px; }
.modal-head { padding: 16px 20px; border-bottom: 1px solid var(--line); display: flex; align-items: flex-start; gap: 12px; }
.modal-body { padding: 18px 20px; max-height: 68vh; overflow-y: auto; }
.modal-foot { padding: 12px 20px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; background: var(--card); }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(0.99); } to { opacity: 1; transform: none; } }

/* --------------------------------------------------------------- toast */
.toast-root { position: fixed; right: 18px; bottom: 18px; z-index: 90; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
.toast {
  background: #0f172a; color: #f1f5f9; padding: 10px 14px; border-radius: 10px; font-size: 13px;
  box-shadow: var(--shadow-lg); display: flex; align-items: center; gap: 9px; max-width: 380px;
  animation: slidein 0.2s ease;
}
.toast.ok { background: #064e3b; }
.toast.danger { background: #881337; }
.toast.info { background: #1e2470; }
.toast svg { width: 15px; height: 15px; flex: none; }
@keyframes slidein { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------------------------------------------------------------- misc */
.muted { color: var(--muted); }
.small { font-size: 12px; }
.tnum { font-variant-numeric: tabular-nums; }
.clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.hide-scroll::-webkit-scrollbar { height: 8px; width: 8px; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #cfd6e4; border-radius: 10px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: #b3bdd1; background-clip: content-box; }
::-webkit-scrollbar-track { background: transparent; }

.empty { text-align: center; padding: 44px 20px; }
.empty-icon { width: 44px; height: 44px; border-radius: 13px; background: var(--surface); display: grid; place-items: center; margin: 0 auto 10px; color: var(--t-ink-400); }
.empty-icon svg { width: 21px; height: 21px; }

.divider { height: 1px; background: var(--line); }

.link { color: var(--brand); font-weight: 600; }
.link:hover { text-decoration: underline; }

.switch { position: relative; width: 34px; height: 19px; border-radius: 999px; background: var(--surface-2); transition: background 0.16s; flex: none; cursor: pointer; }
.switch.on { background: var(--brand); }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 15px; height: 15px; border-radius: 50%; background: var(--card); transition: transform 0.16s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.switch.on::after { transform: translateX(15px); }

.dropzone {
  border: 2px dashed #cbd3e3; border-radius: 14px; padding: 34px 20px; text-align: center;
  background: var(--card); transition: all 0.16s; cursor: pointer;
}
.dropzone:hover, .dropzone.hot { border-color: var(--brand); background: var(--surface); }
.dropzone.hot { transform: scale(1.005); }

.step-num {
  width: 22px; height: 22px; border-radius: 50%; background: var(--surface); color: var(--t-ink-500);
  display: grid; place-items: center; font-size: 12px; font-weight: 700; flex: none;
}
.step-num.on { background: var(--brand); color: #fff; }

.pbar { height: 6px; border-radius: 999px; background: var(--surface); overflow: hidden; }
.pbar > span { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #4f5ce8, #7c8cff); }

.stat-split { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; }

[data-tip] { position: relative; cursor: help; }
[data-tip]:hover::after {
  content: attr(data-tip); position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%);
  background: #0f172a; color: #fff; font-size: 11px; font-weight: 500; padding: 5px 8px; border-radius: 6px;
  white-space: nowrap; z-index: 50; pointer-events: none; box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

/* --------------------------------------------------------- responsive */
/* Un chip long (intitulé de formation + centre + dates) doit revenir à la
   ligne au lieu de pousser la page horizontalement sur mobile. */
.chip-long {
  white-space: normal; text-align: left; line-height: 1.35;
  align-items: flex-start; padding: 4px 8px;
}
.chip-long > svg { flex: none; margin-top: 1px; }

@media (max-width: 1023px) {
}

@media (max-width: 1023px) {
  /* Zones tactiles confortables dans le tiroir de navigation. */
  .nav-item { padding: 12px 12px; font-size: 14px; }
  .nav-item svg { width: 18px; height: 18px; }
  .nav-label { padding-top: 14px; }
}

@media (min-width: 1280px) and (max-width: 1439px) {
  /* Écran 1280-1439 px : la colonne « Freins » reste dans le dossier pour que
     le tableau tienne sans défilement horizontal. */
  table.data-portfolio th:nth-child(7), table.data-portfolio td:nth-child(7) { display: none; }
  table.data-portfolio tbody td { padding: 8px; }
}

@media (max-width: 767px) {
  .topbar { min-height: 56px; padding: 8px 12px; gap: 8px;
  background: var(--card);
  border-bottom-color: var(--line);
  box-shadow: 0 1px 0 rgba(16, 24, 40, 0.035);}
  .btn-icon { width: 38px; height: 38px;
  color: var(--ink-2);}
  .nav-item { min-height: 44px;
  color: var(--sidebar-ink);
  padding: 9.5px 10px;
  border-radius: 10px;}
  /* Les tableaux restent lisibles : défilement horizontal avec une ombre qui
     signale qu'il reste des colonnes à droite. */
  .table-wrap {
    background: linear-gradient(90deg, #fff 30%, rgba(255, 255, 255, 0)) left / 24px 100% no-repeat local,
      linear-gradient(270deg, #fff 30%, rgba(255, 255, 255, 0)) right / 24px 100% no-repeat local,
      radial-gradient(farthest-side at 0 50%, rgba(15, 23, 42, 0.14), transparent) left / 10px 100% no-repeat scroll,
      radial-gradient(farthest-side at 100% 50%, rgba(15, 23, 42, 0.14), transparent) right / 10px 100% no-repeat scroll;
    background-color: var(--card);
  -webkit-overflow-scrolling: touch;}
  table.data { min-width: 520px;
  font-size: 12px;}
  .view { padding: 24px 28px 64px; }
  .card-pad { padding: 20px; }
  .card-head { padding: 14px 14px 0; }
  .kpi-value { font-size: 23px; }
  .kpi-icon { width: 28px; height: 28px; }
  .modal-scrim { padding: 0; align-items: flex-end; }
  .modal {
    max-width: 100%; border-radius: 16px 16px 0 0; max-height: 94vh;
    display: flex; flex-direction: column;
  background: var(--card);}
  .modal-lg { max-width: 100%; }
  .modal-head { padding: 14px 16px; }
  .modal-body { padding: 14px 16px; max-height: none; flex: 1 1 auto; }
  .modal-foot { padding: 10px 16px; flex-wrap: wrap;
  background: var(--surface);}
  .modal-foot .btn { flex: 1 1 auto; }
  .toast-root { left: 12px; right: 12px; bottom: 12px; align-items: stretch; }
  .toast { max-width: none; }
  .empty { padding: 30px 12px; }
  .dropzone { padding: 24px 14px;
  background: var(--surface);
  border-color: var(--line-strong);}
  /* Le portefeuille bascule en cartes sous 1024 px (voir views-portfolio.js). */
  table.data thead th, table.data tbody td { padding: 8px 9px; }
  .donut-center .n { font-size: 20px; }
    }

@media (max-width: 400px) {
  .btn { padding: 7px 10px; font-size: 12px; }
  .btn-sm { padding: 5px 8px; font-size: 12px; }
  .badge { font-size: 11px; }
}

@media print {
  .sidebar, .topbar, .toast-root, .no-print { display: none !important; }
  .view { padding: 0; max-width: none; }
  body { background: #fff;
  color: #000;}
  .card { box-shadow: none; break-inside: avoid;
  border: 1px solid #d9dde8;}
}

/* ------------------------------------------------------------ atelier CV */
.cv-themes{
  display:grid;grid-template-columns:repeat(auto-fill,minmax(128px,1fr));gap:6px;margin:4px 0 10px;
}
.cv-theme{
  display:flex;align-items:center;gap:6px;text-align:left;position:relative;
  padding:6px 7px;border:1px solid #e6e9f2;border-radius:9px;background: var(--card);
  transition:border-color .15s,box-shadow .15s,background .15s;min-height:40px;
}
.cv-theme:hover{border-color:#c7d2fe;background:var(--card)}
.cv-theme.on{border-color:#3b46d6;box-shadow:0 0 0 2px #e0e7ff inset;background:var(--surface)}
.cv-swatch{width:16px;height:26px;border-radius:5px;flex:none}
.cv-theme-txt{display:flex;flex-direction:column;min-width:0;line-height:1.15}
.cv-theme-txt b{font-size: 12px;color: var(--t-ink-800)}
.cv-theme-txt span{font-size: 11px;color: var(--t-ink-400);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.cv-rec{
  position:absolute;top:-6px;right:4px;background:#047857;color:#fff;font-size: 11px;
  border-radius:999px;padding:1px 5px;letter-spacing:.02em;
}
.cv-controls{display:grid;grid-template-columns:repeat(auto-fit,minmax(190px,1fr));gap:10px}
.cv-control{min-width:0}
.cv-control-wide{grid-column:1/-1}
.cv-label{display:block;font-size: 11px;text-transform:uppercase;letter-spacing:.05em;color: var(--t-ink-400);font-weight:600;margin-bottom:4px}
.cv-dots{display:flex;flex-wrap:wrap;gap:4px;align-items:center}
.cv-dot{width:20px;height:20px;border-radius:50%;border:2px solid #fff;box-shadow:0 0 0 1px #dfe3ee;transition:transform .12s,box-shadow .12s}
.cv-dot:hover{transform:scale(1.12)}
.cv-dot.on{box-shadow:0 0 0 2px #131c33}
.cv-color{display:inline-flex;align-items:center;gap:4px;font-size: 11px;color: var(--t-ink-500);cursor:pointer}
.cv-color input{width:20px;height:20px;padding:0;border:0;background:none;cursor:pointer}
.cv-layouts{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:4px}
.cv-layout{
  display:flex;flex-direction:column;align-items:center;gap:3px;padding:5px 2px;
  border:1px solid #e6e9f2;border-radius:8px;background: var(--card);font-size: 11px;color: var(--t-ink-500);
}
.cv-layout.on{border-color:#3b46d6;background:var(--surface);color: var(--brand-dark);font-weight:600}
.cv-layout-demo{display:grid;width:100%;height:22px;gap:2px;padding:2px;border-radius:3px;background:var(--surface)}
.cv-layout-demo i{background:var(--brand-line);border-radius:1px}
.cv-demo-classic{grid-template-columns:1fr;grid-template-rows:5px 1fr}
.cv-demo-band{grid-template-columns:1fr;grid-template-rows:9px 1fr}
.cv-demo-band i:first-child{background:var(--brand-line)}
.cv-demo-sidebar{grid-template-columns:9px 1fr;grid-template-rows:1fr 1fr}
.cv-demo-sidebar i:first-child{grid-row:1/3}
.cv-demo-split{grid-template-columns:1fr 1fr;grid-template-rows:4px 1fr}
.cv-demo-split i:first-child{grid-column:1/3}
.cv-secs{display:flex;flex-wrap:wrap;gap:4px}
.cv-sec{display:inline-flex;align-items:center;border:1px solid #e6e9f2;border-radius:999px;overflow:hidden;background: var(--card)}
.cv-sec.on{border-color:#c7d2fe;background:var(--surface)}
.cv-sec>button:first-child{
  display:inline-flex;align-items:center;gap:3px;padding:3px 8px;font-size: 11px;color: var(--t-ink-500);
}
.cv-sec.on>button:first-child{color: var(--brand-dark);font-weight:600}
.cv-sec-move{padding:2px 4px;color:#a5adc2;border-left:1px solid #eef0f7}
.cv-sec-move:hover{color: var(--brand);background:var(--surface)}
.cv-sec-move:disabled{opacity:.35}
.cv-photo-mini{width:26px;height:26px;object-fit:cover;border-radius:50%;border:1px solid #e6e9f2}
.cv-photo-mini.sq{border-radius:4px}
.cv-preview-card{position:sticky;top:12px;align-self:start}
.cv-frame-wrap{
  position:relative;height:648px;background:var(--surface);border:1px solid #e6e8f0;border-radius:10px;
  overflow:hidden;
}
.cv-frame{width:794px;height:1123px;border:0;background:#fff;transform-origin:top left;transform:scale(.56)}
@media (min-width:1280px) and (max-width:1535px){
  .cv-frame-wrap{height:815px}
  .cv-frame{transform:scale(.72)}
}
@media (min-width:1536px){
  .cv-frame-wrap{height:648px}
  .cv-frame{transform:scale(.56)}
}
@media (max-width:640px){
  .cv-frame-wrap{height:486px}
  .cv-frame{transform:scale(.42)}
  .cv-layouts{grid-template-columns:repeat(2,minmax(0,1fr))}
}

/* --------------------------------------------------- chargements (veille) */
@keyframes hi-shimmer { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }
@keyframes hi-spin { to { transform: rotate(360deg); } }
@keyframes hi-pulse { 0%,100% { opacity: 1; transform: scale(1); } 50% { opacity: .45; transform: scale(.8); } }
@keyframes hi-sweep { 0% { transform: translateX(-100%); } 100% { transform: translateX(320%); } }

.sk {
  background-image: linear-gradient(90deg, var(--surface-2) 0%, var(--surface) 45%, var(--surface-2) 70%);
  background-size: 300% 100%;
  animation: hi-shimmer 1.6s ease-in-out infinite;
  border-radius: 6px;
  min-height: 10px;
}
.sk-line { height: 10px; }
.sk-line.sm { height: 8px; }
.sk-title { height: 14px; width: 58%; }
.sk-chip { height: 18px; width: 64px; border-radius: 999px; }
.sk-card { display: flex; flex-direction: column; gap: 10px; padding: 14px; }
.sk-title-row { display: flex; align-items: center; gap: 10px; }
.sk-avatar { width: 32px; height: 32px; border-radius: 8px; flex: none; }
.sk-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; }

.spin {
  display: inline-block; width: 13px; height: 13px; flex: none;
  border: 2px solid rgba(59, 70, 214, .22);
  border-top-color: #3b46d6;
  border-radius: 50%;
  animation: hi-spin .7s linear infinite;
  vertical-align: -2px;
}
.spin.light { border-color: rgba(255,255,255,.35); border-top-color: #fff; }

.live-dot {
  width: 7px; height: 7px; border-radius: 50%; background: #10b981;
  box-shadow: 0 0 0 3px rgba(16,185,129,.14);
  animation: hi-pulse 1.8s ease-in-out infinite;
  display: inline-block;
}
.live-dot.idle { background: #f59e0b; box-shadow: 0 0 0 3px rgba(245,158,11,.16); }
.live-dot.off { background: #94a3b8; box-shadow: 0 0 0 3px rgba(148,163,184,.18); animation: none; }

.sweep { position: relative; overflow: hidden; }
.sweep::after {
  content: ""; position: absolute; inset: 0 auto 0 0; width: 30%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.55), transparent);
  animation: hi-sweep 1.5s ease-in-out infinite;
}
.hi-fadein { animation: fade .22s ease both; }

/* Mise en évidence d'un chargement déclenché par un clic. */
.btn.is-busy {
  cursor: progress;
  box-shadow: 0 0 0 3px rgba(59, 70, 214, .18);
  opacity: .92;
}
.btn.is-busy .spin { margin-right: 2px; }
.card.is-loading {
  box-shadow: 0 0 0 2px rgba(59, 70, 214, .22), 0 10px 26px -18px rgba(59, 70, 214, .55);
  transition: box-shadow .18s ease;
}

/* Croix de retrait d'un métier de la collecte. */
.chip-x {
  display: inline-flex; align-items: center; justify-content: center;
  width: 18px; height: 18px; border-radius: 5px; flex: none;
  color: var(--muted-soft); background: transparent; border: 1px solid transparent;
  cursor: pointer; transition: all .12s ease;
}
.chip-x:hover { color: var(--danger); background: var(--danger-soft); border-color: var(--danger-line); }
.chip-x:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }

@media (prefers-reduced-motion: reduce) {
  .sk, .spin, .live-dot, .sweep::after { animation: none; }
}

/* --------------------------------------------- recherche, résultats, listes */
/* Surlignage des mots trouvés : repérage immédiat dans une liste dense. */
.shl { background: color-mix(in srgb, var(--warn) 26%, var(--card)); color: var(--ink); border-radius: 3px; padding: 0 1px; }

/* Champ de recherche global du bandeau. */
.gs-wrap .gs-input { padding-right: 32px; background: var(--card);
  color: var(--ink);}
.gs-kbd {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  font-size: 11px; font-weight: 600; color: var(--muted-soft); background: var(--surface);
  border: 1px solid #e3e7f0; border-radius: 5px; padding: 0 5px; line-height: 16px;
  pointer-events: none;
}
.gs-wrap:focus-within .gs-kbd { opacity: 0; }
.gs-panel {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 60;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 18px 40px -18px rgba(16, 24, 40, 0.32);
  overflow: hidden; max-height: 70vh; overflow-y: auto;
}
.gs-head {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 8px 12px; font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em;
  font-weight: 700; color: var(--muted-soft); background: var(--card); border-bottom: 1px solid #f1f3f8;
}
.gs-count { text-transform: none; letter-spacing: 0; font-size: 11px; font-weight: 600; color: var(--t-ink-500); }
.gs-row {
  display: flex; align-items: center; gap: 10px; padding: 8px 12px;
  border-bottom: 1px solid #f4f6fa; transition: background 0.1s;
}
.gs-row:hover, .gs-row.is-active { background: var(--surface); }
.gs-row.is-active { box-shadow: inset 3px 0 0 var(--brand); }
.gs-name {
  display: block; font-size: 13px; font-weight: 650; color: var(--ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.gs-meta {
  display: block; font-size: 11px; color: var(--t-ink-400); margin-top: 1px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.gs-empty { display: flex; align-items: flex-start; gap: 9px; padding: 14px 12px; font-size: 12px; color: var(--ink-2); }
.gs-empty svg { color: var(--muted-soft); flex: none; margin-top: 1px; }
.gs-foot {
  display: flex; align-items: center; gap: 6px; width: 100%; text-align: left;
  padding: 9px 12px; font-size: 12px; font-weight: 600; color: var(--brand);
  background: var(--surface); border-top: 1px solid #f1f3f8; cursor: pointer;
}
.gs-foot:hover { background: var(--surface); }
.gs-foot kbd {
  margin-left: auto; font-size: 11px; font-weight: 600; color: var(--t-ink-400);
  background: var(--card); border: 1px solid #e3e7f0; border-radius: 5px; padding: 0 5px; line-height: 16px;
}

/* Champ de recherche des listes (portefeuille, collecte). */
.pf-search { position: relative; }
.pf-search-icon {
  position: absolute; left: 9px; top: 50%; transform: translateY(-50%);
  color: var(--muted-soft); pointer-events: none; display: flex;
}
.pf-search-input { padding-left: 30px !important; padding-right: 32px; }
.pf-search-input::-webkit-search-cancel-button,
.pf-search-input::-webkit-search-decoration { -webkit-appearance: none; display: none; }
.pf-clear {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  width: 21px; height: 21px; display: grid; place-items: center;
  border-radius: 6px; color: var(--ink-2); background: var(--surface-2); border: 0; cursor: pointer;
}
.pf-clear:hover { background: var(--line); color: var(--ink); }
.pf-clear[hidden] { display: none; }
.pf-clear:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }

/* Sélecteur de dossier : champ + liste cherchable. */
.combo { position: relative; }
.combo-input { padding-right: 26px; }
.combo.open .combo-input { border-color: #8e97ef; box-shadow: 0 0 0 3px rgba(79, 92, 232, 0.13); }
.combo-list {
  position: absolute; left: 0; right: 0; top: calc(100% + 5px); z-index: 70;
  background: var(--card); border: 1px solid var(--line); border-radius: 11px;
  box-shadow: 0 16px 36px -16px rgba(16, 24, 40, 0.3);
  max-height: 264px; overflow-y: auto;
}
.combo-head {
  position: sticky; top: 0; z-index: 1; background: var(--card); border-bottom: 1px solid #f1f3f8;
  padding: 6px 10px; font-size: 11px; text-transform: uppercase; letter-spacing: 0.07em;
  font-weight: 700; color: var(--muted-soft);
}
.combo-item {
  display: flex; align-items: center; gap: 9px; width: 100%; text-align: left;
  padding: 7px 10px; border-bottom: 1px solid #f4f6fa; background: var(--card); cursor: pointer;
}
.combo-item:last-child { border-bottom: 0; }
.combo-item:hover, .combo-item.is-active { background: var(--surface); }
.combo-item .avatar { width: 26px; height: 26px; border-radius: 8px; font-size: 11px; }
.combo-name {
  display: block; font-size: 12px; font-weight: 600; color: var(--t-ink-800);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.combo-meta {
  display: block; font-size: 11px; color: var(--t-ink-400);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.combo-none .combo-name { color: var(--t-ink-500); }
.combo-empty { padding: 10px 12px; font-size: 12px; color: var(--t-ink-400); }

/* Barre de chargement des traitements longs (export, import). */
.loadbar { position: fixed; inset: 0 0 auto 0; z-index: 90; opacity: 0; pointer-events: none; transition: opacity 0.16s; }
.loadbar.on { opacity: 1; }
.loadbar-track { height: 3px; background: var(--brand-soft); overflow: hidden; }
.loadbar-track span {
  display: block; height: 100%; width: 35%; border-radius: 0 3px 3px 0;
  background: linear-gradient(90deg, #8b95f5, #3b46d6);
  animation: hi-sweep 1.1s ease-in-out infinite;
}
.loadbar-label {
  position: absolute; right: 14px; top: 8px; font-size: 11px; font-weight: 600; color: var(--brand);
  background: var(--card); border: 1px solid #dfe3f7; border-radius: 999px; padding: 3px 10px;
  box-shadow: 0 6px 18px -10px rgba(16, 24, 40, 0.35);
  border-color: var(--brand-line);}

@media (max-width: 640px) {
  .gs-panel { max-height: 60vh; }
  .combo-list { max-height: 210px; }
}

/* ------------------------------------------ interface adaptative (guide) */
/* Bandeau d'aide en haut de chaque écran : une phrase, trois repères, un bouton. */
.coach {
  position: relative; display: flex; flex-wrap: wrap; align-items: flex-start; gap: 12px;
  padding: 13px 40px 13px 14px; margin-bottom: 16px;
  border: 1px solid #dfe3f7; border-radius: 12px;
  background: linear-gradient(180deg, var(--brand-soft), var(--card));
  border-color: var(--brand-line);}
.coach-ico { flex: none; width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--surface-2); color: var(--brand); }
.coach-body { min-width: 0; flex: 1; }
.coach-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.coach-head strong { font-size: 13px; color: var(--ink); }
.coach-tag { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: var(--t-ink-400); background: var(--card); border: 1px solid var(--line); border-radius: 99px; padding: 1px 6px; }
.coach-text { font-size: 12px; color: var(--t-ink-600); line-height: 1.5; margin: 3px 0 0; }
.coach-more { margin-top: 5px; }
.coach-more summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; color: var(--brand); }
.coach-more summary::-webkit-details-marker { display: none; }
.coach-more summary svg { transition: transform 0.15s; }
.coach-more[open] summary svg { transform: rotate(180deg); }
.coach-more ol { margin: 7px 0 0; padding-left: 18px; font-size: 12px; color: var(--t-ink-600); line-height: 1.6; }
.coach-more li { margin-bottom: 3px; }
.coach-tools { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 7px; }
.coach-link { font-size: 12px; font-weight: 600; color: var(--brand); border: 0; background: none; padding: 0; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.coach-actions { flex: none; display: flex; align-items: center; }
.coach-cta { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; color: var(--on-brand); background: var(--brand); border: 1px solid var(--brand); border-radius: 8px; padding: 6px 10px; white-space: nowrap; }
.coach-cta:hover { background: var(--brand-dark); }
.coach-close { position: absolute; top: 7px; right: 7px; width: 24px; height: 24px; border-radius: 7px; border: 0; background: transparent; color: var(--t-ink-400); display: grid; place-items: center; cursor: pointer; }
.coach-close:hover { background: var(--surface-2); color: var(--t-ink-600); }

.guide-body { font-size: 13px; color: var(--t-ink-600); }
.guide-lead { font-size: 12px; color: var(--muted); line-height: 1.55; margin: 0 0 4px; }
.guide-q { display: flex; align-items: flex-start; gap: 9px; margin: 16px 0 8px; }
.guide-qn { width: 22px; height: 22px; flex: none; border-radius: 99px; background: var(--brand); color: #fff; display: grid; place-items: center; font-size: 12px; font-weight: 700; }
.guide-qt { font-size: 13px; font-weight: 650; color: var(--ink); }
.guide-qs { font-size: 12px; color: var(--muted); margin-top: 1px; }
.guide-grid { display: grid; gap: 7px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.guide-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.guide-opt { display: flex; gap: 8px; align-items: flex-start; padding: 9px 10px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; background: var(--card); }
.guide-opt:hover { border-color: #c7cffa; background: var(--card); }
.guide-opt input { margin-top: 2px; accent-color: var(--brand); }
.guide-opt-main { min-width: 0; }
.guide-opt-label { display: block; font-size: 12px; font-weight: 600; color: var(--ink); }
.guide-opt-desc { display: block; font-size: 11px; color: var(--muted); line-height: 1.45; margin-top: 2px; }
.guide-opt.on { border-color: var(--brand); background: var(--surface); box-shadow: inset 0 0 0 1px var(--brand); }
.guide-tip { display: flex; gap: 6px; align-items: flex-start; font-size: 12px; color: var(--t-ink-500); margin-top: 14px; padding: 8px 10px; background: var(--surface); border-radius: 8px; }

.glossary { display: grid; grid-template-columns: 190px 1fr; gap: 8px 16px; margin: 0; }
.glossary dt { font-size: 12px; font-weight: 650; color: var(--ink); }
.glossary dd { font-size: 12px; color: var(--t-ink-500); line-height: 1.55; margin: 0; }

.side-mode { width: calc(100% - 28px); margin: 8px 14px 0; display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--muted-soft); background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.08); border-radius: 8px; padding: 6px 8px; cursor: pointer; text-align: left; }
.side-mode:hover { background: rgba(255, 255, 255, 0.09); color: #e6eaf6; }
.side-mode span { flex: 1; }
.side-mode b { font-weight: 600; color: #c7ceff; }
.nav-toggle { width: 100%; background: none; border: 0; cursor: pointer; text-align: left; color: var(--muted-soft); }
.nav-toggle:hover { color: #e6eaf6; }

/* Accueil essentiel */
.prio-list { list-style: none; margin: 0; padding: 0; }
.prio { display: flex; align-items: flex-start; gap: 11px; padding: 11px 0; border-bottom: 1px solid #f0f2f7; }
.prio:first-child { padding-top: 0; }
.prio:last-child { border-bottom: 0; padding-bottom: 2px; }
.prio-n { flex: none; width: 24px; height: 24px; border-radius: 99px; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; font-size: 12px; font-weight: 700; }
.prio-main { min-width: 0; flex: 1; }
.prio-title { font-size: 13px; font-weight: 650; color: var(--ink); line-height: 1.3; }
.prio-who { font-size: 12px; color: var(--t-ink-600); margin-top: 1px; }
.prio-why { font-size: 12px; color: var(--muted); margin-top: 3px; display: flex; align-items: center; gap: 4px; }
.prio-foot { font-size: 11px; color: var(--muted); margin: 10px 0 0; padding-top: 9px; border-top: 1px solid #f0f2f7; }
.resume { display: flex; align-items: center; gap: 9px; padding: 9px 12px; margin-bottom: 14px; border: 1px dashed #cfd6ea; border-radius: 10px; background: var(--card);
  border-color: var(--line-strong);}
.resume-ico { color: var(--brand); display: grid; place-items: center; }
.resume-txt { flex: 1; min-width: 0; font-size: 12px; color: var(--muted); }
.resume-txt strong { color: var(--ink); font-weight: 650; }
.start-tiles { display: grid; gap: 7px; }
.start-tile { display: grid; grid-template-columns: 26px 1fr; grid-template-rows: auto auto; column-gap: 8px; align-items: center; text-align: left; padding: 9px 10px; border: 1px solid #e6e8ef; border-radius: 10px; background: var(--card); cursor: pointer; }
.start-tile:hover { border-color: #bcc5f7; background: var(--card); }
.start-ico { grid-row: 1 / span 2; width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); }
.start-label { font-size: 12px; font-weight: 600; color: var(--ink); }
.start-hint { font-size: 11px; color: var(--muted); }
.seg-line { display: flex; align-items: center; gap: 9px; padding: 7px 6px; margin: 0 -6px; border-radius: 8px; }
.seg-line:hover { background: var(--surface); }
.seg-dot { width: 8px; height: 8px; border-radius: 99px; flex: none; }
.seg-main { min-width: 0; flex: 1; }
.seg-name { display: block; font-size: 12px; font-weight: 600; color: var(--ink); }
.seg-desc { display: block; font-size: 11px; color: var(--muted); line-height: 1.4; }
.seg-n { font-size: 13px; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.help-card { background: var(--card); border-style: dashed; }
.help-ico { flex: none; width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); }

@media (max-width: 640px) {
  .coach { padding-right: 34px; }
  .coach-actions { width: 100%; margin-top: 6px; }
  .guide-grid, .guide-grid-3 { grid-template-columns: 1fr; }
  .glossary { grid-template-columns: 1fr; gap: 2px; }
  .glossary dd { margin-bottom: 8px; }
}

/* ------------------------------------------- étiquettes et groupes */
.pf-tagbar { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; margin: 0 0 10px; }
.pf-tagbar-label { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; text-transform: uppercase; letter-spacing: 0.12em; font-weight: 700; color: var(--t-ink-400); margin-right: 2px; }
.pf-tagbar-manage { margin-left: auto; font-size: 12px; font-weight: 600; color: var(--brand); white-space: nowrap; }
.pf-tagbar-manage:hover { text-decoration: underline; }

.pf-scope { display: flex; align-items: center; justify-content: flex-end; gap: 10px; padding: 4px 16px 6px; font-size: 11px; color: var(--t-ink-400); }

.pf-groups { padding: 4px 0; }
.pf-group { border-bottom: 1px solid #f0f2f7; }
.pf-group:last-child { border-bottom: 0; }
.pf-group-head { display: flex; align-items: center; gap: 8px; padding: 6px 12px; }
.pf-group-head:hover { background: var(--card); }
.pf-group-toggle { display: flex; align-items: center; gap: 7px; flex: 1; min-width: 0; background: none; border: 0; padding: 5px 0; cursor: pointer; text-align: left; }
.pf-group-chevron { color: var(--muted-soft); display: grid; place-items: center; transform: rotate(0deg); }
.pf-group-toggle[aria-expanded="true"] .pf-group-chevron { color: var(--brand); }
.pf-group-tag { font-size: 13px; font-weight: 650; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pf-group-count { font-size: 11px; font-weight: 700; color: #4f5ce8; background: var(--brand-soft); border-radius: 99px; padding: 1px 7px; }
.pf-group-actions { display: flex; align-items: center; gap: 4px; flex: none; }
.pf-group-actions .btn { white-space: nowrap; }
.pf-group-body { padding: 0 12px 8px 30px; }
.pf-group-row { display: flex; align-items: center; gap: 8px; padding: 5px 6px; margin: 0 -6px; border-radius: 7px; }
.pf-group-row:hover { background: var(--surface); }
.pf-group-name { display: block; font-size: 12px; font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pf-group-meta { display: block; font-size: 11px; color: var(--t-ink-400); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pf-group-more { display: block; margin-top: 4px; font-size: 12px; font-weight: 600; color: var(--brand); background: none; border: 0; padding: 2px 0; cursor: pointer; }

.tag-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(268px, 1fr)); gap: 12px; }
.tag-card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 13px; display: flex; flex-direction: column; gap: 8px; }
.tag-card:hover { border-color: #c7cffa; box-shadow: 0 6px 20px -14px rgba(16, 24, 40, 0.4); }
.tag-card-head { display: flex; align-items: center; gap: 7px; }
.tag-color { width: 8px; height: 8px; border-radius: 99px; flex: none; }
.tag-name { font-size: 13px; font-weight: 650; color: var(--ink); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tag-count { font-size: 12px; font-weight: 700; color: #4f5ce8; background: var(--brand-soft); border-radius: 99px; padding: 1px 8px; }
.tag-meta { font-size: 11px; color: var(--t-ink-400); line-height: 1.45; }
.tag-note { font-size: 11px; color: var(--ink-2); background: var(--surface); border-left: 2px solid #dde2f4; border-radius: 0 6px 6px 0; padding: 4px 7px; line-height: 1.4;
  border-left-color: var(--line-strong);}
.tag-swatches { display: flex; flex-wrap: wrap; gap: 6px; }
.tag-swatch { width: 24px; height: 24px; border-radius: 99px; border: 2px solid transparent; box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.08); }
.tag-swatch.is-selected { border-color: var(--ink); }
.tag-bar { height: 4px; border-radius: 99px; background: var(--surface); overflow: hidden; }
.tag-bar span { display: block; height: 100%; border-radius: 99px; }
.tag-preview { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; }
.tag-person { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; color: var(--ink-2); background: var(--surface); border-radius: 99px; padding: 2px 7px 2px 2px; }
.tag-person:hover { background: var(--brand-soft); color: var(--brand); }
.tag-more { font-size: 11px; color: var(--muted-soft); font-weight: 600; }
.tag-actions { display: flex; flex-wrap: wrap; gap: 5px; }
.tag-card-foot { display: flex; justify-content: space-between; gap: 8px; border-top: 1px solid #f2f4f8; padding-top: 7px; }
.coach-link.danger { color: var(--danger); }
.loose-card { border-style: dashed; }

.tag-picker-tools { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.tag-picker-tools .input { flex: 1; }
.tag-picker-count { font-size: 12px; font-weight: 600; color: #4f5ce8; white-space: nowrap; }
.tag-pick-list { border: 1px solid var(--line); border-radius: 10px; max-height: 340px; overflow-y: auto; }
.tag-pick { display: flex; align-items: center; gap: 8px; padding: 7px 9px; border-bottom: 1px solid #f4f5fa; cursor: pointer; }
.tag-pick:last-child { border-bottom: 0; }
.tag-pick:hover { background: var(--surface); }
.tag-pick input { accent-color: var(--brand); flex: none; }
.tag-pick-main { min-width: 0; flex: 1; }
.tag-pick-name { display: block; font-size: 12px; font-weight: 600; color: var(--ink); }
.tag-pick-meta { display: block; font-size: 11px; color: var(--t-ink-400); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tag-pick-tags { display: block; font-size: 11px; color: #a5aec4; margin-top: 1px; }
.tag-dot { width: 7px; height: 7px; border-radius: 99px; flex: none; }

@media (max-width: 640px) {
  .tag-grid { grid-template-columns: 1fr; }
  .pf-group-btn-label { display: none; }
  .pf-group-body { padding-left: 12px; }
  .pf-group-head { padding: 6px 8px; gap: 4px; }
  .pf-tagbar-manage { width: 100%; margin-left: 0; }
}

/* ==================================================== en-têtes d'écran */
/* Un seul gabarit de titre pour toutes les pages : surtitre, titre, résumé,
   actions alignées à droite. Il remplace les en-têtes improvisés écran par
   écran et garde la même respiration partout. */
.page-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 16px; flex-wrap: wrap; margin-bottom: 18px;
}
.page-head-main { min-width: 0; }
.page-eyebrow {
  font-size: 11px; font-weight: 700; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--t-ink-400);
}
.page-title {
  font-size: 25px; font-weight: 700; letter-spacing: -0.025em;
  color: var(--ink); line-height: 1.18; margin-top: 3px;
}
.page-sub { font-size: 13px; color: var(--muted); margin-top: 4px; line-height: 1.5;
  max-width: 78ch;}
.page-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
@media (max-width: 720px) {
  .page-title { font-size: 20px; }
  .page-head { align-items: flex-start; }
  .page-actions { width: 100%; }
}

/* ============================================ barre de filtres unifiée */
/* Trois zones, toujours dans le même ordre : chercher, filtrer, compter.
   Les vues rapides sont des pastilles ; les filtres avancés vivent dans un
   panneau replié, groupé par thème, jamais empilés au hasard. */
.portfolio-toolbar { padding: 12px 14px 8px; margin-bottom: 14px; }
.filter-toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.filter-toolbar .pf-search { flex: 1 1 200px; max-width: 460px; }
/* Les menus d'une barre restent à leur taille naturelle : sans cela, un
   select en width:100% repousse le bouton et le compteur à la ligne. */
.filter-toolbar > .select, .filter-toolbar > .input {
  flex: 0 0 auto; width: auto; min-width: 160px; max-width: 210px;
}
.filter-toggle { gap: 6px; }
.filter-toggle.is-open {
  background: var(--brand-soft); border-color: var(--brand-line); color: var(--brand);
}
.filter-count {
  display: inline-grid; place-items: center; min-width: 17px; height: 17px;
  padding: 0 5px; border-radius: 99px; background: var(--brand); color: #fff;
  font-size: 11px; font-weight: 700; line-height: 1;
}
.toolbar-result {
  margin-left: auto; font-size: 12px; font-weight: 650; color: var(--muted);
  white-space: nowrap;
}

.quick-views {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  margin-top: 10px; padding-top: 10px; border-top: 1px solid #f0f2f7;
  border-top-color: var(--line);}
.quick-views-label {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.12em;
  font-weight: 700; color: var(--t-ink-400); margin-right: 2px; white-space: nowrap;
}
.qv {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 9px; border-radius: 99px; border: 1px solid var(--line);
  background: var(--card); font-size: 12px; font-weight: 600; color: var(--ink-2);
  cursor: pointer; white-space: nowrap; transition: all 0.12s ease;
}
.qv b { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--muted); }
.qv:hover { border-color: var(--brand-line); background: var(--hover); color: var(--brand); }
.qv:hover b { color: var(--brand); }
.qv.is-active { background: var(--brand-soft); border-color: var(--brand-line); color: var(--brand); }
.qv.is-active b { color: var(--brand); }
.qv-danger b { color: var(--danger); }
.qv-warn b { color: var(--warn); }
.qv-danger.is-active { background: var(--danger-soft); border-color: #fbd5dc; color: var(--danger); }
.qv-danger.is-active b { color: var(--danger); }
.qv-warn.is-active { background: var(--warn-soft); border-color: #fcecc0; color: var(--warn); }
.qv-warn.is-active b { color: var(--warn); }

.filter-active {
  display: flex; flex-wrap: wrap; align-items: center; gap: 5px;
  margin-top: 8px;
}
.filter-active-label {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.12em;
  font-weight: 700; color: var(--t-ink-400); margin-right: 2px;
}
.filter-empty { font-size: 11px; color: var(--muted-soft); padding: 2px 0; }
.filter-chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 8px; border-radius: 99px; border: 1px solid #d5dbfb;
  background: var(--brand-soft); color: var(--brand); font-size: 12px; font-weight: 600;
  cursor: pointer; line-height: 1.35;
  border-color: var(--brand-line);}
.filter-chip:hover { background: var(--brand-line); border-color: #b9c3f7; }
.filter-chip span { color: var(--muted); font-size: 12px; line-height: 1; }
.filter-clear-all {
  border: 0; background: none; padding: 3px 5px; cursor: pointer;
  font-size: 12px; font-weight: 600; color: var(--muted);
  text-decoration: underline; text-underline-offset: 2px;
}
.filter-clear-all:hover { color: var(--danger); }

/* Panneau groupé : quatre ou cinq blocs lisibles, jamais une bouillie de
   menus. Il s'ouvre sous la barre, sans changer de page. */
.filter-panel {
  margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line);
  animation: fade 0.16s ease both;
}
.filter-panel[hidden] { display: none; }
.filter-panel-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 12px; margin-bottom: 10px;
}
.filter-panel-title { font-size: 13px; font-weight: 650; color: var(--ink); }
.filter-panel-sub { font-size: 12px; color: var(--muted); margin-top: 2px; line-height: 1.45; }
.filter-grid {
  display: grid; gap: 10px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.filter-group {
  border: 1px solid #eef0f6; border-radius: 10px;
  padding: 10px 10px 11px; background: var(--card); min-width: 0;
}
.filter-group-title {
  display: flex; align-items: baseline; justify-content: space-between; gap: 6px;
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.1em; color: var(--t-ink-500); margin-bottom: 8px;
}
.filter-group-title span {
  text-transform: none; letter-spacing: 0; font-size: 11px;
  font-weight: 500; color: var(--muted-soft); white-space: nowrap;
}
.filter-fields { display: grid; gap: 8px; }
.filter-field { display: block; min-width: 0; }
.filter-field > span {
  display: block; font-size: 11px; font-weight: 600;
  color: var(--t-ink-500); margin-bottom: 4px;
}
.filter-field .select { font-size: 12px; padding: 6px 8px; padding-right: 26px; }
.filter-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.filter-more {
  display: inline-block; margin-top: 7px; font-size: 11px;
  font-weight: 600; color: var(--brand);
}
.filter-more:hover { text-decoration: underline; }
.filter-panel-foot {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; flex-wrap: wrap; margin-top: 10px; padding-top: 10px;
  border-top: 1px solid #f0f2f7; font-size: 12px; color: var(--muted);
}
@media (max-width: 1180px) {
  .filter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .filter-grid { grid-template-columns: 1fr; }
  .filter-toolbar .pf-search { flex-basis: 100%; max-width: none; }
  .toolbar-result { display: none; }
  .quick-views {
    flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none;
    margin-left: -2px; padding-left: 2px;
  }
  .quick-views::-webkit-scrollbar { display: none; }
  .quick-views-label { display: none; }
}

/* ===================================================== plan de journée */
/* Une seule file, dans l'ordre du jour : atelier, rendez-vous, échéance.
   L'heure ou le retard est à gauche, la personne au centre, le geste à droite. */
.day-plan { display: flex; flex-direction: column; }
.day-row {
  display: grid; grid-template-columns: 62px minmax(0, 1fr) auto;
  gap: 10px; align-items: center; padding: 9px 0;
  border-bottom: 1px solid #f0f2f7;
}
.day-row:last-child { border-bottom: 0; padding-bottom: 2px; }
.day-when {
  font-size: 12px; font-weight: 700; color: var(--muted);
  font-variant-numeric: tabular-nums; line-height: 1.3;
}
.day-when.late { color: var(--danger); }
.day-when small { display: block; font-size: 11px; font-weight: 600; color: var(--muted-soft); }
.day-main { min-width: 0; }
.day-title { font-size: 13px; font-weight: 650; color: var(--ink); line-height: 1.3; }
.day-who { font-size: 12px; color: var(--ink-2); margin-top: 1px; }
.day-why {
  font-size: 11px; color: var(--muted); margin-top: 2px;
  display: flex; align-items: center; gap: 4px; flex-wrap: wrap;
}
.day-cta { white-space: nowrap; }
.day-empty { padding: 6px 0 2px; }
.day-foot {
  margin: 10px 0 0; padding-top: 9px; border-top: 1px solid #f0f2f7;
  font-size: 11px; color: var(--muted); display: flex;
  align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap;
}
@media (max-width: 560px) {
  .day-row { grid-template-columns: 52px minmax(0, 1fr); }
  .day-row .day-cta { grid-column: 2; justify-self: start; margin-top: -2px; }
}

/* Bloc repliable des fiches : l'essentiel reste visible, le reste se déplie. */
.fold { margin-top: 2px; }
.fold-head {
  display: flex; align-items: center; gap: 9px;
  padding: 11px 13px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 12px; cursor: pointer; list-style: none;
  font-size: 12px; font-weight: 650; color: var(--ink);
  box-shadow: var(--shadow);
}
.fold-head::-webkit-details-marker { display: none; }
.fold-head:hover { border-color: var(--brand-line); background: var(--surface-2); }
.fold-head .muted { font-weight: 500; font-size: 11px; }
.fold-chevron { margin-left: auto; color: var(--muted-soft); display: grid; place-items: center; transition: transform .15s; }
.fold[open] .fold-head { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
.fold[open] .fold-chevron { transform: rotate(180deg); }
.fold-body { display: flex; flex-direction: column; gap: 12px; padding-top: 12px; }

/* ==========================================================================
   Thèmes — huit palettes, une seule feuille.
   Les variables remplacent les couleurs écrites en dur des composants ;
   les couleurs des vues (classes Tailwind arbitraires) sont repeintes par
   assets/theme.js. Rien ici ne change l'apparence par défaut : « Clair »
   reprend exactement les valeurs d'origine.
   ========================================================================== */
:root, html[data-theme="clair"] {
  --bg: #f5f6fa; --card: #ffffff; --surface: #f8f9fd; --surface-2: #f1f3f8;
  --line: #e6e8ef; --line-strong: #d4d9e5; --ink: #0b1224; --ink-2: #33405c;
  --muted: #5c657c; --muted-soft: #636d7b;
  --brand: #3b46d6; --brand-dark: #2f38b4; --brand-soft: #eef1ff; --brand-line: #c7cffa; --on-brand: #ffffff;
  --hover: #fafbff; --table-head: #f8fafc; --chip: #f4f6fa; --chip-line: #e9edf4;
  --ok: #047857; --warn: #b45309; --danger: #be123c; --info: #1d4ed8;
  --ok-soft: #ecfdf5; --warn-soft: #fffbeb; --danger-soft: #fff1f3; --info-soft: #eff6ff;
  --warn-line: #fde9b8; --danger-line: #fecdd3; --info-line: #d8e6ff; --ok-line: #c7f0dd;
  --topbar-bg: rgba(255, 255, 255, 0.86);
  --sidebar-bg: linear-gradient(180deg, #0c1427 0%, #0a1122 55%, #0a0f1d 100%);
  --sidebar-ink: #b9c3d8; --sidebar-muted: #8d99b6;
  --t-ink-900: #0b1224; --t-ink-800: #131c33; --t-ink-700: #1f2a44;
  --t-ink-600: #33405c; --t-ink-500: #5b6784; --t-ink-400: #646e83;
}
html[data-theme="sombre"] {
  --bg: #0d1220; --card: #151c2c; --surface: #19212f; --surface-2: #202a3b;
  --line: #29344a; --line-strong: #3a4760; --ink: #e9eef8; --ink-2: #c3cddf;
  --muted: #98a5bc; --muted-soft: #8894aa;
  --brand: #8b95f5; --brand-dark: #a5b4fc; --brand-soft: #222b47; --brand-line: #3d4a78; --on-brand: #0b1020;
  --hover: #1c2536; --table-head: #19212f; --chip: #202a3b; --chip-line: #2c3850;
  --ok: #6ee7b7; --warn: #fcd34d; --danger: #fda4af; --info: #93c5fd;
  --ok-soft: #142a26; --warn-soft: #2b2415; --danger-soft: #2c1a22; --info-soft: #17243a;
  --warn-line: #4a3a18; --danger-line: #4d2733; --info-line: #2a3d5c; --ok-line: #1e4a3a;
  --topbar-bg: rgba(13, 18, 32, 0.88);
  --sidebar-bg: linear-gradient(180deg, #0a0f1a 0%, #070b13 60%, #05080f 100%);
  --sidebar-ink: #b3bfd6; --sidebar-muted: #818ea8;
  --t-ink-900: #e9eef8; --t-ink-800: #dbe3f2; --t-ink-700: #c3cde0;
  --t-ink-600: #a9b6cd; --t-ink-500: #8e9cb6; --t-ink-400: #8892a8;
  --shadow: 0 1px 2px rgba(0,0,0,.35), 0 1px 3px rgba(0,0,0,.30);
  --shadow-lg: 0 20px 44px -14px rgba(0,0,0,.65);
}
html[data-theme="automne"] {
  --bg: #f6efe4; --card: #fffdf8; --surface: #faf3e8; --surface-2: #f2e6d5;
  --line: #e8dac6; --line-strong: #d9c6ab; --ink: #2c2115; --ink-2: #4a3a27;
  --muted: #6c5b47; --muted-soft: #706454;
  --brand: #a84a08; --brand-dark: #92400e; --brand-soft: #fdf0dd; --brand-line: #f0d3a8; --on-brand: #ffffff;
  --hover: #fffaf2; --table-head: #faf3e8; --chip: #f5ece0; --chip-line: #ecdfcc;
  --topbar-bg: rgba(255, 250, 242, 0.9);
  --sidebar-bg: linear-gradient(180deg, #33220f 0%, #291b0c 55%, #1e1308 100%);
  --sidebar-ink: #e8dcc9; --sidebar-muted: #b7a68f;
  --t-ink-900: #2c2115; --t-ink-800: #3a2c1c; --t-ink-700: #4a3a27;
  --t-ink-600: #5f4a31; --t-ink-500: #76644d; --t-ink-400: #73634e;
}
html[data-theme="cerisier"] {
  --bg: #fdf3f7; --card: #fffbfd; --surface: #fdf1f6; --surface-2: #f9e6ee;
  --line: #f2dbe6; --line-strong: #e7c3d4; --ink: #3a1b29; --ink-2: #5c3145;
  --muted: #775667; --muted-soft: #77616c;
  --brand: #c2255c; --brand-dark: #a61e4d; --brand-soft: #fde8f0; --brand-line: #f7c6da; --on-brand: #ffffff;
  --hover: #fff7fa; --table-head: #fdf1f6; --chip: #fbeaf1; --chip-line: #f4dae6;
  --topbar-bg: rgba(255, 250, 252, 0.9);
  --sidebar-bg: linear-gradient(180deg, #3a1728 0%, #2e1120 55%, #240c17 100%);
  --sidebar-ink: #f3dbe6; --sidebar-muted: #c9a3b4;
  --t-ink-900: #3a1b29; --t-ink-800: #4a2434; --t-ink-700: #5c3143;
  --t-ink-600: #74465a; --t-ink-500: #825e71; --t-ink-400: #7c5f6e;
}
html[data-theme="yin-yang"] {
  --bg: #f2f2f2; --card: #ffffff; --surface: #f8f8f8; --surface-2: #ececec;
  --line: #dcdcdc; --line-strong: #c4c4c4; --ink: #0a0a0a; --ink-2: #2b2b2b;
  --muted: #606060; --muted-soft: #696969;
  --brand: #111111; --brand-dark: #000000; --brand-soft: #ededed; --brand-line: #cfcfcf; --on-brand: #ffffff;
  --hover: #fafafa; --table-head: #f7f7f7; --chip: #f0f0f0; --chip-line: #e0e0e0;
  --ok: #067647; --warn: #8a5a00; --danger: #b42318; --info: #344054;
  --ok-soft: #f2f7f4; --warn-soft: #f8f5ec; --danger-soft: #f9f2f1; --info-soft: #f3f4f6;
  --topbar-bg: rgba(255, 255, 255, 0.9);
  --sidebar-bg: linear-gradient(180deg, #000000 0%, #0a0a0a 60%, #000000 100%);
  --sidebar-ink: #e6e6e6; --sidebar-muted: #a3a3a3;
  --t-ink-900: #0a0a0a; --t-ink-800: #1a1a1a; --t-ink-700: #2b2b2b;
  --t-ink-600: #3a3a3a; --t-ink-500: #555555; --t-ink-400: #686868;
}
html[data-theme="ocean"] {
  --bg: #eef5f8; --card: #ffffff; --surface: #f2f9fb; --surface-2: #e6f2f5;
  --line: #d5e6ea; --line-strong: #b9d6dd; --ink: #0c2b33; --ink-2: #234b55;
  --muted: #496770; --muted-soft: #576e74;
  --brand: #0e7490; --brand-dark: #0b5c73; --brand-soft: #e2f4fa; --brand-line: #b7e0eb; --on-brand: #ffffff;
  --hover: #f7fcfe; --table-head: #f0f8fa; --chip: #eaf5f8; --chip-line: #dcebef;
  --topbar-bg: rgba(250, 254, 255, 0.9);
  --sidebar-bg: linear-gradient(180deg, #083640 0%, #052a32 55%, #041f26 100%);
  --sidebar-ink: #d8e9ee; --sidebar-muted: #9fc0c8;
  --t-ink-900: #0c2b33; --t-ink-800: #113a44; --t-ink-700: #174b57;
  --t-ink-600: #23606e; --t-ink-500: #3a7381; --t-ink-400: #47717b;
}
html[data-theme="foret"] {
  --bg: #f0f6ee; --card: #ffffff; --surface: #f5faf3; --surface-2: #e9f2e5;
  --line: #d9e7d2; --line-strong: #c1d7b8; --ink: #172a19; --ink-2: #34503a;
  --muted: #4f6952; --muted-soft: #5c705e;
  --brand: #2f6b3a; --brand-dark: #24552e; --brand-soft: #e8f5e8; --brand-line: #c4e3c4; --on-brand: #ffffff;
  --hover: #f8fcf6; --table-head: #f3f9f0; --chip: #edf5e9; --chip-line: #e0edda;
  --topbar-bg: rgba(252, 255, 251, 0.9);
  --sidebar-bg: linear-gradient(180deg, #0f3320 0%, #0b2817 55%, #081d0f 100%);
  --sidebar-ink: #d6e8d9; --sidebar-muted: #9dbda2;
  --t-ink-900: #172a19; --t-ink-800: #1f3822; --t-ink-700: #2a4a2e;
  --t-ink-600: #3a6140; --t-ink-500: #507356; --t-ink-400: #55715d;
}
html[data-theme="aurore"] {
  --bg: #f2f1fa; --card: #ffffff; --surface: #f7f6fd; --surface-2: #eeeafb;
  --line: #e1ddf3; --line-strong: #ccc4ea; --ink: #241f3a; --ink-2: #433c63;
  --muted: #625c7c; --muted-soft: #6b667c;
  --brand: #6d4bd8; --brand-dark: #5b21b6; --brand-soft: #f0ebff; --brand-line: #d8ccfa; --on-brand: #ffffff;
  --hover: #faf8ff; --table-head: #f5f2fd; --chip: #f2eefb; --chip-line: #e7e1f5;
  --topbar-bg: rgba(252, 251, 255, 0.9);
  --sidebar-bg: linear-gradient(180deg, #241c47 0%, #1c1638 55%, #16112b 100%);
  --sidebar-ink: #e3ddf6; --sidebar-muted: #aba2c9;
  --t-ink-900: #241f3a; --t-ink-800: #2f2849; --t-ink-700: #3d3559;
  --t-ink-600: #4f466f; --t-ink-500: #6a6089; --t-ink-400: #6c6483;
}

/* ==========================================================================
   Onze thèmes dégradés — tons adoucis : les fonds restent colorés mais plus
   clairs, les dégradés sont des voiles pâles plutôt que des aplats sombres.
   Le fond de page, la barre latérale, le bouton principal, le logo et le
   liseré de la barre du haut portent un dégradé ; les cartes restent
   opaques pour que le texte garde son contraste. `--btn-ink` donne au
   bouton principal une encre lisible sur un dégradé clair.
   ========================================================================== */
html[data-theme="nebuleuse"] {
  --bg: #241f3d; --card: #2c2649; --surface: #342d55; --surface-2: #3e3664;
  --line: #473d76; --line-strong: #5c5092;
  --ink: #f4efff; --ink-2: #ded5f5; --muted: #bbb0d9; --muted-soft: #ada3c8;
  --brand: #c3b0ff; --brand-dark: #d5c6ff; --brand-soft: #3a3263; --brand-line: #55498f; --on-brand: #2a1d4d; --btn-ink: #2a1d4d;
  --hover: #322b52; --table-head: #342d55; --chip: #3e3664; --chip-line: #4f4479;
  --ok: #6ee7b7; --warn: #fcd34d; --danger: #fda4af; --info: #93c5fd;
  --ok-soft: #1e3b33; --warn-soft: #3a3322; --danger-soft: #3a2630; --info-soft: #223a52;
  --warn-line: #5e4c26; --danger-line: #5e3644; --info-line: #35506e; --ok-line: #2d5c4c;
  --shadow: 0 1px 2px rgba(0,0,0,.28), 0 1px 3px rgba(0,0,0,.22);
  --shadow-lg: 0 22px 48px -16px rgba(0,0,0,.55);
  --topbar-bg: rgba(36, 31, 61, 0.82);
  --sidebar-bg: linear-gradient(180deg, #4a3f7d 0%, #322a56 55%, #262046 100%);
  --sidebar-ink: #ded5f5; --sidebar-muted: #b0a5cf;
  --t-ink-900: #f4efff; --t-ink-800: #e8e0fb; --t-ink-700: #d6cbf2;
  --t-ink-600: #c0b4de; --t-ink-500: #aea2cc; --t-ink-400: #ada5c3;
  --page-grad: radial-gradient(1000px 640px at 6% -10%, rgba(199,180,255,.34), transparent 66%), radial-gradient(900px 580px at 100% 4%, rgba(251,207,232,.24), transparent 62%), linear-gradient(168deg, #2e2850 0%, #262046 55%, #312a55 100%);
  --btn-grad: linear-gradient(135deg, #cbb9ff 0%, #ddc6ff 48%, #fbcfe8 100%);
  --mark-grad: linear-gradient(140deg, #cbb9ff, #f0abfc 55%, #a5f3fc);
  --edge-grad: linear-gradient(90deg, #c3b0ff, #f0abfc 55%, #a5f3fc);
}
html[data-theme="crepuscule"] {
  --bg: #35242c; --card: #3f2c35; --surface: #49343e; --surface-2: #553e49;
  --line: #644a55; --line-strong: #7d5b69;
  --ink: #fff2f6; --ink-2: #f8dbe4; --muted: #dcb6c2; --muted-soft: #cbacb6;
  --brand: #f7a8c0; --brand-dark: #fbc0d2; --brand-soft: #55303d; --brand-line: #774554; --on-brand: #3d1024; --btn-ink: #3d1024;
  --hover: #4b3540; --table-head: #49343e; --chip: #553e49; --chip-line: #684a57;
  --ok: #6ee7b7; --warn: #fcd34d; --danger: #fda4af; --info: #93c5fd;
  --ok-soft: #1e3b33; --warn-soft: #3a3322; --danger-soft: #3a2630; --info-soft: #223a52;
  --warn-line: #5e4c26; --danger-line: #5e3644; --info-line: #35506e; --ok-line: #2d5c4c;
  --shadow: 0 1px 2px rgba(0,0,0,.28), 0 1px 3px rgba(0,0,0,.22);
  --shadow-lg: 0 22px 48px -16px rgba(0,0,0,.55);
  --topbar-bg: rgba(53, 36, 44, 0.82);
  --sidebar-bg: linear-gradient(180deg, #653c4c 0%, #4a2e3a 55%, #372530 100%);
  --sidebar-ink: #f6dbe4; --sidebar-muted: #d3aab6;
  --t-ink-900: #fff2f6; --t-ink-800: #fbe3ea; --t-ink-700: #f3cfdb;
  --t-ink-600: #e3b6c5; --t-ink-500: #d4a9b6; --t-ink-400: #cbabb5;
  --page-grad: radial-gradient(950px 580px at 0% -8%, rgba(253,186,116,.26), transparent 62%), radial-gradient(880px 560px at 100% 6%, rgba(249,168,196,.26), transparent 60%), linear-gradient(162deg, #3e2b35 0%, #35242c 55%, #402b36 100%);
  --btn-grad: linear-gradient(135deg, #fbd0b4 0%, #f8b4c7 52%, #f5b8d8 100%);
  --mark-grad: linear-gradient(140deg, #fbd0b4, #f8b4c7 55%, #f5b8d8);
  --edge-grad: linear-gradient(90deg, #fbbf94, #f7a8c0 55%, #f5b8d8);
}
html[data-theme="electrique"] {
  --bg: #17323c; --card: #1e3b47; --surface: #244453; --surface-2: #2b4f5f;
  --line: #31596a; --line-strong: #437288;
  --ink: #eafcff; --ink-2: #cfeef6; --muted: #a7ceda; --muted-soft: #a3c1cc;
  --brand: #86e7f7; --brand-dark: #a8effb; --brand-soft: #1f4a56; --brand-line: #347082; --on-brand: #0c3038; --btn-ink: #0c3038;
  --hover: #264a57; --table-head: #244453; --chip: #2b4f5f; --chip-line: #386274;
  --ok: #6ee7b7; --warn: #fcd34d; --danger: #fda4af; --info: #93c5fd;
  --ok-soft: #1e3b33; --warn-soft: #3a3322; --danger-soft: #3a2630; --info-soft: #223a52;
  --warn-line: #5e4c26; --danger-line: #5e3644; --info-line: #35506e; --ok-line: #2d5c4c;
  --shadow: 0 1px 2px rgba(0,0,0,.28), 0 1px 3px rgba(0,0,0,.22);
  --shadow-lg: 0 22px 48px -16px rgba(0,0,0,.55);
  --topbar-bg: rgba(23, 50, 60, 0.82);
  --sidebar-bg: linear-gradient(180deg, #22525f 0%, #1a3a45 55%, #17323c 100%);
  --sidebar-ink: #d6f1f7; --sidebar-muted: #a1c6d1;
  --t-ink-900: #eafcff; --t-ink-800: #d9f7fd; --t-ink-700: #c4eef8;
  --t-ink-600: #aedde9; --t-ink-500: #97c4d1; --t-ink-400: #a3c1cb;
  --page-grad: radial-gradient(920px 540px at 100% 0%, rgba(134,231,247,.26), transparent 62%), radial-gradient(820px 500px at 0% 100%, rgba(190,242,100,.18), transparent 60%), linear-gradient(170deg, #1d3e49 0%, #17323c 55%, #1e3d48 100%);
  --btn-grad: linear-gradient(135deg, #b8f4fb 0%, #8ee7f3 50%, #d9f99d 100%);
  --mark-grad: linear-gradient(140deg, #86e7f7, #67e8f9 55%, #bef264);
  --edge-grad: linear-gradient(90deg, #86e7f7, #bef264);
}
html[data-theme="braise"] {
  --bg: #35231d; --card: #3f2b24; --surface: #49332b; --surface-2: #553c33;
  --line: #664840; --line-strong: #7f5a4e;
  --ink: #fff3ec; --ink-2: #f8dacb; --muted: #dcb2a1; --muted-soft: #cba99b;
  --brand: #f9b08a; --brand-dark: #fbc8a8; --brand-soft: #553122; --brand-line: #77483a; --on-brand: #401808; --btn-ink: #401808;
  --hover: #4a3229; --table-head: #49332b; --chip: #553c33; --chip-line: #684a3f;
  --ok: #6ee7b7; --warn: #fcd34d; --danger: #fda4af; --info: #93c5fd;
  --ok-soft: #1e3b33; --warn-soft: #3a3322; --danger-soft: #3a2630; --info-soft: #223a52;
  --warn-line: #5e4c26; --danger-line: #5e3644; --info-line: #35506e; --ok-line: #2d5c4c;
  --shadow: 0 1px 2px rgba(0,0,0,.28), 0 1px 3px rgba(0,0,0,.22);
  --shadow-lg: 0 22px 48px -16px rgba(0,0,0,.55);
  --topbar-bg: rgba(53, 35, 29, 0.82);
  --sidebar-bg: linear-gradient(180deg, #623a28 0%, #48291e 55%, #35231d 100%);
  --sidebar-ink: #f8dccd; --sidebar-muted: #d6ab99;
  --t-ink-900: #fff3ec; --t-ink-800: #fbe4d8; --t-ink-700: #f3d0c0;
  --t-ink-600: #e4b5a2; --t-ink-500: #d5a695; --t-ink-400: #caa89a;
  --page-grad: radial-gradient(920px 540px at 8% -8%, rgba(253,186,116,.28), transparent 60%), linear-gradient(160deg, #3f2a22 0%, #35231d 55%, #412b23 100%);
  --btn-grad: linear-gradient(135deg, #fbdcb2 0%, #f9bc96 52%, #f8b0b0 100%);
  --mark-grad: linear-gradient(140deg, #fbdcb2, #f9bc96 55%, #f8a8b0);
  --edge-grad: linear-gradient(90deg, #f9b08a, #f8a8b0);
}
html[data-theme="ultraviolet"] {
  --bg: #2d1e3f; --card: #362547; --surface: #402d54; --surface-2: #4a3560;
  --line: #563e70; --line-strong: #6d518c;
  --ink: #faf0ff; --ink-2: #e7d2f8; --muted: #c8addf; --muted-soft: #b8a2cd;
  --brand: #ddb8ff; --brand-dark: #ead2ff; --brand-soft: #462f60; --brand-line: #624585; --on-brand: #31154a; --btn-ink: #31154a;
  --hover: #40305a; --table-head: #402d54; --chip: #4a3560; --chip-line: #5c4478;
  --ok: #6ee7b7; --warn: #fcd34d; --danger: #fda4af; --info: #93c5fd;
  --ok-soft: #1e3b33; --warn-soft: #3a3322; --danger-soft: #3a2630; --info-soft: #223a52;
  --warn-line: #5e4c26; --danger-line: #5e3644; --info-line: #35506e; --ok-line: #2d5c4c;
  --shadow: 0 1px 2px rgba(0,0,0,.28), 0 1px 3px rgba(0,0,0,.22);
  --shadow-lg: 0 22px 48px -16px rgba(0,0,0,.55);
  --topbar-bg: rgba(45, 30, 63, 0.82);
  --sidebar-bg: linear-gradient(180deg, #513270 0%, #39254d 55%, #2d1e3f 100%);
  --sidebar-ink: #e9d5f9; --sidebar-muted: #c4a9da;
  --t-ink-900: #faf0ff; --t-ink-800: #eedcfb; --t-ink-700: #e2c8f5;
  --t-ink-600: #cfb1e7; --t-ink-500: #bfa0d7; --t-ink-400: #b9a2ca;
  --page-grad: radial-gradient(940px 560px at 100% 0%, rgba(221,184,255,.26), transparent 62%), radial-gradient(860px 520px at 0% 100%, rgba(249,168,212,.18), transparent 60%), linear-gradient(155deg, #34224a 0%, #2d1e3f 55%, #372452 100%);
  --btn-grad: linear-gradient(135deg, #ecd6ff 0%, #ddb8ff 50%, #f5c8f0 100%);
  --mark-grad: linear-gradient(140deg, #ecd6ff, #ddb8ff 55%, #f5c8f0);
  --edge-grad: linear-gradient(90deg, #ddb8ff, #f5c8f0);
}
html[data-theme="charbon-or"] {
  --bg: #26262b; --card: #2e2e34; --surface: #35353c; --surface-2: #3e3e47;
  --line: #4c4c56; --line-strong: #63636e;
  --ink: #faf6ec; --ink-2: #e8dfcd; --muted: #c1b8a5; --muted-soft: #b2ab9e;
  --brand: #e6cd8b; --brand-dark: #efdca6; --brand-soft: #423a27; --brand-line: #635634; --on-brand: #2e2408; --btn-ink: #2e2408;
  --hover: #36363d; --table-head: #35353c; --chip: #3e3e47; --chip-line: #4f4f59;
  --ok: #6ee7b7; --warn: #fcd34d; --danger: #fda4af; --info: #93c5fd;
  --ok-soft: #1e3b33; --warn-soft: #3a3322; --danger-soft: #3a2630; --info-soft: #223a52;
  --warn-line: #5e4c26; --danger-line: #5e3644; --info-line: #35506e; --ok-line: #2d5c4c;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 1px 3px rgba(0,0,0,.24);
  --shadow-lg: 0 22px 48px -16px rgba(0,0,0,.6);
  --topbar-bg: rgba(38, 38, 43, 0.86);
  --sidebar-bg: linear-gradient(180deg, #3c382f 0%, #2c2c31 55%, #26262b 100%);
  --sidebar-ink: #ece5d3; --sidebar-muted: #c1b8a5;
  --t-ink-900: #faf6ec; --t-ink-800: #f0e9da; --t-ink-700: #e4dac6;
  --t-ink-600: #d0c6b1; --t-ink-500: #b8ae99; --t-ink-400: #b1ab9e;
  --page-grad: radial-gradient(880px 540px at 0% 0%, rgba(230,205,139,.20), transparent 60%), linear-gradient(160deg, #2d2d33 0%, #26262b 55%, #2f2e34 100%);
  --btn-grad: linear-gradient(135deg, #f7ecc8 0%, #e6cd8b 55%, #d9b96a 100%);
  --mark-grad: linear-gradient(140deg, #f7ecc8, #e6cd8b 55%, #cdae5e);
  --edge-grad: linear-gradient(90deg, #e6cd8b, #cdae5e);
}
html[data-theme="desert"] {
  --bg: #fbf5ec; --card: #fffdfa; --surface: #fdf8f0; --surface-2: #f8ede0;
  --line: #efe2d1; --line-strong: #e0cbaf;
  --ink: #3b2717; --ink-2: #5d402a; --muted: #7a5d46; --muted-soft: #7b6753;
  --brand: #a84a08; --brand-dark: #92400e; --brand-soft: #fdeee0; --brand-line: #f2cfa9; --on-brand: #ffffff; --btn-ink: #2a1204;
  --hover: #fffaf3; --table-head: #fdf8f0; --chip: #f9eee1; --chip-line: #f0e0cd;
  --topbar-bg: rgba(255, 251, 245, 0.88);
  --sidebar-bg: linear-gradient(180deg, #4d2c18 0%, #38200f 55%, #2b1808 100%);
  --sidebar-ink: #f2ddc7; --sidebar-muted: #cfae8c;
  --t-ink-900: #3b2717; --t-ink-800: #4b331f; --t-ink-700: #5d402a;
  --t-ink-600: #765538; --t-ink-500: #82644a; --t-ink-400: #7e6652;
  --page-grad: radial-gradient(900px 520px at 0% -6%, rgba(251,191,36,.16), transparent 64%), linear-gradient(148deg, #fef8ef 0%, #fbeedd 52%, #f8e6d2 100%);
  --btn-grad: linear-gradient(135deg, #fde2b8 0%, #fbcf9a 50%, #f8bd8f 100%);
  --mark-grad: linear-gradient(140deg, #fbcf9a, #f59e0b 55%, #b45309);
  --edge-grad: linear-gradient(90deg, #f59e0b, #c2410c);
}
html[data-theme="menthe"] {
  --bg: #f1faf6; --card: #ffffff; --surface: #f6fcf9; --surface-2: #e8f6ef;
  --line: #d6ece2; --line-strong: #b7dccd;
  --ink: #0e2c24; --ink-2: #244c40; --muted: #4c6b60; --muted-soft: #5a7169;
  --brand: #0f766e; --brand-dark: #115e59; --brand-soft: #e2f7f1; --brand-line: #bce8dd; --on-brand: #ffffff; --btn-ink: #05322e;
  --hover: #f8fefc; --table-head: #f3fbf7; --chip: #eaf8f2; --chip-line: #d8efe6;
  --topbar-bg: rgba(248, 254, 251, 0.88);
  --sidebar-bg: linear-gradient(180deg, #12504a 0%, #0c3b36 55%, #072a26 100%);
  --sidebar-ink: #d9f0e9; --sidebar-muted: #a3c8bc;
  --t-ink-900: #0e2c24; --t-ink-800: #173d33; --t-ink-700: #244c40;
  --t-ink-600: #376558; --t-ink-500: #547469; --t-ink-400: #56736a;
  --page-grad: radial-gradient(880px 500px at 0% 0%, rgba(52,211,153,.16), transparent 64%), linear-gradient(150deg, #f5fdf9 0%, #e8faf3 52%, #e4f5fb 100%);
  --btn-grad: linear-gradient(135deg, #c6f5e5 0%, #9beed8 50%, #92e9e2 100%);
  --mark-grad: linear-gradient(140deg, #9beed8, #14b8a6 55%, #0891b2);
  --edge-grad: linear-gradient(90deg, #2dd4bf, #0e7490);
}
html[data-theme="citron-vert"] {
  --bg: #f8fceb; --card: #ffffff; --surface: #fbfdf3; --surface-2: #eff8dd;
  --line: #e2edc6; --line-strong: #cddfa4;
  --ink: #25320e; --ink-2: #3d5019; --muted: #5c6c37; --muted-soft: #667248;
  --brand: #3f6212; --brand-dark: #365314; --brand-soft: #edf9d4; --brand-line: #d3e8a3; --on-brand: #ffffff; --btn-ink: #1a2405;
  --hover: #fcfef6; --table-head: #f8fcea; --chip: #f1f9dd; --chip-line: #e2efc6;
  --topbar-bg: rgba(252, 254, 246, 0.88);
  --sidebar-bg: linear-gradient(180deg, #35481a 0%, #26350f 55%, #1b2708 100%);
  --sidebar-ink: #e8f1d1; --sidebar-muted: #b8c98f;
  --t-ink-900: #25320e; --t-ink-800: #314115; --t-ink-700: #3d5019;
  --t-ink-600: #52682a; --t-ink-500: #62733b; --t-ink-400: #657445;
  --page-grad: radial-gradient(880px 500px at 100% -6%, rgba(190,242,100,.18), transparent 64%), linear-gradient(145deg, #fcfef5 0%, #f5fce2 50%, #eef9d2 100%);
  --btn-grad: linear-gradient(135deg, #eefbc8 0%, #dcf59a 48%, #c9f083 100%);
  --mark-grad: linear-gradient(140deg, #dcf59a, #84cc16 55%, #3f6212);
  --edge-grad: linear-gradient(90deg, #a3e635, #4d7c0f);
}
html[data-theme="bonbon"] {
  --bg: #fdf4fb; --card: #ffffff; --surface: #fff7fd; --surface-2: #fbe9f6;
  --line: #f3dbee; --line-strong: #e7c1e0;
  --ink: #3b1332; --ink-2: #5f2450; --muted: #825376; --muted-soft: #7f6174;
  --brand: #be185d; --brand-dark: #9d174d; --brand-soft: #fde8f4; --brand-line: #f5c2de; --on-brand: #ffffff; --btn-ink: #3b1332;
  --hover: #fff9fd; --table-head: #fdf2fa; --chip: #fbeaf6; --chip-line: #f5dbec;
  --topbar-bg: rgba(255, 250, 253, 0.88);
  --sidebar-bg: linear-gradient(180deg, #50184a 0%, #3a0f35 55%, #2d0a29 100%);
  --sidebar-ink: #f4dcee; --sidebar-muted: #d2a8c6;
  --t-ink-900: #3b1332; --t-ink-800: #4d1a41; --t-ink-700: #5f2450;
  --t-ink-600: #773463; --t-ink-500: #8d5a80; --t-ink-400: #836079;
  --page-grad: radial-gradient(900px 520px at 0% 0%, rgba(244,114,182,.14), transparent 64%), radial-gradient(800px 480px at 100% 8%, rgba(129,140,248,.12), transparent 62%), linear-gradient(140deg, #fdf6fc 0%, #f7efff 48%, #edf4ff 100%);
  --btn-grad: linear-gradient(135deg, #fbd0e6 0%, #ecc3f4 52%, #cfe0fb 100%);
  --mark-grad: linear-gradient(140deg, #f9a8d4, #a855f7 55%, #38bdf8);
  --edge-grad: linear-gradient(90deg, #f472b6, #a855f7 55%, #38bdf8);
}
/* Le thème des métiers de l'informatique : vert terminal et cyan, sur un
   gris-vert d'éditeur de code — lisible sans être une console noire. */
html[data-theme="terminal"] {
  --bg: #15211f; --card: #1c2b28; --surface: #22332f; --surface-2: #2a3e39;
  --line: #334a44; --line-strong: #47635c;
  --ink: #e8f7f0; --ink-2: #c6e8da; --muted: #96bcae; --muted-soft: #8bada2;
  --brand: #7ee2b8; --brand-dark: #9df0cd; --brand-soft: #1f3a33; --brand-line: #2f5a4e; --on-brand: #08221b; --btn-ink: #08221b;
  --hover: #263a35; --table-head: #22332f; --chip: #2a3e39; --chip-line: #38514a;
  --ok: #6ee7b7; --warn: #fcd34d; --danger: #fda4af; --info: #93c5fd;
  --ok-soft: #1e3b33; --warn-soft: #3a3322; --danger-soft: #3a2630; --info-soft: #223a52;
  --warn-line: #5e4c26; --danger-line: #5e3644; --info-line: #35506e; --ok-line: #2d5c4c;
  --shadow: 0 1px 2px rgba(0,0,0,.28), 0 1px 3px rgba(0,0,0,.22);
  --shadow-lg: 0 22px 48px -16px rgba(0,0,0,.55);
  --topbar-bg: rgba(21, 33, 31, 0.84);
  --sidebar-bg: linear-gradient(180deg, #1f4038 0%, #172b26 55%, #121d1a 100%);
  --sidebar-ink: #d7efe5; --sidebar-muted: #9cc0b2;
  --t-ink-900: #e8f7f0; --t-ink-800: #d6f2e6; --t-ink-700: #c1e6d6;
  --t-ink-600: #a9d4c3; --t-ink-500: #93bbac; --t-ink-400: #8bada1;
  /* Grille de fond façon Tailwind : traits fins de 32 px, repères majeurs
     toutes les 160 px, posés au-dessus des halos. Elle reste fixe au défilement
     et ne passe jamais sous les cartes, qui restent opaques. */
  --page-grad: linear-gradient(to right, rgba(126,226,184,.10) 1px, transparent 1px), linear-gradient(to bottom, rgba(126,226,184,.10) 1px, transparent 1px), linear-gradient(to right, rgba(103,232,249,.16) 1px, transparent 1px), linear-gradient(to bottom, rgba(103,232,249,.16) 1px, transparent 1px), radial-gradient(900px 540px at 8% -8%, rgba(110,231,183,.20), transparent 62%), radial-gradient(820px 500px at 100% 0%, rgba(103,232,249,.14), transparent 60%), linear-gradient(160deg, #1a2a27 0%, #15211f 55%, #1b2c28 100%);
  --page-size: 32px 32px, 32px 32px, 160px 160px, 160px 160px, cover, cover, cover;
  --page-repeat: repeat, repeat, repeat, repeat, no-repeat, no-repeat, no-repeat;
  --btn-grad: linear-gradient(135deg, #a7f3d0 0%, #6ee7b7 50%, #67e8f9 100%);
  --mark-grad: linear-gradient(140deg, #6ee7b7, #22d3ee 60%, #a3e635);
  --edge-grad: linear-gradient(90deg, #34d399, #22d3ee 60%, #a3e635);
}
/* Seconde ambiance de développeur : bleu acier, gris et noir, avec la même
   grille de fond façon Tailwind que Terminal. */
html[data-theme="acier"] {
  --bg: #141a22; --card: #1b2029; --surface: #212833; --surface-2: #2a3240;
  --line: #343e4d; --line-strong: #4a5666;
  --ink: #eef3fa; --ink-2: #d3dce8; --muted: #a7b4c6; --muted-soft: #929daf;
  --brand: #93c5fd; --brand-dark: #bcd8fe; --brand-soft: #243247; --brand-line: #3b5170; --on-brand: #0b1220; --btn-ink: #0b1220;
  --hover: #232b36; --table-head: #212833; --chip: #2a3240; --chip-line: #38424f;
  --ok: #6ee7b7; --warn: #fcd34d; --danger: #fda4af; --info: #93c5fd;
  --ok-soft: #1b3a33; --warn-soft: #333022; --danger-soft: #362630; --info-soft: #1f3149;
  --warn-line: #554a26; --danger-line: #553444; --info-line: #32506e; --ok-line: #2a5c4c;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 1px 3px rgba(0,0,0,.24);
  --shadow-lg: 0 22px 48px -16px rgba(0,0,0,.6);
  --topbar-bg: rgba(20, 26, 34, 0.84);
  --sidebar-bg: linear-gradient(180deg, #2b3a52 0%, #1a2230 55%, #0d1117 100%);
  --sidebar-ink: #d6e0ec; --sidebar-muted: #9aabbf;
  --t-ink-900: #eef3fa; --t-ink-800: #e2eaf4; --t-ink-700: #d3dce8;
  --t-ink-600: #bcc9d9; --t-ink-500: #a3b0c2; --t-ink-400: #919daf;
  --page-grad: linear-gradient(to right, rgba(147,197,253,.10) 1px, transparent 1px), linear-gradient(to bottom, rgba(147,197,253,.10) 1px, transparent 1px), linear-gradient(to right, rgba(148,163,184,.18) 1px, transparent 1px), linear-gradient(to bottom, rgba(148,163,184,.18) 1px, transparent 1px), radial-gradient(900px 560px at 8% -10%, rgba(96,165,250,.22), transparent 62%), radial-gradient(820px 500px at 100% 0%, rgba(148,163,184,.16), transparent 60%), linear-gradient(160deg, #2c3b54 0%, #1a212b 55%, #080b10 100%);
  --page-size: 32px 32px, 32px 32px, 160px 160px, 160px 160px, cover, cover, cover;
  --page-repeat: repeat, repeat, repeat, repeat, no-repeat, no-repeat, no-repeat;
  --btn-grad: linear-gradient(135deg, #bcd8fe 0%, #93c5fd 50%, #a5b4fc 100%);
  --mark-grad: linear-gradient(140deg, #bcd8fe, #60a5fa 55%, #a5b4fc);
  --edge-grad: linear-gradient(90deg, #60a5fa, #93c5fd 55%, #a5b4fc);
}

/* ==========================================================================
   Dix thèmes de luxe — cinq clairs, cinq sombres. Or, bronze, platine et
   cuivre sur des fonds crème, marbre, vin ou vert profond. Les cartes restent
   opaques : le dégradé habille le fond, jamais le texte.
   ========================================================================== */
html[data-theme="champagne"] {
  --bg: #f7f2e7; --card: #fffcf5; --surface: #faf5ea; --surface-2: #f2e9d8;
  --line: #e6dac4; --line-strong: #d3c3a5;
  --ink: #2a2116; --ink-2: #4a3b28; --muted: #6b5a41; --muted-soft: #74644d;
  --brand: #8a6a1f; --brand-dark: #6f5414; --brand-soft: #f7edd4; --brand-line: #e2cfa4; --on-brand: #ffffff; --btn-ink: #3a2b08;
  --hover: #fffaf0; --table-head: #faf5ea; --chip: #f5eddd; --chip-line: #e9dcc5;
  --topbar-bg: rgba(255, 252, 245, 0.88);
  --sidebar-bg: linear-gradient(180deg, #33291a 0%, #241c10 55%, #1a140a 100%);
  --sidebar-ink: #ece1c9; --sidebar-muted: #bfae8c;
  --t-ink-900: #2a2116; --t-ink-800: #3a2e1e; --t-ink-700: #4a3b28;
  --t-ink-600: #5d4b33; --t-ink-500: #6f5c42; --t-ink-400: #74644d;
  --page-grad: radial-gradient(900px 520px at 0% -6%, rgba(226,196,128,.24), transparent 64%), linear-gradient(150deg, #fbf6ea 0%, #f5eddd 52%, #efe3cd 100%);
  --btn-grad: linear-gradient(135deg, #f7e8bd 0%, #e9cf90 50%, #d9b96a 100%);
  --mark-grad: linear-gradient(140deg, #f3dfa8, #c9a84f 55%, #8a6a1f);
  --edge-grad: linear-gradient(90deg, #e2c98d, #b08d3a);
}
html[data-theme="marbre"] {
  --bg: #f4f4f1; --card: #ffffff; --surface: #fafaf8; --surface-2: #eeede9;
  --line: #e3e2dc; --line-strong: #cbc9c0;
  --ink: #1b1b19; --ink-2: #37372f; --muted: #5f5f57; --muted-soft: #6a6a61;
  --brand: #8a6a1f; --brand-dark: #6f5414; --brand-soft: #f6efdd; --brand-line: #e3d3ae; --on-brand: #ffffff; --btn-ink: #33270a;
  --hover: #fcfcfa; --table-head: #f7f7f4; --chip: #f1f1ed; --chip-line: #e4e3dd;
  --topbar-bg: rgba(255, 255, 253, 0.9);
  --sidebar-bg: linear-gradient(180deg, #26272b 0%, #191a1d 55%, #101113 100%);
  --sidebar-ink: #e6e5df; --sidebar-muted: #a8a69d;
  --t-ink-900: #1b1b19; --t-ink-800: #2b2b26; --t-ink-700: #37372f;
  --t-ink-600: #4b4b43; --t-ink-500: #5e5e56; --t-ink-400: #6a6a61;
  --page-grad: radial-gradient(900px 540px at 100% -8%, rgba(138,106,31,.12), transparent 62%), radial-gradient(760px 460px at 0% 100%, rgba(120,122,118,.10), transparent 60%), linear-gradient(150deg, #fbfbf9 0%, #f1f1ee 55%, #e8e8e3 100%);
  --btn-grad: linear-gradient(135deg, #f7eccb 0%, #e6d3a0 55%, #cdb273 100%);
  --mark-grad: linear-gradient(140deg, #efe2bb, #c7a95c 55%, #8a6a1f);
  --edge-grad: linear-gradient(90deg, #d8c48f, #8a6a1f);
}
html[data-theme="ivoire"] {
  --bg: #f6f1e8; --card: #fffdf8; --surface: #fbf6ee; --surface-2: #f1e9dc;
  --line: #e6dccd; --line-strong: #d2c3ac;
  --ink: #241f18; --ink-2: #423a2e; --muted: #655a4a; --muted-soft: #6f6555;
  --brand: #7a5c2e; --brand-dark: #5f4620; --brand-soft: #f4ead9; --brand-line: #ddcaa9; --on-brand: #ffffff; --btn-ink: #33281a;
  --hover: #fffcf6; --table-head: #faf5ec; --chip: #f4ecdf; --chip-line: #e8dbca;
  --topbar-bg: rgba(255, 253, 248, 0.88);
  --sidebar-bg: linear-gradient(180deg, #2b2418 0%, #201a10 55%, #16110a 100%);
  --sidebar-ink: #ece2d1; --sidebar-muted: #b3a68f;
  --t-ink-900: #241f18; --t-ink-800: #332c22; --t-ink-700: #423a2e;
  --t-ink-600: #554a3b; --t-ink-500: #675a48; --t-ink-400: #6f6555;
  --page-grad: radial-gradient(880px 500px at 0% -6%, rgba(196,164,116,.20), transparent 64%), linear-gradient(150deg, #fbf7ef 0%, #f3ece0 55%, #e9dfcf 100%);
  --btn-grad: linear-gradient(135deg, #f2e3c8 0%, #ddc59d 55%, #c4a878 100%);
  --mark-grad: linear-gradient(140deg, #e8d6b4, #b8905a 55%, #7a5c2e);
  --edge-grad: linear-gradient(90deg, #c9a877, #7a5c2e);
}
html[data-theme="bordeaux"] {
  --bg: #f7f1f1; --card: #fffbfb; --surface: #fcf5f5; --surface-2: #f4e7e8;
  --line: #e9d7d9; --line-strong: #d5b8bc;
  --ink: #2a1418; --ink-2: #4a2830; --muted: #6d4d55; --muted-soft: #74555c;
  --brand: #7d1f34; --brand-dark: #601526; --brand-soft: #f8e6ea; --brand-line: #e6c2ca; --on-brand: #ffffff; --btn-ink: #3a0d18;
  --hover: #fff9f9; --table-head: #fbf3f3; --chip: #f7e9ea; --chip-line: #edd8db;
  --topbar-bg: rgba(255, 251, 251, 0.88);
  --sidebar-bg: linear-gradient(180deg, #31121c 0%, #240b13 55%, #1a070d 100%);
  --sidebar-ink: #f0dde2; --sidebar-muted: #c39aa5;
  --t-ink-900: #2a1418; --t-ink-800: #3a1d23; --t-ink-700: #4a2830;
  --t-ink-600: #5d3741; --t-ink-500: #6e4a53; --t-ink-400: #74555c;
  --page-grad: radial-gradient(900px 520px at 100% -6%, rgba(190,90,112,.14), transparent 64%), linear-gradient(150deg, #fbf5f5 0%, #f4e8ea 55%, #ecd9dd 100%);
  --btn-grad: linear-gradient(135deg, #f6dcd9 0%, #e4b3b9 55%, #cf8f9b 100%);
  --mark-grad: linear-gradient(140deg, #eec3c8, #b45a6c 55%, #7d1f34);
  --edge-grad: linear-gradient(90deg, #d29aa5, #7d1f34);
}
html[data-theme="emeraude"] {
  --bg: #f2f5ef; --card: #ffffff; --surface: #f8faf5; --surface-2: #e9efe3;
  --line: #dde5d5; --line-strong: #c4d1b8;
  --ink: #14231a; --ink-2: #2c4334; --muted: #4f6455; --muted-soft: #5b6c5f;
  --brand: #0f5132; --brand-dark: #0a3d26; --brand-soft: #e6f2e8; --brand-line: #bcd9c2; --on-brand: #ffffff; --btn-ink: #0d2b1f;
  --hover: #fbfdf9; --table-head: #f4f8f0; --chip: #edf3e7; --chip-line: #dfe9d8;
  --topbar-bg: rgba(252, 254, 250, 0.88);
  --sidebar-bg: linear-gradient(180deg, #0d2b1f 0%, #092117 55%, #06180f 100%);
  --sidebar-ink: #dcece1; --sidebar-muted: #9db9a8;
  --t-ink-900: #14231a; --t-ink-800: #1e3326; --t-ink-700: #2c4334;
  --t-ink-600: #3d5747; --t-ink-500: #506757; --t-ink-400: #5b6c5f;
  --page-grad: radial-gradient(900px 520px at 0% -6%, rgba(176,196,140,.20), transparent 64%), radial-gradient(820px 480px at 100% 6%, rgba(212,188,120,.12), transparent 62%), linear-gradient(150deg, #f7faf4 0%, #eaf0e5 55%, #dfe8d8 100%);
  --btn-grad: linear-gradient(135deg, #ece4c2 0%, #d6c693 55%, #bfa96a 100%);
  --mark-grad: linear-gradient(140deg, #e4d7a8, #a8a05e 55%, #0f5132);
  --edge-grad: linear-gradient(90deg, #cbb87a, #0f5132);
}
html[data-theme="minuit-or"] {
  --bg: #0f1420; --card: #151c2b; --surface: #1b2333; --surface-2: #222c3f;
  --line: #2c3850; --line-strong: #3e4d6b;
  --ink: #f7f2e4; --ink-2: #e2d8c0; --muted: #bdb298; --muted-soft: #ada38c;
  --brand: #e8cd8f; --brand-dark: #f3e0b4; --brand-soft: #33301f; --brand-line: #5b5230; --on-brand: #221a05; --btn-ink: #221a05;
  --hover: #1c2536; --table-head: #1b2333; --chip: #222c3f; --chip-line: #303b50;
  --ok: #6ee7b7; --warn: #fcd34d; --danger: #fda4af; --info: #93c5fd;
  --ok-soft: #142a26; --warn-soft: #2b2415; --danger-soft: #2c1a22; --info-soft: #17243a;
  --warn-line: #4a3a18; --danger-line: #4d2733; --info-line: #2a3d5c; --ok-line: #1e4a3a;
  --shadow: 0 1px 2px rgba(0,0,0,.32), 0 1px 3px rgba(0,0,0,.26);
  --shadow-lg: 0 22px 48px -16px rgba(0,0,0,.6);
  --topbar-bg: rgba(15, 20, 32, 0.85);
  --sidebar-bg: linear-gradient(180deg, #1a2337 0%, #101624 55%, #0a0e18 100%);
  --sidebar-ink: #d9d3c2; --sidebar-muted: #a49a83;
  --t-ink-900: #f7f2e4; --t-ink-800: #efe7d3; --t-ink-700: #e2d8c0;
  --t-ink-600: #cbbfa4; --t-ink-500: #b6aa91; --t-ink-400: #aaa08a;
  --page-grad: radial-gradient(920px 540px at 8% -8%, rgba(232,205,143,.20), transparent 62%), radial-gradient(820px 500px at 100% 4%, rgba(147,197,253,.10), transparent 60%), linear-gradient(160deg, #141b2b 0%, #0f1420 55%, #141a28 100%);
  --btn-grad: linear-gradient(135deg, #f8ecc8 0%, #e8cd8f 55%, #cfae5e 100%);
  --mark-grad: linear-gradient(140deg, #f8ecc8, #e8cd8f 55%, #b9944a);
  --edge-grad: linear-gradient(90deg, #e8cd8f, #b9944a);
}
html[data-theme="onyx"] {
  --bg: #0b0b0d; --card: #131316; --surface: #191a1e; --surface-2: #212227;
  --line: #2e2f36; --line-strong: #45464f;
  --ink: #f4f4f5; --ink-2: #dcdce0; --muted: #b0b1b8; --muted-soft: #a1a2a9;
  --brand: #d9d9de; --brand-dark: #ececf0; --brand-soft: #26262c; --brand-line: #45454e; --on-brand: #141416; --btn-ink: #141416;
  --hover: #1d1e23; --table-head: #191a1e; --chip: #212227; --chip-line: #2f3037;
  --ok: #6ee7b7; --warn: #fcd34d; --danger: #fda4af; --info: #93c5fd;
  --ok-soft: #142a26; --warn-soft: #2b2415; --danger-soft: #2c1a22; --info-soft: #17243a;
  --warn-line: #4a3a18; --danger-line: #4d2733; --info-line: #2a3d5c; --ok-line: #1e4a3a;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 1px 3px rgba(0,0,0,.32);
  --shadow-lg: 0 24px 52px -16px rgba(0,0,0,.7);
  --topbar-bg: rgba(11, 11, 13, 0.86);
  --sidebar-bg: linear-gradient(180deg, #1f2025 0%, #101012 55%, #08080a 100%);
  --sidebar-ink: #dedee2; --sidebar-muted: #a5a5ac;
  --t-ink-900: #f4f4f5; --t-ink-800: #e8e8eb; --t-ink-700: #dcdce0;
  --t-ink-600: #c6c6cc; --t-ink-500: #b0b1b8; --t-ink-400: #a1a2a9;
  --page-grad: radial-gradient(920px 540px at 100% -8%, rgba(217,217,222,.12), transparent 62%), radial-gradient(780px 460px at 0% 100%, rgba(160,162,170,.10), transparent 60%), linear-gradient(160deg, #18181c 0%, #0b0b0d 55%, #121215 100%);
  --btn-grad: linear-gradient(135deg, #f2f2f4 0%, #d9d9de 55%, #b9b9c0 100%);
  --mark-grad: linear-gradient(140deg, #f2f2f4, #cfcfd5 55%, #9c9ca4);
  --edge-grad: linear-gradient(90deg, #e6e6ea, #9c9ca4);
}
html[data-theme="bordeaux-nuit"] {
  --bg: #1c0f14; --card: #26151c; --surface: #2f1b23; --surface-2: #3a232c;
  --line: #4a2c37; --line-strong: #65404d;
  --ink: #fbefef; --ink-2: #eed3d6; --muted: #cfa9af; --muted-soft: #bf9ba2;
  --brand: #edbfa8; --brand-dark: #f6d3c2; --brand-soft: #3d2029; --brand-line: #663a45; --on-brand: #2b0c14; --btn-ink: #2b0c14;
  --hover: #2b1920; --table-head: #2f1b23; --chip: #3a232c; --chip-line: #4b2d38;
  --ok: #6ee7b7; --warn: #fcd34d; --danger: #fda4af; --info: #93c5fd;
  --ok-soft: #1e3b33; --warn-soft: #3a3322; --danger-soft: #3a2630; --info-soft: #223a52;
  --warn-line: #5e4c26; --danger-line: #5e3644; --info-line: #35506e; --ok-line: #2d5c4c;
  --shadow: 0 1px 2px rgba(0,0,0,.32), 0 1px 3px rgba(0,0,0,.26);
  --shadow-lg: 0 22px 48px -16px rgba(0,0,0,.6);
  --topbar-bg: rgba(28, 15, 20, 0.85);
  --sidebar-bg: linear-gradient(180deg, #3d1b26 0%, #260f18 55%, #1a0a10 100%);
  --sidebar-ink: #f0dbe0; --sidebar-muted: #c49da7;
  --t-ink-900: #fbefef; --t-ink-800: #f5e0e2; --t-ink-700: #eed3d6;
  --t-ink-600: #dcbcc1; --t-ink-500: #cbaab0; --t-ink-400: #bf9ba2;
  --page-grad: radial-gradient(920px 540px at 0% -8%, rgba(237,191,168,.20), transparent 62%), radial-gradient(820px 500px at 100% 4%, rgba(190,90,112,.16), transparent 60%), linear-gradient(160deg, #2b141c 0%, #1c0f14 55%, #26141b 100%);
  --btn-grad: linear-gradient(135deg, #f8dcc6 0%, #e8b79f 55%, #d19a86 100%);
  --mark-grad: linear-gradient(140deg, #f8dcc6, #e0a892 55%, #b0705f);
  --edge-grad: linear-gradient(90deg, #edbfa8, #b0705f);
}
html[data-theme="emeraude-nuit"] {
  --bg: #0c1a14; --card: #112219; --surface: #162b20; --surface-2: #1d372a;
  --line: #294536; --line-strong: #3b5f4b;
  --ink: #eef6ef; --ink-2: #d3e6d7; --muted: #a9c4b2; --muted-soft: #9bb6a4;
  --brand: #e2c98d; --brand-dark: #f0dcaa; --brand-soft: #29321f; --brand-line: #4c5230; --on-brand: #14200b; --btn-ink: #14200b;
  --hover: #17301f; --table-head: #162b20; --chip: #1d372a; --chip-line: #2b4938;
  --ok: #6ee7b7; --warn: #fcd34d; --danger: #fda4af; --info: #93c5fd;
  --ok-soft: #16392d; --warn-soft: #342f1e; --danger-soft: #35222b; --info-soft: #1d334a;
  --warn-line: #4f4622; --danger-line: #543040; --info-line: #2c4462; --ok-line: #275442;
  --shadow: 0 1px 2px rgba(0,0,0,.32), 0 1px 3px rgba(0,0,0,.26);
  --shadow-lg: 0 22px 48px -16px rgba(0,0,0,.62);
  --topbar-bg: rgba(12, 26, 20, 0.86);
  --sidebar-bg: linear-gradient(180deg, #143326 0%, #0d241a 55%, #07130e 100%);
  --sidebar-ink: #d8ebe0; --sidebar-muted: #9fbba9;
  --t-ink-900: #eef6ef; --t-ink-800: #e0efe4; --t-ink-700: #d3e6d7;
  --t-ink-600: #bcd5c4; --t-ink-500: #a8c2b1; --t-ink-400: #9bb6a4;
  --page-grad: radial-gradient(920px 540px at 100% -8%, rgba(226,201,141,.18), transparent 62%), radial-gradient(820px 500px at 0% 100%, rgba(78,160,120,.16), transparent 60%), linear-gradient(160deg, #13291e 0%, #0c1a14 55%, #12251b 100%);
  --btn-grad: linear-gradient(135deg, #f4e7c4 0%, #e2c98d 55%, #c6a967 100%);
  --mark-grad: linear-gradient(140deg, #f4e7c4, #d9c084 55%, #a88e50);
  --edge-grad: linear-gradient(90deg, #e2c98d, #a88e50);
}
html[data-theme="prune-cuivre"] {
  --bg: #1b1020; --card: #24172b; --surface: #2d1d35; --surface-2: #372541;
  --line: #4a3357; --line-strong: #64466f;
  --ink: #f9eefb; --ink-2: #e7d2ec; --muted: #c6a9cd; --muted-soft: #b89fc0;
  --brand: #eab08c; --brand-dark: #f5c6a8; --brand-soft: #3a2030; --brand-line: #5e3a4e; --on-brand: #2a0f1a; --btn-ink: #2a0f1a;
  --hover: #2b1a32; --table-head: #2d1d35; --chip: #372541; --chip-line: #472f52;
  --ok: #6ee7b7; --warn: #fcd34d; --danger: #fda4af; --info: #93c5fd;
  --ok-soft: #1b3a31; --warn-soft: #38301f; --danger-soft: #38232c; --info-soft: #20344c;
  --warn-line: #574922; --danger-line: #583040; --info-line: #304662; --ok-line: #2a5545;
  --shadow: 0 1px 2px rgba(0,0,0,.32), 0 1px 3px rgba(0,0,0,.26);
  --shadow-lg: 0 22px 48px -16px rgba(0,0,0,.6);
  --topbar-bg: rgba(27, 16, 32, 0.86);
  --sidebar-bg: linear-gradient(180deg, #3a2145 0%, #271530 55%, #180d1d 100%);
  --sidebar-ink: #eddaf0; --sidebar-muted: #c0a1c8;
  --t-ink-900: #f9eefb; --t-ink-800: #f1e1f4; --t-ink-700: #e7d2ec;
  --t-ink-600: #d6b9dc; --t-ink-500: #c4a5cb; --t-ink-400: #b89fc0;
  --page-grad: radial-gradient(920px 540px at 0% -8%, rgba(234,176,140,.20), transparent 62%), radial-gradient(820px 500px at 100% 4%, rgba(196,132,220,.14), transparent 60%), linear-gradient(160deg, #2b1733 0%, #1b1020 55%, #25152c 100%);
  --btn-grad: linear-gradient(135deg, #f6d6bd 0%, #eab08c 55%, #d18f6d 100%);
  --mark-grad: linear-gradient(140deg, #f6d6bd, #e0a17c 55%, #b07458);
  --edge-grad: linear-gradient(90deg, #eab08c, #b07458);
}

/* Les dégradés se posent par variables : les thèmes unis gardent exactement
   leur apparence, puisque les valeurs de repli restent celles d'origine. */
html[data-theme] body {
  background-image: var(--page-grad, none);
  background-attachment: fixed;
  background-repeat: var(--page-repeat, no-repeat);
  background-size: var(--page-size, cover);
}
html[data-theme] .btn-primary { background-image: var(--btn-grad, none); color: var(--btn-ink, var(--on-brand)); }
html[data-theme] .btn-primary:hover { background-image: var(--btn-grad, none); filter: brightness(1.07) saturate(1.04); }
html[data-theme] .brand-mark {
  background-image: var(--mark-grad, linear-gradient(140deg, var(--brand), color-mix(in srgb, var(--brand) 55%, #ffffff) 60%, var(--brand-dark)));
}
html[data-theme] .topbar::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px;
  background: var(--edge-grad, none); pointer-events: none;
}
@media print {
  html[data-theme] body { background-image: none !important; }
  html[data-theme] .topbar::after { display: none; }
}

/* --- base et coquille ------------------------------------------------ */
html body { background-color: var(--bg) !important; color: var(--ink) !important; }
/* Les vues emploient text-ink-900…400 : la même échelle, teintée par le thème
   (indispensable en sombre, où un gris d'encre resterait illisible). */
.text-ink-900 { color: var(--t-ink-900) !important; }
.text-ink-800 { color: var(--t-ink-800) !important; }
.text-ink-700 { color: var(--t-ink-700) !important; }
.text-ink-600 { color: var(--t-ink-600) !important; }
.text-ink-500 { color: var(--t-ink-500) !important; }
.text-ink-400 { color: var(--t-ink-400) !important; }
::selection { background: var(--brand-soft); color: var(--ink); }
/* Barre du haut opaque : la couleur pleine de carte du thème, sans voile. */
.sidebar { background: var(--sidebar-bg); color: var(--sidebar-ink); }
.nav-item:hover { background: rgba(255, 255, 255, 0.09); }
.nav-item.active { background: rgba(255, 255, 255, 0.14); }
.nav-item.active::before { background: var(--brand); }
.sidebar-foot .src { color: var(--sidebar-muted); }
.save-pill { color: var(--sidebar-muted); }
.brand-mark { background: linear-gradient(140deg, var(--brand), color-mix(in srgb, var(--brand) 55%, #ffffff) 60%, var(--brand-dark)); }
.btn-ghost { color: var(--ink-2); }
.btn-ghost:hover { background: var(--surface-2); }
.search input, .gs-input { color: var(--ink); }

/* --- surfaces et composants ----------------------------------------- */
.card { background: var(--card); border-color: var(--line);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;}
.card-title, .td-strong, .legend-val, .kpi-value, .gs-name, .combo-name,
.pf-group-tag, .pf-group-name, .tag-card b, .glossary dt { color: var(--ink); }
.card-sub, .card-link, .td-muted, .legend-pct, .kpi-label, .kpi-foot,
.muted, .gs-meta, .combo-meta, .pf-group-meta, .pf-scope, .glossary dd { color: var(--muted); }
.legend-name, .crit-label, .task-title, .tl-title, .coach-text, .coach-more ol,
.guide-body, .guide-lead, .guide-opt-label, .prio-who, .resume-txt, .seg-desc { color: var(--ink-2); }
.btn { background: var(--card); color: var(--ink-2); border-color: var(--line-strong);
  border-radius: 10px;}
.btn:hover { background: var(--hover); border-color: var(--line-strong); }
.btn-primary { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.btn-primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); }
.btn-dark { background: var(--ink); border-color: var(--ink); color: var(--card); }
.btn-dark:hover { background: var(--ink-2); border-color: var(--ink-2); }
.btn-danger { color: var(--danger); border-color: var(--danger-line); background: var(--danger-soft); }
.btn-danger:hover { background: color-mix(in srgb, var(--danger-soft) 70%, var(--card)); }
.badge-neutral, .badge-ghost, .chip { background: var(--chip); color: var(--ink-2); border-color: var(--chip-line); }
.chip-danger { background: var(--danger-soft); color: var(--danger); border-color: var(--danger-line); }
.chip-warn { background: var(--warn-soft); color: var(--warn); border-color: var(--warn-line); }
.chip-ok { background: var(--ok-soft); color: var(--ok); border-color: var(--ok-line); }
.chip-info { background: var(--info-soft); color: var(--info); border-color: var(--info-line); }
.badge-ok { background: var(--ok-soft); color: var(--ok); border-color: var(--ok-line); }
.badge-warn { background: var(--warn-soft); color: var(--warn); border-color: var(--warn-line); }
.badge-danger { background: var(--danger-soft); color: var(--danger); border-color: var(--danger-line); }
.badge-info { background: var(--info-soft); color: var(--info); border-color: var(--info-line); }
.input, .select, .textarea { background: var(--card); color: var(--ink); border-color: var(--line-strong);
  border-radius: 10px;}
.input::placeholder, .textarea::placeholder { color: var(--muted-soft); }
table.data thead th { background: var(--table-head); color: var(--muted); border-bottom-color: var(--line);
  padding: 10px 13px;
  letter-spacing: 0.06em;}
table.data tbody td { border-bottom-color: var(--line);
  padding: 10px 13px;}
table.data tbody tr { background: var(--card); }
table.data tbody tr:hover { background: var(--hover); }
table.data tbody tr.selected { background: var(--brand-soft); }
.hbar, .mini-bar, .crit-bar, .pbar { background: var(--surface-2); }
.tl::before { background: var(--line); }
.tl-dot { background: var(--card); border-color: var(--line-strong); }
.tl-meta, .task-meta { color: var(--muted); }
.task, .tag-card, .resume, .start-tile, .guide-opt, .cv-theme, .cv-layout {
  background: var(--card); border-color: var(--line);
}
.task:hover { border-color: var(--line-strong); }
.task.done { background: var(--surface); }
.check { background: var(--card); border-color: var(--line-strong); }
.modal-head, .modal-foot { border-color: var(--line); }
.empty-icon, .step-num { background: var(--surface-2); color: var(--muted); }
.step-num.on { background: var(--brand); color: var(--on-brand); }
.dropzone:hover, .dropzone.hot { background: var(--brand-soft); border-color: var(--brand); }
.switch { background: var(--line-strong); }
.switch::after { background: var(--card); }
.coach-tag, .gs-kbd { background: var(--card); border-color: var(--line); color: var(--muted); }
.guide-opt:hover, .start-tile:hover, .cv-theme:hover { background: var(--hover); border-color: var(--brand-line); }
.guide-opt.on, .cv-theme.on, .cv-layout.on, .cv-sec.on { background: var(--brand-soft); }
.guide-tip, .help-card { background: var(--surface); }
.prio-n, .start-ico, .help-ico, .coach-ico, .pf-group-count { background: var(--brand-soft); color: var(--brand); }
.prio, .prio-foot, .pf-group, .pf-group-row, .pf-group-head { border-color: var(--line); }
.legend-row:hover, .seg-line:hover, .pf-group-row:hover, .pf-group-head:hover,
.gs-row:hover, .gs-row.is-active, .combo-item:hover, .combo-item.is-active { background: var(--hover); }
.pf-tagbar-label, .pf-search-icon, .combo-head, .gs-head, .pf-group-meta { color: var(--muted); }
.gs-panel, .combo-list { background: var(--card); border-color: var(--line); }
.gs-head, .combo-head { background: var(--surface); border-color: var(--line); }
.gs-row, .combo-item, .gs-foot { background: var(--card); border-color: var(--line); }
.tl-dot.ok { border-color: var(--ok); } .tl-dot.warn { border-color: var(--warn); }
.tl-dot.danger { border-color: var(--danger); } .tl-dot.info { border-color: var(--info); }
::-webkit-scrollbar-thumb { background: var(--line-strong); border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: var(--muted-soft); background-clip: content-box; }
@media (max-width: 767px) {
  .table-wrap {
    background: linear-gradient(90deg, var(--card) 30%, transparent) left / 24px 100% no-repeat local,
      linear-gradient(270deg, var(--card) 30%, transparent) right / 24px 100% no-repeat local,
      radial-gradient(farthest-side at 0 50%, rgba(15, 23, 42, 0.14), transparent) left / 10px 100% no-repeat scroll,
      radial-gradient(farthest-side at 100% 50%, rgba(15, 23, 42, 0.14), transparent) right / 10px 100% no-repeat scroll;
    background-color: var(--card);
  }
}
html[data-theme="sombre"] .modal-scrim { background: rgba(3, 6, 12, 0.7); }
html[data-theme="sombre"] .toast { background: var(--surface-2); color: var(--ink); border: 1px solid var(--line); }
html[data-theme="sombre"] .toast.ok { background: #14352c; }
html[data-theme="sombre"] .toast.danger { background: #3a1a24; }
html[data-theme="sombre"] .toast.info { background: #1d2745; }
html[data-theme="sombre"] .cv-frame-wrap { background: var(--surface-2); border-color: var(--line); }

/* --- page Personnalisation ------------------------------------------ */
.theme-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(212px, 1fr)); gap: 12px; }
.theme-card {
  display: flex; flex-direction: column; gap: 9px; text-align: left; padding: 10px;
  border: 1px solid var(--line); border-radius: 12px; background: var(--card); cursor: pointer;
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.theme-card:hover { border-color: var(--brand-line); transform: translateY(-1px); box-shadow: 0 8px 22px -16px rgba(16, 24, 40, .45); }
.theme-card.on { border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand-soft); }
.theme-pv { height: 78px; border-radius: 8px; overflow: hidden; display: flex; border: 1px solid var(--line); }
.theme-pv-side { width: 26%; padding: 7px 5px; display: flex; flex-direction: column; gap: 4px; }
.theme-pv-logo { width: 13px; height: 13px; border-radius: 4px; margin-bottom: 3px; }
.theme-pv-line { height: 4px; border-radius: 3px; opacity: .65; }
.theme-pv-main { flex: 1; padding: 7px 7px 6px; display: flex; flex-direction: column; gap: 5px; }
.theme-pv-card { flex: 1; border-radius: 5px; padding: 5px; display: flex; flex-direction: column; gap: 4px; box-shadow: 0 1px 2px rgba(16,24,40,.12); }
.theme-pv-chip { height: 6px; width: 32px; border-radius: 999px; margin-top: auto; }
.theme-group-label {
  margin-top: 16px; font-size: 11px; font-weight: 800; letter-spacing: 0.09em;
  text-transform: uppercase; color: var(--muted);
}
.theme-card.is-gradient { position: relative; overflow: hidden; }
.theme-card.is-gradient::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px;
  background: var(--pv-grad, var(--brand));
}
.theme-meta { display: flex; align-items: center; gap: 6px; }
.theme-name { font-size: 13px; font-weight: 650; color: var(--ink); }
.theme-mode { margin-left: auto; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); border: 1px solid var(--line); border-radius: 99px; padding: 1px 6px; }
.theme-tagline { font-size: 11px; color: var(--muted); line-height: 1.4; min-height: 28px; }
.theme-dots { display: flex; gap: 4px; align-items: center; }
.theme-dot { width: 11px; height: 11px; border-radius: 50%; border: 1px solid rgba(0,0,0,.08); }
.theme-check { margin-left: auto; color: var(--brand); display: inline-flex; }
.theme-note { display: flex; gap: 7px; align-items: flex-start; font-size: 12px; color: var(--muted); line-height: 1.5; }
@media (max-width: 520px) { .theme-grid { grid-template-columns: 1fr; } .theme-pv { height: 84px; } }

/* Compléments thématiques : textes secondaires encore écrits en dur. */
.prio-why, .prio-foot, .resume-txt, .seg-desc { color: var(--muted); }
.donut-center .l { color: var(--muted); }
.empty-icon { color: var(--muted); }
.tour-bubble { color: var(--ink); }
.select { color: var(--ink); }

/* Compléments thématiques : filtres, groupes, étiquettes, notes. */
.filter-count, .step-num.on, .guide-qn { color: var(--on-brand); }
.qv-danger.is-active, .qv-danger { color: var(--danger); }
.qv-warn.is-active, .qv-warn { color: var(--warn); }
.quick-views-label, .filter-active-label, .filter-empty { color: var(--muted); }
.tag-meta, .tag-more, .tag-pick-meta, .tag-pick-tags, .pf-tagbar-label { color: var(--muted); }
.tag-count, .tag-picker-count { color: var(--brand); background: var(--brand-soft); }
.pf-group-chevron, .tag-more { color: var(--muted-soft); }
.pf-group-body, .tag-grid { color: inherit; }
/* Champ de recherche du bandeau : sa règle d'origine fixe un fond blanc
   plus spécifique que .input, on la ramène sur les jetons du thème. */
.gs-wrap .gs-input::placeholder { color: var(--muted-soft); }
.gs-wrap .gs-input:focus { border-color: var(--brand); }

/* ============================================ parcours de prise en main */
/* Un seul chemin, numéroté, lisible sans explication : la prochaine étape est
   toujours visible, la progression se lit dans les données réelles. */
.path-kicker {
  display: flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--muted);
}
.path-progress { padding: 16px 18px; }
.path-progress-top { display: flex; flex-wrap: wrap; gap: 16px; align-items: stretch; }
.path-progress-main { flex: 1 1 270px; min-width: 0; }
.path-num { font-size: 26px; font-weight: 700; letter-spacing: -0.03em; color: var(--ink); margin-top: 3px; line-height: 1.15; }
.path-num span { font-size: 12px; font-weight: 600; letter-spacing: 0; color: var(--muted); }
.path-bar { height: 7px; border-radius: 99px; background: var(--surface-2, #f1f3f8); overflow: hidden; margin-top: 10px; }
.path-bar > span { display: block; height: 100%; border-radius: 99px; background: var(--brand); transition: width 0.3s ease; }
.path-progress-foot { font-size: 11px; color: var(--muted); margin-top: 7px; line-height: 1.5; }
.path-next {
  flex: 1 1 300px; min-width: 0; padding: 12px 14px; border-radius: 12px;
  border: 1px solid var(--brand-line); background: var(--brand-soft);
  display: flex; flex-direction: column; gap: 3px;
}
.path-next .path-kicker { color: var(--brand); }
.path-next-title { font-size: 13px; font-weight: 700; color: var(--ink); margin-top: 2px; }
.path-next-why { font-size: 12px; color: var(--ink-2, #33405c); line-height: 1.55; }
.path-next .btn { align-self: flex-start; margin-top: 7px; }
.path-next.is-complete { border-color: var(--line); }

.path-list { list-style: none; margin: 0; padding: 4px 0 0; }
.path-step {
  display: flex; align-items: flex-start; gap: 11px;
  padding: 12px 18px; border-top: 1px solid var(--line);
}
.path-step:first-child { border-top: 0; }
.path-step.is-next { background: var(--brand-soft); }
.path-bullet {
  flex: none; width: 26px; height: 26px; border-radius: 99px;
  display: grid; place-items: center; margin-top: 1px;
  font-size: 12px; font-weight: 700;
  background: var(--surface-2, #f1f3f8); color: var(--muted);
  border: 1px solid var(--line);
}
.path-step.is-done .path-bullet { background: var(--ok); border-color: var(--ok); color: #fff; }
.path-step.is-next .path-bullet { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.path-main { flex: 1 1 auto; min-width: 0; }
.path-title { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; font-size: 13px; font-weight: 650; color: var(--ink); }
.path-state {
  font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  padding: 1px 6px; border-radius: 99px;
  background: var(--surface-2, #f1f3f8); color: var(--muted);
}
.path-step.is-done .path-state { background: rgba(14, 159, 110, 0.14); color: var(--ok); }
.path-step.is-next .path-state { background: var(--brand); color: var(--on-brand); }
.path-why { font-size: 12px; color: var(--muted); line-height: 1.55; margin: 3px 0 0; }
.path-where { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; color: var(--muted); margin-top: 5px; }
.path-go { flex: none; align-self: center; }
.path-skip { background: none; border: 0; padding: 0; margin-left: 6px; font-size: 11px; color: var(--muted); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.path-skip:hover { color: var(--brand, #2563eb); }
.path-step.is-done .path-go { opacity: 0.6; }

.path-map-group { padding: 0 18px 14px; }
.path-map-title {
  font-size: 11px; font-weight: 700; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--muted); padding: 10px 0 4px;
}
.path-map-row {
  display: flex; align-items: baseline; gap: 10px;
  padding: 6px 0; border-top: 1px solid var(--line);
  font-size: 12px; color: var(--ink); text-decoration: none;
}
.path-map-row:hover .path-map-name { color: var(--brand); }
.path-map-name { flex: none; width: 178px; font-weight: 650; }
.path-map-use { flex: 1 1 auto; min-width: 0; color: var(--muted); line-height: 1.5; }
.path-map-go { flex: none; font-size: 11px; font-weight: 600; color: var(--brand); }
.path-learn { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.path-keys { margin-top: 10px; padding-top: 9px; border-top: 1px solid var(--line); display: grid; gap: 5px; font-size: 12px; color: var(--muted); }
.path-keys kbd {
  display: inline-block; min-width: 18px; text-align: center;
  padding: 1px 5px; margin-right: 4px; border-radius: 5px;
  border: 1px solid var(--line-strong, #d4d9e5); background: var(--card);
  font-family: inherit; font-size: 11px; font-weight: 700; color: var(--ink);
}
.path-note { font-size: 11px; color: var(--muted); line-height: 1.5; margin-top: 9px; }

.path-home {
  position: relative; display: flex; align-items: center; flex-wrap: wrap;
  gap: 14px; padding: 14px 18px; margin-bottom: 16px;
  border-color: var(--brand-line);
  background: linear-gradient(180deg, var(--brand-soft), var(--card));
}
.path-home-main { flex: 1 1 240px; min-width: 0; }
.path-home-title { font-size: 13px; font-weight: 700; color: var(--ink); margin-top: 3px; }
.path-home-why { font-size: 12px; color: var(--muted); line-height: 1.5; margin-top: 2px; }
.path-home .path-bar { max-width: 340px; margin-top: 8px; }
.path-home-actions { flex: none; display: flex; flex-direction: column; align-items: flex-start; gap: 5px; }
.path-home-all { font-size: 11px; font-weight: 600; color: var(--brand); text-decoration: underline; text-underline-offset: 2px; }
.path-home-close {
  position: absolute; top: 6px; right: 6px; width: 24px; height: 24px;
  border: 0; border-radius: 7px; background: transparent; color: var(--muted);
  display: grid; place-items: center; cursor: pointer;
}
.path-home-close:hover { background: var(--surface-2, #f1f3f8); color: var(--ink); }

@media (max-width: 720px) {
  .path-step { padding: 11px 12px; flex-wrap: wrap; }
  .path-go { width: calc(100% - 37px); margin-left: 37px; }
  .path-home { padding: 13px 14px 14px; }
  .path-home-actions { width: 100%; }
  .path-map-row { flex-wrap: wrap; gap: 1px 8px; }
  .path-map-name { width: auto; }
  .path-map-go { display: none; }
}

/* ================================================ mode démonstration */
/* Un bandeau net, en haut de chaque écran : on ne peut pas confondre le
   portefeuille fictif avec les vraies données. */
.demo-bar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-bottom: 14px; padding: 9px 12px; border-radius: 10px;
  background: #0b1224; color: #eef1ff; border: 1px solid #26304d;
}
.demo-tag {
  flex: none; font-size: 11px; font-weight: 800; letter-spacing: 0.14em;
  text-transform: uppercase; padding: 3px 7px; border-radius: 99px;
  background: #facc15; color: #3b3005;
}
.demo-text { flex: 1 1 240px; min-width: 0; font-size: 12px; line-height: 1.45; color: #dbe1f3; }
.demo-text strong { color: #ffffff; font-weight: 700; }
.demo-exit {
  flex: none; background: var(--card); border-color: #ffffff; color: var(--ink);
}
.demo-exit:hover { background: #e8ebfa; border-color: #e8ebfa; }
/* Consultation d'un portefeuille d'un collègue : même bandeau, autre couleur,
   pour ne jamais confondre la copie avec ses propres données. */
.share-bar { background: #0c2b4a; border-color: #274766; }
.share-bar .demo-tag { background: #7dd3fc; color: #082f49; }
@media (max-width: 640px) {
  .demo-bar { padding: 9px 10px; }
  .demo-exit { width: 100%; }
}

/* ============================================ reprise après absence */
/* Une seule carte, en haut de la journée : ce qui a changé depuis la dernière
   ouverture, lu dans le journal. Elle disparaît si rien n'a bougé. */
.since-card { margin-bottom: 16px; }
.since-head { display: flex; align-items: center; gap: 10px; }
.since-ico {
  flex: none; width: 30px; height: 30px; border-radius: 9px;
  display: grid; place-items: center;
  background: var(--brand-soft); color: var(--brand);
}
.since-title { font-size: 13px; font-weight: 700; color: var(--ink); }
.since-sub { font-size: 11px; color: var(--muted); margin-top: 1px; }
.since-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.since-chip {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 12px; padding: 4px 9px; border-radius: 99px;
  border: 1px solid var(--line); background: var(--surface, #f8f9fd);
  color: var(--ink); text-decoration: none;
}
.since-chip b { font-weight: 700; color: var(--brand); }
.since-chip:hover { border-color: var(--brand-line); background: var(--brand-soft); }
.since-foot {
  margin-top: 9px; padding-top: 8px; border-top: 1px solid var(--line);
  display: flex; align-items: center; gap: 5px; flex-wrap: wrap;
  font-size: 11px; color: var(--muted);
}

/* Raccourcis : la touche se lit comme une touche, pas comme du texte. */
.glossary dt kbd {
  display: inline-block; min-width: 22px; text-align: center;
  padding: 2px 6px; border-radius: 5px; border: 1px solid var(--line-strong, #d4d9e5);
  background: var(--surface-2, #f1f3f8); color: var(--ink);
  font-family: inherit; font-size: 12px; font-weight: 700;
}

/* ==================================================== impression journée */
.print-only { display: none; }
@media print {
  .no-print, .btn, .check, .coach, .path-home, .demo-bar, .since-card,
  .sidebar, .topbar, .toast-root, .scrim, .gs-wrap, .sidebar-foot { display: none !important; }
  .print-only { display: block !important; }
  .main-col { margin: 0; }
  .day-row, .seg-line, .task { break-inside: avoid; }
  .day-cta { display: none !important; }
  .print-head { margin: 0 0 14px; padding-bottom: 8px; border-bottom: 2px solid #111; }
  .print-title { font-size: 20px; font-weight: 700; letter-spacing: -0.02em; }
  .print-sub { font-size: 12px; color: #444; margin-top: 2px; }
  a { color: #000; text-decoration: none; }
}

/* ------------------------------------------------- verrouillage de session */
.sec-lock { position: fixed; inset: 0; z-index: 4000; display: grid; place-items: center; padding: 20px; background: #0b1220; background-image: radial-gradient(circle at 50% 0%, #16223c 0%, #0b1220 60%); }
html.sec-is-locked, body.sec-is-locked { overflow: hidden; }
html.sec-is-locked body > *:not(#sec-lock) { visibility: hidden; }
.sec-lock-card { width: min(400px, 100%); background: var(--card); border-radius: 14px; padding: 24px; box-shadow: 0 24px 60px rgba(15, 23, 42, 0.35);
  max-height: 92vh;
  overflow-y: auto;}
.sec-lock-brand { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: #4f46e5; }
.sec-lock-title { margin: 10px 0 4px; font-size: 20px; font-weight: 700; color: #111827; letter-spacing: -0.02em; }
.sec-lock-sub { font-size: 12px; color: #6b7280; line-height: 1.5; margin-bottom: 14px; }
.sec-lock-input { letter-spacing: 0.35em; font-size: 18px; text-align: center; }
.sec-lock-msg { min-height: 18px; margin-top: 8px; font-size: 12px; font-weight: 600; color: var(--danger); }
.sec-lock-note { margin-top: 12px; font-size: 11px; color: #9ca3af; line-height: 1.5; }

/* Procédure de secours sur l'écran verrouillé */
.sec-lock-help { display: block; width: 100%; margin-top: 10px; background: none; border: 0; font-size: 12px; color: #6b7280; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.sec-lock-help:hover { color: #111827; }
.sec-lock-recovery { margin-top: 12px; border-top: 1px solid #e5e7eb; padding-top: 12px; }
.sec-lock-recovery-title { font-size: 12px; font-weight: 700; color: #111827; margin-bottom: 6px; }
.sec-lock-steps { list-style: decimal; padding-left: 18px; font-size: 12px; color: #4b5563; line-height: 1.55; display: flex; flex-direction: column; gap: 4px; }
.sec-lock-recovery .field-label { margin-top: 10px; }

/* ============================================================ vue Tâches */
/* Un groupe = un intitulé. Le bandeau porte le titre, les compteurs et les
   gestes de masse ; le corps ne s'ouvre que sur demande. Objectif : lire dix
   fois plus vite un portefeuille de plusieurs centaines d'actions. */
.task-toolbar { padding: 12px 14px; margin-bottom: 10px; display: flex; flex-direction: column; gap: 10px; }
.task-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.task-filters { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.task-count { margin-left: auto; font-size: 12px; font-weight: 650; color: var(--muted); white-space: nowrap; }
.task-search { position: relative; display: flex; align-items: center; flex: 1 1 260px; max-width: 440px; }
.task-search .input { padding-left: 31px; padding-right: 28px; width: 100%; }
.task-search-ico { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--muted-soft); display: inline-flex; pointer-events: none; }
.task-search kbd { position: absolute; right: 8px; }
.task-seg { display: inline-flex; align-items: center; gap: 2px; padding: 2px; border: 1px solid var(--line); background: var(--surface-2); border-radius: 10px; }
.task-seg-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em; font-weight: 700; color: var(--t-ink-400); padding: 0 6px 0 5px; white-space: nowrap; }
.task-view-btn { border: 0; background: none; padding: 5px 9px; border-radius: 7px; font-size: 12px; font-weight: 600; color: var(--t-ink-500); cursor: pointer; white-space: nowrap; }
.task-view-btn:hover { color: var(--brand); }
.task-view-btn.is-active { background: var(--card); color: var(--brand); box-shadow: 0 1px 2px rgba(16, 24, 40, 0.12); }
.task-expand { flex: none; }
.task-keys { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 0 2px 12px; font-size: 11px; color: var(--t-ink-400); }
.task-keys span { display: inline-flex; align-items: center; gap: 4px; }

.tgroups { display: flex; flex-direction: column; gap: 8px; }
.tgroup { background: var(--card); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; transition: border-color 0.14s, box-shadow 0.14s; }
.tgroup-head { display: flex; align-items: center; gap: 5px; padding: 9px 10px 9px 0; }
.tgroup-head:hover { background: var(--card); }
.tgroup-accent { width: 3px; align-self: stretch; border-radius: 0 99px 99px 0; background: #cbd5e1; margin-right: 3px; }
.tgroup.tone-danger .tgroup-accent { background: #e11d48; }
.tgroup.tone-warn .tgroup-accent { background: #f59e0b; }
.tgroup.tone-info .tgroup-accent { background: #0ea5e9; }
.tgroup.is-focus { border-color: #b9c3f7; box-shadow: 0 0 0 3px rgba(79, 92, 232, 0.12); }
.tgroup-toggle { display: flex; align-items: center; gap: 9px; flex: 1; min-width: 0; background: none; border: 0; padding: 2px 0; text-align: left; cursor: pointer; color: inherit; }
.tgroup-caret { width: 24px; height: 24px; border-radius: 7px; display: grid; place-items: center; background: var(--surface); color: var(--t-ink-400); flex: none; }
.tgroup-main { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.tgroup-title { font-size: 13px; font-weight: 650; color: var(--ink); line-height: 1.35; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tgroup-sub { font-size: 11px; color: var(--t-ink-400); line-height: 1.35; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tgroup-badges { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; justify-content: flex-end; margin-left: auto; padding-left: 8px; }
.tbadge-high { display: inline-flex; align-items: center; gap: 3px; font-size: 11px; font-weight: 700; color: var(--danger); background: var(--danger-soft); border: 1px solid #fecdd3; border-radius: 99px; padding: 1px 6px; }
.tgroup-tools { display: flex; align-items: center; gap: 1px; flex: none; }
.tgroup-tool { display: inline-flex; align-items: center; gap: 4px; border: 1px solid transparent; background: none; padding: 5px 7px; border-radius: 8px; font-size: 11px; font-weight: 600; color: var(--muted); cursor: pointer; white-space: nowrap; }
.tgroup-tool:hover { background: var(--surface); border-color: #dfe4fb; color: var(--brand); }
.tgroup-tool.ok:hover { background: var(--ok-soft); border-color: #c7f0dd; color: var(--ok); }
.tgroup-body { border-top: 1px solid var(--line); padding: 5px 6px; background: var(--card); display: flex; flex-direction: column; gap: 1px; }
.trow { display: flex; align-items: flex-start; gap: 9px; padding: 7px 8px; border-radius: 8px; }
.trow:hover, .trow:focus-within { background: var(--card); box-shadow: inset 0 0 0 1px var(--line); }
.trow-main { min-width: 0; flex: 1; }
.trow-person { display: inline-flex; align-items: center; gap: 7px; min-width: 0; color: var(--ink); }
.trow-person .avatar { width: 22px; height: 22px; border-radius: 6px; font-size: 11px; }
.trow-person:hover .trow-name { color: var(--brand); }
.trow-name { font-size: 12px; font-weight: 600; line-height: 1.35; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trow-title { font-size: 12px; font-weight: 600; color: var(--ink); line-height: 1.4; }
.trow-meta { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; margin-top: 2px; font-size: 11px; color: var(--t-ink-400); }
.trow-when { display: inline-flex; align-items: center; gap: 3px; }
.trow-when.late { color: var(--danger); font-weight: 650; }
.trow-when.today { color: var(--warn); font-weight: 650; }
.trow-who { color: var(--t-ink-500); font-weight: 600; }
.trow-who:hover { color: var(--brand); }
.trow-prio { display: inline-flex; align-items: center; gap: 4px; }
.trow-prio .dot { width: 5px; height: 5px; border-radius: 50%; }
.trow-cat { padding: 0 5px; border-radius: 99px; background: var(--surface); border: 1px solid #e7eaf1; font-size: 11px; font-weight: 600; color: var(--t-ink-500); }
.trow.done { opacity: 0.65; }
.trow.done .trow-title { text-decoration: line-through; text-decoration-color: #b9c1d4; }
.trow .check { margin-top: 1px; flex: none; padding: 0; appearance: none; -webkit-appearance: none; }
.trow-tools { display: flex; align-items: center; gap: 1px; opacity: 0; transition: opacity 0.12s; flex: none; }
.trow:hover .trow-tools, .trow:focus-within .trow-tools { opacity: 1; }
.trow-tool { border: 0; background: none; width: 24px; height: 24px; display: grid; place-items: center; border-radius: 6px; color: var(--muted-soft); cursor: pointer; }
.trow-tool:hover { background: var(--brand-soft); color: var(--brand); }
.trow-tool.danger:hover { background: var(--danger-soft); color: var(--danger); }

/* Étendre un intitulé à d'autres dossiers */
.task-extend { display: flex; flex-direction: column; gap: 10px; }
.task-extend-recap { font-size: 12px; color: var(--t-ink-500); display: flex; align-items: center; gap: 5px; }
.task-search-modal { max-width: none; }
.task-extend-list { max-height: 300px; overflow-y: auto; border: 1px solid var(--line); border-radius: 10px; padding: 4px; }
.task-extend-row { display: flex; align-items: center; gap: 9px; padding: 7px 8px; border-radius: 8px; cursor: pointer; }
.task-extend-row:hover { background: var(--surface); }
.task-extend-row input { flex: none; }
.task-extend-row .avatar { width: 26px; height: 26px; border-radius: 8px; font-size: 11px; }
.task-extend-name { display: block; font-size: 12px; font-weight: 600; color: var(--ink); }
.task-extend-meta { display: block; font-size: 11px; color: var(--t-ink-400); }
.task-extend-empty { display: flex; gap: 9px; padding: 20px 12px; color: var(--t-ink-400); font-size: 12px; line-height: 1.45; }
.task-extend-empty b { display: block; color: var(--ink); font-size: 12px; }
.task-extend-empty span { display: block; margin-top: 2px; }

/* Palette « Aller à… » */
.pal-open { gap: 6px; }
.pal-open kbd { margin-left: 2px; }
.pal-open span { font-size: 12px; font-weight: 600; }
.pal { display: flex; flex-direction: column; gap: 9px; }
.pal-search { max-width: none; }
.pal-list { max-height: min(52vh, 420px); overflow-y: auto; margin: 0 -4px; }
.pal-group { font-size: 11px; text-transform: uppercase; letter-spacing: 0.12em; font-weight: 700; color: var(--t-ink-400); padding: 8px 9px 4px; }
.pal-row { display: flex; align-items: center; gap: 9px; width: 100%; padding: 7px 8px; border: 0; background: none; border-radius: 8px; text-align: left; cursor: pointer; }
.pal-row.is-active { background: var(--brand-soft); }
.pal-ico { width: 26px; height: 26px; border-radius: 8px; background: var(--surface); color: var(--t-ink-500); display: grid; place-items: center; flex: none; overflow: hidden; }
.pal-row.is-active .pal-ico { background: var(--card); color: var(--brand); }
.pal-ico .avatar { width: 26px; height: 26px; border-radius: 8px; font-size: 11px; }
.pal-main { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 1px; }
.pal-label { font-size: 13px; font-weight: 600; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pal-hint-text { font-size: 11px; color: var(--t-ink-400); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pal-key { margin-left: auto; font-size: 11px; color: var(--muted-soft); white-space: nowrap; }
.pal-empty { display: flex; gap: 10px; padding: 22px 12px; color: var(--t-ink-400); font-size: 12px; line-height: 1.45; }
.pal-empty b { display: block; color: var(--ink); font-size: 13px; }
.pal-empty span { display: block; margin-top: 2px; }
.pal-foot { display: flex; gap: 14px; flex-wrap: wrap; padding-top: 8px; border-top: 1px solid var(--line); font-size: 11px; color: var(--t-ink-400); }
.pal-foot span { display: inline-flex; align-items: center; gap: 4px; }

.pal-open kbd, .task-search kbd, .task-keys kbd, .pal-foot kbd, .pal-key kbd {
  display: inline-block; min-width: 17px; text-align: center; padding: 1px 4px;
  border-radius: 4px; border: 1px solid var(--line-strong, #d4d9e5);
  background: var(--surface-2, #f1f3f8); color: var(--muted);
  font-family: inherit; font-size: 11px; font-weight: 700; line-height: 1.4;
}

/* Respiration et lisibilité communes : même cap sur tous les écrans. */
.task { padding: 10px 11px; gap: 10px; }
:where(a, button, [role="button"], input, select, textarea, summary):focus-visible {
  outline: 2px solid var(--brand); outline-offset: 2px;
}

@media (max-width: 900px) {
  .tgroup-tool span { display: none; }
  .tgroup-tool { padding: 5px; }
  .pal-open span, .pal-open kbd { display: none; }
}
@media (max-width: 760px) {
  .task-count { margin-left: 0; width: 100%; }
  .task-search { max-width: none; flex-basis: 100%; }
  .task-seg { width: 100%; overflow-x: auto; }
  .task-seg-label { display: none; }
  .task-keys { display: none; }
  .tgroup-badges { display: none; }
  .tgroup-sub { white-space: normal; }
  .tgroup-head { align-items: flex-start; }
  .tgroup-tools { padding-top: 1px; }
}

@media print {
  .task-toolbar, .task-keys, .tgroup-tools, .trow-tools, .pal-open { display: none !important; }
  .tgroup { break-inside: avoid; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}

/* ================================================= v95 — confort et gestes */
/* La même grammaire visuelle sur tous les écrans : plus d'air, des titres
   nets, des commandes faciles à viser et deux réglages persistants. */

.btn-sm { border-radius: 8px; }
.nav-label { padding-top: 14px; }
.ux-btn[aria-pressed="true"] { background: var(--brand-soft, #eef1ff); color: var(--brand); }

/* Deux réglages de confort, mémorisés dans le navigateur. */
html[data-density="confort"] .card-pad { padding: 22px; }
html[data-density="confort"] table.data tbody td { padding: 11px 14px; }
html[data-density="confort"] .task { padding-top: 11px; padding-bottom: 11px; }
html[data-density="compact"] .view { padding-top: 16px; }
html[data-density="compact"] .card-pad { padding: 14px 16px; }
html[data-density="compact"] .page-title { font-size: 22px; }
html[data-density="compact"] table.data thead th,
html[data-density="compact"] table.data tbody td { padding: 6px 10px; }
html[data-density="compact"] .task { padding-top: 6px; padding-bottom: 6px; }
html[data-density="compact"] .nav-item { padding-top: 6px; padding-bottom: 6px; }

/* Mode focus : le menu disparaît, la fiche respire. */
body.focus-mode .sidebar { display: none; }
body.focus-mode .view { max-width: 1740px; }

/* Actions rapides toujours visibles, en haut du menu. */
.side-quick { display: grid; gap: 6px; padding: 2px 12px 10px; }
.side-quick-btn {
  display: flex; align-items: center; gap: 8px; min-height: 36px;
  padding: 7px 9px; border-radius: 9px; text-align: left;
  font-size: 12px; font-weight: 600; color: #dfe5f5;
  background: rgba(255, 255, 255, 0.055); border: 1px solid rgba(255, 255, 255, 0.09);
  transition: background 0.14s, border-color 0.14s;
}
.side-quick-btn:hover { background: rgba(255, 255, 255, 0.11); border-color: rgba(255, 255, 255, 0.16); }
.side-quick-btn.primary {
  background: linear-gradient(135deg, #4f5ce8, #6d5cf0);
  border-color: transparent; color: #fff;
  box-shadow: 0 6px 16px -8px rgba(79, 92, 232, 0.9);
}
.side-quick-btn.primary:hover { background: linear-gradient(135deg, #4350dc, #5e4ce2); }
.side-quick-btn span { flex: 1; min-width: 0; }
.side-quick-btn kbd {
  flex: none; font: inherit; font-size: 11px; line-height: 1; padding: 3px 4px;
  border-radius: 4px; background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.16); color: #fff;
}

/* Indication discrète après un appui seul sur G. */
.key-hint {
  position: fixed; left: 50%; bottom: 22px; z-index: 95;
  transform: translate(-50%, 10px); opacity: 0;
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px;
  max-width: calc(100vw - 24px); padding: 9px 13px;
  border-radius: 12px; background: #101a31; color: #cdd6ea;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 18px 40px -12px rgba(2, 8, 23, 0.55);
  font-size: 12px; transition: opacity 0.16s ease, transform 0.16s ease;
  pointer-events: none;
}
.key-hint.on { opacity: 1; transform: translate(-50%, 0); }
.key-hint span { white-space: nowrap; }
.key-hint kbd {
  display: inline-block; min-width: 17px; padding: 2px 4px; margin-right: 3px;
  border-radius: 4px; background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.16); color: #fff;
  font: inherit; font-size: 11px; font-weight: 700; text-align: center;
}
.key-hint-main { color: #fff; font-weight: 700; }
.key-hint-main kbd { background: #4f5ce8; border-color: #6a75ff; }

/* Fiche dossier : retour et pas-à-pas au même endroit. */
.person-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.person-back { display: flex; align-items: center; gap: 10px; min-width: 0; }
.person-step { display: inline-flex; align-items: center; gap: 4px; padding-left: 9px; border-left: 1px solid var(--line); }
.person-step .btn { color: var(--muted); }

/* Échéances rapides dans la fenêtre d'une action. */
.due-presets { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; margin-top: -3px; }
.due-presets > span:first-child {
  font-size: 11px; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--muted);
}
.due-presets button {
  font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 99px;
  border: 1px solid var(--line); background: var(--card); color: var(--ink-2);
  transition: border-color 0.14s, color 0.14s, background 0.14s;
}
.due-presets button:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-soft, #eef1ff); }
.due-presets-tip { margin-left: auto; font-size: 11px; color: var(--muted); }

/* Aide des raccourcis. */
.shortcut-sheet { display: grid; gap: 0; }
.shortcut-lead {
  font-size: 12px; line-height: 1.55; color: var(--ink-2);
  padding: 10px 12px; margin-bottom: 8px; border-radius: 10px;
  background: var(--surface); border: 1px solid var(--line);
}
.shortcut-lead kbd { margin-right: 4px; }
.shortcut-row {
  display: grid; grid-template-columns: 218px 1fr; gap: 14px;
  align-items: start; padding: 8px 2px; border-bottom: 1px solid var(--line);
}
.shortcut-row:last-of-type { border-bottom: 0; }
.shortcut-keys { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.shortcut-keys kbd, .shortcut-tip kbd, .shortcut-lead kbd {
  display: inline-block; min-width: 19px; padding: 3px 5px;
  border-radius: 5px; border: 1px solid var(--line-strong);
  background: var(--card); color: var(--ink); font: inherit; font-size: 11px;
  font-weight: 700; text-align: center; box-shadow: 0 1px 0 var(--line);
}
.shortcut-then { font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.shortcut-text { font-size: 12px; line-height: 1.5; color: var(--ink-2); }
.shortcut-tip {
  margin-top: 10px; padding: 8px 10px; border-radius: 9px;
  background: var(--surface); color: var(--muted); font-size: 12px; line-height: 1.6;
}
.shortcut-group { margin-top: 11px; }
.shortcut-group-title {
  font-size: 11px; font-weight: 800; letter-spacing: 0.09em; text-transform: uppercase;
  color: var(--brand); padding: 0 2px 2px;
}
.shortcut-group-note { font-size: 11px; color: var(--muted); line-height: 1.5; padding: 0 2px 5px; }
.shortcut-browser {
  margin-top: 15px; padding: 10px 12px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--surface);
}
.shortcut-browser-title { display: flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 700; color: var(--ink); }
.shortcut-browser-text { margin: 4px 0 7px; font-size: 11px; line-height: 1.55; color: var(--muted); }
.shortcut-browser-keys { display: flex; flex-wrap: wrap; gap: 4px 11px; font-size: 11px; color: var(--ink-2); }
.shortcut-browser-keys span { white-space: nowrap; }
.shortcut-browser-keys kbd {
  font: inherit; font-size: 11px; font-weight: 700; padding: 2px 4px; border-radius: 4px;
  border: 1px solid var(--line-strong); background: var(--card); color: var(--ink);
}

/* Repères d'écran : situer la section et distinguer ses voisines. */
.reperes {
  display: flex; align-items: center; flex-wrap: wrap; gap: 5px 10px;
  margin: -8px 0 18px; padding: 8px 11px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--surface);
  font-size: 12px; line-height: 1.45; color: var(--ink-2);
}
.reperes-ico { display: inline-flex; flex: none; color: var(--brand); }
.reperes-here { font-weight: 600; color: var(--ink); }
.reperes-nums { font-weight: 700; color: var(--brand); white-space: nowrap; }
.reperes-near { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; margin-left: auto; }
.reperes-near-label {
  font-size: 11px; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--muted);
}
.reperes-near a {
  display: inline-flex; align-items: baseline; gap: 4px; padding: 2px 7px;
  border-radius: 99px; border: 1px solid var(--line); background: var(--card);
  color: var(--ink-2); text-decoration: none;
}
.reperes-near a b { font-weight: 700; color: var(--ink); }
.reperes-near a span { font-size: 11px; color: var(--muted); }
.reperes-near a:hover { border-color: var(--brand); color: var(--brand); }
.reperes-near a:hover b { color: var(--brand); }
.reperes-help {
  flex: none; width: 18px; height: 18px; border-radius: 50%; border: 1px solid var(--line);
  background: var(--card); color: var(--muted); font: inherit; font-size: 11px; font-weight: 700; cursor: pointer;
}
.reperes-help:hover { border-color: var(--brand); color: var(--brand); }

@media (max-width: 720px) {
  .shortcut-row { grid-template-columns: 1fr; gap: 3px; padding: 8px 0; }
  .shortcut-tip { font-size: 11px; }
  .due-presets-tip { display: none; }
  .person-step { margin-left: auto; }
  .side-quick { padding-bottom: 6px; }
  .key-hint { bottom: 10px; font-size: 11px; gap: 3px 9px; }
  /* Les liens voisins restent sur une seule ligne, à faire défiler :
     la barre de repères ne prend pas un tiers de l'écran. */
  .reperes { margin: -6px 0 14px; padding: 7px 10px; font-size: 11px; }
  .reperes-near { width: 100%; margin-left: 0; flex-wrap: nowrap; overflow-x: auto; padding-bottom: 2px; }
  .reperes-near a { flex: none; }
  .reperes-near a span { display: none; }
  .reperes-help { display: none; }
}

/* ============================== v96 — finition page par page */
/* Les en-têtes gardent la même respiration sur tous les écrans, y compris
   Synthèses et Sécurité qui avaient leur propre gabarit. */
.page-head { margin-bottom: 20px; }
.page-actions { gap: 7px; }
.page-sub { line-height: 1.55; }

/* Onglets d'outils et de plans : même pastilles que les autres écrans. */
.tools-tabs { padding: 10px 14px; margin-bottom: 14px; }

/* Journal : la barre de jours reste lisible sur les thèmes sombres. */
.journal-day { background: var(--bg); }

/* Sécurité : les quatre indicateurs du haut. */
.sec-strip .kpi-value { font-size: 18px; line-height: 1.2; }
.sec-strip .kpi-foot { min-height: 20px; }

/* Confort de lecture, réglable aussi depuis Apparence. */
.ux-choice { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.ux-choice-btn {
  display: flex; align-items: center; gap: 8px; text-align: left;
  padding: 9px 10px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--card); color: var(--ink-2); cursor: pointer;
  transition: border-color 0.14s, background 0.14s, box-shadow 0.14s;
}
.ux-choice-btn:hover { border-color: var(--brand); background: var(--brand-soft, #eef1ff); }
.ux-choice-btn.is-active { border-color: var(--brand); background: var(--brand-soft, #eef1ff); box-shadow: inset 0 0 0 1px var(--brand); }
.ux-choice-btn span { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.ux-choice-btn b { font-size: 12px; font-weight: 650; color: var(--ink); }
.ux-choice-btn small { font-size: 11px; color: var(--muted); }
.ux-tip {
  display: flex; align-items: flex-start; gap: 6px; margin-top: 10px;
  font-size: 11px; line-height: 1.5; color: var(--muted);
}
.ux-tip kbd {
  display: inline-block; padding: 1px 4px; border: 1px solid var(--line-strong);
  border-radius: 4px; background: var(--card); color: var(--ink-2);
  font: inherit; font-size: 11px; font-weight: 700;
}

/* Retour en haut, présent sur toutes les pages longues. */
.back-top {
  position: fixed; right: 18px; bottom: 18px; z-index: 70;
  display: inline-flex; align-items: center; gap: 5px;
  padding: 7px 11px; border-radius: 99px;
  border: 1px solid var(--line-strong); background: var(--card); color: var(--ink-2);
  box-shadow: var(--shadow-lg); font-size: 12px; font-weight: 650;
  opacity: 0; pointer-events: none; transform: translateY(8px);
  transition: opacity 0.16s ease, transform 0.16s ease, background 0.14s;
}
.back-top.on { opacity: 1; pointer-events: auto; transform: translateY(0); }
.back-top:hover { background: var(--brand-soft, #eef1ff); color: var(--brand); }
.back-top svg { width: 14px; height: 14px; }

/* Cartes d'étiquettes : un survol plus net, sans déplacer la grille. */
.tag-card { transition: border-color 0.14s, box-shadow 0.14s, transform 0.14s; }
.tag-card:hover { transform: translateY(-1px); box-shadow: 0 10px 24px -18px rgba(16, 24, 40, 0.55); }

@media (max-width: 640px) {
  .ux-choice { grid-template-columns: 1fr; }
  .back-top { right: 10px; bottom: 10px; }
  .back-top span { display: none; }
}

/* ===================================================== dispositions v97 */
/* Deux colonnes de travail : le contenu principal garde la priorité, une
   colonne de repères accompagne sans répéter les mêmes cartes. */
.page-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 292px;
  gap: 16px;
  align-items: start;
}
.page-main { min-width: 0; display: flex; flex-direction: column; gap: 14px; }
/* Variante pour les colonnes qui portent un document (aperçu A4, dossier). */
.page-split-wide { grid-template-columns: minmax(0, 1fr) minmax(380px, 420px); }
.page-aside {
  display: flex; flex-direction: column; gap: 12px;
  position: sticky; top: 80px;
}
.page-aside-flat { position: static; }
.aside-card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 14px 15px;
}
.aside-head {
  display: flex; align-items: center; gap: 7px;
  font-size: 11px; font-weight: 800; letter-spacing: 0.09em;
  text-transform: uppercase; color: var(--t-ink-400);
}
.aside-head svg { width: 13px; height: 13px; color: var(--brand); }
.aside-title { font-size: 13px; font-weight: 700; letter-spacing: -0.01em; margin-top: 3px; }
.aside-sub { font-size: 12px; color: var(--muted); line-height: 1.45; margin-top: 2px; }
.aside-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin-top: 11px; }
.aside-stat {
  border: 1px solid var(--line); border-radius: 10px; padding: 9px 10px;
  background: color-mix(in srgb, var(--card) 82%, var(--bg));
  display: block; text-decoration: none; color: inherit;
  font: inherit; text-align: left; cursor: pointer;
  transition: border-color 0.14s, background 0.14s;
}
.aside-stat:hover { border-color: var(--brand); background: var(--brand-soft, #eef1ff); }
.aside-stat b { display: block; font-size: 20px; line-height: 1; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.aside-stat span { display: block; font-size: 11px; color: var(--muted); line-height: 1.25; margin-top: 3px; }
.aside-stat.tone-danger b { color: var(--danger); }
.aside-stat.tone-warn b { color: var(--warn); }
.aside-stat.tone-ok b { color: var(--ok); }
button.aside-link { background: none; border: 0; padding: 0; font-family: inherit; }
.aside-list { display: flex; flex-direction: column; margin-top: 10px; }
.aside-row {
  display: flex; align-items: flex-start; gap: 8px; width: 100%;
  padding: 8px 0; border: 0; border-top: 1px solid var(--line);
  background: none; text-align: left; color: inherit; cursor: pointer;
  font: inherit; text-decoration: none;
}
.aside-row:first-child { border-top: 0; padding-top: 2px; }
.aside-row:hover .aside-row-title { color: var(--brand); }
.aside-row-ico {
  width: 24px; height: 24px; border-radius: 7px; flex: none;
  display: grid; place-items: center; background: var(--brand-soft, #eef1ff); color: var(--brand);
}
.aside-row-main { min-width: 0; flex: 1; }
.aside-row-title { display: block; font-size: 12px; font-weight: 650; line-height: 1.3; }
.aside-row-meta { display: block; font-size: 11px; color: var(--muted); line-height: 1.3; margin-top: 1px; }
.aside-link { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 650; color: var(--brand); margin-top: 9px; }
.aside-link:hover { text-decoration: underline; }
.page-aside .quick-views {
  flex-direction: column; align-items: stretch; gap: 5px;
  margin: 10px 0 0; padding: 0; border: 0; background: none;
}
.page-aside .quick-views-label { display: block; margin: 0 0 3px; }
.page-aside .qv {
  width: 100%; justify-content: space-between; text-align: left;
  padding: 7px 9px; border-radius: 8px;
}
.page-aside .toolbar-result { display: block; margin: 8px 0 0; }
.task-keys-card .task-keys {
  display: flex; flex-direction: column; align-items: flex-start;
  gap: 6px; margin: 9px 0 0; font-size: 11px; line-height: 1.35;
}
.task-keys-card .task-keys span { display: inline-flex; }
@media (max-width: 1279px) {
  .task-keys-card .task-keys { flex-direction: row; flex-wrap: wrap; gap: 6px 12px; }
}

/* Tableau de bord : la journée au centre, les repères et raccourcis à droite. */
.dash-layout {
  display: grid; grid-template-columns: minmax(0, 1fr) 302px;
  gap: 16px; align-items: start;
}
.dash-main { min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.dash-rail { display: flex; flex-direction: column; gap: 12px; position: sticky; top: 80px; }
.dash-lower { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
.dash-pulse { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin-top: 11px; }
.dash-pulse-item {
  display: block; border: 1px solid var(--line); border-radius: 10px;
  padding: 9px 10px; text-decoration: none; color: inherit;
  background: color-mix(in srgb, var(--card) 82%, var(--bg));
  transition: border-color 0.14s, background 0.14s;
}
.dash-pulse-item:hover { border-color: var(--brand); background: var(--brand-soft, #eef1ff); }
.dash-pulse-item b { display: block; font-size: 20px; line-height: 1; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.dash-pulse-item span { display: block; font-size: 11px; color: var(--muted); line-height: 1.25; margin-top: 3px; }
.dash-pulse-item.is-danger b { color: var(--danger); }
.dash-rail .start-tiles { grid-template-columns: 1fr; gap: 7px; }
.dash-rail .start-tile { padding: 9px 10px; }
.dash-rail .help-card { padding: 14px 15px; }
.dash-rail .help-card .btn { font-size: 11px; padding: 5px 8px; }

@media (max-width: 1279px) {
  .page-split { grid-template-columns: 1fr; }
  .page-aside { position: static; order: -1; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
  .page-aside.page-aside-after { order: 0; }
  .page-aside .quick-views { flex-direction: row; flex-wrap: wrap; }
  .page-aside .qv { width: auto; }
  .dash-layout { grid-template-columns: 1fr; }
  .dash-rail { position: static; display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
  .dash-lower { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .page-aside { grid-template-columns: 1fr; }
  .dash-pulse { grid-template-columns: 1fr 1fr; }
}

/* Bandeau de repères du portefeuille. */
.portfolio-summary {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px; margin-bottom: 14px;
}
.portfolio-summary .sum-tile {
  display: flex; align-items: center; gap: 10px; text-align: left;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: 11px 13px; color: inherit; cursor: pointer; font: inherit;
  transition: border-color 0.14s, box-shadow 0.14s;
}
.portfolio-summary .sum-tile:hover { border-color: var(--brand); box-shadow: 0 8px 18px -16px rgba(16, 24, 40, 0.5); }
.sum-ico { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; flex: none; background: var(--brand-soft, #eef1ff); color: var(--brand); }
.sum-tile.tone-danger .sum-ico { background: var(--danger-soft); color: var(--danger); }
.sum-tile.tone-warn .sum-ico { background: var(--warn-soft); color: var(--warn); }
.sum-tile.tone-ok .sum-ico { background: var(--ok-soft); color: var(--ok); }
.sum-main { min-width: 0; }
.sum-main b { display: block; font-size: 19px; line-height: 1; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.sum-main span { display: block; font-size: 11px; color: var(--muted); margin-top: 2px; line-height: 1.2; }
@media (max-width: 900px) {
  .portfolio-summary { grid-template-columns: 1fr 1fr; }
}

/* Listes de fiches : une colonne dans le rail de travail, deux dès qu'il y a
   assez de largeur utile — jamais deux colonnes écrasées à 1 280 px. */
.results-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 12px; }

/* Sécurité : les gestes courants à gauche, les procédures à droite. */
.sec-layout { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(280px, 0.75fr); gap: 14px; align-items: start; }
.sec-layout .sec-main { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; align-items: start; }
.sec-layout .sec-rail { display: flex; flex-direction: column; gap: 14px; }
@media (max-width: 1279px) {
  .sec-layout { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .sec-layout .sec-main { grid-template-columns: 1fr; }
}

/* v98 : fiche dossier, ateliers, boîte à outils et plans. */
.page-split .page-aside { min-width: 0; }
.page-aside .card-head { flex-wrap: wrap; row-gap: 6px; }
.page-split-wide .cv-preview-card { position: static; min-width: 0; align-self: stretch; }
.page-split-wide .cv-frame-wrap { width: 100%;
  height: 578px;}
.page-split-wide .cv-frame { transform: scale(.5); }
/* Sous 1 440 px, le document garde toute la largeur : un rail de 420 px
   écraserait le formulaire sur un poste de 1 280 px. */
@media (max-width: 1439px) {
  .page-split-wide { grid-template-columns: 1fr; }
  .page-split-wide .cv-frame-wrap { height: 815px; }
  .page-split-wide .cv-frame { transform: scale(.72); }
}
@media (max-width: 1279px) {
  .page-split-wide .cv-frame-wrap { height: 815px; }
  .page-split-wide .cv-frame { transform: scale(.72); }
}
@media (max-width: 900px) {
  .page-split-wide .cv-frame-wrap { height: 648px; }
  .page-split-wide .cv-frame { transform: scale(.56); }
}
@media (max-width: 640px) {
  .page-split-wide .cv-frame-wrap { height: 410px; }
  .page-split-wide .cv-frame { transform: scale(.36); }
}
/* Sur téléphone, les libellés longs (critères d'atelier, offre suivie) se
   replient au lieu de déborder de la carte. */
@media (max-width: 720px) {
  #view .chip,
  #view .badge { max-width: 100%; white-space: normal; }
}

/* ==========================================================================
   Lisibilité et coquille (v107)
   Un seul plancher typographique, un en-tête allégé, un lien d'évitement,
   des onglets sur téléphone et un portefeuille qui tient sans défilement.
   ========================================================================== */

/* --- plancher typographique -------------------------------------------------
   Les classes arbitraires de Tailwind sont produites au chargement de la page :
   il faut les reprendre avec !important pour garantir le minimum de 11 px. */
.text-\[9px\],
.text-\[9\.5px\],
.text-\[10px\],
.text-\[10\.5px\] { font-size: 11px !important; }
.text-\[11px\],
.text-\[11\.5px\] { font-size: 12px !important; }
.text-\[12\.5px\] { font-size: 13px !important; }
.text-\[13\.5px\] { font-size: 14px !important; }

/* --- lien d'évitement ------------------------------------------------------ */
.skip-link {
  position: fixed; top: 10px; left: 10px; z-index: 300;
  transform: translateY(-180%); transition: transform .16s ease;
  background: var(--brand); color: #fff; font-size: 12px; font-weight: 700;
  padding: 10px 14px; border-radius: 10px; box-shadow: var(--shadow-lg);
}
.skip-link:focus { transform: none; outline: 3px solid #fff; outline-offset: 2px; }

/* --- en-tête : moins de boutons, libellé sur une ligne --------------------- */
#topbar .ux-btn { display: none; }
.topbar #crumb { white-space: nowrap; }
.topbar .crumb-wrap { white-space: nowrap; }

/* --- menu d'affichage ------------------------------------------------------ */
.display-menu {
  position: fixed; z-index: 120; width: 268px; padding: 8px;
  border-radius: 14px; border: 1px solid var(--line);
  background: var(--card);
  box-shadow: var(--shadow-lg);
}
.display-head {
  font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--muted); padding: 6px 8px 4px;
}
.display-row {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  padding: 8px; border-radius: 9px; border: 0; background: none;
  color: var(--ink); font-size: 12px; font-weight: 600;
}
.display-row:hover, .display-row:focus-visible { background: var(--surface); }
.display-row > svg { color: var(--muted); flex: none; }
.display-row > span { display: flex; flex-direction: column; min-width: 0; }
.display-row small { font-size: 11px; font-weight: 500; color: var(--muted); }
.display-row .display-state { margin-left: auto; font-size: 11px; font-weight: 700; color: var(--brand); }
.display-static { cursor: default; }
.display-static:hover { background: none; }
.display-seg { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 2px 8px 6px; }
.display-seg button {
  font-size: 11px; font-weight: 650; padding: 6px 8px; border-radius: 8px;
  border: 1px solid var(--line); background: var(--card); color: var(--muted);
}
.display-seg button[aria-pressed="true"] {
  background: var(--brand-soft); border-color: color-mix(in srgb, var(--brand) 34%, transparent);
  color: var(--brand);
}
.display-sep { height: 1px; background: var(--line); margin: 6px 4px; }

/* --- navigation mobile ----------------------------------------------------- */
.tabbar { display: none; }
@media (max-width: 1023px) {
  .tabbar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 36;
    display: grid; grid-template-columns: repeat(5, 1fr); gap: 2px;
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom, 0px));
    background: var(--card);
    border-top: 1px solid var(--line);
    box-shadow: 0 -10px 30px -22px rgba(15, 23, 42, .5);
  }
  .tabbar .tab-item {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 2px; min-height: 46px; padding: 4px 2px; border: 0; border-radius: 10px;
    background: none; color: var(--muted); font-size: 11px; font-weight: 650;
    text-decoration: none;
  }
  .tabbar .tab-item svg { width: 19px; height: 19px; }
  .tabbar .tab-item.active { color: var(--brand); background: var(--brand-soft); }
  .toast-root { bottom: 82px; }
  .back-top { bottom: 86px; }
}

/* --- portefeuille : 8 colonnes jusqu'à 1 439 px ----------------------------
   La colonne « Freins » est la plus large et la moins scannable : elle reste
   dans la fiche du dossier et dans les cartes. Sans elle, le tableau tient
   sans défilement horizontal sur un poste de 1 280 px. */
@media (min-width: 1280px) and (max-width: 1439px) {
  table.data-portfolio thead th { padding: 8px; }
}

/* À 1 280 px, les colonnes se resserrent plutôt que de faire défiler le
   tableau : les libellés longs sont tronqués avec leur infobulle. */
@media (min-width: 1280px) and (max-width: 1439px) {
  table.data-portfolio .td-strong { max-width: 134px; }
  table.data-portfolio td:nth-child(4) .truncate { max-width: 112px; }
  table.data-portfolio td:nth-child(6) .truncate { max-width: 126px; }
}

/* --------------------------------------------------------------------------
   Passe complète des écrans (v108)
   Deux tableaux ne doivent jamais faire défiler leur carte : l'aperçu de thème
   (qui illustre des composants) et l'émargement d'un atelier sur téléphone,
   où les colonnes secondaires s'effacent au profit des boutons de présence.
   -------------------------------------------------------------------------- */
.table-wrap.table-specimen { overflow: visible; }
.table-wrap.table-specimen table.data { min-width: 0; width: 100%; }
.table-wrap.table-specimen thead th,
.table-wrap.table-specimen tbody td { padding: 6px 7px; white-space: normal; }

@media (max-width: 767px) {
  table.data-ws, table.data-ws-suivi { min-width: 0; width: 100%; }
  table.data-ws thead th:nth-child(2), table.data-ws tbody td:nth-child(2),
  table.data-ws thead th:nth-child(3), table.data-ws tbody td:nth-child(3),
  table.data-ws thead th:nth-child(5), table.data-ws tbody td:nth-child(5) { display: none; }
  table.data-ws-suivi thead th:nth-child(2), table.data-ws-suivi tbody td:nth-child(2),
  table.data-ws-suivi thead th:nth-child(3), table.data-ws-suivi tbody td:nth-child(3) { display: none; }
  table.data-ws thead th, table.data-ws tbody td,
  table.data-ws-suivi thead th, table.data-ws-suivi tbody td { padding: 8px 7px; }
}

/* L'aperçu de thème perd sa quatrième colonne sur téléphone : elle ne tient pas
   dans la carte, et les pastilles au-dessus montrent déjà le même composant. */
@media (max-width: 640px) {
  .table-specimen thead th:nth-child(4), .table-specimen tbody td:nth-child(4) { display: none; }
}

/* ================================================ survol lisible (v111)
   Le survol existait mais se confondait avec la carte : --hover valait
   #fafbff sur un fond #ffffff, et les lignes cliquables n'avaient ni curseur
   ni repère. On donne au survol un cran de teinte de marque, mesurable sur
   les trente thèmes, et une barre d'accent sur la ligne de dossier. */
html[data-theme] { --hover: color-mix(in srgb, var(--brand) 9%, var(--card)); }

[data-href],
[data-act]:not(button):not(a):not(input):not(select):not(textarea):not(summary) { cursor: pointer; }

table.data tbody tr[data-href] { cursor: pointer; }
table.data tbody tr[data-href]:hover,
table.data tbody tr[data-href]:focus-within { background: var(--hover); }
table.data tbody tr[data-href]:hover td:first-child,
table.data tbody tr[data-href]:focus-within td:first-child { box-shadow: inset 3px 0 0 var(--brand); }
table.data tbody tr.selected:hover,
table.data tbody tr.selected:focus-within { background: color-mix(in srgb, var(--brand) 16%, var(--card)); }

article[data-href]:hover,
article[data-href]:focus-within { background: var(--hover); }

.aside-row:hover,
.trow:hover,
.trow:focus-within,
.tgroup-head:hover,
.start-tile:hover,
.tag-card:hover,
.theme-card:hover,
.notif-main:hover { background: var(--hover); }

/* Filet de sécurité : un élément cliquable qui n'a pas de règle de survol
   propre prend la même teinte. :where() le laisse sans spécificité, donc
   toutes les règles existantes (cartes, pastilles, lignes) restent maîtresses. */
:where([data-act]:not(button):not(a):not(input):not(select):not(textarea):not(summary)):hover { background-color: var(--hover); }

/* ================================================ fiches repliées (v112)
   La fiche dossier garde trois blocs en clair — décision, plan, historique —
   et replie les sections secondaires. Chaque barre annonce son contenu en une
   ligne : rien n'est caché sans être résumé. */
.fold-card { overflow: hidden; }
.fold-summary { display: flex; align-items: center; gap: 10px; padding: 11px 14px; cursor: pointer; list-style: none; }
.fold-summary::-webkit-details-marker { display: none; }
.fold-ico { flex: none; width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); }
.fold-main { min-width: 0; flex: 1; }
.fold-title, .fold-sub { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fold-title { font-size: 12.5px; font-weight: 700; color: var(--ink); }
.fold-sub { font-size: 11px; color: var(--muted); margin-top: 1px; }
.fold-badge { flex: none; max-width: 134px; overflow: hidden; }
.fold-badge .badge { max-width: 134px; overflow: hidden; white-space: nowrap; }
.fold-card[open] > .fold-summary { border-bottom: 1px solid var(--line); }
.fold-card[open] .fold-chevron { transform: rotate(180deg); }
.fold-summary:hover { background: var(--hover); }
/* Les cartes repliées sont rendues sans section ni en-tête (option flat des
   constructeurs) : aucune règle de masquage n'est nécessaire. */
