/* Planning — feuille de style unique.
   Mobile d'abord (iPhone 12 Pro Max : 428 × 926 pt), mise en page ordinateur à partir de 900 px.
   Palette des données : travail = bleu, perte = orange, gain = aqua (créneaux 1-3 validés daltonisme) ;
   statuts (critique / attention / positif) toujours doublés d'une icône et d'un texte. */

:root {
  color-scheme: light;
  --bg: #f4f4f1;
  --surface: #fcfcfb;
  --surface-2: #f0efec;
  --surface-3: #e6e5df;
  --ink: #0b0b0b;
  --ink-2: #52514e;
  --muted: #7d7b75;
  --line: #e1e0d9;
  --axis: #c3c2b7;
  --ring: rgba(11, 11, 11, .09);
  --bar: #16161a;
  --bar-ink: #f4f4f6;
  --work: #2a78d6;
  --diverted: #a33f9a;
  --loss: #eb6834;
  --gain: #1baf7a;
  --good: #0ca30c;
  --good-ink: #006300;
  --warning: #fab219;
  --warning-ink: #8a5a00;
  --critical: #d03b3b;
  --critical-ink: #b42323;
  --accent: #2a78d6;
  --focus: #2a78d6;
  --shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 4px 14px rgba(0, 0, 0, .04);
  --shadow-lg: 0 14px 44px rgba(0, 0, 0, .22);
  --r: 14px;
  --r-sm: 10px;
  --font: system-ui, -apple-system, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0d0d0d; --surface: #1a1a19; --surface-2: #242422; --surface-3: #2f2f2c;
    --ink: #ffffff; --ink-2: #c3c2b7; --muted: #8f8d86; --line: #2c2c2a; --axis: #45453f;
    --ring: rgba(255, 255, 255, .08); --bar: #111113;
    --work: #3987e5; --diverted: #c85cc0; --loss: #d95926; --gain: #199e70;
    --good-ink: #3ccf3c; --warning-ink: #fab219; --critical-ink: #ff8080; --accent: #3987e5; --focus: #5598e7;
    --shadow: 0 1px 2px rgba(0, 0, 0, .5); --shadow-lg: 0 14px 44px rgba(0, 0, 0, .6);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0d0d0d; --surface: #1a1a19; --surface-2: #242422; --surface-3: #2f2f2c;
  --ink: #ffffff; --ink-2: #c3c2b7; --muted: #8f8d86; --line: #2c2c2a; --axis: #45453f;
  --ring: rgba(255, 255, 255, .08); --bar: #111113;
  --work: #3987e5; --diverted: #c85cc0; --loss: #d95926; --gain: #199e70;
  --good-ink: #3ccf3c; --warning-ink: #fab219; --critical-ink: #ff8080; --accent: #3987e5; --focus: #5598e7;
  --shadow: 0 1px 2px rgba(0, 0, 0, .5); --shadow-lg: 0 14px 44px rgba(0, 0, 0, .6);
}

/* Couleurs d'espace (enregistrées pour fond clair) : éclaircies sur fond sombre. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .g-bar, :root:not([data-theme="light"]) .dot { filter: brightness(1.35) saturate(.95); }
}
:root[data-theme="dark"] .g-bar, :root[data-theme="dark"] .dot { filter: brightness(1.35) saturate(.95); }

/* ------------------------------------------------------------------ base */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; background: var(--bar); }
body {
  margin: 0; min-height: 100dvh; background: var(--bg); color: var(--ink);
  font: 15px/1.45 var(--font); -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { touch-action: manipulation; }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { letter-spacing: -.01em; }
img { max-width: 100%; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.i { width: 20px; height: 20px; flex: none; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.grow { flex: 1; }
.row { display: flex; align-items: center; }
.row.gap { gap: 8px; }
.row.wrap { flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.stack { display: flex; flex-direction: column; gap: 8px; }
.crit { color: var(--critical-ink); }
.crit .i { width: 15px; height: 15px; vertical-align: -2px; margin-right: 2px; }
.warn-txt { color: var(--warning-ink); font-weight: 600; }
.prewrap { white-space: pre-wrap; margin: 0 0 12px; line-height: 1.55; }
.spaced { margin-top: 20px; }
.link { border: 0; background: none; padding: 0; color: var(--accent); cursor: pointer; text-decoration: underline; }
.desktop-only { display: none !important; }
@media (min-width: 900px) {
  .desktop-only { display: revert !important; }
  .mobile-only { display: none !important; }
}

.boot { min-height: 100dvh; display: grid; place-items: center; gap: 12px; background: var(--bar); color: var(--bar-ink); text-align: center; padding: 24px; }
.boot-spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid rgba(255, 255, 255, .15); border-top-color: #fff; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ------------------------------------------------------------------ structure */

.app { min-height: 100dvh; background: var(--bg); }
.sidebar { display: none; }
.main { min-width: 0; }

.topbar {
  position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 10px;
  background: var(--bar); color: var(--bar-ink);
  padding: calc(env(safe-area-inset-top) + 6px) max(12px, env(safe-area-inset-right)) 8px max(12px, env(safe-area-inset-left));
}
.topbar .brand img { display: block; border-radius: 8px; }
.topbar-title { flex: 1; min-width: 0; font-weight: 650; font-size: 16.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar-btn { width: 40px; height: 40px; border-radius: 12px; border: 0; background: rgba(255, 255, 255, .13); color: #fff; display: grid; place-items: center; cursor: pointer; }
/* Avancement des projets ouverts (anneau : 100 % = tous terminés) et cloche des points d'attention. */
.top-stats { display: flex; align-items: center; gap: 7px; flex: none; min-height: 40px; padding: 0 10px 0 5px; border-radius: 12px; background: rgba(255, 255, 255, .13); color: inherit; }
.ts-ring { width: 30px; height: 30px; flex: none; transform: rotate(-90deg); }
.ts-ring circle { fill: none; stroke-width: 4; }
.ts-track { stroke: rgba(255, 255, 255, .25); }
.ts-arc { stroke: #fff; stroke-linecap: round; transition: stroke-dasharray .4s ease; }
.ts-text { display: flex; flex-direction: column; line-height: 1.15; }
.top-stats b { font-size: 13.5px; font-weight: 680; font-variant-numeric: tabular-nums; white-space: nowrap; }
.top-stats small { font-size: 10.5px; opacity: .78; white-space: nowrap; }
.bell { position: relative; flex: none; }
.bell-badge { position: absolute; top: 2px; right: 2px; display: grid; place-items: center; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 99px; background: var(--critical); color: #fff; font-size: 10.5px; font-weight: 700; line-height: 1; box-shadow: 0 0 0 2px var(--bar); }
.top-stats[hidden], .bell-badge[hidden] { display: none; }
.side-foot-btns { display: flex; gap: 2px; }
@media (max-width: 360px) { .top-stats small { display: none; } }
.offline-flag { display: none; font-size: 11.5px; background: var(--warning); color: #111; padding: 2px 8px; border-radius: 99px; font-weight: 650; }
html.offline .offline-flag { display: inline-flex; }

.view {
  padding: 16px max(16px, env(safe-area-inset-right)) calc(180px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  max-width: 1560px; margin: 0 auto; transition: opacity .2s;
}
.view.busy { opacity: .6; transition: opacity .2s .15s; }
html.has-dock .view { padding-bottom: calc(250px + env(safe-area-inset-bottom)); }

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; display: grid; grid-template-columns: repeat(5, 1fr);
  background: color-mix(in srgb, var(--surface) 90%, transparent);
  -webkit-backdrop-filter: saturate(1.6) blur(18px); backdrop-filter: saturate(1.6) blur(18px);
  border-top: 1px solid var(--line); padding: 0 env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}
.tabbar a { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 9px 0 7px; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.tabbar a .i { width: 28px; height: 28px; }
.tabbar a.on { color: var(--ink); }
.tabbar a.on .i { stroke-width: 2.2; }
/* Liens des espaces : chacun dans la couleur de sa page (bleu, vert menthe, rose cerise), sur toutes les pages,
   éclaircie en mode sombre (libellés AA sur la barre). L'entrée active ajoute une pastille teintée derrière l'icône,
   la couleur seule ne la distinguant plus. */
.tabbar a { position: relative; }
.tabbar a[data-nav="somoba"] { --tab: #1a4fe0; }
.tabbar a[data-nav="pro"] { --tab: #0b6f51; }
.tabbar a[data-nav="perso"] { --tab: #b8123a; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .tabbar a[data-nav="somoba"] { --tab: #82a8ff; }
  :root:not([data-theme="light"]) .tabbar a[data-nav="pro"] { --tab: #4fdca8; }
  :root:not([data-theme="light"]) .tabbar a[data-nav="perso"] { --tab: #ff6fa6; }
}
:root[data-theme="dark"] .tabbar a[data-nav="somoba"] { --tab: #82a8ff; }
:root[data-theme="dark"] .tabbar a[data-nav="pro"] { --tab: #4fdca8; }
:root[data-theme="dark"] .tabbar a[data-nav="perso"] { --tab: #ff6fa6; }
.tabbar a[data-nav="somoba"], .tabbar a[data-nav="pro"], .tabbar a[data-nav="perso"] { color: var(--tab); }
.tabbar a::before {
  content: ""; position: absolute; z-index: -1; top: 7px; left: 50%; width: 54px; height: 32px; margin-left: -27px;
  border-radius: 99px; background: transparent; transition: background-color .2s;
}
.tabbar a.on::before { background: color-mix(in srgb, var(--tab, var(--ink)) 16%, transparent); }

/* Zone flottante au-dessus de la barre d'onglets : bouton « + » (actions) puis chronos ouverts. */
.float-zone {
  position: fixed; z-index: 35; display: flex; flex-direction: column; align-items: flex-end; gap: 6px;
  left: max(8px, env(safe-area-inset-left)); right: max(8px, env(safe-area-inset-right));
  bottom: calc(68px + env(safe-area-inset-bottom)); margin-bottom: 8px; pointer-events: none;
}
.float-zone > * { pointer-events: auto; }
.dock { display: flex; flex-direction: column; gap: 6px; align-self: stretch; }
.fabs { display: flex; align-items: flex-end; gap: 6px; margin-right: 0; }
.fab {
  display: grid; place-items: center; width: 56px; height: 56px; padding: 0;
  border-radius: 9px; cursor: pointer; box-shadow: var(--shadow-lg);
  /* Toujours sombre, quel que soit le thème ; sur une page d'espace, ton profond de sa couleur (--tint-fab). */
  background: var(--bar); color: #fff; border: none;
}
.fab .i { width: 28px; height: 28px; }
.fab.sm { width: 60px; height: 60px; }
.fab.sm .i { width: 26px; height: 26px; }
.fab:active { transform: scale(.97); }

@media (min-width: 900px) {
  html { background: var(--bg); }
  .app { display: grid; grid-template-columns: 250px minmax(0, 1fr); }
  .sidebar {
    display: flex; flex-direction: column; position: sticky; top: 0; height: 100dvh; overflow-y: auto;
    background: var(--bar); color: var(--bar-ink); padding: 18px 12px 12px;
  }
  .topbar, .tabbar { display: none; }
  .view { padding: 28px 36px 56px; }
  html.has-dock .view { padding-bottom: 130px; }
  .float-zone { left: auto; right: 24px; bottom: 24px; width: 400px; }
}

.sidebar .brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 17px; padding: 2px 10px 20px; color: #fff; }
.sidebar .brand img { border-radius: 8px; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a { display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 10px; color: #b7b7c2; font-weight: 550; font-size: 14.5px; }
.nav a:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.nav a.on { background: rgba(255, 255, 255, .11); color: #fff; }
.nav .dot { width: 10px; height: 10px; margin: 0 5px; }
.nav hr { border: 0; border-top: 1px solid rgba(255, 255, 255, .08); margin: 12px 4px; }
.nav-label { margin: 14px 12px 4px; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: #7c7c88; }
.side-quick { margin-top: auto; padding: 12px 2px; }
.side-quick .btn { background: rgba(255, 255, 255, .1); color: #fff; border-color: transparent; }
.side-quick .btn:hover { background: rgba(255, 255, 255, .16); }
.side-foot { display: flex; align-items: center; justify-content: space-between; padding: 8px 6px 2px 12px; color: #9a9aa5; font-size: 13px; border-top: 1px solid rgba(255, 255, 255, .08); }
.side-foot .icon-btn { color: #b7b7c2; }
.side-foot .icon-btn:hover { background: rgba(255, 255, 255, .08); color: #fff; }

/* ------------------------------------------------------------------ boutons */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 42px; padding: 0 15px;
  border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  font-weight: 580; font-size: 14.5px; cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s, transform .06s;
}
.btn:hover { background: var(--surface-2); }
.btn:active { transform: scale(.98); }
.btn .i { width: 18px; height: 18px; }
.btn.primary { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.btn.primary:hover { background: color-mix(in srgb, var(--ink) 84%, var(--surface)); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.danger { color: var(--critical-ink); }
.btn.danger:not(.ghost) { background: var(--critical); color: #fff; border-color: var(--critical); }
.btn.sm { min-height: 34px; padding: 0 11px; font-size: 13.5px; }
.btn.lg { min-height: 50px; font-size: 16px; padding: 0 20px; }
.btn.wide { width: 100%; }
.btn.icon-only { width: 42px; padding: 0; }
.btn:disabled { opacity: .5; pointer-events: none; }
.icon-btn { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; border: 0; background: transparent; color: var(--ink-2); cursor: pointer; }
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }
.icon-btn.sm { width: 30px; height: 30px; border-radius: 8px; }
.icon-btn.sm .i { width: 17px; height: 17px; }
.icon-btn:disabled { opacity: .28; pointer-events: none; }

/* ------------------------------------------------------------------ en-têtes, filtres */

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 2px 0 14px; }
.page-head h1 { font-size: 28px; line-height: 1.12; margin: 2px 0 0; font-weight: 720; letter-spacing: -.025em; overflow-wrap: anywhere; }
.page-head .ph-main { min-width: 0; flex: 1 1 320px; }
.kicker { margin: 0; font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 6px; font-weight: 550; }
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
@media (max-width: 520px) {
  .page-head h1 { font-size: 25px; }
  .head-actions .lbl { display: none; }
  .head-actions .btn { padding: 0 12px; }
}
.back { display: inline-flex; align-items: center; gap: 3px; color: var(--ink-2); font-size: 14px; margin: -4px 0 6px; padding: 4px 6px 4px 0; font-weight: 550; }
.back .i { width: 18px; height: 18px; }

.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 8px; }
.range { font-size: 12px; margin: 0 0 12px; }
.seg { display: inline-flex; background: var(--surface-2); border-radius: 11px; padding: 3px; gap: 2px; overflow-x: auto; max-width: 100%; scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
.seg button { border: 0; background: transparent; padding: 7px 11px; border-radius: 8px; font-size: 13.5px; font-weight: 570; color: var(--ink-2); white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, .14); }
.seg .count { color: var(--muted); font-weight: 500; font-size: 12px; }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex: none; }

.quick { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 0 0 14px; }
.quick-btn { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 13px 4px 11px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--ring); box-shadow: var(--shadow); font-size: 12.5px; font-weight: 620; cursor: pointer; }
.quick-btn .i { width: 25px; height: 25px; }
.quick-btn:first-child { background: var(--ink); color: var(--surface); border-color: var(--ink); }

/* ------------------------------------------------------------------ cartes, tuiles, grilles */

.card { background: var(--surface); border: 1px solid var(--ring); border-radius: var(--r); padding: 16px; box-shadow: var(--shadow); min-width: 0; }
.card + .card { margin-top: 12px; }
.dash-grid > .card + .card, .pj-col > .card + .card { margin-top: 0; }
.card-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin-bottom: 12px; }
.card-head h2 { font-size: 15.5px; margin: 0; font-weight: 660; }
.card-head .btn { margin-left: auto; }
.card-sub { flex-basis: 100%; margin: 0; color: var(--muted); font-size: 12.5px; }
.badge { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px; background: var(--surface-2); font-size: 11.5px; font-weight: 650; color: var(--ink-2); }

.dash-grid { display: grid; gap: 12px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 900px) {
  .dash-grid { grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 16px; }
  .span-12, .span-7, .span-5 { grid-column: span 12; }
  .span-6, .span-4 { grid-column: span 6; }
}
@media (min-width: 1280px) {
  .span-7 { grid-column: span 7; }
  .span-5 { grid-column: span 5; }
  .span-4 { grid-column: span 4; }
}

.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 0 0 14px; }
@media (min-width: 900px) { .tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; } }
.tile { background: var(--surface); border: 1px solid var(--ring); border-radius: var(--r); padding: 12px 14px; display: flex; flex-direction: column; gap: 3px; box-shadow: var(--shadow); min-width: 0; }
.tile-label { font-size: 12.5px; color: var(--ink-2); display: flex; gap: 5px; align-items: center; font-weight: 550; }
.tile-label .i { width: 15px; height: 15px; }
.tile-value { font-size: 24px; font-weight: 680; letter-spacing: -.02em; line-height: 1.15; }
@media (min-width: 900px) { .tile-value { font-size: 28px; } }
.tile-sub { font-size: 12px; color: var(--muted); }
.tile.is-critical { border-color: color-mix(in srgb, var(--critical) 45%, var(--ring)); }
.tile.is-critical .tile-label { color: var(--critical-ink); }
.tile.is-neg .tile-label .i { color: var(--critical-ink); }
.tile.is-pos .tile-label .i { color: var(--good-ink); }
.delta { font-size: 12px; font-weight: 620; }
.delta.good { color: var(--good-ink); }
.delta.bad { color: var(--critical-ink); }
.delta.flat { color: var(--muted); font-weight: 500; }
.delta .muted { font-weight: 450; }

.mini-kpis { display: flex; flex-wrap: wrap; gap: 6px; margin: -4px 0 14px; }
.mini-kpis span { display: inline-flex; align-items: center; gap: 4px; background: var(--surface); border: 1px solid var(--ring); border-radius: 99px; padding: 4px 11px; font-size: 13px; color: var(--ink-2); }
.mini-kpis b { color: var(--ink); font-weight: 650; }
.mini-kpis .crit b, .mini-kpis .crit { color: var(--critical-ink); }
.mini-kpis .i { width: 15px; height: 15px; }

.kv { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 10px; }
@media (min-width: 900px) { .kv { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.kv div { display: flex; flex-direction: column; background: var(--surface-2); border-radius: var(--r-sm); padding: 10px 12px; }
.kv span { font-size: 12px; color: var(--ink-2); }
.kv b { font-size: 18px; }

.empty { color: var(--muted); font-size: 13.5px; margin: 4px 0; }
.empty-card { background: var(--surface); border: 1px dashed var(--axis); border-radius: var(--r); padding: 28px 16px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 12px; color: var(--ink-2); }
.empty-card p { margin: 0; }

/* ------------------------------------------------------------------ points d'attention, charge */

.insights { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.ins > a, .ins > div { display: flex; gap: 10px; align-items: flex-start; padding: 10px; border-radius: 11px; background: var(--surface-2); }
.ins > a:hover { background: var(--surface-3); }
.ins-icon { flex: none; width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; }
.ins-icon .i { width: 17px; height: 17px; }
.ins.danger .ins-icon { background: color-mix(in srgb, var(--critical) 16%, transparent); color: var(--critical); }
.ins.warn .ins-icon { background: color-mix(in srgb, var(--warning) 24%, transparent); color: var(--warning-ink); }
.ins.info .ins-icon { background: var(--surface-3); color: var(--ink-2); }
.ins.good .ins-icon { background: color-mix(in srgb, var(--good) 16%, transparent); color: var(--good-ink); }
.ins-text { display: flex; flex-direction: column; gap: 1px; font-size: 13.5px; min-width: 0; flex: 1; }
.ins-text span { color: var(--ink-2); }
.ins .chev { color: var(--muted); align-self: center; width: 18px; height: 18px; }

.load-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.load-list a { display: block; padding: 12px; border-radius: 11px; background: var(--surface-2); }
.load-list a:hover { background: var(--surface-3); }
.load-top, .load-nums, .load-foot { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; align-items: baseline; }
.load-top { font-size: 13px; }
.sp-name { display: inline-flex; align-items: center; gap: 7px; font-weight: 650; font-size: 15px; }
.load-nums { font-size: 13.5px; margin-top: 4px; }
.load-foot { font-size: 11.5px; color: var(--muted); }

/* ------------------------------------------------------------------ graphiques */

.hbars { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 9px; }
.hb { display: grid; grid-template-columns: minmax(0, 40%) minmax(0, 1fr); gap: 10px; align-items: center; border-radius: 6px; padding: 1px 0; }
.hb-label { display: flex; flex-direction: column; min-width: 0; }
.hb-name { font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hb-sub { font-size: 11.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hb-track { display: flex; align-items: center; gap: 8px; min-width: 0; }
.hb-bar { flex: none; height: 14px; width: calc((100% - 70px) * var(--p)); min-width: 2px; border-radius: 0 4px 4px 0; }
.hb-val { font-size: 12.5px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.hb-bar.parts { display: flex; gap: 2px; background: none; border-radius: 0; }
.hb-bar.parts i { min-width: 2px; }
.hb-bar.parts i:last-child { border-radius: 0 4px 4px 0; }
/* Répartition du temps suivi : barre 100 % dédié · imprévu · perdu, légende chiffrée avec définitions. */
.split-bar { display: flex; gap: 2px; height: 22px; margin: 2px 0 14px; }
.split-bar span { min-width: 3px; }
.split-bar span:first-child { border-radius: 6px 0 0 6px; }
.split-bar span:last-child { border-radius: 0 6px 6px 0; }
.split-bar span:only-child { border-radius: 6px; }
.split-legend { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 10px 22px; }
.split-legend li { display: flex; align-items: flex-start; font-size: 13.5px; }
.split-legend .key { flex: none; margin-top: 3px; }
.split-legend small { display: block; margin-top: 2px; font-size: 12px; color: var(--muted); }
.sub-title { margin: 16px 0 8px; font-size: 13px; font-weight: 620; color: var(--ink-2); }
.set-def { margin: -2px 0 8px; }
a.hb:hover .hb-name { text-decoration: underline; }
@media (max-width: 480px) { .hb { grid-template-columns: minmax(0, 1fr); gap: 3px; } }

.chart { width: 100%; min-height: 250px; }
.timechart { display: block; touch-action: pan-y; }
.timechart .grid { stroke: var(--line); stroke-width: 1; }
.timechart .axis { stroke: var(--axis); stroke-width: 1; }
.timechart .tick { fill: var(--muted); font-size: 10.5px; font-variant-numeric: tabular-nums; }
.timechart .line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.timechart .dot-end { stroke: var(--surface); stroke-width: 2; }
.timechart .xhair { stroke: var(--axis); stroke-width: 1; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--ink-2); margin-top: 6px; }
.key { display: inline-block; width: 11px; height: 11px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.key.line { width: 16px; height: 3px; border-radius: 2px; vertical-align: 3px; }

.heat-wrap { overflow-x: auto; padding-bottom: 2px; }
.heat { display: grid; grid-template-columns: 32px repeat(var(--cols), minmax(13px, 1fr)); gap: 3px; min-width: calc(32px + var(--cols) * 16px); }
.heat-h { font-size: 10px; color: var(--muted); white-space: nowrap; overflow: visible; }
.heat-d { font-size: 11px; color: var(--ink-2); align-self: center; }
.cell { display: block; aspect-ratio: 1; border-radius: 3px; background: var(--surface-2); }
.cell.l1 { background: color-mix(in oklab, var(--loss) 22%, var(--surface)); }
.cell.l2 { background: color-mix(in oklab, var(--loss) 40%, var(--surface)); }
.cell.l3 { background: color-mix(in oklab, var(--loss) 60%, var(--surface)); }
.cell.l4 { background: color-mix(in oklab, var(--loss) 80%, var(--surface)); }
.cell.l5 { background: var(--loss); }
.heat .cell[tabindex]:hover { outline: 2px solid var(--ink); outline-offset: 1px; }
.heat-scale { display: flex; align-items: center; gap: 4px; margin-top: 10px; font-size: 11px; color: var(--muted); }
.heat-scale .cell { width: 13px; height: 13px; }

.gantt { display: flex; flex-direction: column; gap: 1px; font-size: 13px; }
.g-row { display: grid; grid-template-columns: minmax(0, 32%) minmax(0, 1fr); gap: 12px; align-items: center; min-height: 32px; border-radius: 7px; padding: 3px 4px; }
a.g-row:hover { background: var(--surface-2); }
.g-label { display: flex; gap: 8px; align-items: center; min-width: 0; }
.g-prio { flex: none; min-width: 22px; height: 22px; padding: 0 5px; border-radius: 6px; background: var(--surface-2); display: grid; place-items: center; font-size: 11.5px; font-weight: 680; color: var(--ink-2); }
.g-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.g-track { position: relative; height: 22px; }
.g-track::before { content: ""; position: absolute; left: 0; top: -3px; bottom: -3px; width: 1px; background: var(--axis); }
.g-head .g-track { height: 16px; }
.g-head .g-track::before { display: none; }
.g-tick { position: absolute; top: 0; font-size: 10.5px; color: var(--muted); transform: translateX(-50%); white-space: nowrap; }
.g-tick.g-today { transform: none; font-weight: 680; color: var(--ink-2); }
.g-grid { position: absolute; top: -3px; bottom: -3px; width: 1px; background: var(--line); }
.g-bar { position: absolute; top: 6px; height: 10px; border-radius: 4px; min-width: 3px; }
.g-due { position: absolute; top: 5px; width: 12px; height: 12px; margin-left: -6px; transform: rotate(45deg); background: var(--ink); border: 2px solid var(--surface); border-radius: 2px; }
.g-due.late { background: var(--critical); }
.g-late { position: absolute; top: 2px; margin-left: 12px; font-size: 11px; font-weight: 720; color: var(--critical-ink); white-space: nowrap; background: var(--surface); padding: 0 4px; border-radius: 4px; }
.g-none { position: absolute; left: 8px; top: 3px; font-size: 11px; color: var(--muted); }
.g-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 11.5px; color: var(--muted); margin-top: 10px; }
.g-key-bar { display: inline-block; width: 18px; height: 8px; border-radius: 3px; background: var(--ink-2); margin-right: 6px; vertical-align: 0; }
.g-key-due { display: inline-block; width: 9px; height: 9px; transform: rotate(45deg); background: var(--ink); margin: 0 7px 0 2px; }
.g-key-due.late { background: var(--critical); }
@media (max-width: 640px) {
  .g-row { grid-template-columns: minmax(0, 1fr); gap: 4px; padding: 5px 4px; }
  .g-head .g-label { display: none; }
}

.meter { height: 8px; border-radius: 99px; background: color-mix(in oklab, var(--accent) 18%, var(--surface-2)); overflow: hidden; margin: 7px 0 3px; }
.meter span { display: block; height: 100%; border-radius: 99px; background: var(--accent); }
.meter.warning { background: color-mix(in oklab, var(--warning) 24%, var(--surface-2)); }
.meter.warning span { background: var(--warning); }
.meter.critical { background: color-mix(in oklab, var(--critical) 18%, var(--surface-2)); }
.meter.critical span { background: var(--critical); }
.progress { height: 6px; border-radius: 99px; background: var(--surface-3); overflow: hidden; min-width: 40px; }
.progress span { display: block; height: 100%; background: var(--work); border-radius: 99px; }
.tile .progress { margin: 6px 0 2px; }

.tip {
  position: fixed; left: 0; top: 0; z-index: 200; pointer-events: none; max-width: 290px;
  background: var(--ink); color: var(--surface); padding: 8px 11px; border-radius: 10px; font-size: 12.5px; line-height: 1.4;
  box-shadow: var(--shadow-lg);
}
.tip-title { font-weight: 650; margin-bottom: 2px; }
.tip-row { display: flex; align-items: center; gap: 7px; }
.tip-key { width: 12px; height: 3px; border-radius: 2px; display: inline-block; flex: none; }
.tip-row b { font-variant-numeric: tabular-nums; }
.tip-row span { opacity: .75; }

details.data { margin-top: 12px; font-size: 12.5px; }
details.data summary { cursor: pointer; color: var(--muted); font-size: 12px; }
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 13px; }
th, td { padding: 7px 8px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { font-weight: 620; color: var(--ink-2); font-size: 12px; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl a:hover { text-decoration: underline; }

.kw-cloud { display: flex; flex-wrap: wrap; gap: 6px; }
.kw { display: inline-flex; gap: 4px; align-items: center; padding: 2px 8px; border-radius: 6px; font-size: 12px; background: var(--surface-2); color: var(--ink-2); }
.kw b { font-weight: 650; color: var(--muted); font-size: 11px; }
.kw-cloud .kw { font-size: 13px; padding: 4px 10px; }

.activity { list-style: none; margin: 0; padding: 0; font-size: 13.5px; }
.activity li { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--line); }
.activity li:last-child { border-bottom: 0; }
.activity small { color: var(--muted); white-space: nowrap; }
.activity a:hover { text-decoration: underline; }

.method { margin: 0; padding-left: 18px; color: var(--ink-2); font-size: 13.5px; display: flex; flex-direction: column; gap: 6px; }
.method b { color: var(--ink); }

/* ------------------------------------------------------------------ personnes */

.people { margin: 4px 0 18px; }
/* Grand bouton des personnes (accordéon) : nombre, voyant si un chrono tourne avec l'une d'elles, chevron. */
.people-toggle {
  display: flex; align-items: center; gap: 10px; min-height: 58px; padding: 0 16px; list-style: none; cursor: pointer;
  background: var(--surface); border: 1px solid var(--ring); border-radius: var(--r); box-shadow: var(--shadow);
  font-size: 16.5px; font-weight: 660; user-select: none; -webkit-user-select: none;
}
.people-toggle::-webkit-details-marker { display: none; }
.people-toggle:hover { background: var(--surface-2); }
.people-toggle > .i:first-child { width: 23px; height: 23px; color: var(--accent); }
.pt-count { display: grid; place-items: center; min-width: 26px; height: 24px; padding: 0 8px; border-radius: 99px; background: var(--surface-2); color: var(--ink-2); font-size: 13px; font-variant-numeric: tabular-nums; }
.pt-live { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.pt-live .pulse { width: 8px; height: 8px; }
.pt-chev { margin-left: auto; width: 20px; height: 20px; color: var(--muted); transition: transform .2s; }
.people[open] .pt-chev { transform: rotate(180deg); }
.people[open] .people-toggle { margin-bottom: 10px; }
.people-body > .btn { margin-top: 10px; }
.section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.section-head h2 { font-size: 15.5px; margin: 0; }
.people-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
@media (min-width: 640px) { .people-grid { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); } }
.person { display: flex; align-items: center; background: var(--surface); border: 1px solid var(--ring); border-radius: var(--r); box-shadow: var(--shadow); min-width: 0; transition: border-color .2s, box-shadow .2s; }
.person-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; padding: 10px; border: 0; background: transparent; text-align: left; cursor: pointer; border-radius: var(--r); }
.person-main:hover { background: var(--surface-2); }
.avatar { flex: none; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; font-weight: 680; font-size: 13.5px; background: var(--surface-3); color: var(--ink); }
.avatar.lg { width: 56px; height: 56px; font-size: 19px; }
.person-text { display: flex; flex-direction: column; min-width: 0; }
.person-text b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 14.5px; font-weight: 620; }
.person-text small { color: var(--muted); font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chip-clock { margin-left: auto; font-variant-numeric: tabular-nums; font-size: 13px; font-weight: 680; }
.person.is-running { border-color: var(--loss); box-shadow: 0 0 0 2px color-mix(in srgb, var(--loss) 30%, transparent); }
.person.is-running .avatar { background: var(--loss); color: #fff; animation: breathe 1.8s ease-in-out infinite; }
.person.is-paused { border-color: var(--loss); border-style: dashed; }
.person-quick { gap: 2px; padding-right: 6px; }
@media (min-width: 900px) { .person-quick.desktop-only { display: flex !important; } }
.person-head { align-items: center; flex-wrap: nowrap; }
.person-head .chip-clock { font-size: 20px; margin: 0 8px; }
@keyframes breathe { 50% { transform: scale(.92); } }

/* ------------------------------------------------------------------ onglets, projets */

.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin: 6px 0 14px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { padding: 10px 12px; font-weight: 620; font-size: 14.5px; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a.on { color: var(--ink); border-bottom-color: var(--ink); }

.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 10px; }
.search { display: flex; align-items: center; gap: 6px; flex: 1 1 200px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 0 10px; color: var(--muted); }
.search input { border: 0 !important; box-shadow: none !important; background: transparent; outline: 0; min-height: 40px; padding: 0; width: 100%; font-size: 16px; color: var(--ink); }

.plist { display: flex; flex-direction: column; gap: 8px; }
.prow {
  display: grid; grid-template-columns: 42px repeat(3, minmax(0, 1fr));
  grid-template-areas: "prio main main main" "prio req req req" "prio prog prog prog" "prio time due end";
  column-gap: 10px; row-gap: 6px; background: var(--surface); border: 1px solid var(--ring); border-radius: var(--r); padding: 12px; box-shadow: var(--shadow);
}
.prow-prio { grid-area: prio; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.prio-num { min-width: 30px; height: 30px; padding: 0 6px; border-radius: 9px; background: var(--ink); color: var(--surface); display: grid; place-items: center; font-weight: 720; font-size: 14px; font-variant-numeric: tabular-nums; }
.prio-num.muted { background: var(--surface-2); color: var(--muted); }
.prio-btns { display: flex; flex-direction: column; }
.prow-main { grid-area: main; display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.prow-title { font-weight: 650; font-size: 15px; line-height: 1.3; overflow-wrap: anywhere; }
.prow-main:hover .prow-title { text-decoration: underline; }
.prow-meta { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.prow-req { grid-area: req; font-size: 13px; color: var(--ink-2); min-width: 0; }
.prow-progress { grid-area: prog; display: flex; align-items: center; gap: 8px; font-size: 12.5px; white-space: nowrap; }
.prow-progress .progress { flex: 1; }
.prow-time { grid-area: time; font-size: 12.5px; }
.prow-due { grid-area: due; font-size: 12.5px; }
.prow-end { grid-area: end; font-size: 12.5px; }
.prow-end .i { width: 14px; height: 14px; vertical-align: -2px; }
.prow small.mobile-only { display: block; font-size: 10.5px; }
.prow-req small.mobile-only { display: inline; font-size: 12px; }
.prow.st-done, .prow.st-dropped { opacity: .75; }
.prow.dragging { opacity: .45; }
.drag { color: var(--muted); cursor: grab; display: inline-grid; place-items: center; }
.plist-head { display: none; }
@media (min-width: 900px) {
  .plist { gap: 0; background: var(--surface); border: 1px solid var(--ring); border-radius: var(--r); box-shadow: var(--shadow); overflow: hidden; }
  .plist-head, .prow {
    display: grid; grid-template-areas: none; align-items: center; column-gap: 16px;
    grid-template-columns: 112px minmax(0, 2.5fr) minmax(0, 1.1fr) minmax(0, 1.1fr) minmax(0, 1fr) minmax(0, .8fr) minmax(0, 1fr);
  }
  .plist-head { padding: 10px 14px; font-size: 12px; color: var(--muted); font-weight: 620; border-bottom: 1px solid var(--line); }
  .prow { border: 0; border-radius: 0; box-shadow: none; border-bottom: 1px solid var(--line); padding: 9px 14px; }
  .prow:last-child { border-bottom: 0; }
  .prow > * { grid-area: auto; }
  .prow:hover { background: var(--surface-2); }
  .prow-prio, .prio-btns { flex-direction: row; }
  .prow-prio { justify-content: flex-start; gap: 4px; }
  .plist[data-sortable="1"] .prow { cursor: grab; }
}

.pill { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 99px; font-size: 11.5px; font-weight: 620; background: var(--surface-2); color: var(--ink-2); border: 1px solid transparent; white-space: nowrap; }
.pill.sm { font-size: 10.5px; padding: 1px 7px; }
.pill.st-todo { border-color: var(--line); background: transparent; }
.pill.st-doing { background: color-mix(in srgb, var(--work) 15%, transparent); color: var(--ink); }
.pill.st-waiting { background: color-mix(in srgb, var(--warning) 26%, transparent); color: var(--ink); }
.pill.st-done { background: color-mix(in srgb, var(--good) 15%, transparent); color: var(--ink); }
.pill.st-dropped { color: var(--muted); text-decoration: line-through; }
.pill.st-idea { border: 1px dashed var(--axis); background: transparent; }
.pill.as-btn { cursor: pointer; font-size: 13px; padding: 5px 10px 5px 12px; }
.pill .i { width: 14px; height: 14px; }

/* ------------------------------------------------------------------ fiche projet */

.ph-tags { display: flex; gap: 8px; align-items: center; margin-top: 10px; flex-wrap: wrap; }
.prio-ctl { display: inline-flex; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); }
.pj-actions { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 14px; }
@media (max-width: 600px) {
  .pj-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pj-actions .btn.primary { grid-column: span 2; }
}
.pj-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-bottom: 14px; }
.stat { background: var(--surface); border: 1px solid var(--ring); border-radius: var(--r); padding: 10px 12px; display: flex; flex-direction: column; gap: 3px; min-width: 0; box-shadow: var(--shadow); }
.stat-label { font-size: 12px; color: var(--ink-2); font-weight: 550; }
.stat-value { font-size: 18px; font-weight: 680; }
.stat small { font-size: 11.5px; color: var(--muted); }
.stat.big { grid-column: span 2; }
.stat.big .stat-value { font-size: 30px; }
.stat.is-crit .stat-value, .stat.is-crit small { color: var(--critical-ink); }
.stat.is-warn small { color: var(--warning-ink); font-weight: 600; }
@media (min-width: 900px) {
  .pj-stats { grid-template-columns: minmax(0, 1.5fr) repeat(4, minmax(0, 1fr)); gap: 12px; }
  .stat.big { grid-column: auto; grid-row: span 2; justify-content: center; }
}
.pj-grid { display: grid; gap: 12px; }
@media (min-width: 1100px) { .pj-grid { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 16px; align-items: start; } }
.pj-col { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
@media (min-width: 1100px) { .pj-col { gap: 16px; } }

.tasks { list-style: none; margin: 0 0 10px; padding: 0; }
.task { display: flex; align-items: center; gap: 8px; padding: 5px 0; border-bottom: 1px solid var(--line); }
.task-check { position: relative; flex: none; width: 30px; height: 30px; cursor: pointer; display: grid; place-items: center; }
.task-check input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.task-check .box { display: grid; place-items: center; width: 26px; height: 26px; border: 2px solid var(--axis); border-radius: 8px; color: transparent; transition: background .15s, border-color .15s; }
.task-check .box .i { width: 17px; height: 17px; stroke-width: 2.6; }
.task-check input:checked + .box { background: var(--good); border-color: var(--good); color: #fff; }
.task-check input:focus-visible + .box { outline: 2px solid var(--focus); outline-offset: 2px; }
.task-title { flex: 1; min-width: 0; text-align: left; border: 0; background: transparent; padding: 5px 0; cursor: pointer; display: flex; flex-wrap: wrap; gap: 2px 8px; align-items: baseline; font-size: 14.5px; }
.task-title small { flex-basis: 100%; color: var(--muted); font-size: 11.5px; }
.task.done .task-title span:first-child { text-decoration: line-through; color: var(--muted); }
.task-ops { display: flex; }
.inline-add { display: flex; gap: 6px; margin-top: 6px; }
.inline-add input { flex: 1; }

.links { list-style: none; margin: 0 0 12px; padding: 0; }
.links li { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.link-kind { font-size: 11.5px; font-weight: 650; color: var(--ink-2); background: var(--surface-2); border-radius: 6px; padding: 2px 7px; }
.links a { flex: 1; min-width: 120px; font-weight: 580; }
.links a:hover { text-decoration: underline; }
.link-add { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr) auto; gap: 6px; }
@media (max-width: 480px) { .link-add { grid-template-columns: 1fr; } }
.similar { margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--line); }
.similar ul { list-style: none; margin: 4px 0 0; padding: 0; }
.similar li { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding: 3px 0; font-size: 13.5px; }
.similar li .btn { margin-left: auto; }
.chip-link { display: inline-flex; gap: 6px; align-items: center; padding: 6px 12px; border-radius: 99px; background: var(--surface-2); font-size: 14px; font-weight: 550; }
.chip-link .i { width: 16px; height: 16px; }
.chips.static { display: flex; flex-wrap: wrap; gap: 6px; }
.mini-projects { list-style: none; margin: 0; padding: 0; }
.mini-projects a { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.mini-projects li:last-child a { border-bottom: 0; }
.mini-projects .grow { display: flex; flex-direction: column; min-width: 0; }
.mini-projects small { font-size: 12px; }
.mini-progress { width: 80px; flex: none; }

/* ------------------------------------------------------------------ journal */

.day { margin-bottom: 16px; }
.day-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap; margin: 0 2px 6px; }
.day-head h3 { margin: 0; font-size: 14px; }
.day-tot { display: flex; gap: 12px; font-size: 12px; color: var(--ink-2); flex-wrap: wrap; }
.items { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--ring); border-radius: var(--r); overflow: hidden; box-shadow: var(--shadow); }
.card .items { border: 0; box-shadow: none; background: transparent; border-radius: 0; }
.item { display: flex; align-items: center; gap: 11px; width: 100%; padding: 10px 12px; border: 0; border-bottom: 1px solid var(--line); background: transparent; text-align: left; cursor: pointer; }
.card .item { padding-left: 0; padding-right: 0; }
.items li:last-child .item { border-bottom: 0; }
.item:hover { background: var(--surface-2); }
.item-icon { flex: none; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-2); }
.item-icon .i { width: 18px; height: 18px; }
.item.loss .item-icon { background: color-mix(in srgb, var(--loss) 16%, transparent); color: var(--loss); }
.item.work .item-icon { background: color-mix(in srgb, var(--work) 15%, transparent); color: var(--work); }
.item.diverted .item-icon { background: color-mix(in srgb, var(--diverted) 16%, transparent); color: var(--diverted); }
.item.gain .item-icon, .item-icon.gain { background: color-mix(in srgb, var(--gain) 17%, transparent); color: var(--gain); }
.item-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.item-main b { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item-main small { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item-val { font-variant-numeric: tabular-nums; font-weight: 680; font-size: 14px; white-space: nowrap; display: flex; flex-direction: column; align-items: flex-end; }
.item-val small { font-weight: 450; color: var(--muted); font-size: 11px; }
.gain-list { list-style: none; margin: 0; padding: 0; }
.gain-list li { display: flex; align-items: center; gap: 11px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.gain-list li:last-child { border-bottom: 0; }

/* ------------------------------------------------------------------ formulaires */

input[type=text], input[type=search], input[type=password], input[type=number], input[type=date],
input[type=datetime-local], input[type=email], input:not([type]), select, textarea {
  width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-sm);
  background: var(--surface); color: var(--ink); font-size: 16px; outline: 0; -webkit-appearance: none; appearance: none;
}
input[type=date], input[type=datetime-local] { display: block; }
textarea { resize: vertical; line-height: 1.45; min-height: 70px; }
select {
  padding-right: 34px; background-repeat: no-repeat; background-position: right 11px center; background-size: 14px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23898781' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='m6 9.5 6 6 6-6'/%3E%3C/svg%3E");
}
input:focus, select:focus, textarea:focus { border-color: var(--focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 22%, transparent); }
input[type=color] { width: 56px; height: 44px; padding: 3px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); }
input[type=checkbox] { accent-color: var(--ink); }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 15px; min-width: 0; }
.field-label { font-size: 13px; font-weight: 620; color: var(--ink-2); }
.hint { font-size: 12px; color: var(--muted); margin: 0; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.grid3 { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 12px; }
@media (min-width: 700px) { .grid3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 380px) { .grid2 { grid-template-columns: minmax(0, 1fr); } }

.dur { display: flex; gap: 8px; flex-wrap: wrap; }
.dur-part { display: flex; align-items: center; gap: 5px; }
.dur-part input { width: 62px; text-align: right; padding-left: 8px; padding-right: 8px; }
.dur-part em { font-style: normal; color: var(--ink-2); font-size: 14px; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { position: relative; cursor: pointer; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip span { display: inline-flex; align-items: center; gap: 6px; min-height: 38px; padding: 6px 13px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface); font-size: 14px; font-weight: 540; user-select: none; -webkit-user-select: none; }
.chip:hover span { background: var(--surface-2); }
.chip input:checked + span { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.chip input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 2px; }
.chips.seg { display: inline-flex; flex-wrap: nowrap; padding: 3px; gap: 2px; background: var(--surface-2); border-radius: 12px; }
.chips.seg .chip span { border: 0; background: transparent; min-height: 36px; border-radius: 9px; }
.chips.seg .chip input:checked + span { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, .15); }
.chips.days .chip span { min-width: 40px; justify-content: center; padding: 6px 0; }
.chip-btn { display: inline-flex; align-items: center; gap: 5px; min-height: 36px; padding: 6px 13px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface); font-size: 14px; cursor: pointer; }
.chip-btn:hover { background: var(--surface-2); }
.chip-btn.archived { color: var(--muted); border-style: dashed; }
.chip-btn.add { color: var(--ink-2); border-style: dashed; }
.chip-btn .i { width: 16px; height: 16px; }
.cat-chip { gap: 0; padding: 0 4px 0 0; cursor: default; }
.cat-chip > button { border: 0; background: none; font: inherit; color: inherit; cursor: pointer; }
.cat-chip > button:first-child { align-self: stretch; padding: 0 5px 0 13px; border-radius: 99px 0 0 99px; }
.cat-chip .chip-x { display: grid; place-items: center; width: 26px; height: 26px; padding: 0; border-radius: 99px; color: var(--muted); }
.cat-chip .chip-x:hover { background: var(--critical); color: #fff; }
.cat-chip .chip-x .i { width: 14px; height: 14px; }
.switch { display: flex; align-items: flex-start; gap: 10px; margin: 6px 0 16px; cursor: pointer; font-size: 14px; }
.switch input { width: 22px; height: 22px; flex: none; margin: 0; }
.switch span { display: flex; flex-direction: column; gap: 2px; }
details.more-people { margin-top: 8px; }
details.more-people summary { cursor: pointer; color: var(--ink-2); font-size: 13px; margin-bottom: 8px; }
.kw-live { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; margin: -6px 0 10px; min-height: 22px; }
.kw-label { font-size: 12px; font-weight: 620; color: var(--ink-2); margin-right: 2px; }
.similar-live .hint { margin: -4px 0 12px; }
.similar-live a { text-decoration: underline; }
form.is-work .only-loss { display: none; }
form:not(.is-recurring) .only-recurring { visibility: hidden; }
form:not(.is-waiting) .only-waiting { display: none; }
.gain-preview { margin: -8px 0 12px; min-height: 16px; color: var(--ink-2); }

/* Recherche avec suggestions (combobox) : la liste s'insère sous le champ, sans recouvrir la feuille. */
.combo-box { display: flex; align-items: center; gap: 4px; min-height: 44px; padding: 0 3px 0 11px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); color: var(--muted); }
.combo-box:focus-within { border-color: var(--focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 22%, transparent); }
.combo-box > .i { width: 18px; height: 18px; flex: none; transition: opacity .15s; }
.combo.loading .combo-box > .i { opacity: .35; }
.combo-box input { flex: 1; min-width: 0; min-height: 42px; padding: 0 2px; border: 0 !important; box-shadow: none !important; background: transparent; }
.combo-box input::-webkit-search-cancel-button { display: none; }
.combo.has-value .combo-box input { font-weight: 600; }
.combo-box button { display: grid; place-items: center; width: 36px; height: 36px; flex: none; border: 0; border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer; }
.combo-box button:hover { background: var(--surface-2); color: var(--ink); }
.combo-box button .i { width: 18px; height: 18px; transition: transform .15s; }
.combo:not(.has-value) .combo-clear { display: none; }
.combo.open .combo-toggle .i { transform: rotate(180deg); }
.combo-list { list-style: none; margin: 6px 0 0; padding: 4px; max-height: 264px; overflow-y: auto; overscroll-behavior: contain; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); }
.combo-list li { display: flex; flex-direction: column; gap: 1px; padding: 8px 10px; border-radius: 8px; cursor: pointer; }
.combo-list li b { font-weight: 560; }
.combo-list li small { font-size: 12px; color: var(--muted); }
.combo-list li:hover, .combo-list li[aria-selected=true] { background: var(--surface-2); }
.combo-list li.is-current b::after { content: " ✓"; color: var(--focus); }
.combo-list li.combo-empty { color: var(--muted); cursor: default; background: none; }

.settings .set-group { margin-bottom: 14px; }
.settings h3 { font-size: 13px; color: var(--ink-2); margin: 0 0 8px; font-weight: 620; }
.space-forms { display: flex; flex-direction: column; gap: 14px; }
.space-form { padding: 14px; border: 1px solid var(--line); border-radius: var(--r); }
.space-form-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; font-size: 15px; }

/* ------------------------------------------------------------------ feuilles, toasts, dock */

html.sheet-open, html.sheet-open body { overflow: hidden; }
.sheet-root { position: fixed; inset: 0; z-index: 80; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, .4); opacity: 0; transition: opacity .2s; }
.sheet {
  position: absolute; left: 0; right: 0; bottom: 0; display: flex; flex-direction: column;
  max-height: calc(100dvh - env(safe-area-inset-top) - 18px); margin: 0;
  background: var(--surface); border-radius: 20px 20px 0 0; box-shadow: var(--shadow-lg);
  transform: translateY(100%); transition: transform .24s cubic-bezier(.2, .8, .2, 1);
  padding-bottom: env(safe-area-inset-bottom);
}
.sheet::before { content: ""; display: block; width: 38px; height: 5px; border-radius: 3px; background: var(--axis); margin: 7px auto 0; flex: none; }
.sheet-root.open .sheet-backdrop { opacity: 1; }
.sheet-root.open .sheet { transform: none; }
.sheet-head { display: grid; grid-template-columns: minmax(84px, auto) minmax(0, 1fr) minmax(84px, auto); align-items: center; gap: 6px; padding: 4px 8px 8px; border-bottom: 1px solid var(--line); flex: none; }
.sheet-head > :last-child { justify-self: end; }
.sheet-head > :first-child { justify-self: start; }
.sheet-head h2 { margin: 0; text-align: center; font-size: 16px; font-weight: 660; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sheet-body { overflow-y: auto; padding: 16px max(16px, env(safe-area-inset-right)) 20px max(16px, env(safe-area-inset-left)); overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.sheet-foot { flex: none; padding: 10px 16px; border-top: 1px solid var(--line); }
.sheet-foot > .btn.lg[type=submit] { min-height: 56px; font-size: 17px; font-weight: 650; border-radius: 14px; }
@media (min-width: 900px) {
  .sheet {
    left: 50%; top: 50%; right: auto; bottom: auto; width: min(580px, calc(100vw - 48px)); max-height: min(88vh, 940px);
    border-radius: 18px; opacity: 0; transform: translate(-50%, -47%) scale(.98); transition: transform .18s, opacity .18s; padding-bottom: 0;
  }
  .sheet.wide { width: min(780px, calc(100vw - 48px)); }
  .sheet::before { display: none; }
  .sheet-head { padding-top: 10px; }
  .sheet-root.open .sheet { opacity: 1; transform: translate(-50%, -50%); }
}
.sheet-sub { margin: -4px 0 12px; color: var(--muted); font-size: 13px; }
.sheet-text { margin: 0 0 18px; color: var(--ink-2); }
.actions-list { display: flex; flex-direction: column; gap: 7px; }
/* Recherche de projets (depuis le nuage de mots clés) : grand champ, mots clés sous chaque projet. */
a.kw { cursor: pointer; }
a.kw:hover, .kw[data-act]:hover { text-decoration: underline; }
.kw[data-act] { cursor: pointer; }
.search.big { margin: 0 0 14px; }
.search.big input { min-height: 46px; }
.kw-row { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 5px; }
.kw-row .kw { font-size: 11.5px; padding: 1px 7px; }
/* Popup « Ajouter » : recherche d'un projet existant, sous les actions. */
.sheet-search { margin: 16px 0 0; padding-top: 14px; border-top: 1px solid var(--line); }
.action-item { display: flex; align-items: center; gap: 13px; width: 100%; padding: 12px; border-radius: 13px; border: 1px solid var(--line); background: var(--surface); text-align: left; cursor: pointer; }
.action-item:hover { background: var(--surface-2); }
.action-icon { flex: none; width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--surface-2); }
.action-item.primary { border-color: var(--ink); }
.action-item.primary .action-icon { background: var(--ink); color: var(--surface); }
.action-item.danger { color: var(--critical-ink); }
.action-text { display: flex; flex-direction: column; min-width: 0; }
.action-text b { font-size: 15.5px; font-weight: 620; }
.action-text small { color: var(--muted); font-size: 12.5px; }
.big-duration { font-size: 42px; font-weight: 720; letter-spacing: -.02em; text-align: center; margin: 2px 0 8px; line-height: 1.1; }
.big-duration small { display: block; font-size: 13px; font-weight: 500; color: var(--muted); font-variant-numeric: tabular-nums; margin-top: 2px; }
.stamps { list-style: none; padding: 10px 12px; margin: 0 0 16px; background: var(--surface-2); border-radius: 11px; font-size: 13px; display: flex; flex-direction: column; gap: 4px; }
.stamps li { display: grid; grid-template-columns: auto auto 1fr auto; gap: 8px; align-items: baseline; }
.stamps b { font-variant-numeric: tabular-nums; }

.toasts { position: fixed; left: 50%; top: calc(env(safe-area-inset-top) + 62px); transform: translateX(-50%); z-index: 150; display: flex; flex-direction: column; gap: 6px; align-items: center; pointer-events: none; width: max-content; max-width: calc(100vw - 32px); }
.toast { background: var(--ink); color: var(--surface); padding: 10px 15px; border-radius: 12px; font-size: 14px; font-weight: 580; box-shadow: var(--shadow-lg); opacity: 0; transform: translateY(-8px); transition: opacity .2s, transform .2s; text-align: center; }
.toast.show { opacity: 1; transform: none; }
.toast.error { background: var(--critical); color: #fff; }
@media (min-width: 900px) { .toasts { top: auto; bottom: 28px; left: calc(50% + 125px); } }

.dock-item { display: flex; align-items: center; gap: 5px; background: var(--bar); color: var(--bar-ink); border-radius: 17px; padding: 6px; box-shadow: var(--shadow-lg); border: 1px solid rgba(255, 255, 255, .08); }
.dock-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; border: 0; background: transparent; color: inherit; text-align: left; padding: 4px 6px; cursor: pointer; border-radius: 12px; }
.pulse { flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--loss); animation: ring 1.6s infinite; }
.dock-item.work .pulse { background: var(--work); }
.dock-item.diverted .pulse { background: var(--diverted); }
.dock-item.paused .pulse { animation: none; background: #8a8a92; }
.dock-label { display: flex; flex-direction: column; min-width: 0; }
.dock-label b { font-size: 14px; font-weight: 620; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dock-label small { font-size: 11.5px; opacity: .7; white-space: nowrap; }
.dock-time { margin-left: auto; font-variant-numeric: tabular-nums; font-size: 21px; font-weight: 680; letter-spacing: -.01em; }
.dock-item.paused .dock-time { opacity: .6; }
.dock-btn { flex: none; width: 46px; height: 46px; border-radius: 13px; border: 0; background: rgba(255, 255, 255, .12); color: #fff; display: grid; place-items: center; cursor: pointer; }
.dock-btn:hover { background: rgba(255, 255, 255, .2); }
.dock-btn.stop { background: #fff; color: #111; }
@keyframes ring { 0% { box-shadow: 0 0 0 0 rgba(235, 104, 52, .6); } 70% { box-shadow: 0 0 0 9px rgba(235, 104, 52, 0); } 100% { box-shadow: 0 0 0 0 rgba(235, 104, 52, 0); } }

/* ------------------------------------------------------------------ bilans, menu, connexion */

.out-panel { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 12px; background: var(--surface-2); border-radius: var(--r-sm); margin-top: 14px; }
.out-name { display: flex; align-items: center; gap: 8px; min-width: 0; }
.out-name b { font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pdf-preview { width: 100%; height: 78vh; border: 1px solid var(--line); border-radius: var(--r); margin-top: 12px; background: #fff; }

.menu-list { display: flex; flex-direction: column; gap: 8px; }
.menu-list a, .menu-list button { display: flex; align-items: center; gap: 13px; width: 100%; padding: 14px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--ring); text-align: left; cursor: pointer; box-shadow: var(--shadow); }
.menu-list span { flex: 1; display: flex; flex-direction: column; }
.menu-list small { color: var(--muted); font-size: 12.5px; }
.menu-list .chev { color: var(--muted); }

.login { min-height: 100dvh; display: grid; place-items: center; padding: calc(env(safe-area-inset-top) + 24px) 20px calc(env(safe-area-inset-bottom) + 24px); background: var(--bar); }
.login-card { width: min(390px, 100%); background: var(--surface); border-radius: 22px; padding: 30px 22px 24px; box-shadow: var(--shadow-lg); text-align: center; }
.login-card .field { text-align: left; }
.login-logo { border-radius: 18px; margin-bottom: 6px; }
.login-card h1 { margin: 4px 0 2px; font-size: 26px; }
.login-card > .muted { margin: 0 0 22px; }
.login-error { color: var(--critical-ink); font-size: 14px; margin: -4px 0 12px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
@media print {
  .sidebar, .topbar, .tabbar, .dock, .head-actions, .quick, .filters { display: none !important; }
  .app { display: block; }
  .card, .tile { box-shadow: none; break-inside: avoid; }
}

/* ------------------------------------------------------------------ teinte des pages d'espace */
/* Onglet d'un espace, fiches projet et personne : fond en dégradé radial propre à l'espace, lumineux en haut à droite
   (--grad-a, --grad-b) et qui descend vers un ton profond de l'espace (--grad-c, --grad-d, sombre sans aller au noir) ;
   blocs clairs légèrement teintés posés dessus,
   barres vives et soutenues (blanc lisible à 8,8 au moins), éléments pleins dans la couleur de l'espace. Les textes
   posés directement sur le fond sont en blanc (--on-grad) : ils tombent hors du halo, dans la partie sombre. L'accueil et
   les pages générales restent neutres ; les couleurs des graphiques (dédié, imprévu, perdu, gagné) et des statuts
   ne changent pas. Valeurs de base en dur : une variable ne peut pas se redéfinir à partir d'elle-même.
   --tint-strong porte du texte blanc (contraste AA) ; --tint-surface (plus saturée) teinte les blocs en mode sombre. */
:root[data-tint="somoba"] {
  --tint: #2f6bff; --tint-strong: #1a4fe0; --tint-bar: #0d2466; --tint-deep: #152e79; --tint-surface: #0a4fe0; --tint-fab: #081a4d;
  --grad-a: #1f5bff; --grad-b: #1845d0; --grad-c: #0b1f5c; --grad-d: #0f1a38; /* bleu électrique, bleu marine, marine profond */
}
:root[data-tint="pro"] {
  --tint: #20b584; --tint-strong: #0b6f51; --tint-bar: #094f3c; --tint-deep: #15795b; --tint-surface: #00a870; --tint-fab: #073f32;
  --grad-a: #dcf542; --grad-b: #20b584; --grad-c: #0d6d5a; --grad-d: #0c2d26; /* jaune balle de tennis, vert tirant sur le cyan, sarcelle profond */
}
:root[data-tint="perso"] {
  --tint: #e0168a; --tint-strong: #b8123a; --tint-bar: #850b29; --tint-deep: #7e102c; --tint-surface: #d50045; --tint-fab: #6a0820;
  --grad-a: #e0168a; --grad-b: #d0145c; --grad-c: #a80f2b; --grad-d: #390d15; /* rose fuchsia, rouge cerise, bordeaux profond */
}
:root[data-tint] {
  --bg: color-mix(in srgb, var(--tint) 20%, #f4f4f1);
  --surface: color-mix(in srgb, var(--tint) 6%, #fcfcfb);
  --surface-2: color-mix(in srgb, var(--tint) 14%, #f0efec);
  --surface-3: color-mix(in srgb, var(--tint) 22%, #e6e5df);
  --ink: color-mix(in srgb, var(--tint-strong) 40%, #0b0b0b);
  --ink-2: color-mix(in srgb, var(--tint-strong) 45%, #52514e);
  --muted: color-mix(in srgb, var(--tint-strong) 40%, #6b6964);
  --line: color-mix(in srgb, var(--tint) 30%, #e1e0d9);
  --axis: color-mix(in srgb, var(--tint) 40%, #c3c2b7);
  --ring: color-mix(in srgb, var(--tint) 30%, transparent);
  --bar: var(--tint-bar);
  --accent: var(--tint-strong); --focus: var(--tint-strong); --tint-text: var(--tint-strong);
}
@media (prefers-color-scheme: dark) {
  :root[data-tint]:not([data-theme="light"]) {
    --bg: color-mix(in srgb, var(--tint-deep) 16%, #0d0d0d);
    --surface: color-mix(in srgb, var(--tint-surface) 12%, #1a1a19);
    --surface-2: color-mix(in srgb, var(--tint) 16%, #242422);
    --surface-3: color-mix(in srgb, var(--tint) 20%, #2f2f2c);
    --ink: color-mix(in srgb, var(--tint) 10%, #ffffff);
    --ink-2: color-mix(in srgb, var(--tint) 35%, #c3c2b7);
    --muted: color-mix(in srgb, var(--tint) 30%, #a09e97);
    --line: color-mix(in srgb, var(--tint) 28%, #2c2c2a);
    --axis: color-mix(in srgb, var(--tint) 30%, #45453f);
    --ring: color-mix(in srgb, var(--tint) 32%, transparent);
    --accent: var(--tint); --focus: var(--tint); --tint-text: color-mix(in srgb, var(--tint) 80%, #ffffff);
  }
}
:root[data-tint][data-theme="dark"] {
  --bg: color-mix(in srgb, var(--tint-deep) 16%, #0d0d0d);
  --surface: color-mix(in srgb, var(--tint-surface) 12%, #1a1a19);
  --surface-2: color-mix(in srgb, var(--tint) 16%, #242422);
  --surface-3: color-mix(in srgb, var(--tint) 20%, #2f2f2c);
  --ink: color-mix(in srgb, var(--tint) 10%, #ffffff);
  --ink-2: color-mix(in srgb, var(--tint) 35%, #c3c2b7);
  --muted: color-mix(in srgb, var(--tint) 30%, #a09e97);
  --line: color-mix(in srgb, var(--tint) 28%, #2c2c2a);
  --axis: color-mix(in srgb, var(--tint) 30%, #45453f);
  --ring: color-mix(in srgb, var(--tint) 32%, transparent);
  --accent: var(--tint); --focus: var(--tint); --tint-text: color-mix(in srgb, var(--tint) 80%, #ffffff);
}
/* Côté vif : éléments pleins, titre de page, liseré des blocs, entrée active du menu. */
:root[data-tint] .btn.primary, :root[data-tint] .quick-btn:first-child, :root[data-tint] .prio-num,
:root[data-tint] .chips:not(.seg) .chip input:checked + span, :root[data-tint] .action-item.primary .action-icon {
  background: var(--tint-strong); border-color: var(--tint-strong); color: #fff;
}
/* Barres vives : textes en blanc voilé sur la barre (AA), entrée active en voile clair avec un trait blanc. */
:root[data-tint] .nav a { color: color-mix(in srgb, #ffffff 80%, var(--tint-bar)); }
:root[data-tint] .nav a:hover, :root[data-tint] .nav a.on { color: #fff; }
:root[data-tint] .nav a.on { background: color-mix(in srgb, #ffffff 20%, var(--tint-bar)); box-shadow: inset 3px 0 0 #fff; }
:root[data-tint] .nav-label { color: color-mix(in srgb, #ffffff 68%, var(--tint-bar)); }
:root[data-tint] .side-foot { color: color-mix(in srgb, #ffffff 70%, var(--tint-bar)); }
:root[data-tint] .side-foot .icon-btn { color: color-mix(in srgb, #ffffff 80%, var(--tint-bar)); }
:root[data-tint] .fab { background: var(--tint-fab); }
:root[data-tint] .btn.primary:hover { background: color-mix(in srgb, var(--tint-strong) 85%, #000); }
/* Liseré clair : sur le halo du fond, le bouton plein a la même couleur que le dégradé et s'y fondrait. */
:root[data-tint] .btn.primary { box-shadow: 0 0 0 1px rgba(255, 255, 255, .45), var(--shadow); }
:root[data-tint] .action-item.primary { border-color: var(--tint-strong); }
:root[data-tint] .card, :root[data-tint] .tile { box-shadow: inset 0 3px 0 var(--tint), var(--shadow); }
/* Fond en dégradé radial : calque fixe derrière la page (reste en place au défilement, y compris sur iPhone où
   background-attachment: fixed est ignoré). Halo en haut à droite, repères en vw : les textes posés sur le fond
   (à gauche, au-delà de la moitié de la largeur depuis le coin) tombent dans la partie sombre, sur mobile comme
   sur ordinateur. En mode sombre, voile noir à 35 % pour adoucir le halo. */
:root[data-tint] { --on-grad: #ffffff; --on-grad-2: rgba(255, 255, 255, .85); --grad-veil: rgba(0, 0, 0, 0); }
@media (prefers-color-scheme: dark) {
  :root[data-tint]:not([data-theme="light"]) { --grad-veil: rgba(0, 0, 0, .35); }
}
:root[data-tint][data-theme="dark"] { --grad-veil: rgba(0, 0, 0, .35); }
:root[data-tint] body, :root[data-tint] .app { background: transparent; }
:root[data-tint] body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(var(--grad-veil), var(--grad-veil)),
    radial-gradient(circle at 100% 0, var(--grad-a) 0, var(--grad-b) 20vw, var(--grad-c) 44vw, var(--grad-d) 110vw);
}
/* Textes posés directement sur le dégradé (hors blocs). */
:root[data-tint] .back, :root[data-tint] .page-head h1, :root[data-tint] .person-head .chip-clock,
:root[data-tint] .day-head, :root[data-tint] .people-body > .empty { color: var(--on-grad); }
:root[data-tint] .page-head .kicker, :root[data-tint] .page-head .ph-main > .muted, :root[data-tint] .ph-tags > .muted,
:root[data-tint] .range, :root[data-tint] .day-tot { color: var(--on-grad-2); }
:root[data-tint] .tab-body > .empty { color: var(--on-grad-2); }
/* Pastilles de statut de l'en-tête : fond plein (la teinte transparente ne se lirait pas sur le dégradé). */
:root[data-tint] .page-head .pill { background: var(--surface); color: var(--ink); }
:root[data-tint] .page-head .pill.st-doing { background: color-mix(in srgb, var(--work) 15%, var(--surface)); }
:root[data-tint] .page-head .pill.st-waiting { background: color-mix(in srgb, var(--warning) 26%, var(--surface)); }
:root[data-tint] .page-head .pill.st-done { background: color-mix(in srgb, var(--good) 15%, var(--surface)); }
:root[data-tint] .page-head .pill.st-dropped { color: var(--muted); }
:root[data-tint] .card .day-head { color: var(--ink); }
:root[data-tint] .card .day-tot { color: var(--ink-2); }
:root[data-tint] .people-body > .btn.ghost { color: var(--on-grad); }
:root[data-tint] .people-body > .btn.ghost:hover { background: color-mix(in srgb, var(--on-grad) 14%, transparent); }
:root[data-tint] .tabs { border-bottom-color: color-mix(in srgb, var(--on-grad) 30%, transparent); }
:root[data-tint] .tabs a { color: var(--on-grad-2); }
:root[data-tint] .tabs a.on { color: var(--on-grad); border-bottom-color: var(--on-grad); }
:root[data-tint] .seg button.on,
:root[data-tint] .chips.seg .chip input:checked + span { color: var(--tint-text); }
body, .app, .topbar, .sidebar, .card, .tile, .btn { transition: background-color .25s ease, border-color .25s ease; }
