/* ============================================================================
   Socle A2Z : jetons et primitives d'interface communs aux outils internes.

   Source unique : dashboard-interne/shared/socle/socle.css. Les copies sont listées
   dans shared/copies.txt : ne jamais éditer une copie, modifier ici puis lancer
   shared/sync.sh et shared/test.sh. Mode d'emploi, règles et
   plan de bascule : shared/socle/README.md.

   Structure reprise de Twenty CRM (paquet twenty-ui), finition façon Apple.
   Règles maison : aucun chip, aucune pastille ni badge à fond coloré, aucun bandeau
   pastel, aucune bande colorée sur le côté d'une carte. Un état = un point + un mot.

   Tout est préfixé so- (classes) et --so- (jetons) pour cohabiter avec le CSS d'un
   outil pendant sa bascule. Une primitive ne connaît jamais une couleur, seulement
   un rôle. L'adaptation au téléphone dépend de la largeur de .so-shell (requêtes de
   conteneur), pas de celle de l'écran.
   ============================================================================ */

/* Inter n'est téléchargée que hors appareils Apple (SF Pro passe avant dans --so-font). */
@font-face { font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap; src: url("InterVariable.woff2") format("woff2"); }

/* ---------- Jetons : clair, puis sombre (réglage du système, puis choix explicite) ---------- */
:root, .so-light {
  --so-canvas: #f5f5f7;
  --so-canvas-dot: rgba(0, 0, 0, 0.07);
  --so-surface: #ffffff;
  --so-surface-2: #fbfbfd;
  --so-sunken: #f0f0f3;
  --so-vibrancy: rgba(244, 244, 247, 0.82);
  --so-hover: rgba(0, 0, 0, 0.045);
  --so-press: rgba(0, 0, 0, 0.075);
  --so-line: rgba(0, 0, 0, 0.08);
  --so-line-2: rgba(0, 0, 0, 0.15);
  --so-ink: #1d1d1f;
  --so-ink-2: #6e6e73;
  --so-ink-3: #8e8e93;
  --so-seg-thumb: #ffffff;
  --so-switch-off: #e3e3e8;
  --so-mono-grad: linear-gradient(180deg, #a6a6ab, #85858a);
  --so-tooltip: rgba(29, 29, 31, 0.86);

  --so-a2z: #6d28d9;
  --so-a2z-fill: #6d28d9;
  --so-gmb: #f97316;
  --so-gmb-fill: #f97316;
  --so-accent: var(--so-a2z);
  --so-accent-fill: var(--so-a2z-fill);
  --so-on-accent: #ffffff;
  --so-focus: rgba(109, 40, 217, 0.32);

  --so-ok: #1e7b34;
  --so-ok-dot: #34c759;
  --so-warn: #a54b00;
  --so-warn-dot: #ff9f0a;
  --so-bad: #c9001a;
  --so-bad-dot: #ff3b30;
  --so-info: #0060c7;
  --so-info-dot: #0a84ff;
  --so-idle-dot: #aeaeb2;

  --so-shadow-1: 0 0 0 0.5px rgba(0, 0, 0, 0.07), 0 1px 2px rgba(0, 0, 0, 0.05);
  --so-shadow-2: 0 0 0 0.5px rgba(0, 0, 0, 0.07), 0 1px 3px rgba(0, 0, 0, 0.04), 0 6px 16px rgba(0, 0, 0, 0.06);
  --so-shadow-3: 0 0 0 0.5px rgba(0, 0, 0, 0.09), 0 2px 6px rgba(0, 0, 0, 0.06), 0 14px 36px rgba(0, 0, 0, 0.13);
  --so-shadow-window: 0 0 0 0.5px rgba(0, 0, 0, 0.11), 0 8px 20px rgba(0, 0, 0, 0.06), 0 30px 80px rgba(0, 0, 0, 0.13);

  --so-font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", system-ui, sans-serif;
  --so-mono: "SF Mono", ui-monospace, "JetBrains Mono", Menlo, Consolas, monospace;
  --so-r-xs: 4px;
  --so-r-sm: 7px;
  --so-r-md: 10px;
  --so-r-lg: 14px;
  --so-r-xl: 20px;
  --so-ease: cubic-bezier(0.22, 1, 0.36, 1);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --so-canvas: #0b0b0c;
    --so-canvas-dot: rgba(255, 255, 255, 0.06);
    --so-surface: #1c1c1e;
    --so-surface-2: #212124;
    --so-sunken: #141416;
    --so-vibrancy: rgba(33, 33, 36, 0.82);
    --so-hover: rgba(255, 255, 255, 0.06);
    --so-press: rgba(255, 255, 255, 0.1);
    --so-line: rgba(255, 255, 255, 0.09);
    --so-line-2: rgba(255, 255, 255, 0.17);
    --so-ink: #f5f5f7;
    --so-ink-2: #a1a1a6;
    --so-ink-3: #7c7c81;
    --so-seg-thumb: #48484c;
    --so-switch-off: #3a3a3d;
    --so-mono-grad: linear-gradient(180deg, #6e6e73, #4b4b4f);
    --so-tooltip: rgba(72, 72, 76, 0.96);
    --so-a2z: #b49cf8;
    --so-a2z-fill: #7c3aed;
    --so-gmb: #f97316;
    --so-gmb-fill: #f97316;
    --so-focus: rgba(180, 156, 248, 0.38);
    --so-ok: #4fd672;
    --so-ok-dot: #30d158;
    --so-warn: #ffb240;
    --so-warn-dot: #ff9f0a;
    --so-bad: #ff6b61;
    --so-bad-dot: #ff453a;
    --so-info: #6cb2ff;
    --so-info-dot: #0a84ff;
    --so-idle-dot: #636366;
    --so-shadow-1: 0 0 0 0.5px rgba(255, 255, 255, 0.08), 0 1px 2px rgba(0, 0, 0, 0.4);
    --so-shadow-2: 0 0 0 0.5px rgba(255, 255, 255, 0.09), 0 6px 16px rgba(0, 0, 0, 0.45);
    --so-shadow-3: 0 0 0 0.5px rgba(255, 255, 255, 0.11), 0 14px 36px rgba(0, 0, 0, 0.6);
    --so-shadow-window: 0 0 0 0.5px rgba(255, 255, 255, 0.12), 0 30px 80px rgba(0, 0, 0, 0.7);
    color-scheme: dark;
  }
}
:root[data-theme="dark"], .so-dark {
  --so-canvas: #0b0b0c;
  --so-canvas-dot: rgba(255, 255, 255, 0.06);
  --so-surface: #1c1c1e;
  --so-surface-2: #212124;
  --so-sunken: #141416;
  --so-vibrancy: rgba(33, 33, 36, 0.82);
  --so-hover: rgba(255, 255, 255, 0.06);
  --so-press: rgba(255, 255, 255, 0.1);
  --so-line: rgba(255, 255, 255, 0.09);
  --so-line-2: rgba(255, 255, 255, 0.17);
  --so-ink: #f5f5f7;
  --so-ink-2: #a1a1a6;
  --so-ink-3: #7c7c81;
  --so-seg-thumb: #48484c;
  --so-switch-off: #3a3a3d;
  --so-mono-grad: linear-gradient(180deg, #6e6e73, #4b4b4f);
  --so-tooltip: rgba(72, 72, 76, 0.96);
  --so-a2z: #b49cf8;
  --so-a2z-fill: #7c3aed;
  --so-gmb: #f97316;
  --so-gmb-fill: #f97316;
  --so-focus: rgba(180, 156, 248, 0.38);
  --so-ok: #4fd672;
  --so-ok-dot: #30d158;
  --so-warn: #ffb240;
  --so-warn-dot: #ff9f0a;
  --so-bad: #ff6b61;
  --so-bad-dot: #ff453a;
  --so-info: #6cb2ff;
  --so-info-dot: #0a84ff;
  --so-idle-dot: #636366;
  --so-shadow-1: 0 0 0 0.5px rgba(255, 255, 255, 0.08), 0 1px 2px rgba(0, 0, 0, 0.4);
  --so-shadow-2: 0 0 0 0.5px rgba(255, 255, 255, 0.09), 0 6px 16px rgba(0, 0, 0, 0.45);
  --so-shadow-3: 0 0 0 0.5px rgba(255, 255, 255, 0.11), 0 14px 36px rgba(0, 0, 0, 0.6);
  --so-shadow-window: 0 0 0 0.5px rgba(255, 255, 255, 0.12), 0 30px 80px rgba(0, 0, 0, 0.7);
  color-scheme: dark;
}

/* ---------- Base : s'active avec la classe so-root sur <html> ---------- */
.so-root { -webkit-text-size-adjust: 100%; }
.so-root body { margin: 0; background: var(--so-canvas); color: var(--so-ink); font: 13px/1.4 var(--so-font); font-optical-sizing: auto; -webkit-font-smoothing: antialiased; }
.so-root *, .so-root *::before, .so-root *::after { box-sizing: border-box; }
.so-root :focus-visible { outline: 3px solid var(--so-focus); outline-offset: 2px; }
.so-root [hidden] { display: none !important; }
.so-light, .so-dark { background: var(--so-canvas); color: var(--so-ink); }

/* ---------- Primitives ---------- */
/* Accent par marque : les primitives ne connaissent que --so-accent. */
[data-brand="a2z"] { --so-accent: var(--so-a2z); --so-accent-fill: var(--so-a2z-fill); }
[data-brand="gmb"] { --so-accent: var(--so-gmb); --so-accent-fill: var(--so-gmb-fill); --so-focus: rgba(249, 115, 22, 0.32); }
.so-ico { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.so-ico.sm { width: 14px; height: 14px; }
.so-ico.lg { width: 20px; height: 20px; }
.so-ico.fill { fill: currentColor; stroke: none; }

.so-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 30px; padding: 0 14px; border: 0; border-radius: 999px;
  font: 500 13px/1 var(--so-font); letter-spacing: -0.006em; white-space: nowrap; text-decoration: none; cursor: pointer;
  transition: background-color 0.15s var(--so-ease), box-shadow 0.15s var(--so-ease), transform 0.12s var(--so-ease), filter 0.15s var(--so-ease);
}
.so-btn:active { transform: scale(0.97); }
.so-btn .so-ico { width: 15px; height: 15px; }
.so-btn--primary { background: var(--so-accent-fill); color: var(--so-on-accent); box-shadow: inset 0 0.5px 0 rgba(255, 255, 255, 0.22), 0 1px 2px rgba(0, 0, 0, 0.14); }
.so-btn--primary:hover { filter: brightness(1.07); }
.so-btn--secondary { background: var(--so-surface); color: var(--so-ink); box-shadow: 0 0 0 0.5px var(--so-line-2), 0 1px 2px rgba(0, 0, 0, 0.06); }
.so-btn--secondary:hover { background: var(--so-surface-2); box-shadow: 0 0 0 0.5px var(--so-line-2), 0 2px 4px rgba(0, 0, 0, 0.07); }
.so-btn--tertiary { background: transparent; color: var(--so-ink-2); }
.so-btn--tertiary:hover { background: var(--so-hover); color: var(--so-ink); }
.so-btn--danger { background: var(--so-surface); color: var(--so-bad); box-shadow: 0 0 0 0.5px var(--so-line-2), 0 1px 2px rgba(0, 0, 0, 0.06); }
.so-btn--sm { height: 24px; padding: 0 10px; font-size: 12px; gap: 5px; }
.so-btn--sm .so-ico { width: 13px; height: 13px; }
.so-btn--lg { height: 40px; padding: 0 20px; font-size: 15px; }
.so-btn[disabled] { opacity: 0.4; cursor: default; transform: none; filter: none; }
.so-btn .so-kbd { margin-left: 2px; }
.so-btn--primary .so-kbd { background: rgba(255, 255, 255, 0.18); color: inherit; box-shadow: none; }

.so-iconbtn { display: inline-grid; place-items: center; width: 28px; height: 28px; border: 0; text-decoration: none; border-radius: var(--so-r-sm); background: transparent; color: var(--so-ink-2); cursor: pointer; transition: background-color 0.15s var(--so-ease), color 0.15s var(--so-ease); flex: none; }
.so-iconbtn:hover { background: var(--so-hover); color: var(--so-ink); }
.so-iconbtn[disabled] { opacity: 0.35; cursor: default; background: none; }
.so-iconbtn--accent[disabled] { background: var(--so-accent-fill); } /* sinon l'icône blanche disparaît sur fond clair */
.so-iconbtn--secondary { background: var(--so-surface); box-shadow: 0 0 0 0.5px var(--so-line-2), 0 1px 2px rgba(0, 0, 0, 0.06); color: var(--so-ink); }
.so-iconbtn--round { border-radius: 999px; }
.so-iconbtn--accent { background: var(--so-accent-fill); color: var(--so-on-accent); border-radius: 999px; }
.so-iconbtn--accent:hover { background: var(--so-accent-fill); color: var(--so-on-accent); filter: brightness(1.07); }
.so-iconbtn.sm { width: 22px; height: 22px; border-radius: 6px; }
.so-iconbtn.sm .so-ico { width: 14px; height: 14px; }

.so-seg { display: inline-flex; padding: 2px; gap: 2px; background: var(--so-sunken); border-radius: 9px; box-shadow: inset 0 0 0 0.5px var(--so-line); }
.so-seg button { height: 24px; padding: 0 12px; border: 0; border-radius: 7px; background: transparent; color: var(--so-ink-2); font: 500 12.5px/1 var(--so-font); cursor: pointer; display: inline-flex; align-items: center; gap: 5px; transition: background-color 0.18s var(--so-ease), color 0.18s var(--so-ease), box-shadow 0.18s var(--so-ease); white-space: nowrap; }
.so-seg button:hover { color: var(--so-ink); }
.so-seg button[aria-pressed="true"] { background: var(--so-seg-thumb); color: var(--so-ink); box-shadow: 0 0 0 0.5px var(--so-line), 0 1px 2px rgba(0, 0, 0, 0.12); }
.so-seg .so-ico { width: 14px; height: 14px; }

.so-field { display: grid; gap: 6px; min-width: 0; }
.so-label { font-size: 12px; font-weight: 500; color: var(--so-ink-2); }
.so-input { display: flex; align-items: center; gap: 8px; height: 30px; padding: 0 10px; background: var(--so-surface); border-radius: 8px; box-shadow: 0 0 0 0.5px var(--so-line-2), inset 0 1px 1px rgba(0, 0, 0, 0.03); color: var(--so-ink-2); transition: box-shadow 0.15s var(--so-ease); min-width: 0; }
.so-input input, .so-input textarea { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font: 13px/1.4 var(--so-font); color: var(--so-ink); padding: 0; }
.so-input input::placeholder, .so-input textarea::placeholder { color: var(--so-ink-2); }
.so-input:focus-within { box-shadow: 0 0 0 0.5px var(--so-accent), 0 0 0 3.5px var(--so-focus); }
/* Le cadre du champ porte déjà l'anneau : pas de second anneau sur la saisie elle-même. */
.so-root .so-input input:focus-visible, .so-root .so-input textarea:focus-visible, .so-root .so-input select:focus-visible { outline: 0; }
.so-input.is-error { box-shadow: 0 0 0 0.5px var(--so-bad), 0 0 0 3.5px rgba(255, 59, 48, 0.2); }
.so-input--search { background: var(--so-sunken); box-shadow: inset 0 0 0 0.5px var(--so-line); }
.so-input--select { position: relative; padding: 0; color: var(--so-ink); }
.so-input--select select { -webkit-appearance: none; appearance: none; flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: transparent; font: 13px var(--so-font); color: var(--so-ink); padding: 0 28px 0 10px; cursor: pointer; text-overflow: ellipsis; }
.so-input--select > .so-ico { position: absolute; right: 8px; color: var(--so-ink-2); pointer-events: none; }
.so-input--select > .so-ico:first-child { position: static; margin-left: 10px; }
.so-input--select > .so-ico:first-child + select { padding-left: 8px; }
.so-input--area { height: auto; align-items: flex-start; padding: 8px 10px; }
.so-hint { font-size: 12px; color: var(--so-ink-2); }
.so-hint.is-error { color: var(--so-bad); }

.so-check, .so-radio { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--so-ink); cursor: pointer; user-select: none; }
.so-check input, .so-radio input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.so-check-box { width: 16px; height: 16px; border-radius: 4.5px; background: var(--so-surface); box-shadow: inset 0 0 0 1px var(--so-line-2), 0 1px 1px rgba(0, 0, 0, 0.04); display: grid; place-items: center; color: transparent; transition: background-color 0.15s var(--so-ease); flex: none; }
.so-check-box .so-ico { width: 12px; height: 12px; stroke-width: 2.6; }
.so-check input:checked + .so-check-box, .so-check input:indeterminate + .so-check-box { background: var(--so-accent-fill); box-shadow: none; color: var(--so-on-accent); }
.so-check input:focus-visible + .so-check-box, .so-radio input:focus-visible + .so-radio-dot { outline: 3px solid var(--so-focus); outline-offset: 1px; }
.so-radio-dot { width: 16px; height: 16px; border-radius: 50%; background: var(--so-surface); box-shadow: inset 0 0 0 1px var(--so-line-2); display: grid; place-items: center; flex: none; }
.so-radio-dot::after { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--so-on-accent); transform: scale(0); transition: transform 0.15s var(--so-ease); }
.so-radio input:checked + .so-radio-dot { background: var(--so-accent-fill); box-shadow: none; }
.so-radio input:checked + .so-radio-dot::after { transform: scale(1); }

.so-switch { display: inline-flex; align-items: center; gap: 10px; border: 0; background: none; padding: 0; cursor: pointer; font-size: 13px; color: var(--so-ink); }
.so-switch-track { width: 34px; height: 20px; border-radius: 999px; background: var(--so-switch-off); position: relative; transition: background-color 0.2s var(--so-ease); flex: none; }
.so-switch-track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25), 0 0 0 0.5px rgba(0, 0, 0, 0.04); transition: transform 0.22s var(--so-ease); }
.so-switch[aria-checked="true"] .so-switch-track { background: var(--so-accent-fill); }
.so-switch[aria-checked="true"] .so-switch-track::after { transform: translateX(14px); }

.so-slider { -webkit-appearance: none; appearance: none; width: 100%; height: 4px; border-radius: 999px; background: linear-gradient(90deg, var(--so-accent-fill) var(--v, 50%), var(--so-switch-off) var(--v, 50%)); outline: none; }
.so-slider::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25), 0 0 0 0.5px rgba(0, 0, 0, 0.06); cursor: pointer; }
.so-slider::-moz-range-thumb { width: 18px; height: 18px; border: 0; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25); cursor: pointer; }

.so-avatar { width: 24px; height: 24px; border-radius: 50%; background: var(--so-mono-grad); color: #fff; display: inline-grid; place-items: center; font: 600 9.5px/1 var(--so-font); letter-spacing: 0.02em; flex: none; }
.so-avatar.sm { width: 18px; height: 18px; font-size: 7.5px; }
.so-avatar.lg { width: 32px; height: 32px; font-size: 12px; }
.so-avatar.xl { width: 56px; height: 56px; font-size: 20px; }
.so-avatar.square { border-radius: 6px; background: var(--so-surface); color: var(--so-ink-2); box-shadow: inset 0 0 0 0.5px var(--so-line-2); }
.so-avatar.square.lg { border-radius: 8px; }
.so-avatar.square.xl { border-radius: 13px; }
.so-avatar.accent { background: var(--so-accent-fill); color: var(--so-on-accent); }
.so-avgroup { display: inline-flex; }
.so-avgroup .so-avatar { box-shadow: 0 0 0 2px var(--so-surface); }
.so-avgroup .so-avatar + .so-avatar { margin-left: -6px; }

.so-chip { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 6px 0 2px; border-radius: 6px; font-size: 13px; font-weight: 500; color: var(--so-ink); white-space: nowrap; max-width: 100%; min-width: 0; }
.so-chip span { overflow: hidden; text-overflow: ellipsis; }
.so-chip:hover { background: var(--so-hover); }

.so-status { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 500; color: var(--so-ink-2); white-space: nowrap; }
.so-status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--dot, var(--so-idle-dot)); flex: none; }
.so-status.ok { --dot: var(--so-ok-dot); color: var(--so-ok); }
.so-status.warn { --dot: var(--so-warn-dot); color: var(--so-warn); }
.so-status.bad { --dot: var(--so-bad-dot); color: var(--so-bad); }
.so-status.info { --dot: var(--so-info-dot); color: var(--so-info); }
.so-status.accent { --dot: var(--so-accent-fill); color: var(--so-accent); }
.so-status.idle { --dot: var(--so-idle-dot); color: var(--so-ink-2); }
.so-status.plain { color: var(--so-ink); }

.so-count { font-size: 12px; color: var(--so-ink-2); font-variant-numeric: tabular-nums; font-weight: 500; }
.so-kbd { display: inline-flex; align-items: center; gap: 1px; height: 18px; min-width: 18px; padding: 0 5px; border-radius: 5px; background: var(--so-sunken); box-shadow: inset 0 0 0 0.5px var(--so-line-2); font: 500 11px/1 var(--so-font); color: var(--so-ink-2); justify-content: center; }

.so-progress { height: 6px; border-radius: 999px; background: var(--so-sunken); box-shadow: inset 0 0 0 0.5px var(--so-line); overflow: hidden; width: 100%; }
.so-progress i { display: block; height: 100%; border-radius: inherit; background: var(--bar, var(--so-accent-fill)); }
.so-progress.ok { --bar: var(--so-ok-dot); } .so-progress.warn { --bar: var(--so-warn-dot); } .so-progress.bad { --bar: var(--so-bad-dot); }
.so-ring { position: relative; display: inline-grid; place-items: center; flex: none; }
.so-ring svg { transform: rotate(-90deg); }
.so-ring .track { stroke: var(--so-sunken); }
.so-ring .val { stroke: var(--bar, var(--so-accent-fill)); stroke-linecap: round; transition: stroke-dashoffset 0.6s var(--so-ease); }
.so-ring.ok { --bar: var(--so-ok-dot); } .so-ring.warn { --bar: var(--so-warn-dot); } .so-ring.bad { --bar: var(--so-bad-dot); }
.so-ring b { position: absolute; white-space: nowrap; font-weight: 650; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }

.so-metrics { display: flex; flex-wrap: wrap; }
.so-metric { display: grid; gap: 2px; padding: 0 20px; border-left: 0.5px solid var(--so-line-2); min-width: 0; }
.so-metric:first-child { border-left: 0; padding-left: 0; }
.so-metric small { font-size: 12px; color: var(--so-ink-2); }
.so-metric b { font-size: 22px; font-weight: 650; letter-spacing: -0.025em; font-variant-numeric: tabular-nums; line-height: 1.15; }
.so-metric span { font-size: 12px; color: var(--so-ink-2); }
.so-metric span.up { color: var(--so-ok); } .so-metric span.down { color: var(--so-bad); }

.so-details { display: grid; }
.so-drow { display: grid; grid-template-columns: 136px 1fr; align-items: center; gap: 8px; min-height: 32px; font-size: 13px; }
.so-drow > span:first-child { display: flex; align-items: center; gap: 8px; color: var(--so-ink-2); }
.so-drow > span:last-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.so-drow.wrap { align-items: start; }
.so-drow.wrap > span:first-child { min-height: 32px; }
.so-drow.wrap > span:last-child { white-space: normal; overflow: visible; overflow-wrap: anywhere; padding: 6px 0; }
.so-drow a { color: inherit; text-decoration: underline; text-decoration-color: var(--so-line-2); text-underline-offset: 3px; }
.so-drow a:hover { text-decoration-color: var(--so-accent); }

.so-code { margin: 0; padding: 10px 12px; border-radius: var(--so-r-md); background: var(--so-sunken); box-shadow: inset 0 0 0 0.5px var(--so-line); font: 12px/1.6 var(--so-mono); color: var(--so-ink); overflow-x: auto; white-space: pre; }
.so-skel { display: block; border-radius: 6px; background: linear-gradient(90deg, var(--so-sunken) 25%, var(--so-hover) 50%, var(--so-sunken) 75%); background-size: 200% 100%; animation: so-shimmer 1.4s linear infinite; }
@keyframes so-shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

.so-nav { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1px; }
.so-nav-item { display: flex; align-items: center; gap: 8px; width: 100%; height: 28px; padding: 0 8px; border: 0; border-radius: var(--so-r-sm); background: none; font: 500 13px/1.2 var(--so-font); color: var(--so-ink); text-align: left; text-decoration: none; cursor: pointer; white-space: nowrap; }
.so-nav-item .so-ico { color: var(--so-ink-2); }
.so-nav-item:hover { background: var(--so-hover); }
.so-nav-item.is-active { background: var(--so-press); }
.so-nav-item.is-active .so-ico { color: var(--so-accent); }
.so-nav-item > span:not(.dot):not(.so-count) { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.so-nav-item .so-count { margin-left: auto; flex: none; padding-left: 4px; }
.so-nav-item .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--dot); flex: none; margin: 0 4px; }
.so-nav-label { font-size: 11.5px; font-weight: 600; color: var(--so-ink-2); padding: 14px 8px 4px; }

.so-sidebar { width: 224px; flex: none; display: flex; flex-direction: column; gap: 2px; padding: 10px 10px 12px; overflow-y: auto; background: var(--so-vibrancy); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px); border-right: 0.5px solid var(--so-line); }
.so-ws { display: flex; align-items: center; gap: 8px; height: 34px; padding: 0 8px; border-radius: var(--so-r-sm); margin-bottom: 6px; min-width: 0; }
.so-mark { width: 18px; height: 18px; flex: none; }
.so-mark-a2z { font-weight: 800; letter-spacing: -0.02em; }
.so-mark-a2z i { font-style: normal; color: var(--so-a2z); }
.so-ws b { font-size: 13.5px; font-weight: 700; letter-spacing: -0.01em; }
.so-ws span { font-size: 12.5px; color: var(--so-ink-2); }
.so-ws span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.so-sidebar .so-input--search { margin: 0 0 8px; height: 28px; }
.so-sidebar-foot { margin-top: auto; padding-top: 8px; }

.so-tabs { display: flex; gap: 18px; border-bottom: 0.5px solid var(--so-line); padding: 0 16px; }
.so-tab { display: inline-flex; align-items: center; gap: 6px; height: 36px; border: 0; background: none; padding: 0; font: 500 13px/1 var(--so-font); color: var(--so-ink-2); border-bottom: 2px solid transparent; margin-bottom: -0.5px; cursor: pointer; white-space: nowrap; }
.so-tab:hover { color: var(--so-ink); }
.so-tab[aria-selected="true"] { color: var(--so-ink); border-bottom-color: var(--so-accent-fill); }
.so-tab .so-count { font-size: 11.5px; }

.so-crumbs { display: flex; align-items: center; gap: 4px; font-size: 13px; color: var(--so-ink-2); min-width: 0; white-space: nowrap; }
.so-crumbs b { color: var(--so-ink); font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.so-crumbs .so-ico { width: 13px; height: 13px; color: var(--so-ink-3); }

.so-menu { background: var(--so-surface); border-radius: 11px; box-shadow: var(--so-shadow-3); padding: 5px; min-width: 210px; display: grid; gap: 1px; }
.so-menu hr { border: 0; border-top: 0.5px solid var(--so-line); margin: 4px 6px; }
.so-menu-item { display: flex; align-items: center; gap: 9px; width: 100%; height: 28px; padding: 0 8px; border: 0; border-radius: 6px; background: none; font: 13px/1.2 var(--so-font); color: var(--so-ink); text-align: left; text-decoration: none; cursor: pointer; white-space: nowrap; }
.so-menu-item .so-ico { color: var(--so-ink-2); }
.so-menu-item .so-kbd { margin-left: auto; background: none; box-shadow: none; padding: 0; }
.so-menu-item:hover, .so-menu-item.is-hl, .so-menu-item:focus-visible { background: var(--so-accent-fill); color: var(--so-on-accent); outline: none; }
.so-menu-item:hover .so-ico, .so-menu-item.is-hl .so-ico, .so-menu-item:focus-visible .so-ico, .so-menu-item:hover .so-kbd, .so-menu-item.is-hl .so-kbd, .so-menu-item:focus-visible .so-kbd { color: inherit; }
.so-menu-item.danger { color: var(--so-bad); }
.so-menu-item.danger:hover { background: var(--so-bad-dot); color: #fff; }
.so-menu-item .check { margin-left: auto; color: var(--so-accent); }
.so-menu-item:hover .check, .so-menu-item:focus-visible .check { color: inherit; }

.so-pager { display: inline-flex; align-items: center; gap: 2px; font-size: 12.5px; color: var(--so-ink-2); font-variant-numeric: tabular-nums; }
.so-pager span { padding: 0 4px; }

.so-card { background: var(--so-surface); border-radius: 12px; box-shadow: var(--so-shadow-1); padding: 16px; }
.so-popover { background: var(--so-surface); border-radius: 12px; box-shadow: var(--so-shadow-3); padding: 14px; }
.so-dialog { width: 340px; background: var(--so-surface); border-radius: var(--so-r-lg); box-shadow: var(--so-shadow-window); padding: 20px; display: grid; gap: 8px; }
/* Boîte de dialogue native (<dialog class="so-dialog">) : ouverte par [data-so-open], fermée par [data-so-close] ou Échap. */
dialog.so-dialog { border: 0; color: var(--so-ink); font: 13px/1.4 var(--so-font); max-width: calc(100vw - 32px); max-height: calc(100dvh - 32px); overflow: auto; }
dialog.so-dialog:not([open]) { display: none; }
dialog.so-dialog::backdrop { background: rgba(0, 0, 0, 0.32); }
dialog.so-dialog[open] { animation: so-pop 0.18s var(--so-ease); }
.so-dialog--wide { width: 520px; }
.so-dialog-title { font-size: 15px; font-weight: 650; letter-spacing: -0.01em; }
.so-dialog p { font-size: 13px; color: var(--so-ink-2); }
.so-dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 10px; }
.so-tooltip { display: inline-block; background: var(--so-tooltip); color: #fff; font-size: 12px; font-weight: 500; padding: 5px 9px; border-radius: 7px; white-space: nowrap; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.16); }
.so-tooltip .so-kbd { background: rgba(255, 255, 255, 0.16); color: rgba(255, 255, 255, 0.8); box-shadow: none; margin-left: 6px; height: 16px; }
.so-toast { display: inline-flex; align-items: center; gap: 10px; padding: 9px 9px 9px 14px; border-radius: 13px; background: var(--so-vibrancy); -webkit-backdrop-filter: saturate(180%) blur(24px); backdrop-filter: saturate(180%) blur(24px); box-shadow: var(--so-shadow-3); font-size: 13px; font-weight: 500; color: var(--so-ink); }
.so-toast > .so-ico { color: var(--so-ok); }
.so-toasts[data-tone="bad"] .so-toast > .so-ico { color: var(--so-bad); }
.so-toasts[data-tone="warn"] .so-toast > .so-ico { color: var(--so-warn); }
.so-callout { display: grid; grid-template-columns: 18px 1fr; gap: 10px; padding: 12px 14px; border-radius: var(--so-r-md); background: var(--so-surface); box-shadow: inset 0 0 0 0.5px var(--so-line-2); font-size: 13px; }
.so-callout > .so-ico { margin-top: 1px; color: var(--tone, var(--so-info)); }
.so-callout.warn { --tone: var(--so-warn-dot); } .so-callout.bad { --tone: var(--so-bad-dot); } .so-callout.ok { --tone: var(--so-ok-dot); }
.so-callout b { display: block; font-weight: 600; margin-bottom: 2px; }
.so-callout span { color: var(--so-ink-2); }

.so-empty { display: grid; justify-items: center; gap: 6px; text-align: center; padding: 28px 16px; }
.so-empty > .so-ico { width: 28px; height: 28px; color: var(--so-ink-3); margin-bottom: 4px; stroke-width: 1.5; }
.so-empty b { font-size: 15px; font-weight: 600; }
.so-empty > span { font-size: 13px; color: var(--so-ink-2); max-width: 30ch; }
.so-empty .so-btn { margin-top: 8px; }

/* Données */
.so-viewbar { display: flex; align-items: center; gap: 4px; height: 44px; padding: 0 12px 0 16px; border-bottom: 0.5px solid var(--so-line); }
.so-viewbar .view { display: inline-flex; align-items: center; gap: 7px; height: 28px; padding: 0 8px; margin-left: -8px; border: 0; border-radius: var(--so-r-sm); background: none; font: 600 13px/1.2 var(--so-font); color: var(--so-ink); white-space: nowrap; min-width: 0; }
.so-viewbar button.view { cursor: pointer; }
.so-viewbar button.view:hover { background: var(--so-hover); }
.so-viewbar .view .so-ico { color: var(--so-ink-2); }
.so-viewbar .spacer { flex: 1; }
.so-pagehead { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 0 16px; border-bottom: 0.5px solid var(--so-line); flex: none; }
.so-pagehead .spacer { flex: 1; }
.so-pagehead-title { margin: 0; font-size: 15px; font-weight: 650; letter-spacing: -0.012em; display: flex; align-items: center; gap: 8px; white-space: nowrap; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.so-pagehead.has-crumbs .so-pagehead-title { font-size: 13px; font-weight: 600; letter-spacing: 0; }
.so-pagehead-title > span { overflow: hidden; text-overflow: ellipsis; }
.so-pagehead-actions { display: flex; align-items: center; gap: 10px; min-width: 0; }
.so-pagehead-back { color: var(--so-accent); padding: 0 10px 0 4px; }
.so-pagehead-lead { display: none; }
.so-pagehead-title .so-ico { color: var(--so-ink-2); }

.so-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
.so-table th { height: 32px; padding: 0 12px; text-align: left; font-size: 12px; font-weight: 500; color: var(--so-ink-2); border-bottom: 0.5px solid var(--so-line); white-space: nowrap; background: var(--so-surface); position: sticky; top: 0; }
.so-table th .so-ico { width: 14px; height: 14px; vertical-align: -2px; margin-right: 6px; color: var(--so-ink-3); }
.so-table td { height: 38px; padding: 0 12px; border-bottom: 0.5px solid var(--so-line); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 260px; }
.so-table tr[tabindex] { cursor: pointer; }
.so-table tr[tabindex]:focus-visible { outline-offset: -3px; }
.so-table tr:hover td { background: var(--so-hover); }
.so-table tr.is-selected td { background: color-mix(in srgb, var(--so-accent-fill) 8%, transparent); }
.so-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.so-table .muted { color: var(--so-ink-2); }
.so-table .chk { width: 36px; padding: 0 0 0 14px; }
.so-table tfoot td { color: var(--so-ink-2); font-size: 12px; border-bottom: 0; height: 34px; }
.so-table tfoot b { color: var(--so-ink); font-weight: 600; font-variant-numeric: tabular-nums; }

.so-board { display: flex; height: 100%; overflow-x: auto; overflow-y: hidden; overscroll-behavior-x: contain; padding: 0 8px; }
.so-col { width: 252px; flex: none; display: flex; flex-direction: column; border-left: 0.5px solid var(--so-line); min-height: 0; }
.so-col:first-child { border-left: 0; }
.so-col-head { display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 10px; flex: none; }
.so-col-head .so-status { color: var(--so-ink); font-weight: 600; font-size: 13px; }
.so-col-body { display: flex; flex-direction: column; gap: 8px; padding: 2px 8px 8px; overflow-y: auto; overscroll-behavior-y: contain; flex: 1; min-height: 0; }
.so-col-end { flex: 1 0 20px; font-size: 12.5px; color: var(--so-ink-2); padding: 2px; }
.so-bcard { flex: none; background: var(--so-surface-2); border-radius: var(--so-r-md); box-shadow: var(--so-shadow-1); padding: 9px 10px 10px; display: grid; gap: 6px; cursor: pointer; transition: box-shadow 0.15s var(--so-ease); }
.so-bcard:hover { box-shadow: var(--so-shadow-2); background: var(--so-surface); }
/* Longue colonne : une carte hors écran n'est mise en page que lorsqu'elle approche. */
.so-col-body > .so-bcard { content-visibility: auto; contain-intrinsic-size: auto 120px; }
.so-bcard-top { display: flex; align-items: center; gap: 8px; min-width: 0; min-height: 24px; }
.so-bcard:focus-visible { outline-offset: 1px; }
.so-bcard-actions { display: flex; align-items: center; margin: -3px -4px -3px 0; flex: none; }
.so-bcard-grip { cursor: grab; touch-action: none; }
.so-bcard-grip .so-ico { fill: currentColor; stroke: none; }
@media (hover: hover) and (pointer: fine) { .so-bcard-grip { display: none; } }
.so-bcard-top b { font-size: 13px; font-weight: 600; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; letter-spacing: -0.005em; }
.so-bfields { display: grid; gap: 3px; }
.so-bfield { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--so-ink-2); min-width: 0; }
.so-bfield .so-ico { width: 14px; height: 14px; color: var(--so-ink-3); }
.so-bfield span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.so-bfield .accent { color: var(--so-accent); font-weight: 600; }
.so-bcard-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-top: 2px; }
.so-bcard.is-ghost { box-shadow: var(--so-shadow-3); rotate: 1.2deg; cursor: grabbing; z-index: 90; }
.so-bplace { border-radius: var(--so-r-md); box-shadow: inset 0 0 0 1px var(--so-accent); background: color-mix(in srgb, var(--so-accent-fill) 6%, transparent); }
.kanban-drag-hidden { display: none !important; }
body.kanban-is-dragging { user-select: none; -webkit-user-select: none; cursor: grabbing; }

.so-sidepanel { width: var(--so-sidepanel-w, 490px); flex: none; background: var(--so-surface); border-left: 0.5px solid var(--so-line); box-shadow: -10px 0 30px rgba(0, 0, 0, 0.06); display: flex; flex-direction: column; min-height: 0; }
.so-sidepanel-head { display: flex; align-items: center; gap: 6px; height: 44px; padding: 0 10px 0 16px; border-bottom: 0.5px solid var(--so-line); }
.so-sidepanel-head .spacer { flex: 1; }
.so-sidepanel-id { display: flex; align-items: center; gap: 12px; padding: 18px 16px 6px; }
.so-sidepanel-name { margin: 0; font-size: 17px; font-weight: 650; letter-spacing: -0.02em; overflow-wrap: anywhere; }
.so-sidepanel-id p { font-size: 12.5px; color: var(--so-ink-2); }
.so-sidepanel-body { padding: 10px 16px 16px; display: grid; gap: 14px; align-content: start; overflow-y: auto; overscroll-behavior: contain; flex: 1; min-height: 0; }
.so-sidepanel-body > * { min-width: 0; }

.so-cal { display: grid; grid-template-columns: 52px repeat(5, 1fr); position: relative; }
.so-cal-head { display: contents; }
.so-cal-head div { height: 46px; display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 12.5px; color: var(--so-ink-2); border-bottom: 0.5px solid var(--so-line); }
.so-cal-head div b { font-size: 17px; font-weight: 600; color: var(--so-ink); letter-spacing: -0.02em; }
.so-cal-head div.today b { background: var(--so-accent-fill); color: var(--so-on-accent); width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-size: 14px; }
.so-cal-hours { display: grid; grid-auto-rows: 52px; }
.so-cal-hours span { font-size: 11px; color: var(--so-ink-2); text-align: right; padding-right: 8px; transform: translateY(-7px); font-variant-numeric: tabular-nums; }
.so-cal-day { position: relative; border-left: 0.5px solid var(--so-line); background-image: linear-gradient(var(--so-line) 0.5px, transparent 0.5px); background-size: 100% 52px; }
.so-ev { position: absolute; left: 4px; right: 4px; border-radius: 7px; padding: 5px 8px; font-size: 11.5px; line-height: 1.3; overflow: hidden; background: var(--ev, var(--so-accent-fill)); color: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12); }
.so-ev b { display: block; font-weight: 600; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.so-ev span { opacity: 0.86; }
.so-ev.gmb { --ev: var(--so-gmb-fill); } .so-ev.a2z { --ev: var(--so-a2z-fill); }
.so-ev.blocked { background: repeating-linear-gradient(-45deg, var(--so-sunken) 0 6px, transparent 6px 12px); color: var(--so-ink-2); box-shadow: inset 0 0 0 0.5px var(--so-line-2); }
.so-ev.tentative { background: var(--so-surface); color: var(--so-ink); box-shadow: inset 0 0 0 1px var(--so-accent); }
.so-now { position: absolute; left: 0; right: 0; height: 0; border-top: 1.5px solid var(--so-bad-dot); z-index: 2; }
.so-now::before { content: ""; position: absolute; left: -4px; top: -4.5px; width: 7px; height: 7px; border-radius: 50%; background: var(--so-bad-dot); }

.so-thread { display: flex; flex-direction: column; gap: 8px; }
.so-bubble { max-width: 72%; padding: 8px 13px; border-radius: 18px; font-size: 13.5px; line-height: 1.45; }
.so-bubble.me { align-self: flex-end; background: var(--so-accent-fill); color: var(--so-on-accent); border-bottom-right-radius: 6px; }
.so-bubble.them { align-self: flex-start; background: var(--so-sunken); color: var(--so-ink); border-bottom-left-radius: 6px; box-shadow: inset 0 0 0 0.5px var(--so-line); }
.so-bubble-meta { font-size: 11px; color: var(--so-ink-2); align-self: center; margin: 6px 0 2px; }
.so-composer { display: flex; align-items: flex-end; gap: 8px; padding: 6px 6px 6px 14px; border-radius: 20px; background: var(--so-surface); box-shadow: 0 0 0 0.5px var(--so-line-2), 0 2px 8px rgba(0, 0, 0, 0.05); }
.so-composer span { flex: 1; font-size: 13.5px; color: var(--so-ink-2); padding: 6px 0; }

.so-beat { display: flex; gap: 2px; align-items: stretch; height: 22px; }
.so-beat i { width: 4px; border-radius: 2px; background: var(--so-ok-dot); opacity: 0.9; }
.so-beat i.warn { background: var(--so-warn-dot); } .so-beat i.bad { background: var(--so-bad-dot); } .so-beat i.idle { background: var(--so-switch-off); }

.so-inset { background: var(--so-surface); border-radius: 12px; box-shadow: var(--so-shadow-1); overflow: hidden; }
.so-inset-row { display: flex; align-items: center; position: relative; }
.so-inset-main { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; min-height: 46px; padding: 0 14px; border: 0; background: none; font: 13px/1.3 var(--so-font); color: var(--so-ink); text-align: left; text-decoration: none; }
button.so-inset-main, a.so-inset-main { cursor: pointer; }
button.so-inset-main:hover, a.so-inset-main:hover { background: var(--so-hover); }
.so-inset-main:focus-visible { outline-offset: -3px; }
.so-inset-trail { flex: none; display: flex; align-items: center; gap: 2px; padding-right: 8px; }
.so-inset-row + .so-inset-row::before { content: ""; position: absolute; top: 0; left: 44px; right: 0; border-top: 0.5px solid var(--so-line); }
.so-inset-main > .so-ico:first-child { width: 18px; height: 18px; color: var(--so-ink-2); }
.so-inset-main .t { display: grid; min-width: 0; flex: 1; }
.so-inset-main .t b { font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.so-inset-main .t span { font-size: 12px; color: var(--so-ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.so-inset-main > .so-ico:last-child { color: var(--so-ink-3); width: 14px; height: 14px; }
.so-inset-title { font-size: 12.5px; font-weight: 600; color: var(--so-ink-2); padding: 0 4px 8px; }

.so-user { display: flex; align-items: center; gap: 8px; width: 100%; height: 34px; padding: 0 8px; border: 0; border-radius: var(--so-r-sm); background: none; font: 550 13px/1.2 var(--so-font); color: var(--so-ink); text-align: left; cursor: pointer; }
.so-user:hover { background: var(--so-hover); }
.so-user > span:not(.so-avatar) { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.so-user .so-ico { color: var(--so-ink-2); width: 14px; height: 14px; }
.so-seg.fit { display: flex; width: 100%; }
.so-seg.fit button { flex: 1 1 auto; padding: 0 3px; font-size: 11.5px; justify-content: center; min-width: 0; }
.so-bfield.bad span, .so-bfield.bad .so-ico { color: var(--so-bad); }
.so-inset-row.is-selected .so-inset-main { background: var(--so-press); }
.so-inset-row { content-visibility: auto; contain-intrinsic-size: auto 46px; }
.so-side-block { padding: 2px 8px 0; display: grid; gap: 10px; }
.so-side-block small { font-size: 12px; color: var(--so-ink-2); line-height: 1.4; }
.so-h { font-size: 13px; font-weight: 650; letter-spacing: -0.01em; margin: 0 0 10px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.so-h small { font-weight: 500; color: var(--so-ink-2); font-size: 12px; }
.so-pad { padding: 16px; }
.so-strip { padding: 16px 16px 14px; border-bottom: 0.5px solid var(--so-line); }
.so-split { display: flex; flex: 1; min-height: 0; }
.so-pane { display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.so-pane + .so-pane { border-left: 0.5px solid var(--so-line); }
.so-grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; align-items: start; }
.so-stack { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-content: start; min-width: 0; }
.so-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.so-main.canvas { background: var(--so-canvas); }
.so-main.canvas .so-pagehead, .so-main.canvas .so-strip { background: var(--so-surface); }
.so-steps { display: grid; }
.so-step { display: grid; grid-template-columns: 18px 1fr auto; gap: 10px; align-items: center; min-height: 34px; font-size: 13px; }
.so-step .so-ico { width: 18px; height: 18px; }
.so-step small { color: var(--so-ink-2); font-size: 12px; font-variant-numeric: tabular-nums; }
.so-step.done .so-ico { color: var(--so-ok-dot); }
.so-step.current { font-weight: 600; }
.so-step.current .so-ico { color: var(--so-accent); }
.so-step.todo { color: var(--so-ink-2); }
.so-step.todo .so-ico { color: var(--so-ink-3); }
.so-player { width: 268px; aspect-ratio: 9 / 16; border-radius: 18px; background: #0d0d0f; color: #fff; position: relative; overflow: hidden; display: grid; place-items: center; box-shadow: var(--so-shadow-2); flex: none; }
.so-player .play { width: 58px; height: 58px; border-radius: 50%; background: rgba(255, 255, 255, 0.16); display: grid; place-items: center; }
.so-player .play .so-ico { margin-left: 3px; }
.so-player .cap { position: absolute; left: 18px; right: 18px; bottom: 76px; text-align: center; font-size: 19px; font-weight: 800; line-height: 1.15; letter-spacing: -0.015em; }
.so-player .cap em { font-style: normal; color: var(--so-gmb); }
.so-player .bar { position: absolute; left: 14px; right: 14px; bottom: 16px; display: flex; align-items: center; gap: 8px; font-size: 11px; font-variant-numeric: tabular-nums; color: rgba(255, 255, 255, 0.82); }
.so-player .bar .so-progress { background: rgba(255, 255, 255, 0.22); box-shadow: none; height: 4px; }
.so-player .bar .so-progress i { background: #fff; }
.so-gauges { display: flex; justify-content: space-around; gap: 8px; padding: 16px 0 6px; }
.so-gauge { display: grid; justify-items: center; gap: 4px; text-align: center; }
.so-gauge b { font-weight: 600; font-size: 12.5px; margin-top: 4px; }
.so-gauge small { color: var(--so-ink-2); font-size: 11.5px; }
.so-actions { display: grid; grid-template-columns: repeat(var(--cols, 3), 1fr); gap: 8px; }
.so-action { height: 34px; padding: 0 10px; border: 0; border-radius: 9px; background: var(--so-surface); box-shadow: 0 0 0 0.5px var(--so-line-2), 0 1px 2px rgba(0, 0, 0, 0.05); font: 500 13px/1 var(--so-font); color: var(--so-ink); cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: background-color 0.15s var(--so-ease), transform 0.12s var(--so-ease); }
.so-action:hover { background: var(--so-surface-2); }
.so-action:active { transform: scale(0.98); }

/* ---------- Coquille d'application ---------- */
.so-shell { position: relative; display: flex; height: 100dvh; min-height: 0; overflow: hidden; background: var(--so-surface); color: var(--so-ink); font: 13px/1.4 var(--so-font); container: so-shell / inline-size; }
.so-main { position: relative; flex: 1; min-width: 0; min-height: 0; display: flex; flex-direction: column; background: var(--so-surface); }
.so-scroll { flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; }
.so-drawer-backdrop { display: none; }
.so-tabbar { display: none; justify-content: space-around; flex: none; padding: 6px 8px calc(6px + env(safe-area-inset-bottom, 0px)); background: var(--so-vibrancy); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px); border-top: 0.5px solid var(--so-line); }
.so-tabbar-item { display: grid; justify-items: center; gap: 2px; min-width: 64px; padding: 2px 6px; border: 0; border-radius: var(--so-r-sm); background: none; font: 500 10.5px/1.2 var(--so-font); color: var(--so-ink-2); text-decoration: none; cursor: pointer; }
.so-tabbar-item .so-ico { width: 24px; height: 24px; }
.so-tabbar-item.is-active { color: var(--so-accent); }

/* ---------- Ce qui flotte : popover, menu, feuille, notifications ---------- */
.so-floating { position: fixed; inset: 0; z-index: 70; pointer-events: none; }
.so-floating > * { position: absolute; pointer-events: auto; max-width: calc(100% - 16px); max-height: calc(100% - 16px); overflow: auto; animation: so-pop 0.16s var(--so-ease); }
.so-floating.is-sheet { pointer-events: auto; background: rgba(0, 0, 0, 0.3); animation: so-fade 0.2s var(--so-ease); }
.so-floating.is-sheet > * { left: 0 !important; right: 0; top: auto !important; bottom: 0; width: auto; max-width: none; max-height: 82%; border-radius: 18px 18px 0 0; padding: 16px 16px calc(18px + env(safe-area-inset-bottom, 0px)); animation: so-sheet 0.28s var(--so-ease); }
.so-floating.is-sheet .so-menu-item { height: 46px; font-size: 16px; }
.so-form { display: grid; gap: 12px; min-width: 240px; }
.so-form-title { font-size: 13px; font-weight: 650; letter-spacing: -0.01em; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.so-toasts { position: fixed; z-index: 80; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); translate: -50% 0; display: grid; gap: 8px; justify-items: center; width: max-content; max-width: calc(100% - 24px); pointer-events: none; }
.so-toasts .so-toast { pointer-events: auto; animation: so-rise 0.3s var(--so-ease); }
@keyframes so-pop { from { opacity: 0; translate: 0 -4px; } to { opacity: 1; translate: 0 0; } }
@keyframes so-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes so-sheet { from { translate: 0 28px; } to { translate: 0 0; } }
@keyframes so-rise { from { translate: 0 12px; } to { translate: 0 0; } }
body.kanban-is-dragging .so-board { scroll-snap-type: none; }

/* ---------- Coquille étroite (téléphone) : selon la largeur de .so-shell ---------- */
@container so-shell (min-width: 761px) {
  .so-hide-wide { display: none !important; }

  /* Fiche latérale : posée par-dessus le contenu, qui se devine flouté derrière elle. Un liseré
     de flou progressif adoucit la jonction. Le contenu garde une marge pour rester atteignable. */
  .so-split { position: relative; --so-sidepanel-w: min(490px, 62cqw); }
  .so-sidepanel { position: absolute; inset: 0 0 0 auto; z-index: 40; background: var(--so-vibrancy); -webkit-backdrop-filter: saturate(180%) blur(22px); backdrop-filter: saturate(180%) blur(22px); box-shadow: -18px 0 44px rgba(0, 0, 0, 0.1); }
  .so-sidepanel::before { content: ""; position: absolute; inset: 0 100% 0 auto; width: 36px; pointer-events: none; -webkit-backdrop-filter: blur(7px); backdrop-filter: blur(7px); -webkit-mask-image: linear-gradient(to left, #000, transparent); mask-image: linear-gradient(to left, #000, transparent); }
  .so-split:has(.so-sidepanel) > .so-pane:not(:has(.so-sidepanel)) :is(.so-board, .so-scroll) { padding-right: calc(var(--so-sidepanel-w) + 16px); }
}
@container so-shell (max-width: 760px) {
  .so-hide-narrow { display: none !important; }

  /* La barre latérale devient un tiroir, la navigation principale une barre d'onglets. */
  .so-sidebar { position: absolute; inset: 0 auto 0 0; z-index: 60; width: min(86cqw, 320px); translate: -104% 0; visibility: hidden; will-change: translate; transition: translate 0.3s var(--so-ease), visibility 0s 0.3s; background: var(--so-surface-2); -webkit-backdrop-filter: none; backdrop-filter: none; box-shadow: var(--so-shadow-3); padding: calc(12px + env(safe-area-inset-top, 0px)) 12px calc(12px + env(safe-area-inset-bottom, 0px)); }
  .so-shell.is-drawer-open > .so-sidebar { translate: 0 0; visibility: visible; transition: translate 0.3s var(--so-ease); }
  .so-shell.is-drawer-open > .so-drawer-backdrop { display: block; position: absolute; inset: 0; z-index: 59; border: 0; padding: 0; background: rgba(0, 0, 0, 0.3); animation: so-fade 0.2s var(--so-ease); }
  .so-tabbar { display: flex; }

  /* En-tête : une rangée d'actions, puis le titre en grand. */
  .so-pagehead { flex-wrap: wrap; row-gap: 0; min-height: 0; padding: calc(6px + env(safe-area-inset-top, 0px)) 12px 8px 16px; }
  .so-pagehead-lead { display: inline-flex; align-items: center; justify-content: center; margin-left: -8px; }
  .so-pagehead .so-crumbs { display: none; }
  .so-pagehead-actions { min-height: 38px; }
  .so-pagehead-title, .so-pagehead.has-crumbs .so-pagehead-title { order: 9; flex: 0 0 100%; font-size: 28px; font-weight: 750; letter-spacing: -0.03em; line-height: 1.15; padding-top: 2px; white-space: normal; }
  .so-pagehead-title > .so-ico { display: none; }

  /* Cibles tactiles de 38 px au moins, champs à 16 px (sinon Safari iOS zoome à la mise au point). */
  .so-btn { height: 38px; padding: 0 16px; font-size: 14.5px; }
  .so-btn--sm { height: 32px; padding: 0 12px; font-size: 13.5px; }
  .so-btn--lg { height: 50px; font-size: 16px; border-radius: 14px; }
  .so-iconbtn { width: 38px; height: 38px; }
  .so-iconbtn .so-ico { width: 18px; height: 18px; }
  .so-nav-item { height: 40px; font-size: 15px; gap: 12px; }
  .so-nav-item .so-ico { width: 18px; height: 18px; }
  .so-nav-label { font-size: 13px; }
  .so-input { height: 40px; }
  .so-input--area { height: auto; }
  .so-input input, .so-input textarea, .so-input--select select { font-size: 16px; }
  .so-seg button { height: 32px; font-size: 13.5px; }
  .so-seg.fit button { font-size: 12.5px; }
  .so-tabs { gap: 20px; overflow-x: auto; }
  .so-tab { height: 42px; font-size: 14.5px; }
  .so-status { font-size: 14px; }
  .so-count { font-size: 13px; }
  .so-inset-main { min-height: 52px; font-size: 15px; }
  .so-inset-main .t span { font-size: 13px; }
  .so-drow { grid-template-columns: 124px 1fr; min-height: 40px; font-size: 15px; }
  .so-viewbar { height: 48px; }
  .so-viewbar .view { font-size: 15px; }
  .so-action { height: 46px; border-radius: 13px; font-size: 14.5px; }
  .so-actions { gap: 10px; }
  .so-metric { padding: 0 14px; }
  .so-metric b { font-size: 19px; }

  /* Kanban : une colonne par écran, le glissement s'arrête net sur la suivante. */
  .so-board { padding: 0; scroll-snap-type: x mandatory; }
  .so-col { width: 88cqw; scroll-snap-align: start; }
  .so-col:last-child { margin-right: 12cqw; }
  .so-bcard-top b { font-size: 15px; }
  .so-bfield { font-size: 14px; }

  /* Le panneau de fiche prend tout l'écran. */
  .so-sidepanel { position: absolute; inset: 0; z-index: 50; width: auto; border-left: 0; box-shadow: none; padding-top: env(safe-area-inset-top, 0px); }
  .so-sidepanel-name { font-size: 20px; }
  .so-toasts { bottom: calc(76px + env(safe-area-inset-bottom, 0px)); }
}

@media (prefers-reduced-motion: reduce) {
  .so-root *, .so-root *::before, .so-root *::after, .so-shell *, .so-floating, .so-floating * { animation: none !important; transition: none !important; }
  .so-bcard.is-ghost { rotate: none; }
}
