/* COLOR by novatechweb — espace de travail pleine largeur inspiré de Photoshop :
   barre de menus, barre d'options, outils, document central (colonnes), dock du bas,
   panneaux à droite et barre d'état. Interface neutre pour juger les couleurs sans biais.
   Les variables --m1 … --m6 (palette triée du clair au sombre) et --accent viennent d'app.js. */

:root {
  --app: #1b1b1d;        /* fond de travail (autour du document) */
  --chrome: #262628;     /* barres */
  --panel: #2d2d30;      /* panneaux */
  --panel-head: #343437;
  --field: #1f1f22;      /* champs de saisie */
  --line: #3b3b40;
  --line-dark: #121214;
  --text: #dcdce1;
  --muted: #94949e;
  --accent: #4d8dff;
  --accent-on: #fff;
  --font: "Archivo", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  /* Valeurs (hex, OKLCH…) : Archivo à chiffres tabulaires ; le code exporté reste en monospace. */
  --mono: "Archivo", ui-sans-serif, system-ui, sans-serif;
  --code: ui-monospace, "SF Mono", "Cascadia Code", Consolas, monospace;
  --dock-w: 312px;
  --bdock-h: 300px;
  color-scheme: dark;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }
/* Vérification du compte auprès du serveur : rien ne s'affiche avant. */
.is-booting body { visibility: hidden; }

html, body { margin: 0; }

body {
  background: var(--app);
  color: var(--text);
  font: 12.5px/1.4 var(--font);
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, p { margin: 0; }

button { font: inherit; color: inherit; }

:focus-visible { outline: 2px solid #fff; outline-offset: 1px; }

.muted { color: var(--muted); }

kbd {
  margin-left: auto;
  padding-left: 18px;
  color: var(--muted);
  font: 11px var(--font);
}

/* ================= Structure ================= */

.app {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

.workspace {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) var(--dock-w);
  min-height: 0;
  border-top: 1px solid var(--line-dark);
}

/* ================= Barre de menus ================= */

.menubar {
  display: flex;
  align-items: center;
  gap: 14px;
  height: 34px;
  padding: 0 10px;
  background: var(--chrome);
  border-bottom: 1px solid var(--line-dark);
}

.brand { display: flex; align-items: center; gap: 8px; }
.brand-logo { display: block; width: auto; height: 22px; }
.brand-by { padding-top: 5px; color: var(--muted); font-size: 11.5px; font-weight: 500; letter-spacing: .01em; white-space: nowrap; }

.menus { display: flex; gap: 2px; }
.menu { position: relative; }
.menu-btn {
  height: 24px;
  padding: 0 9px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  cursor: default;
}
.menu-btn:hover, .menu-btn[aria-expanded="true"] { background: #3a3a3f; }

.menu-list {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 50;
  display: flex;
  flex-direction: column;
  width: max-content;
  min-width: 240px;
  max-width: min(380px, 92vw);
  padding: 5px;
  border: 1px solid #47474d;
  border-radius: 7px;
  background: #2f2f33;
  box-shadow: 0 14px 34px rgba(0, 0, 0, .55);
}
.menu-list button {
  position: relative;
  display: flex;
  flex: none;
  align-items: center;
  gap: 8px;
  min-height: 28px;
  padding: 4px 10px 4px 24px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  text-align: left;
  white-space: nowrap;
  cursor: default;
}
.menu-list button kbd { margin-left: auto; padding-left: 20px; }
.menu-list button:disabled { color: #67676f; }
.menu-list button:disabled:hover { background: transparent; color: #67676f; }
.menu-list button[aria-checked="true"]::before {
  content: "✓";
  position: absolute;
  left: 8px;
  font-size: 11px;
}
.menu-list button:hover, .menu-list button:focus-visible { background: var(--accent); color: var(--accent-on); outline: none; }
.menu-list button:hover kbd, .menu-list button:focus-visible kbd { color: inherit; }
.menu-list hr { width: 100%; height: 1px; margin: 4px 0; border: 0; background: #47474d; }

/* Compte connecté (à droite de la barre de menus). */
.menu-user { margin-left: auto; }
.menu-user .menu-list { right: 0; left: auto; min-width: 220px; }
.user-btn { display: flex; align-items: center; gap: 8px; padding-left: 4px; }
.user-avatar {
  display: block;
  width: 22px;
  height: 22px;
  overflow: hidden;
  border-radius: 50%;
  background: var(--accent);
}
.user-avatar svg, .user-avatar img { display: block; width: 100%; height: 100%; object-fit: cover; }
.user-name { max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-card { display: flex; flex-direction: column; padding: 6px 10px 4px; }
.user-card b { font-weight: 700; }
.user-card span { color: var(--muted); font-size: 11.5px; }

/* ================= Barre d'options ================= */

.optionsbar {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  padding: 4px 10px;
  background: var(--chrome);
  overflow-x: auto;
  scrollbar-width: none;
}
.opt-sep { flex: none; width: 1px; height: 22px; background: var(--line); }
.opt-label { color: var(--muted); white-space: nowrap; }
.opt-actions { display: flex; gap: 6px; margin-left: auto; }

.btn {
  display: inline-flex;
  align-items: center;
  height: 26px;
  padding: 0 12px;
  border: 1px solid #4a4a50;
  border-radius: 5px;
  background: #38383d;
  white-space: nowrap;
  cursor: pointer;
  transition: background .12s, border-color .12s;
}
.btn:hover { background: #424248; }
.btn-primary { border-color: transparent; background: var(--accent); color: var(--accent-on); font-weight: 600; }
.btn-primary:hover { background: var(--accent); filter: brightness(1.08); }

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #38383d;
  cursor: pointer;
}

.stepper {
  display: inline-flex;
  align-items: center;
  height: 26px;
  border: 1px solid var(--line-dark);
  border-radius: 5px;
  background: var(--field);
  overflow: hidden;
}
.stepper button {
  width: 26px;
  height: 100%;
  border: 0;
  background: transparent;
  font-size: 15px;
  cursor: pointer;
}
.stepper button:hover:not(:disabled) { background: #3a3a3f; }
.stepper button:disabled { color: #5a5a62; cursor: default; }
.stepper input {
  width: 34px;
  height: 100%;
  border: 0;
  border-inline: 1px solid var(--line-dark);
  background: transparent;
  color: var(--text);
  font: 700 13px var(--mono);
  text-align: center;
  -moz-appearance: textfield;
}
.stepper input::-webkit-inner-spin-button, .stepper input::-webkit-outer-spin-button { margin: 0; -webkit-appearance: none; }
.stepper input:focus { outline: 2px solid var(--accent); outline-offset: -2px; }

.chips { display: flex; gap: 4px; }
.chip {
  height: 24px;
  padding: 0 10px;
  border: 1px solid #4a4a50;
  border-radius: 99px;
  background: transparent;
  white-space: nowrap;
  cursor: pointer;
  transition: background .12s, border-color .12s;
}
.chip:hover { border-color: #66666e; }
.chip[aria-pressed="true"] { border-color: transparent; background: var(--accent); color: var(--accent-on); }

.toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
}
.toggle input { position: absolute; opacity: 0; pointer-events: none; }
.toggle-ui {
  position: relative;
  flex: none;
  width: 28px;
  height: 16px;
  border-radius: 99px;
  background: #4a4a50;
  transition: background .15s;
}
.toggle-ui::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #fff;
  transition: transform .15s;
}
.toggle input:checked + .toggle-ui { background: var(--accent); }
.toggle input:checked + .toggle-ui::after { transform: translateX(12px); }
.toggle input:focus-visible + .toggle-ui { outline: 2px solid #fff; outline-offset: 2px; }
.toggle-sm { color: var(--muted); }

/* ================= Outils ================= */

.toolbar {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 8px 0;
  overflow-y: auto;
  scrollbar-width: none;
  background: var(--chrome);
  border-right: 1px solid var(--line-dark);
}
.tool {
  display: grid;
  place-items: center;
  width: 34px;
  height: 32px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: #c4c4cc;
  cursor: pointer;
}
.tool:hover { background: #3a3a3f; color: #fff; }
.tool[aria-pressed="true"], .tool[aria-checked="true"] { background: #4a4a51; color: #fff; box-shadow: inset 0 0 0 1px #5c5c64; }
.tool { flex: none; }
.tool-group { display: flex; flex-direction: column; gap: 3px; }
.tool-harmony .hwheel { width: 22px; height: 22px; }
.tool-harmony .hwheel::before {
  -webkit-mask: radial-gradient(circle, transparent 5.5px, #000 6px);
  mask: radial-gradient(circle, transparent 5.5px, #000 6px);
}
.tool-harmony .hwheel i { width: 7px; height: 7px; margin: -3.5px 0 0 -3.5px; border-width: 1.5px; }
.tool-harmony .hwheel i:first-child { width: 8px; height: 8px; margin: -4px 0 0 -4px; }
img.logo { display: block; object-fit: contain; }
.tool .logo { width: 20px; height: 20px; }
/* Icône PDF : contour noir et étiquette rouge, posée sur une tuile claire pour rester lisible. */
.tool [src$="pdf.svg"], .platform-logo [src$="pdf.svg"] { padding: 1.5px; border-radius: 4px; background: #ececf0; }
.tool svg { fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.tool svg { width: 19px; height: 19px; }
.tool svg .dot { fill: currentColor; stroke: none; }
.tool-sep { width: 22px; height: 1px; margin: 5px 0; background: var(--line); }

/* ================= Document central ================= */

.center {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  background: var(--app);
}

.doc { display: flex; flex: 1 1 auto; flex-direction: column; min-height: 160px; }

.doc-tabs {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  height: 30px;
  padding: 0 8px;
  background: var(--chrome);
  border-bottom: 1px solid var(--line-dark);
}
.doc-tablist { display: flex; flex: 0 1 auto; align-items: flex-end; gap: 2px; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.doc-tab {
  display: flex;
  flex: none;
  align-items: center;
  gap: 7px;
  height: 26px;
  padding: 0 12px;
  border: 0;
  border-radius: 5px 5px 0 0;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
  cursor: pointer;
}
.doc-tab:hover { background: #303034; color: var(--text); }
.doc-tab[aria-selected="true"] { background: var(--app); color: var(--text); }
.doc-tab svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.doc-tab .doc-count { padding: 0 5px; border-radius: 99px; background: #3a3a40; color: var(--muted); font-size: 10.5px; font-weight: 700; }

/* Vues autres que la palette : occupent tout le centre (le dock du bas est masqué). */
.views { display: contents; }
.view { flex: 1 1 auto; min-height: 0; overflow: auto; background: var(--app); scrollbar-width: thin; }
.center.is-view .stage, .center.is-view .splitter, .center.is-view .bdock { display: none; }

.stage {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

/* Colonnes de la palette (HTML/CSS) : aplats pleine hauteur, code et nom en bas,
   actions au survol, clic pour copier. Animations par anime.js. */
.col-overlay { position: absolute; inset: 0; display: flex; overflow: hidden; }

.col {
  position: relative;
  display: flex;
  flex: 1 1 0;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  min-width: 0;
  background: var(--c);
  color: var(--on);
  cursor: copy;
  container-type: inline-size;
}
.col-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .3em;
  width: 100%;
  padding: 0 6px 11%;
  text-align: center;
  transition: transform .25s;
}
.col-label b { font-size: clamp(13px, 15cqi, 42px); font-weight: 700; letter-spacing: .02em; }
.col-label span { max-width: 100%; overflow: hidden; font-size: clamp(10px, 5.4cqi, 14px); font-weight: 600; text-overflow: ellipsis; white-space: nowrap; opacity: .78; }
.col:hover .col-label { transform: translateY(-4px); }

.col-tools {
  position: absolute;
  top: 46%;
  left: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  opacity: 0;
  transform: translate(-50%, calc(-50% + 6px));
  transition: opacity .18s, transform .18s;
}
.col:hover .col-tools, .col:focus-within .col-tools { opacity: 1; transform: translate(-50%, -50%); }
.col-btn {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: inherit;
  cursor: pointer;
}
.col-btn:hover { background: color-mix(in srgb, currentColor 16%, transparent); }
.col-btn svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.col-contrast { margin-top: 2px; font-size: 11px; font-weight: 700; opacity: .85; white-space: nowrap; }

.splitter {
  flex: none;
  height: 6px;
  background: var(--line-dark);
  cursor: row-resize;
  touch-action: none;
}
.splitter:hover, .splitter.is-dragging { background: var(--accent); }

/* ----- Dock du bas : déclinaisons / aperçu ----- */

.bdock {
  display: flex;
  flex: none;
  flex-direction: column;
  height: var(--bdock-h);
  min-height: 0;
  background: var(--panel);
}
.bdock.is-fitting { transition: height .3s cubic-bezier(.2, .8, .2, 1); }

.bdock-tabs {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  height: 32px;
  padding: 0 8px 0 0;
  background: var(--panel-head);
  border-bottom: 1px solid var(--line-dark);
}

.ptabs { display: flex; align-self: stretch; }
.ptabs button {
  padding: 0 14px;
  border: 0;
  border-right: 1px solid var(--line-dark);
  background: transparent;
  color: var(--muted);
  font-weight: 600;
  cursor: pointer;
}
.ptabs button:hover { color: var(--text); }
.ptabs button[aria-selected="true"] { background: var(--panel); color: var(--text); box-shadow: inset 0 2px 0 var(--accent); }


.bdock-body { flex: 1 1 auto; min-height: 0; padding: 12px 14px; overflow: auto; scrollbar-width: thin; }

/* ================= Panneaux de droite ================= */

.dock {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--panel);
  border-left: 1px solid var(--line-dark);
}
.dock-scroll { flex: 1 1 auto; min-height: 0; overflow-y: auto; scrollbar-width: thin; }
.dpanel-pinned { flex: none; border-top: 1px solid var(--line-dark); border-bottom: 0; box-shadow: 0 -8px 18px rgba(0, 0, 0, .25); }
.dpanel-pinned .plane { aspect-ratio: 1 / .72; }

.dpanel { border-bottom: 1px solid var(--line-dark); }
.dpanel-head {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  height: 28px;
  padding: 0 10px;
  border: 0;
  background: var(--panel-head);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .04em;
  text-align: left;
  text-transform: uppercase;
  cursor: pointer;
}
.dpanel-head::before {
  content: "";
  width: 0;
  height: 0;
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  border-left: 5px solid var(--muted);
  transform: rotate(90deg);
  transition: transform .15s;
}
.dpanel-head[aria-expanded="false"]::before { transform: none; }
.dpanel-head[aria-expanded="false"] + .dpanel-body { display: none; }
.dpanel-sub { margin-left: auto; overflow: hidden; color: var(--muted); font-weight: 500; letter-spacing: 0; text-overflow: ellipsis; text-transform: none; white-space: nowrap; }
.dpanel-body { padding: 12px; }

/* ----- Couleur ----- */

.base-row {
  display: grid;
  grid-template-columns: 40px 1fr;
  grid-template-rows: auto auto;
  column-gap: 10px;
  align-items: center;
  margin-bottom: 14px;
}

.base-swatch {
  position: relative;
  grid-row: span 2;
  width: 40px;
  height: 40px;
  border-radius: 6px;
  background: var(--base, #888);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .16), 0 0 0 1px #111;
  cursor: pointer;
}
.base-swatch input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.base-swatch:focus-within { outline: 2px solid #fff; outline-offset: 2px; }

.hex-input {
  width: 100%;
  height: 26px;
  padding: 0 8px;
  border: 1px solid var(--line-dark);
  border-radius: 4px;
  background: var(--field);
  color: var(--text);
  font: 700 13px var(--mono);
  letter-spacing: .04em;
  text-transform: uppercase;
}
.hex-input:focus { border-color: var(--accent); outline: none; }
.hex-input[aria-invalid="true"] { border-color: #d0566b; }

.base-meta { margin-top: 3px; color: var(--muted); font: 11px var(--mono); }

.field { margin-bottom: 12px; }
.field:last-child { margin-bottom: 0; }
.field-head { display: flex; justify-content: space-between; margin-bottom: 5px; color: var(--muted); }
.field-head output { color: var(--text); font: 11.5px var(--mono); }

input[type="range"] {
  width: 100%;
  height: 8px;
  margin: 3px 0;
  border-radius: 99px;
  background: var(--track, var(--line));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08);
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}
input[type="range"]::-webkit-slider-thumb {
  width: 15px;
  height: 15px;
  border: 3px solid #fff;
  border-radius: 50%;
  background: transparent;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .6), inset 0 0 0 1px rgba(0, 0, 0, .6);
  cursor: grab;
  -webkit-appearance: none;
}
input[type="range"]::-moz-range-thumb {
  width: 9px;
  height: 9px;
  border: 3px solid #fff;
  border-radius: 50%;
  background: transparent;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .6), inset 0 0 0 1px rgba(0, 0, 0, .6);
  cursor: grab;
}

.hue-strip { position: relative; height: 22px; border-radius: 5px; touch-action: none; cursor: pointer; }
.hue-strip canvas { display: block; width: 100%; height: 100%; border-radius: 5px; }
.hue-thumb {
  position: absolute;
  top: -3px;
  bottom: -3px;
  width: 10px;
  border: 3px solid #fff;
  border-radius: 5px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .6), inset 0 0 0 1px rgba(0, 0, 0, .6);
  transform: translateX(-50%);
  pointer-events: none;
}
.hue-markers { position: absolute; inset: 0; pointer-events: none; }
.hue-markers i {
  position: absolute;
  top: 50%;
  width: 10px;
  height: 10px;
  margin: -5px 0 0 -5px;
  border: 2px solid #fff;
  border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .55);
}

/* ----- Harmonie ----- */

/* Mini roue chromatique : anneau OKLCH (dégradé calculé en JS) et points des teintes. */
.hwheel { position: relative; flex: none; width: 26px; height: 26px; border-radius: 50%; }
.hwheel::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--wheel, conic-gradient(#888, #888));
  -webkit-mask: radial-gradient(circle, transparent 6.5px, #000 7px);
  mask: radial-gradient(circle, transparent 6.5px, #000 7px);
}
.hwheel i {
  position: absolute;
  width: 8px;
  height: 8px;
  margin: -4px 0 0 -4px;
  border: 2px solid #fff;
  border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .6);
}
.hwheel i:first-child { width: 10px; height: 10px; margin: -5px 0 0 -5px; }

/* ----- Nuancier (palette détaillée) ----- */

.swatches { display: flex; flex-direction: column; gap: 4px; }

.swatch {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 3px;
  border-radius: 6px;
}
.swatch.is-hover { background: #36363a; }

.swatch-color {
  position: relative;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 0;
  border-radius: 5px;
  background: var(--c);
  color: var(--on);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .1), 0 0 0 1px #111;
  cursor: copy;
}
.swatch-index { font: 700 11px var(--mono); }
.swatch-base {
  position: absolute;
  right: -3px;
  bottom: -3px;
  width: 11px;
  height: 11px;
  border: 2px solid var(--panel);
  border-radius: 50%;
  background: #fff;
  font-size: 0;
}

.swatch-info { display: flex; flex-direction: column; align-items: flex-start; min-width: 0; }
.swatch-info button {
  max-width: 100%;
  padding: 0;
  border: 0;
  background: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: copy;
}
.swatch-hex { font: 700 13px var(--mono); letter-spacing: .03em; }
.swatch-oklch { color: var(--muted); font: 11px var(--mono); }
.swatch-info button:hover { color: #fff; }
.swatch-badge { color: var(--muted); font-size: 11px; text-align: right; white-space: nowrap; }

/* ----- Espace OKLCH ----- */

.plane {
  position: relative;
  aspect-ratio: 1 / .85;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 0 0 1px #111;
}
.plane canvas { display: block; width: 100%; height: 100%; cursor: crosshair; touch-action: none; }
.axis {
  position: absolute;
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(0, 0, 0, .5);
  color: #fff;
  font: 10.5px var(--mono);
  pointer-events: none;
}
.axis-l { top: 6px; left: 6px; }
.axis-c { right: 6px; bottom: 6px; }

.hint { margin-top: 8px; color: var(--muted); font-size: 11px; }

/* ================= Contrôle segmenté ================= */

.seg {
  display: inline-flex;
  gap: 2px;
  padding: 2px;
  border: 1px solid var(--line-dark);
  border-radius: 6px;
  background: var(--field);
}
.seg button {
  height: 22px;
  padding: 0 10px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.seg button:hover { color: var(--text); }
.seg button[aria-pressed="true"] { background: #45454b; color: var(--text); }

/* ================= Déclinaisons ================= */

.decl-help { margin-bottom: 10px; font-size: 11.5px; }

.decl { display: flex; flex-direction: column; gap: 6px; }

.decl-row { display: grid; grid-template-columns: 26px minmax(0, 1fr); align-items: center; gap: 8px; }
.decl-label { color: var(--muted); font: 700 11px var(--mono); }

.decl-cells { display: flex; border-radius: 6px; overflow: hidden; box-shadow: 0 0 0 1px #111; }

.decl-cell {
  position: relative;
  display: flex;
  flex: 1 1 0;
  flex-direction: column;
  justify-content: space-between;
  min-width: 0;
  height: 46px;
  padding: 5px 8px;
  border: 0;
  background: var(--c);
  color: var(--on);
  text-align: left;
  cursor: copy;
  transition: flex-grow .2s;
}
.decl-cell:hover { flex-grow: 1.35; z-index: 1; }
.decl-cell.is-base::after {
  content: "";
  position: absolute;
  top: 6px;
  right: 6px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.decl.is-alpha .decl-cell {
  background:
    linear-gradient(var(--c), var(--c)),
    repeating-conic-gradient(#d9d9de 0 25%, #fff 0 50%) 0 0 / 10px 10px;
}

.decl-step { font: 700 11px var(--mono); }
.decl-hex { overflow: hidden; font: 10.5px var(--mono); text-overflow: ellipsis; white-space: nowrap; opacity: .85; }

/* ================= Design system =================
   Toute la page est pilotée par des rôles de couleur : fond, surfaces, bordures, texte,
   couleur principale et accent (posés par app.js d'après la palette), en clair ou en sombre.
   Les couleurs d'état (--success, --warning, --danger, --info) sont calculées par design.js. */

.u-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

.ui {
  --bg: color-mix(in oklab, var(--m1) 45%, #fff);
  --surface: color-mix(in oklab, var(--m1) 14%, #fff);
  --surface-2: color-mix(in oklab, var(--m1) 70%, var(--m2));
  --border: color-mix(in oklab, var(--m2) 60%, var(--m1));
  --text: var(--m6);
  --muted: color-mix(in oklab, var(--m5) 70%, var(--m4));
  --primary: var(--ui-primary);
  --on-primary: var(--ui-primary-on);
  --accent: var(--ui-accent);
  --on-accent: var(--ui-accent-on);
  --soft: color-mix(in oklab, var(--primary) 13%, var(--surface));
  --soft-strong: color-mix(in oklab, var(--primary) 32%, var(--surface));
  --soft-text: color-mix(in oklab, var(--primary) 65%, var(--text));
  --success: #2f9e6a;
  --warning: #e0a92e;
  --danger: #d8475a;
  --info: #3a8ee8;
  --c1: var(--primary);
  --c2: var(--accent);
  --c3: var(--m3);
  --c4: var(--m5);
  --shadow: 0 1px 2px color-mix(in oklab, var(--m6) 8%, transparent), 0 10px 26px -14px color-mix(in oklab, var(--m6) 35%, transparent);
  --r: 10px;
  --r-ctl: 8px;
  --btn-r: 8px;
  --badge-r: 99px;
  --bw: 1px;
  --ctl-h: 34px;
  --pad: 16px;
  --gap: 14px;
  --fs-small: 11px;
  --fs-body: 14px;
  --fs-ui: 13px;
  --fs-h3: 17.5px;
  --fs-h2: 22px;
  --fs-h1: 27.5px;
  --fs-display: 34px;
  --fw-head: 800;
  --lh: 1.55;
  --ls-head: -.02em;
  --ds-font-head: var(--font);
  --ds-font-body: var(--font);
  container-type: inline-size;
  color: var(--text);
  font: var(--fs-ui)/1.5 var(--ds-font-body);
}
.ui.is-dark {
  --bg: color-mix(in oklab, var(--m6) 85%, #000);
  --surface: var(--m6);
  --surface-2: color-mix(in oklab, var(--m6) 65%, var(--m5));
  --border: color-mix(in oklab, var(--m5) 70%, var(--m6));
  --text: var(--m1);
  --muted: color-mix(in oklab, var(--m3) 70%, var(--m2));
  --primary: var(--ui-primary-d);
  --on-primary: var(--ui-primary-d-on);
  --accent: var(--ui-accent-d);
  --on-accent: var(--ui-accent-d-on);
  --soft: color-mix(in oklab, var(--primary) 18%, var(--surface));
  --soft-strong: color-mix(in oklab, var(--primary) 38%, var(--surface));
  --soft-text: color-mix(in oklab, var(--primary) 80%, var(--text));
  --c3: var(--m3);
  --c4: var(--m2);
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 12px 30px -14px rgba(0, 0, 0, .7);
}

.ui h1, .ui h2, .ui h3, .ui p, .ui figure, .ui blockquote, .ui ul { margin: 0; }
.ui small { display: block; color: var(--muted); font-size: 11.5px; }
.ui a { color: inherit; text-decoration: none; cursor: default; }

/* ----- Mise en page de la vue ----- */

.ds-layout { display: grid; grid-template-columns: 290px minmax(0, 1fr); gap: 20px; align-items: start; }
.ds-stage { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.ds-toc { position: sticky; top: 0; z-index: 2; display: flex; flex-wrap: wrap; gap: 4px; padding: 6px; border: 1px solid var(--line); border-radius: 10px; background: var(--chrome); }
.ds-toc button { padding: 4px 10px; border: 0; border-radius: 6px; background: none; color: #c9c9d2; font: 12px var(--font); cursor: pointer; }
.ds-toc button:hover { background: #3a3a40; color: #fff; }
.ds { display: flex; flex-direction: column; gap: 44px; padding: 32px; border-radius: 16px; background: var(--bg); }

/* Panneau de réglages */
.ds-panel { position: sticky; top: 0; display: flex; flex-direction: column; gap: 4px; max-height: calc(100vh - 150px); overflow-y: auto; padding: 4px 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); scrollbar-width: thin; }
.ds-group { display: flex; flex-direction: column; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.ds-group h4 { margin: 0; color: var(--muted); font-size: 10.5px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.ds-ctl { display: flex; flex-direction: column; gap: 6px; color: #c9c9d2; font-size: 12px; }
.ds-ctl > span { display: flex; justify-content: space-between; gap: 8px; }
.ds-ctl output { color: var(--text); font: 600 11.5px var(--mono); }
.ds-ctl input[type="range"] { width: 100%; }
.ds-seg { display: flex; }
.ds-seg button { flex: 1 1 auto; padding: 0 6px; white-space: nowrap; }
.ds-select { width: 100%; height: 30px; }
.ds-presets { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.ds-preset { display: flex; flex-direction: column; gap: 1px; padding: 7px 9px; border: 1px solid var(--line); border-radius: 8px; background: var(--field); color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.ds-preset:hover { border-color: #5c5c64; }
.ds-preset b { font-size: 12.5px; }
.ds-preset small { color: var(--muted); font-size: 10.5px; line-height: 1.3; }
.ds-picks { display: flex; flex-wrap: wrap; gap: 5px; }
.ds-pick { position: relative; display: grid; place-items: center; width: 24px; height: 24px; padding: 0; overflow: hidden; border: 0; border-radius: 6px; background: var(--c); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .14); cursor: pointer; }
.ds-pick[aria-pressed="true"], .ds-pick-custom.is-on { box-shadow: 0 0 0 2px var(--panel), 0 0 0 4px #fff; }
.ds-pick-auto { width: auto; padding: 0 8px; background: var(--field); color: var(--text); font: 600 11px var(--font); }
.ds-pick-custom { background: conic-gradient(from 90deg, #ff5f6d, #ffc371, #7bed9f, #70a1ff, #a29bfe, #ff5f6d); }
.ds-pick-custom.is-on { background: var(--c); }
.ds-pick-custom input { position: absolute; inset: 0; width: 100%; height: 100%; padding: 0; border: 0; opacity: 0; cursor: pointer; }
.ds-states { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.ds-state { position: relative; display: flex; align-items: center; gap: 6px; padding: 4px 6px; border: 1px solid var(--line); border-radius: 7px; background: var(--field); }
.ds-state label { display: flex; flex: 1; align-items: center; gap: 6px; min-width: 0; cursor: pointer; }
.ds-state input { flex: none; width: 20px; height: 20px; padding: 0; border: 0; border-radius: 4px; background: none; cursor: pointer; }
.ds-state span { overflow: hidden; font-size: 11.5px; text-overflow: ellipsis; white-space: nowrap; }
.ds-auto { flex: none; padding: 0 4px; border: 0; border-radius: 4px; background: #3a3a40; color: var(--muted); font: 600 9.5px var(--font); cursor: pointer; }
.ds-auto:hover { color: #fff; }
.ds-reset { align-self: flex-start; margin-top: 12px; }
.ds-fonts { margin: -6px 0 0; color: var(--muted); font-size: 12.5px; }
.ds-sec { display: flex; flex-direction: column; gap: 14px; scroll-margin-top: 12px; }
.ds-head { display: flex; flex-direction: column; gap: 4px; margin-bottom: 4px; padding-bottom: 14px; border-bottom: 1px solid var(--border); }
.ds-head h2 { font: var(--fw-head) 24px/1.2 var(--ds-font-head); letter-spacing: var(--ls-head); }
.ds-head p { max-width: 680px; color: var(--muted); font-size: 13.5px; }
.ds-sub { margin: 6px 0 0; color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.ds-grid { display: grid; gap: var(--gap); }
.ds-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ds-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ds-grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.ds-grid-main { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.ds-demo { display: flex; flex-direction: column; gap: 12px; min-width: 0; padding: calc(var(--pad) + 2px); border: var(--bw) solid var(--border); border-radius: var(--r); background: var(--surface); }
.ds-center { align-items: center; justify-content: center; }
.ds-label { color: var(--muted); font-size: 10.5px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }

/* Jetons */
.ds-tokens { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.ds-tokens-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.ds-token { display: flex; flex-direction: column; overflow: hidden; padding: 0; border: max(var(--bw), 1px) solid var(--border); border-radius: var(--r); background: var(--surface); color: var(--text); font: inherit; text-align: left; cursor: copy; }
.ds-token i { height: 64px; border-bottom: 1px solid var(--border); }
.ds-token > span { display: flex; flex-direction: column; gap: 1px; padding: 9px 11px 10px; }
.ds-token b { font-size: 13px; }
.ui .ds-token code { padding: 0; background: none; color: var(--soft-text); font: 600 11px var(--code); }
.ds-token small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ds-scale { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); overflow: hidden; border-radius: var(--r); }
.ds-scale .ds-step { display: flex; flex-direction: column; justify-content: flex-end; height: 86px; padding: 10px 12px; border: 0; font: inherit; text-align: left; cursor: copy; }
.ds-step b { font-size: 13px; }
.ds-step small { color: inherit; font: 11px var(--code); opacity: .8; }

/* Typographie */
.ds-type { display: flex; flex-direction: column; border: max(var(--bw), 1px) solid var(--border); border-radius: var(--r); background: var(--surface); }
.ds-type > div { display: grid; grid-template-columns: 210px minmax(0, 1fr); align-items: baseline; gap: 20px; padding: 16px 20px; }
.ds-type > div + div { border-top: 1px solid var(--border); }
.ds-t-display, .ds-t-h1, .ds-t-h2, .ds-t-h3 { font-family: var(--ds-font-head); letter-spacing: var(--ls-head); }
.ds-t-display { font-size: var(--fs-display); font-weight: var(--fw-head); line-height: 1.05; }
.ds-t-h1 { font-size: var(--fs-h1); font-weight: var(--fw-head); line-height: 1.15; }
.ds-t-h2 { font-size: var(--fs-h2); font-weight: max(500, calc(var(--fw-head) - 100)); line-height: 1.2; }
.ds-t-h3 { font-size: var(--fs-h3); font-weight: max(500, calc(var(--fw-head) - 100)); line-height: 1.3; }
.ds-t-body { max-width: 640px; font-size: var(--fs-body); line-height: var(--lh); }
.ds-t-small { color: var(--muted); font-size: var(--fs-small); }
.ui .ds-code { padding: 2px 6px; border-radius: 5px; background: var(--surface-2); font: 12.5px var(--code); }
.ds-kbd { margin-left: auto; padding: 0 6px; border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 5px; background: var(--surface); color: var(--muted); font: 600 10.5px var(--font); }
.ds-field { display: flex; flex-direction: column; gap: 5px; font-size: 12px; font-weight: 600; }
.ds-choices { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.ds-choices > span { display: inline-flex; align-items: center; gap: 8px; }
.ds-loaders { gap: 14px; }
.ds-ring-label { display: flex; flex-direction: column; line-height: 1.3; }
.ds-topbar { flex-direction: row; align-items: center; justify-content: space-between; gap: 24px; padding: 12px 18px; }
.ds-topbar nav { display: flex; gap: 20px; color: var(--muted); font-weight: 500; }
.ds-topbar nav .is-active { color: var(--text); font-weight: 700; box-shadow: inset 0 -2px 0 var(--primary); }

/* ----- Briques communes ----- */

.u-ico { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.u-card { padding: var(--pad); border: var(--bw) solid var(--border); border-radius: var(--r); background: var(--surface); box-shadow: var(--shadow); }
.u-card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.u-card-head b { font-family: var(--ds-font-head); font-size: 14px; }
.u-row { display: flex; align-items: center; gap: 8px; }
.u-row-wrap { flex-wrap: wrap; }
.u-row-end { justify-content: flex-end; }
.u-logo { display: inline-flex; align-items: center; gap: 8px; font: var(--fw-head) 15px var(--ds-font-head); }
.u-logo b { width: 22px; height: 22px; border-radius: 6px; background: linear-gradient(135deg, var(--primary), var(--accent)); }
.u-eyebrow { color: var(--soft-text); font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }

/* Boutons */
.u-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: var(--ctl-h); padding: 0 14px; border: var(--bw) solid transparent; border-radius: var(--btn-r); font-size: var(--fs-ui); font-weight: 600; white-space: nowrap; }
.u-btn-primary { background: var(--primary); color: var(--on-primary); box-shadow: 0 6px 16px -8px var(--primary); }
.u-btn-accent { background: var(--accent); color: var(--on-accent); }
.u-btn-ghost { border-color: var(--border); background: var(--surface); color: var(--text); }
.u-btn-soft { background: var(--soft); color: var(--soft-text); }
.u-btn-text { padding: 0 6px; color: var(--soft-text); }
.u-btn-danger { background: var(--danger); color: var(--danger-on, #fff); }
.u-btn-light { background: var(--surface); color: var(--text); }
.u-btn.is-disabled { box-shadow: none; opacity: .45; }
.u-btn-lg { height: calc(var(--ctl-h) + 8px); padding: 0 18px; font-size: calc(var(--fs-ui) + 1px); }
.u-btn-sm { height: calc(var(--ctl-h) - 6px); padding: 0 10px; font-size: calc(var(--fs-ui) - 1px); }
.u-btn-block { width: 100%; }
.u-btn-group { display: inline-flex; }
.u-btn-group .u-btn { border-radius: 0; }
.u-btn-group .u-btn + .u-btn { margin-left: -1px; }
.u-btn-group .u-btn:first-child { border-radius: var(--btn-r) 0 0 var(--btn-r); }
.u-btn-group .u-btn:last-child { border-radius: 0 var(--btn-r) var(--btn-r) 0; }
.u-btn-group .is-active { background: var(--soft); color: var(--soft-text); }
.u-split { display: inline-flex; }
.u-split .u-btn:first-child { border-radius: var(--btn-r) 0 0 var(--btn-r); }
.u-split .u-btn:last-child { padding: 0 9px; border-left: 1px solid color-mix(in oklab, var(--on-primary) 25%, transparent); border-radius: 0 var(--btn-r) var(--btn-r) 0; }
.u-link { display: inline-flex; align-items: center; gap: 4px; color: var(--soft-text) !important; font-weight: 600; }
.u-link .u-ico { width: 14px; height: 14px; }
.u-icon-circle { display: inline-grid; place-items: center; flex: none; width: 36px; height: 36px; border-radius: 10px; background: var(--soft); color: var(--soft-text); }
.u-icon-lg { width: 52px; height: 52px; border-radius: 14px; }
.u-icon-lg .u-ico { width: 24px; height: 24px; }
.u-icon-btn { position: relative; display: inline-grid; place-items: center; flex: none; width: var(--ctl-h); height: var(--ctl-h); border: max(var(--bw), 1px) solid var(--border); border-radius: var(--r-ctl); background: var(--surface); color: var(--muted); }
.u-icon-btn-sm { width: calc(var(--ctl-h) - 8px); height: calc(var(--ctl-h) - 8px); border-radius: min(6px, var(--r-ctl)); }
.u-icon-btn-primary { border-color: transparent; border-radius: 50%; background: var(--primary); color: var(--on-primary); }
.u-dot::after { content: ""; position: absolute; top: 6px; right: 7px; width: 8px; height: 8px; border: 2px solid var(--surface); border-radius: 50%; background: var(--danger); }
.u-toggle-group { display: inline-flex; padding: 3px; border-radius: 99px; background: var(--surface-2); font-size: 12px; font-weight: 600; }
.u-toggle-group > span { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 99px; color: var(--muted); }
.u-toggle-group .is-active { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }

/* Formulaires */
.u-input { display: inline-flex; align-items: center; gap: 8px; min-width: 0; height: calc(var(--ctl-h) + 2px); padding: 0 12px; border: max(var(--bw), 1px) solid var(--border); border-radius: var(--r-ctl); background: var(--surface); color: var(--muted); font-size: var(--fs-ui); font-weight: 400; }
.u-input.is-focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--soft); color: var(--text); }
.u-input.is-error { border-color: var(--danger); box-shadow: 0 0 0 3px color-mix(in oklab, var(--danger) 16%, transparent); color: var(--text); }
.u-textarea { align-items: flex-start; height: 64px; padding-top: 8px; }
.u-select { display: inline-flex; align-items: center; justify-content: space-between; gap: 8px; height: calc(var(--ctl-h) + 2px); padding: 0 10px; border: max(var(--bw), 1px) solid var(--border); border-radius: var(--r-ctl); background: var(--surface); color: var(--text); font-size: var(--fs-ui); font-weight: 500; white-space: nowrap; }
.u-help { display: inline-flex !important; align-items: center; gap: 5px; font-weight: 400; }
.u-help .u-ico { width: 13px; height: 13px; }
.u-help.is-error { color: var(--danger) !important; font-weight: 600; }
.u-input-group { display: flex; gap: 8px; }
.u-input-group .u-input { flex: 1; }
.u-check { display: inline-grid; place-items: center; flex: none; width: 17px; height: 17px; border: 1.5px solid var(--border); border-radius: min(5px, var(--r-ctl)); background: var(--surface); }
.u-check.is-on, .u-check.is-mixed { border-color: var(--primary); background: var(--primary); color: var(--on-primary); }
.u-check .u-ico { width: 12px; height: 12px; stroke-width: 3; }
.u-radio { flex: none; width: 17px; height: 17px; border: 1.5px solid var(--border); border-radius: 50%; background: var(--surface); }
.u-radio.is-on { border: 5px solid var(--primary); }
.u-switch { position: relative; flex: none; width: 32px; height: 18px; border-radius: 99px; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--border); }
.u-switch i { position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: var(--surface); box-shadow: 0 1px 3px rgba(0, 0, 0, .25); }
.u-switch.is-on { background: var(--primary); box-shadow: none; }
.u-switch.is-on i { left: 16px; }
.u-range { position: relative; display: block; height: 6px; margin: 8px 0 4px; border-radius: 99px; background: var(--surface-2); }
.u-range i { display: block; height: 100%; border-radius: inherit; background: var(--primary); }
.u-range b { position: absolute; top: 50%; width: 16px; height: 16px; border: 3px solid var(--primary); border-radius: 50%; background: var(--surface); transform: translate(-50%, -50%); }
.u-stepper { display: inline-flex; align-items: center; align-self: flex-start; overflow: hidden; border: max(var(--bw), 1px) solid var(--border); border-radius: var(--r-ctl); background: var(--surface); }
.u-stepper span { display: grid; place-items: center; width: var(--ctl-h); height: var(--ctl-h); color: var(--muted); }
.u-stepper b { min-width: 40px; border-inline: 1px solid var(--border); line-height: var(--ctl-h); text-align: center; }
.u-drop { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 14px; border: 1.5px dashed var(--border); border-radius: var(--r); color: var(--muted); }

/* Navigation */
.u-side-menu { display: flex; flex-direction: column; gap: 2px; }
.u-side-menu a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--r-ctl); color: var(--muted); font-weight: 500; }
.u-side-menu a.is-active { background: var(--soft); color: var(--soft-text); font-weight: 700; }
.u-count { margin-left: auto; padding: 1px 7px; border-radius: 99px; background: var(--primary); color: var(--on-primary); font-size: 11px; font-weight: 700; }
.u-count-soft { background: var(--soft-strong); color: var(--text); }
.u-tabs { display: inline-flex; align-self: flex-start; gap: 2px; padding: 3px; border-radius: var(--r-ctl); background: var(--surface-2); font-size: 12px; }
.u-tabs > span { padding: 3px 10px; border-radius: max(0px, calc(var(--r-ctl) - 2px)); color: var(--muted); font-weight: 600; }
.u-tabs > .is-active { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.u-tabs-line { display: flex; align-self: stretch; padding: 0; border-bottom: 1px solid var(--border); border-radius: 0; background: none; }
.u-tabs-line > span { padding: 6px 10px; border-radius: 0; }
.u-tabs-line > .is-active { background: none; box-shadow: inset 0 -2px 0 var(--primary); }
.u-crumbs { display: flex; gap: 6px; color: var(--muted); }
.u-crumbs b { color: var(--text); }
.u-pagination { display: flex; align-items: center; justify-content: space-between; }
.u-pagination > span { display: flex; gap: 4px; }
.u-pagination > span > span { display: inline-grid; place-items: center; min-width: 28px; height: 28px; border: max(var(--bw), 1px) solid var(--border); border-radius: min(6px, var(--r-ctl)); color: var(--muted); font-size: 12px; font-weight: 600; }
.u-pagination .is-active { border-color: transparent !important; background: var(--primary); color: var(--on-primary) !important; }
.u-steps { display: flex; align-items: center; gap: 6px; }
.u-steps span { display: inline-grid; place-items: center; width: 24px; height: 24px; border: 1.5px solid var(--border); border-radius: 50%; color: var(--muted); font-size: 11px; font-weight: 700; }
.u-steps span .u-ico { width: 12px; height: 12px; stroke-width: 3; }
.u-steps .is-done { border-color: var(--primary); background: var(--primary); color: var(--on-primary); }
.u-steps .is-active { border-color: var(--primary); color: var(--soft-text); }
.u-steps i { flex: 1; max-width: 40px; height: 2px; background: var(--border); }
.u-steps i.is-done { background: var(--primary); }

/* Badges, étiquettes, avatars */
.u-badge { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: var(--badge-r); font-size: 11px; font-weight: 700; }
.u-badge-solid { background: var(--primary); color: var(--on-primary); }
.u-badge-soft { background: var(--soft); color: var(--soft-text); }
.u-badge-outline { box-shadow: inset 0 0 0 1px var(--border); color: var(--muted); }
.u-badge-accent { background: var(--accent); color: var(--on-accent); }
.u-status { padding: 3px 9px; border-radius: var(--badge-r); font-size: 11.5px; font-weight: 700; }
.u-status.is-success { background: color-mix(in oklab, var(--success) 18%, var(--surface)); color: color-mix(in oklab, var(--success) 70%, var(--text)); }
.u-status.is-warning { background: color-mix(in oklab, var(--warning) 22%, var(--surface)); color: color-mix(in oklab, var(--warning) 55%, var(--text)); }
.u-status.is-danger { background: color-mix(in oklab, var(--danger) 16%, var(--surface)); color: color-mix(in oklab, var(--danger) 72%, var(--text)); }
.u-status.is-info { background: color-mix(in oklab, var(--info) 16%, var(--surface)); color: color-mix(in oklab, var(--info) 72%, var(--text)); }
.u-tag { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: min(6px, var(--r-ctl)); background: var(--surface-2); font-size: 11.5px; font-weight: 600; }
.u-tag .u-ico { width: 12px; height: 12px; }
.u-tag.is-solid { background: var(--accent); color: var(--on-accent); }
.u-chip { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border: max(var(--bw), 1px) solid var(--border); border-radius: var(--btn-r); color: var(--muted); font-size: 12px; font-weight: 600; }
.u-chip .u-ico { width: 13px; height: 13px; }
.u-chip.is-active { border-color: transparent; background: var(--primary); color: var(--on-primary); }
.u-avatar { display: inline-grid; place-items: center; flex: none; width: 32px; height: 32px; border-radius: 50%; background: var(--soft-strong); color: var(--text); font-size: 11px; font-style: normal; font-weight: 700; }
.u-avatar-lg { width: 44px; height: 44px; background: var(--primary); color: var(--on-primary); font-size: 14px; }
.u-presence { position: relative; display: inline-flex; }
.u-presence b { position: absolute; right: 0; bottom: 0; width: 10px; height: 10px; border: 2px solid var(--surface); border-radius: 50%; background: var(--success); }
.u-avatars { display: inline-flex; }
.u-avatars i { display: inline-grid; place-items: center; width: 30px; height: 30px; margin-left: -8px; border: 2px solid var(--surface); border-radius: 50%; font-size: 10px; font-style: normal; font-weight: 700; }
.u-avatars i:first-child { margin-left: 0; }
.u-avatars i:nth-child(1) { background: var(--m2); color: var(--m2-on); }
.u-avatars i:nth-child(2) { background: var(--m3); color: var(--m3-on); }
.u-avatars i:nth-child(3) { background: var(--m4); color: var(--m4-on); }
.u-avatars i:nth-child(4) { background: var(--primary); color: var(--on-primary); }
.u-who { display: flex; align-items: center; gap: 10px; }
.u-who > span, .u-quote figcaption span { display: flex; flex-direction: column; line-height: 1.3; }
.u-stars { display: inline-flex; gap: 1px; color: var(--warning); vertical-align: -2px; }
.u-stars .u-ico { width: 14px; height: 14px; fill: currentColor; stroke: none; }

/* Retours */
.u-alert { display: flex; gap: 10px; padding: 10px 12px; border: var(--bw) solid transparent; border-radius: var(--r); font-size: 12.5px; }
.u-alert b { display: block; }
.u-alert.is-info { border-color: color-mix(in oklab, var(--info) 30%, transparent); background: color-mix(in oklab, var(--info) 12%, var(--surface)); }
.u-alert.is-info > .u-ico { color: var(--info); }
.u-alert.is-success { border-color: color-mix(in oklab, var(--success) 30%, transparent); background: color-mix(in oklab, var(--success) 12%, var(--surface)); }
.u-alert.is-success > .u-ico { color: var(--success); }
.u-alert.is-warning { border-color: color-mix(in oklab, var(--warning) 40%, transparent); background: color-mix(in oklab, var(--warning) 14%, var(--surface)); }
.u-alert.is-warning > .u-ico { color: color-mix(in oklab, var(--warning) 75%, var(--text)); }
.u-alert.is-danger { border-color: color-mix(in oklab, var(--danger) 30%, transparent); background: color-mix(in oklab, var(--danger) 11%, var(--surface)); }
.u-alert.is-danger > .u-ico { color: var(--danger); }
.u-toast { display: inline-flex; align-items: center; align-self: flex-start; gap: 10px; padding: 9px 12px; border-radius: var(--r-ctl); background: var(--text); color: var(--surface); font-size: 12.5px; box-shadow: var(--shadow); }
.u-toast .u-link { color: inherit !important; text-decoration: underline; }
.u-toast.is-danger { background: var(--danger); color: var(--danger-on, #fff); }
.u-tooltip-demo { position: relative; align-self: flex-start; padding-top: 38px; }
.u-tooltip { position: absolute; top: 0; left: 50%; padding: 5px 9px; border-radius: 6px; background: var(--text); color: var(--surface); font-size: 11.5px; white-space: nowrap; transform: translateX(-50%); }
.u-tooltip::after { content: ""; position: absolute; top: 100%; left: 50%; border: 5px solid transparent; border-top-color: var(--text); transform: translateX(-50%); }
.u-progress-list { display: flex; flex-direction: column; gap: 10px; }
.u-progress-list > div { display: grid; grid-template-columns: 1fr auto; gap: 4px; font-size: 12.5px; }
.u-progress { grid-column: 1 / -1; height: 7px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.u-progress i { display: block; height: 100%; border-radius: inherit; background: var(--primary); }
.u-progress-accent i { background: var(--accent); }
.u-ring { width: 48px; height: 48px; }
.u-spinner { display: inline-block; flex: none; width: 18px; height: 18px; border: 2.5px solid var(--soft-strong); border-top-color: var(--primary); border-radius: 50%; animation: u-spin .8s linear infinite; }
.u-btn .u-spinner { width: 14px; height: 14px; border-color: color-mix(in oklab, var(--on-primary) 35%, transparent); border-top-color: var(--on-primary); }
@keyframes u-spin { to { transform: rotate(360deg); } }
.u-skeleton { display: flex; align-items: center; gap: 10px; }
.u-skeleton > i { flex: none; width: 36px; height: 36px; border-radius: 50%; background: var(--surface-2); }
.u-skeleton span { display: flex; flex: 1; flex-direction: column; gap: 6px; }
.u-skeleton span i { height: 9px; border-radius: 6px; background: var(--surface-2); }
.u-skeleton span i:last-child { width: 60%; }
.u-empty { display: flex; flex: 1; flex-direction: column; align-items: center; justify-content: center; gap: 8px; text-align: center; }
.u-empty p { max-width: 300px; color: var(--muted); }

/* Cartes */
.u-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--gap); }
.u-kpi { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 2px 8px; }
.u-kpi > span:first-child { grid-column: 1 / -1; color: var(--muted); font-size: 12px; }
.u-kpi > b { font: var(--fw-head) 22px var(--ds-font-head); }
.u-delta { display: inline-flex; align-items: center; gap: 2px; padding: 2px 8px; border-radius: 99px; font-size: 11.5px; font-weight: 700; }
.u-delta .u-ico { width: 13px; height: 13px; stroke-width: 2.6; }
.u-delta.is-up { background: color-mix(in oklab, var(--success) 16%, var(--surface)); color: color-mix(in oklab, var(--success) 70%, var(--text)); }
.u-delta.is-down { background: color-mix(in oklab, var(--danger) 14%, var(--surface)); color: color-mix(in oklab, var(--danger) 72%, var(--text)); }
.u-spark { grid-column: 1 / -1; width: 100%; height: 34px; margin-top: 6px; }
.u-feature, .u-plan, .u-media { display: flex; flex-direction: column; gap: 8px; }
.u-feature h3, .u-media h3 { margin-top: 6px; font: max(500, calc(var(--fw-head) - 100)) 15px var(--ds-font-head); }
.u-feature p, .u-media p { color: var(--muted); }
.u-feature .u-link { margin-top: auto; }
.u-plan { position: relative; border: max(2px, var(--bw)) solid var(--primary); }
.u-plan h3 { font: max(500, calc(var(--fw-head) - 100)) 15px var(--ds-font-head); }
.u-plan ul { display: flex; flex-direction: column; gap: 6px; flex: 1; padding: 0; list-style: none; color: var(--muted); }
.u-plan li { display: flex; align-items: center; gap: 8px; }
.u-plan li .u-ico { color: var(--primary); }
.u-corner { position: absolute; top: -11px; right: 16px; }
.u-price { color: var(--muted); }
.u-price b { color: var(--text); font: var(--fw-head) 28px var(--ds-font-head); }
.u-media-img { height: 92px; margin: -16px -16px 4px; border-radius: var(--r) var(--r) 0 0; background: linear-gradient(135deg, var(--m2), var(--primary) 55%, var(--accent)); }
.u-media .u-badge { align-self: flex-start; }
.u-media .u-who { margin-top: auto; }
.u-quote { display: flex; flex-direction: column; gap: 10px; }
.u-quote blockquote { flex: 1; font-size: 15px; font-style: italic; }
.u-quote figcaption { display: flex; align-items: center; gap: 10px; }

/* Données */
.u-chart { display: block; width: 100%; height: 170px; }
.u-chart-sm { height: 120px; margin-bottom: 14px; }
.u-legend { display: flex; gap: 14px; margin-bottom: 6px; color: var(--muted); font-size: 12px; }
.u-legend span { display: inline-flex; align-items: center; gap: 6px; }
.u-legend i { width: 10px; height: 10px; border-radius: 3px; }
.u-legend .is-primary { background: var(--primary); }
.u-legend .is-accent { background: var(--accent); }
.u-axis { display: flex; justify-content: space-between; padding: 6px 4px 0; color: var(--muted); font-size: 11px; }
.u-donut-wrap { position: relative; width: 150px; height: 150px; margin: 4px auto 14px; }
.u-donut { width: 100%; height: 100%; }
.u-donut-label { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.u-donut-label b { font-size: 20px; font-weight: 800; }
.u-legend-list { display: flex; flex-direction: column; gap: 8px; padding: 0; list-style: none; font-size: 12.5px; }
.u-legend-list li { display: flex; align-items: center; gap: 8px; }
.u-legend-list i { width: 10px; height: 10px; border-radius: 50%; }
.u-legend-list b { margin-left: auto; }
.u-table { width: 100%; border-collapse: collapse; }
.u-table th { padding: 8px; border-bottom: 1px solid var(--border); color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .04em; text-align: left; text-transform: uppercase; }
.u-table td { padding: 10px 8px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.u-table tr:last-child td { border-bottom: 0; }
.u-table td:last-child { color: var(--muted); }
.u-timeline { display: flex; flex-direction: column; gap: 10px; padding: 0; list-style: none; font-size: 12.5px; }
.u-timeline li { display: flex; gap: 10px; }
.u-timeline li > i { flex: none; width: 10px; height: 10px; margin-top: 4px; border: 3px solid var(--soft-strong); border-radius: 50%; background: var(--primary); box-sizing: content-box; }
.u-cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; font-size: 12px; text-align: center; }
.u-cal small { padding-bottom: 2px; font-weight: 700; }
.u-cal span { display: grid; place-items: center; height: 26px; border-radius: 6px; }
.u-cal .is-range { border-radius: 0; background: var(--soft); color: var(--soft-text); }
.u-cal .is-today { box-shadow: inset 0 0 0 1.5px var(--primary); font-weight: 700; }
.u-cal .is-sel { border-radius: 6px; background: var(--primary); color: var(--on-primary); font-weight: 700; }

/* Superpositions */
.u-menu { display: flex; flex-direction: column; min-width: 200px; padding: 6px; border: var(--bw) solid var(--border); border-radius: var(--r); background: var(--surface); box-shadow: var(--shadow); font-size: 12.5px; }
.u-menu span { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-radius: 6px; }
.u-menu .is-active { background: var(--soft); color: var(--soft-text); }
.u-menu hr { width: 100%; height: 1px; margin: 4px 0; border: 0; background: var(--border); }
.u-menu .u-danger { color: var(--danger); font-weight: 700; }
.u-modal-demo { display: grid; place-items: center; padding: 24px; border-radius: var(--r); background: color-mix(in oklab, var(--m6) 55%, transparent); }
.u-modal { display: flex; flex-direction: column; gap: 12px; width: min(380px, 100%); padding: calc(var(--pad) + 2px); border-radius: calc(var(--r) + 2px); background: var(--surface); box-shadow: var(--shadow); }
.u-modal p { color: var(--muted); }

/* ----- Utilitaires de mise en page ----- */
.u-row-between { justify-content: space-between; }
.u-center { justify-content: center; text-align: center; }
.u-grow { flex: 1; }
.u-divider { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 11.5px; }
.u-divider::before, .u-divider::after { flex: 1; height: 1px; background: var(--border); content: ""; }
.u-img { position: relative; overflow: hidden; background: linear-gradient(135deg, var(--m2), var(--primary) 60%, var(--accent)); }
.u-img-1 { background: linear-gradient(135deg, var(--m2), var(--primary) 60%, var(--accent)); }
.u-img-2 { background: linear-gradient(160deg, var(--accent), var(--m4)); }
.u-img-3 { background: radial-gradient(circle at 30% 30%, var(--m1), var(--m3) 60%, var(--m5)); }
.u-img-4 { background: linear-gradient(200deg, var(--m5), var(--m6)); }
.u-img::after { position: absolute; right: -12%; bottom: -30%; width: 60%; aspect-ratio: 1; border-radius: 50%; background: color-mix(in oklab, #fff 14%, transparent); content: ""; }
.u-icon-success { background: color-mix(in oklab, var(--success) 18%, var(--surface)); color: var(--success); }
.u-icon-warning { background: color-mix(in oklab, var(--warning) 22%, var(--surface)); color: color-mix(in oklab, var(--warning) 70%, var(--text)); }
.u-avatar-xl { width: 72px; height: 72px; background: var(--primary); color: var(--on-primary); font-size: 20px; }
.u-badge-light { background: color-mix(in oklab, var(--surface) 85%, transparent); color: var(--text); }
.u-select-sm { height: calc(var(--ctl-h) - 6px); font-size: 12px; }
.u-chip.is-disabled { opacity: .4; text-decoration: line-through; }
.u-help.is-success { color: var(--success) !important; font-weight: 600; }

/* ----- Formulaires avancés ----- */
.u-input-end { display: inline-flex; margin-left: auto; color: var(--muted); }
.u-input-addon { padding: 0; overflow: hidden; }
.u-input-addon > :not(.u-addon) { padding: 0 10px; }
.u-addon { display: inline-flex; align-items: center; gap: 4px; align-self: stretch; padding: 0 10px; border-right: max(var(--bw), 1px) solid var(--border); background: var(--surface-2); color: var(--muted); font-size: 12px; font-weight: 600; white-space: nowrap; }
.u-addon-end { margin-left: auto; border-right: 0; border-left: max(var(--bw), 1px) solid var(--border); }
.u-input-addon { gap: 10px; }
.u-listbox { display: flex; flex-direction: column; padding: 4px; border: max(var(--bw), 1px) solid var(--border); border-radius: var(--r-ctl); background: var(--surface); box-shadow: var(--shadow); }
.u-listbox > span { display: flex; justify-content: space-between; gap: 10px; padding: 6px 8px; border-radius: max(0px, calc(var(--r-ctl) - 2px)); color: var(--muted); }
.u-listbox > span b { color: var(--text); }
.u-listbox .is-active { background: var(--soft); color: var(--soft-text); }
.u-tags-input { flex-wrap: wrap; height: auto; min-height: calc(var(--ctl-h) + 2px); padding: 4px 10px; }
.u-tags-input .u-ico:last-child { margin-left: auto; }
.u-otp { display: flex; gap: 8px; }
.u-otp span { display: grid; place-items: center; width: calc(var(--ctl-h) + 6px); height: calc(var(--ctl-h) + 10px); border: max(var(--bw), 1px) solid var(--border); border-radius: var(--r-ctl); background: var(--surface); font: var(--fw-head) 20px var(--ds-font-head); }
.u-otp .is-focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--soft); }
.u-otp .is-focus::after { width: 2px; height: 22px; background: var(--primary); content: ""; animation: u-blink 1s steps(2) infinite; }
@keyframes u-blink { 50% { opacity: 0; } }
.u-strength { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.u-strength i { height: 5px; border-radius: 99px; background: var(--surface-2); }
.u-strength .is-on { background: var(--success); }
.u-rating { display: inline-flex; gap: 2px; color: var(--warning); }
.u-rating .u-ico { width: 22px; height: 22px; fill: currentColor; stroke: none; }
.u-rating .is-off { display: inline-flex; color: var(--surface-2); }
.u-swatch-pick { display: flex; flex-wrap: wrap; gap: 8px; }
.u-swatch-pick i { width: 28px; height: 28px; border-radius: 50%; background: var(--c); box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--text) 12%, transparent); }
.u-swatch-pick .is-on { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--text); }
.u-file { display: flex; align-items: center; gap: 10px; padding: 10px; border: max(var(--bw), 1px) solid var(--border); border-radius: var(--r-ctl); }
.u-file-body { display: flex; flex: 1; flex-direction: column; gap: 4px; min-width: 0; line-height: 1.3; }
.u-file-ok { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--success); color: var(--success-on); }
.u-file-ok .u-ico { width: 13px; height: 13px; stroke-width: 3; }
.u-select.is-open { border-color: var(--primary); box-shadow: 0 0 0 3px var(--soft); }
.u-popover-panel { padding: 10px; border: max(var(--bw), 1px) solid var(--border); border-radius: var(--r); background: var(--surface); box-shadow: var(--shadow); }
.u-segmented { display: flex; padding: 3px; border-radius: var(--r-ctl); background: var(--surface-2); }
.u-segmented > span { display: inline-flex; flex: 1; align-items: center; justify-content: center; gap: 6px; padding: 5px 8px; border-radius: max(0px, calc(var(--r-ctl) - 2px)); color: var(--muted); font-size: 12px; font-weight: 600; }
.u-segmented .is-active { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.u-range-dual i { position: absolute; top: 0; height: 100%; }
.u-range-dual { background: var(--surface-2); }

/* ----- Contenu ----- */
.u-accordion { display: flex; flex-direction: column; }
.u-accordion details { border-bottom: 1px solid var(--border); }
.u-accordion summary { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 0; font-weight: 600; list-style: none; cursor: pointer; }
.u-accordion summary::-webkit-details-marker { display: none; }
.u-accordion details[open] summary .u-ico { transform: rotate(180deg); }
.u-accordion details p { padding-bottom: 12px; color: var(--muted); }
.u-carousel { display: flex; align-items: flex-end; min-height: 190px; padding: 18px; border-radius: var(--r); color: #fff; }
.u-carousel-cap { position: relative; z-index: 1; display: flex; flex-direction: column; }
.u-carousel-cap b { font: var(--fw-head) 18px var(--ds-font-head); }
.u-carousel-cap small { color: rgba(255, 255, 255, .85) !important; }
.u-carousel-nav { position: absolute; top: 50%; z-index: 1; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--surface); color: var(--text); box-shadow: var(--shadow); transform: translateY(-50%); }
.u-carousel-nav.is-prev { left: 12px; }
.u-carousel-nav.is-next { right: 12px; }
.u-dots { position: absolute; right: 18px; bottom: 18px; z-index: 1; display: flex; gap: 5px; }
.u-dots i { width: 7px; height: 7px; border-radius: 99px; background: rgba(255, 255, 255, .55); }
.u-dots .is-on { width: 20px; background: #fff; }
.u-gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.u-gallery .u-img { aspect-ratio: 4 / 3; border-radius: max(4px, calc(var(--r) - 4px)); }
.u-gallery .u-more { display: grid; place-items: center; color: #fff; font: var(--fw-head) 18px var(--ds-font-head); }
.u-gallery .u-more::before { position: absolute; inset: 0; background: rgba(0, 0, 0, .45); content: ""; }
.u-gallery .u-more { z-index: 0; }
.u-video { display: grid; place-items: center; min-height: 170px; border-radius: var(--r); }
.u-play { z-index: 1; display: grid; place-items: center; width: 54px; height: 54px; border-radius: 50%; background: color-mix(in oklab, var(--surface) 92%, transparent); color: var(--text); box-shadow: var(--shadow); }
.u-play .u-ico { width: 22px; height: 22px; margin-left: 3px; fill: currentColor; }
.u-player { position: absolute; right: 10px; bottom: 10px; left: 10px; z-index: 1; display: flex; align-items: center; gap: 10px; padding: 6px 10px; border-radius: var(--r-ctl); background: rgba(0, 0, 0, .55); color: #fff; }
.u-player .u-progress { flex: 1; background: rgba(255, 255, 255, .3); }
.u-player small { color: rgba(255, 255, 255, .85) !important; }
.u-audio { display: flex; align-items: center; gap: 12px; padding: 10px; border: max(var(--bw), 1px) solid var(--border); border-radius: var(--r); }
.u-audio .u-icon-btn .u-ico { fill: currentColor; }
.u-audio-body { display: flex; flex: 1; flex-direction: column; gap: 6px; min-width: 0; }
.u-wave { display: flex; align-items: center; gap: 2px; height: 22px; }
.u-wave i { flex: 1; height: 40%; border-radius: 2px; background: var(--soft-strong); }
.u-wave i:nth-child(3n) { height: 85%; }
.u-wave i:nth-child(4n) { height: 60%; }
.u-wave i:nth-child(5n) { height: 100%; }
.u-wave i:nth-child(-n + 12) { background: var(--primary); }
.u-blockquote { padding: 4px 0 4px 16px; border-left: 3px solid var(--primary); font: italic 16px/1.5 var(--ds-font-head); }
.u-blockquote small { margin-top: 6px; font-style: normal; }
.ui .u-code { margin: 0; overflow: hidden; border-radius: var(--r-ctl); background: var(--m6); color: var(--m1); font: 12px/1.6 var(--code); }
.ui.is-dark .u-code { background: color-mix(in oklab, var(--m6) 60%, #000); }
.u-code-head { display: flex; align-items: center; justify-content: space-between; padding: 6px 12px; border-bottom: 1px solid color-mix(in oklab, var(--m1) 15%, transparent); }
.u-code-head small { color: inherit !important; opacity: .7; }
.ui .u-code code { display: block; padding: 10px 12px; background: none; color: inherit; white-space: pre; }
.u-lists { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.u-list-check { display: flex; flex-direction: column; gap: 6px; padding: 0; list-style: none; }
.u-list-check li { display: flex; align-items: center; gap: 8px; }
.u-list-check .u-ico { color: var(--success); stroke-width: 2.6; }
.u-toc { display: flex; flex-direction: column; gap: 2px; margin: 0; padding: 0 0 0 12px; border-left: 2px solid var(--border); color: var(--muted); list-style: none; }
.u-toc li { margin-left: -14px; padding: 3px 0 3px 12px; border-left: 2px solid transparent; }
.u-toc .is-active { border-left-color: var(--primary); color: var(--text); font-weight: 600; }
.u-dl { display: grid; grid-column: 1 / -1; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 0; }
.u-dl dt { color: var(--muted); }
.u-dl dd { margin: 0; font-weight: 600; }

/* ----- Sections de site ----- */
.u-site { overflow: hidden; border: max(var(--bw), 1px) solid var(--border); border-radius: calc(var(--r) + 4px); background: var(--bg); }
.u-announce { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 8px 16px; background: var(--primary); color: var(--on-primary); font-size: 12.5px; font-weight: 600; }
.u-announce .u-link { color: var(--on-primary) !important; text-decoration: underline; }
.u-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 14px 28px; border-bottom: 1px solid var(--border); background: var(--surface); }
.u-header nav { display: flex; gap: 20px; color: var(--muted); font-weight: 500; }
.u-header nav a { display: inline-flex; align-items: center; gap: 3px; }
.u-header nav .is-active { color: var(--text); font-weight: 700; }
.u-burger { display: none; }
.u-hero { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); align-items: center; gap: 32px; padding: 44px 28px; }
.u-hero-text { display: flex; flex-direction: column; align-items: flex-start; gap: 14px; }
.u-hero-title { font: var(--fw-head) var(--fs-h1)/1.12 var(--ds-font-head); letter-spacing: var(--ls-head); }
.u-hero-text > p { max-width: 520px; color: var(--muted); font-size: var(--fs-body); }
.u-proof { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 10px; color: var(--muted); font-size: 12.5px; }
.u-hero-img { display: flex; align-items: flex-end; min-height: 250px; padding: 18px; border-radius: calc(var(--r) + 6px); }
.u-hero-card { position: relative; z-index: 1; display: flex; align-items: center; gap: 10px; padding: 10px 14px; }
.u-hero-card > span:last-child { display: flex; flex-direction: column; line-height: 1.3; }
.u-logos { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 30px; padding: 18px 28px; border-block: 1px solid var(--border); background: var(--surface); }
.u-logos span { color: var(--muted); font: 800 16px var(--ds-font-head); letter-spacing: .04em; opacity: .75; }
.u-block { display: flex; flex-direction: column; gap: 18px; padding: 40px 28px; }
.u-block-head { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.u-block-head h3 { font: var(--fw-head) var(--fs-h2)/1.2 var(--ds-font-head); letter-spacing: var(--ls-head); }
.u-block-head p { color: var(--muted); }
.u-feature-plain { display: flex; flex-direction: column; gap: 8px; }
.u-feature-plain h4, .u-plan-card h4 { margin: 4px 0 0; font: max(500, calc(var(--fw-head) - 100)) 16px var(--ds-font-head); }
.u-feature-plain p { color: var(--muted); }
.u-stats-band { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; padding: 26px 28px; background: var(--primary); color: var(--on-primary); text-align: center; }
.u-stats-band b { display: block; font: var(--fw-head) 28px var(--ds-font-head); }
.u-stats-band span { opacity: .82; }
.u-plan-card { position: relative; display: flex; flex-direction: column; gap: 10px; }
.u-plan-card.is-featured { border: max(2px, var(--bw)) solid var(--primary); }
.u-plan-card > p:not(.u-price) { color: var(--muted); }
.u-plan-card ul { display: flex; flex: 1; flex-direction: column; gap: 6px; margin: 0; padding: 0; list-style: none; color: var(--muted); }
.u-plan-card li { display: flex; align-items: center; gap: 8px; }
.u-plan-card li .u-ico { color: var(--primary); }
.u-compare { border: max(var(--bw), 1px) solid var(--border); border-radius: var(--r); background: var(--surface); }
.u-compare th, .u-compare td { text-align: center; }
.u-compare th:first-child, .u-compare td:first-child { text-align: left; }
.u-compare .is-featured { background: var(--soft); color: var(--soft-text); font-weight: 700; }
.u-compare .u-ico { color: var(--primary); stroke-width: 2.6; }
.u-no { color: var(--muted); }
.u-member { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; }
.u-member .u-avatar { margin-bottom: 6px; }
.u-cta-band { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px; margin: 0 28px 40px; padding: 28px; border-radius: calc(var(--r) + 4px); background: linear-gradient(120deg, var(--primary), var(--accent)); color: var(--on-primary); }
.u-cta-band h3 { font: var(--fw-head) 20px var(--ds-font-head); }
.u-cta-band p { opacity: .85; }
.u-cta-band .u-input { min-width: 220px; border-color: transparent; }
.u-footer { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 24px; padding: 30px 28px 16px; border-top: 1px solid var(--border); background: var(--surface); }
.u-footer > div { display: flex; flex-direction: column; gap: 8px; }
.u-footer p, .u-footer a { color: var(--muted); }
.u-footer-bottom { display: flex !important; grid-column: 1 / -1; justify-content: space-between; gap: 12px; padding-top: 14px; border-top: 1px solid var(--border); }
.u-cookie { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 16px; padding: 14px 16px; border: max(var(--bw), 1px) solid var(--border); border-radius: var(--r); background: var(--surface); box-shadow: var(--shadow); }
.u-cookie p { flex: 1; min-width: 220px; }
.u-cookie > .u-ico { color: var(--primary); }

/* ----- E-commerce ----- */
.u-product { display: flex; flex-direction: column; gap: 4px; }
.u-product-img { aspect-ratio: 4 / 3; margin: calc(var(--pad) * -1) calc(var(--pad) * -1) 8px; border-radius: var(--r) var(--r) 0 0; }
.u-product-img .u-badge { position: absolute; top: 10px; left: 10px; z-index: 1; }
.u-fav { position: absolute; top: 10px; right: 10px; z-index: 1; }
.u-fav.is-on { color: var(--danger); }
.u-fav.is-on .u-ico { fill: currentColor; }
.u-product > b { font: max(500, calc(var(--fw-head) - 100)) 14.5px var(--ds-font-head); }
.u-price-row { display: flex; align-items: baseline; gap: 8px; margin-top: 6px; }
.u-price-row > b { font: var(--fw-head) 17px var(--ds-font-head); }
.u-price-row s, .u-price s { color: var(--muted); font-size: 12.5px; }
.u-price-row > :last-child { margin-left: auto; align-self: center; }
.u-pdp { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; }
.u-pdp-media { display: flex; flex-direction: column; gap: 8px; }
.u-pdp-main { aspect-ratio: 1; border-radius: var(--r); }
.u-pdp-thumbs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.u-pdp-thumbs i { aspect-ratio: 1; border-radius: max(4px, calc(var(--r) - 4px)); }
.u-pdp-thumbs .is-on { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--primary); }
.u-pdp-info { display: flex; flex-direction: column; gap: 10px; }
.u-pdp-title { font: var(--fw-head) var(--fs-h2)/1.2 var(--ds-font-head); letter-spacing: var(--ls-head); }
.u-cart { display: flex; flex-direction: column; gap: 12px; }
.u-cart-line { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto auto; align-items: center; gap: 10px; padding-bottom: 10px; border-bottom: 1px solid var(--border); }
.u-cart-line i { width: 48px; height: 48px; border-radius: var(--r-ctl); }
.u-cart-line > span:nth-child(2) { display: flex; flex-direction: column; line-height: 1.3; }
.u-qty { color: var(--muted); }
.u-summary { display: grid; grid-template-columns: 1fr auto; gap: 6px; margin: 0; }
.u-summary dt { color: var(--muted); }
.u-summary dd { margin: 0; text-align: right; }
.u-summary .is-total { padding-top: 8px; border-top: 1px solid var(--border); color: var(--text); font: var(--fw-head) 16px var(--ds-font-head); }
.u-summary .is-success { color: var(--success); font-weight: 700; }
.u-checkout { display: flex; flex-direction: column; gap: 10px; }
.u-reviews { display: grid; grid-template-columns: auto 1fr; gap: 18px; align-items: center; }
.u-reviews-sum { display: flex; flex-direction: column; align-items: center; }
.u-reviews-sum b { font: var(--fw-head) 36px var(--ds-font-head); }
.u-reviews-bars { display: grid; grid-template-columns: auto 1fr 40px; align-items: center; gap: 4px 8px; font-size: 12px; }
.u-reviews-bars .u-progress { grid-column: auto; }
.u-reviews-bars .u-progress i { background: var(--warning); }
.u-review { display: flex; flex-direction: column; gap: 6px; padding-top: 12px; border-top: 1px solid var(--border); }

/* ----- Communication ----- */
.u-chat, .u-notifs, .u-comments { display: flex; flex-direction: column; gap: 10px; }
.u-chat-head { display: flex; align-items: center; gap: 10px; padding-bottom: 10px; border-bottom: 1px solid var(--border); }
.u-chat-head > span:nth-child(2) { display: flex; flex: 1; flex-direction: column; line-height: 1.3; }
.u-chat-body { display: flex; flex: 1; flex-direction: column; gap: 6px; }
.u-chat-day { align-self: center; }
.u-bubble { align-self: flex-start; max-width: 82%; padding: 8px 12px; border-radius: calc(var(--r) + 2px) calc(var(--r) + 2px) calc(var(--r) + 2px) 4px; background: var(--surface-2); }
.u-bubble small { margin-top: 2px; font-size: 10.5px; }
.u-bubble.is-me { align-self: flex-end; border-radius: calc(var(--r) + 2px) calc(var(--r) + 2px) 4px calc(var(--r) + 2px); background: var(--primary); color: var(--on-primary); }
.u-bubble-file { display: flex; align-items: center; gap: 8px; }
.u-bubble-file > span { display: flex; flex-direction: column; line-height: 1.3; }
.u-bubble.is-me small { color: inherit !important; opacity: .8; }
.u-typing { display: flex; gap: 4px; align-self: flex-start; padding: 10px 12px; border-radius: 99px; background: var(--surface-2); }
.u-typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); animation: u-bounce 1.2s infinite; }
.u-typing i:nth-child(2) { animation-delay: .15s; }
.u-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes u-bounce { 0%, 60%, 100% { transform: none; } 30% { transform: translateY(-4px); } }
.u-chat-input { display: flex; align-items: center; gap: 8px; }
.u-chat-input .u-input { flex: 1; }
.u-notif { display: flex; align-items: flex-start; gap: 10px; padding: 8px; border-radius: var(--r-ctl); }
.u-notif > span:last-child { display: flex; flex-direction: column; line-height: 1.4; }
.u-notif.is-unread { position: relative; background: var(--soft); }
.u-notif.is-unread::after { position: absolute; top: 12px; right: 10px; width: 8px; height: 8px; border-radius: 50%; background: var(--primary); content: ""; }
.u-comment { display: flex; gap: 10px; }
.u-comment > div { display: flex; flex: 1; flex-direction: column; gap: 4px; min-width: 0; }
.u-comment-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.u-comment-meta small { display: inline; }
.u-comment-actions { display: flex; gap: 14px; color: var(--muted); font-size: 12px; font-weight: 600; }
.u-comment-actions a { display: inline-flex; align-items: center; gap: 4px; }
.u-comment-actions .u-ico { width: 14px; height: 14px; }
.u-comment.is-reply { margin-top: 8px; padding-left: 12px; border-left: 2px solid var(--border); }

/* ----- Organisation ----- */
.u-kanban { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gap); }
.u-kanban-col { display: flex; flex-direction: column; gap: 8px; padding: 10px; border-radius: var(--r); background: var(--surface-2); }
.u-kanban-head { display: flex; align-items: center; gap: 8px; padding: 2px 4px; }
.u-kanban-head .u-icon-btn { margin-left: auto; }
.u-kanban-head .u-count { margin-left: 0; }
.u-task { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding: calc(var(--pad) - 4px); }
.u-task .u-progress { align-self: stretch; }
.u-task-foot { display: flex; align-items: center; justify-content: space-between; align-self: stretch; }
.u-task-foot small { display: inline-flex; align-items: center; gap: 4px; }
.u-task-foot .u-ico { width: 13px; height: 13px; }
.u-list { display: flex; flex-direction: column; }
.u-list-item { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.u-list-item:last-child { border-bottom: 0; }
.u-list-item > span:nth-child(2) { display: flex; flex: 1; flex-direction: column; min-width: 0; line-height: 1.35; }
.u-list-item > .u-ico, .u-list-item > .u-icon-btn, .u-list-item > .u-count { flex: none; color: var(--muted); }
.u-tree, .u-tree ul { margin: 0; padding: 0; list-style: none; }
.u-tree ul { padding-left: 18px; }
.u-tree li { padding: 3px 6px; border-radius: max(0px, calc(var(--r-ctl) - 2px)); }
.u-tree li .u-ico { width: 15px; height: 15px; margin-right: 4px; color: var(--muted); vertical-align: -3px; }
.u-tree li.is-active { background: var(--soft); color: var(--soft-text); font-weight: 600; }
.u-settings { display: flex; flex-direction: column; }
.u-setting { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.u-setting:last-child { border-bottom: 0; }
.u-setting > span:first-child { display: flex; flex-direction: column; line-height: 1.35; }
.u-setting.is-danger b { color: var(--danger); }

/* ----- Mobile ----- */
.u-phones { display: flex; flex-wrap: wrap; justify-content: center; gap: 28px; }
.u-phone { position: relative; display: flex; flex-direction: column; width: 270px; height: 540px; overflow: hidden; border: 9px solid #111; border-radius: 38px; background: var(--bg); box-shadow: 0 20px 40px -24px rgba(0, 0, 0, .6); }
.u-phone-bar { display: flex; justify-content: space-between; padding: 8px 18px 4px; font-size: 11px; font-weight: 700; }
.u-app-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 14px; }
.u-app-top b { font: var(--fw-head) 16px var(--ds-font-head); }
.u-app-body { display: flex; flex: 1; flex-direction: column; gap: 4px; padding: 0 14px; overflow: hidden; }
.u-app-hero { display: flex; flex-direction: column; justify-content: flex-end; min-height: 110px; margin-bottom: 6px; padding: 14px; border-radius: var(--r); color: #fff; }
.u-app-hero b { position: relative; z-index: 1; font: var(--fw-head) 17px var(--ds-font-head); }
.u-app-hero small { position: relative; z-index: 1; color: rgba(255, 255, 255, .85) !important; }
.u-tabbar { display: grid; grid-template-columns: repeat(4, 1fr); padding: 8px 6px 14px; border-top: 1px solid var(--border); background: var(--surface); }
.u-tabbar > span { position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px; color: var(--muted); font-size: 10.5px; font-weight: 600; }
.u-tabbar .is-active { color: var(--primary); }
.u-tab-badge i { position: absolute; top: -4px; right: 18px; display: grid; place-items: center; min-width: 16px; height: 16px; border-radius: 99px; background: var(--danger); color: var(--danger-on); font-size: 9.5px; font-style: normal; }
.u-mobile-menu { display: flex; flex-direction: column; padding: 6px 14px; }
.u-mobile-menu a { display: flex; align-items: center; justify-content: space-between; padding: 14px 4px; border-bottom: 1px solid var(--border); font: max(500, calc(var(--fw-head) - 100)) 17px var(--ds-font-head); }
.u-mobile-menu a .u-ico { color: var(--muted); }
.u-mobile-menu .is-active { color: var(--primary); }
.u-mobile-menu-foot { display: flex; flex-direction: column; gap: 8px; margin-top: auto; padding: 14px; }
.u-app-dim { opacity: .45; }
.u-sheet { position: absolute; right: 0; bottom: 0; left: 0; display: flex; flex-direction: column; gap: 12px; padding: 10px 16px 18px; border-radius: calc(var(--r) + 10px) calc(var(--r) + 10px) 0 0; background: var(--surface); box-shadow: 0 -12px 30px rgba(0, 0, 0, .25); }
.u-sheet-handle { align-self: center; width: 40px; height: 4px; border-radius: 99px; background: var(--border); }
.u-sheet b { font: var(--fw-head) 16px var(--ds-font-head); }
.u-sheet-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; text-align: center; }
.u-sheet-grid > span { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 11px; font-weight: 600; }

/* ----- Pages types ----- */
.u-auth, .u-error-page, .u-onboarding { display: flex; flex-direction: column; gap: 12px; }
.u-auth h3, .u-error-page h3 { font: var(--fw-head) var(--fs-h3)/1.2 var(--ds-font-head); letter-spacing: var(--ls-head); }
.u-auth > p, .u-error-page > p { margin-top: -6px; color: var(--muted); }
.u-auth small.u-center { display: block; }
.u-error-page { align-items: center; text-align: center; }
.u-error-art { display: grid; place-items: center; width: 150px; height: 150px; border-radius: 50%; }
.u-error-art b { position: relative; z-index: 1; color: #fff; font: var(--fw-head) 40px var(--ds-font-head); }
.u-check-item { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: var(--r-ctl); }
.u-check-item > span:nth-child(2) { display: flex; flex: 1; flex-direction: column; line-height: 1.35; }
.u-check-item.is-done b { color: var(--muted); text-decoration: line-through; }
.u-check-item.is-current { background: var(--soft); }

/* ----- Superpositions supplémentaires ----- */
.u-command { display: flex; flex-direction: column; width: 100%; max-width: 340px; padding: 6px; border: max(var(--bw), 1px) solid var(--border); border-radius: var(--r); background: var(--surface); box-shadow: var(--shadow); font-size: 12.5px; }
.u-command > span { display: flex; align-items: center; gap: 8px; padding: 7px 8px; border-radius: max(0px, calc(var(--r-ctl) - 2px)); }
.u-command > span .ds-kbd { margin-left: auto; }
.u-command .is-active { background: var(--soft); color: var(--soft-text); }
.u-command-input { margin-bottom: 4px; padding: 9px 8px !important; border-bottom: 1px solid var(--border); border-radius: 0 !important; color: var(--muted); }
.u-command-group { padding: 6px 8px 2px; font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.u-drawer-demo { position: relative; display: flex; justify-content: flex-end; min-height: 300px; overflow: hidden; border-radius: var(--r); background: color-mix(in oklab, var(--m6) 55%, transparent); }
.u-drawer { display: flex; flex-direction: column; gap: 12px; width: 78%; padding: calc(var(--pad) + 2px); background: var(--surface); box-shadow: var(--shadow); }
.u-drawer-foot { margin-top: auto; }
.ds-pops { align-items: stretch; }
.u-popover { position: relative; display: flex; flex-direction: column; gap: 8px; padding: 12px; border: max(var(--bw), 1px) solid var(--border); border-radius: var(--r); background: var(--surface); box-shadow: var(--shadow); }
.u-popover::before { position: absolute; top: -7px; left: 24px; width: 12px; height: 12px; border-top: max(var(--bw), 1px) solid var(--border); border-left: max(var(--bw), 1px) solid var(--border); background: var(--surface); transform: rotate(45deg); content: ""; }
.u-hovercard { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; overflow: hidden; padding: 0 14px 14px; border: max(var(--bw), 1px) solid var(--border); border-radius: var(--r); background: var(--surface); box-shadow: var(--shadow); }
.u-hovercard-cover { align-self: stretch; height: 54px; margin: 0 -14px; }
.u-hovercard .u-avatar { margin-top: -22px; border: 3px solid var(--surface); }
.u-hovercard p { color: var(--muted); font-size: 12.5px; }

/* Colonnes réduites quand la vue est étroite. */
@container (max-width: 1000px) {
  .ds { padding: 20px; }
  .ds-grid-3, .ds-grid-4, .u-kpis, .ds-tokens { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ds-grid-main, .ds-grid-2 { grid-template-columns: minmax(0, 1fr); }
  .ds-type > div { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .ds-topbar nav { display: none; }
  .u-hero, .u-pdp, .u-kanban, .u-lists { grid-template-columns: minmax(0, 1fr); }
  .u-header nav { display: none; }
  .u-burger { display: inline-grid; }
  .u-footer, .u-stats-band { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ================= Barre d'état ================= */

.statusbar {
  display: flex;
  align-items: center;
  gap: 18px;
  height: 24px;
  padding: 0 10px;
  background: var(--chrome);
  border-top: 1px solid var(--line-dark);
  color: var(--muted);
  font-size: 11.5px;
  white-space: nowrap;
}
.status-hover { display: flex; align-items: center; gap: 6px; overflow: hidden; color: var(--text); text-overflow: ellipsis; }
.status-hover i { width: 10px; height: 10px; border-radius: 2px; box-shadow: 0 0 0 1px #111; }
.status-ad {
  margin-left: auto;
  padding: 1px 10px;
  border-radius: 99px;
  background: color-mix(in srgb, var(--accent) 18%, transparent);
  color: var(--text);
  text-decoration: none;
  transition: background .15s;
}
.status-ad:hover { background: color-mix(in srgb, var(--accent) 32%, transparent); text-decoration: underline; }
.status-ad b { color: var(--accent); font-weight: 800; letter-spacing: .02em; }
.status-right { padding-left: 4px; }

/* ================= Export ================= */

dialog {
  width: min(900px, 94vw);
  padding: 0;
  border: 1px solid #47474d;
  border-radius: 10px;
  background: var(--panel);
  color: var(--text);
  box-shadow: 0 24px 60px rgba(0, 0, 0, .6);
}
dialog::backdrop { background: rgba(0, 0, 0, .55); }

.dialog-inner { display: flex; flex-direction: column; gap: 12px; padding: 16px; }
.dialog-head, .dialog-bar, .dialog-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.dialog-head h2 { font-size: 14px; }
.dialog-foot { justify-content: flex-end; }

.ptabs-boxed {
  align-self: auto;
  border: 1px solid var(--line-dark);
  border-radius: 7px;
  overflow: hidden;
}
.ptabs-boxed button { height: 30px; }
.ptabs-boxed button:last-child { border-right: 0; }

.epane { display: flex; flex-direction: column; gap: 12px; }

.platforms { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; max-height: 60vh; overflow: auto; }
.platform {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  grid-template-rows: 1fr auto;
  gap: 8px 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #29292c;
  transition: border-color .2s, box-shadow .2s;
}
.platform.is-focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 30%, transparent); }
.platform-logo {
  display: grid;
  place-items: center;
  grid-row: span 2;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: #1f1f22;
  box-shadow: inset 0 0 0 1px var(--line);
}
.platform-logo .logo { width: 24px; height: 24px; }
.platform-generic { color: var(--muted); font-size: 18px; font-weight: 800; }
.platform-text h3 { margin-bottom: 3px; font-size: 13.5px; }
.platform-text p { color: var(--muted); font-size: 11.5px; line-height: 1.45; }
.platform-actions { display: flex; flex-wrap: wrap; gap: 6px; }

.ai-targets { display: flex; gap: 8px; }
.ai-targets button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 14px 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #29292c;
  font-weight: 600;
  cursor: pointer;
}
.ai-targets button:hover { border-color: #55555d; }
.ai-targets button[aria-pressed="true"] { border-color: var(--accent); background: #34343a; }
.ai-targets .logo { width: 20px; height: 20px; }
.ai-help { color: var(--muted); font-size: 11.5px; }

.code {
  max-height: 52vh;
  margin: 0;
  padding: 14px;
  overflow: auto;
  border: 1px solid var(--line-dark);
  border-radius: 6px;
  background: #18181a;
  font: 12px/1.6 var(--code);
  tab-size: 2;
}

/* ================= Visualiseur PDF ================= */

/* Plein écran : le visualiseur occupe toute la fenêtre. */
.pdf-viewer { width: 100vw; height: 100vh; height: 100dvh; max-width: none; max-height: none; margin: 0; border: 0; border-radius: 0; }
.pdf-viewer[open] { display: flex; }
.pdf-viewer-inner { display: flex; flex: 1; flex-direction: column; min-height: 0; }
.pdf-viewer-head { display: flex; align-items: center; gap: 12px; padding: 10px 12px 10px 14px; border-bottom: 1px solid var(--line-dark); }
.pdf-viewer-logo .logo { width: 26px; height: 26px; padding: 2px; border-radius: 5px; background: #ececf0; }
.pdf-viewer-text { display: flex; flex-direction: column; min-width: 0; }
.pdf-viewer-text h2 { font-size: 14px; }
.pdf-viewer-text span { overflow: hidden; color: var(--muted); font-size: 11.5px; text-overflow: ellipsis; white-space: nowrap; }
.pdf-viewer-actions { display: flex; gap: 8px; margin-left: auto; }
.pdf-viewer-actions kbd { padding-left: 8px; }
.pdf-viewer-body { display: grid; flex: 1; grid-template-columns: 280px minmax(0, 1fr); min-height: 0; }
.pdf-viewer iframe { width: 100%; height: 100%; border: 0; background: #525659; }

.pdf-options { display: flex; flex-direction: column; gap: 20px; padding: 14px; overflow-y: auto; border-right: 1px solid var(--line-dark); scrollbar-width: thin; }
.pdf-options h3 { margin-bottom: 10px; color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.logo-drop {
  display: grid;
  place-items: center;
  height: 112px;
  padding: 10px;
  border: 1.5px dashed #55555d;
  border-radius: 10px;
  background: repeating-conic-gradient(#ececf0 0 25%, #fafafb 0 50%) 0 0 / 14px 14px;
  transition: border-color .15s, box-shadow .15s;
}
.logo-drop.is-over { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 30%, transparent); }
.logo-drop img { max-width: 100%; max-height: 88px; object-fit: contain; }
.logo-drop span { display: flex; flex-direction: column; gap: 4px; color: #4a4a53; font-weight: 600; text-align: center; }
.logo-drop small { color: #7a7a84; font-size: 10.5px; font-weight: 500; }
.pdf-logo-actions { display: flex; gap: 6px; margin: 8px 0 14px; }
.btn-sm { height: 24px; padding: 0 10px; font-size: 12px; }
.pdf-field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; color: var(--muted); font-size: 12px; }
.pdf-field input { height: 28px; padding: 0 8px; border: 1px solid var(--line-dark); border-radius: 5px; background: var(--field); color: var(--text); font: 13px var(--font); }
.pdf-field input:focus { border-color: var(--accent); outline: none; }
.pdf-pages { display: flex; flex-direction: column; gap: 8px; }
.pdf-pages .toggle { color: var(--text); }
.pdf-pages small { margin-left: auto; color: var(--muted); font-size: 11px; }

/* ================= Notification ================= */

.toast {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 38px;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 10px;
  width: max-content;
  max-width: calc(100vw - 32px);
  margin: 0 auto;
  padding: 8px 14px;
  border: 1px solid #47474d;
  border-radius: 8px;
  background: #2f2f33;
  box-shadow: 0 12px 30px rgba(0, 0, 0, .5);
  opacity: 0;
  pointer-events: none;
}
.toast.show { opacity: 1; }
.toast-dot { width: 13px; height: 13px; border-radius: 3px; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .2); }

/* ================= Palette personnalisée ================= */

.opt-group { display: flex; flex: none; align-items: center; gap: 10px; }
.opt-badge {
  padding: 3px 8px;
  border-radius: 99px;
  background: color-mix(in oklab, var(--accent) 24%, transparent);
  color: #fff;
  font-size: 11.5px;
  font-weight: 700;
  white-space: nowrap;
}
.seg-icons button { display: grid; place-items: center; width: 28px; padding: 0; }
.seg-icons button:disabled { color: #55555c; cursor: default; }
.seg-icons svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.custom-note {
  margin: -2px 0 12px;
  padding: 7px 9px;
  border-radius: 5px;
  background: color-mix(in oklab, var(--accent) 14%, var(--field));
  color: #c9c9d2;
  font-size: 11px;
  line-height: 1.45;
}

/* Icône de l'outil « Personnalisée » : trois pastilles de la palette et un crayon. */
.custom-ico { position: relative; display: block; width: 22px; height: 22px; }
.custom-ico i {
  position: absolute;
  width: 9px;
  height: 9px;
  border: 1.5px solid #fff;
  border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .55);
}
.custom-ico i:nth-child(1) { top: 1px; left: 1px; }
.custom-ico i:nth-child(2) { top: 1px; left: 11px; }
.custom-ico i:nth-child(3) { top: 11px; left: 1px; }
.tool .custom-ico svg { position: absolute; right: -2px; bottom: -2px; width: 14px; height: 14px; stroke-width: 2; }

/* Colonnes : verrou, poignée, insertion, édition. */
.col-tools { gap: 2px; }
.col-btn { width: 34px; height: 32px; }
.col-btn[aria-pressed="true"] { background: color-mix(in srgb, currentColor 18%, transparent); }
.col-grip { cursor: grab; touch-action: none; }
.col-grip:active { cursor: grabbing; }
.col-label b { cursor: text; border-radius: 6px; padding: 0 .2em; }
.col-label b:hover { background: color-mix(in srgb, currentColor 14%, transparent); }
.col-locked { display: none; width: 18px; height: 18px; margin-bottom: 2px; }
.col-locked svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.col.is-locked .col-locked { display: block; }
.col.is-dragging { z-index: 3; box-shadow: 0 0 0 2px rgba(255, 255, 255, .85), 0 18px 40px rgba(0, 0, 0, .55); cursor: grabbing; }
.col.is-editing { box-shadow: inset 0 0 0 3px color-mix(in srgb, var(--on) 75%, transparent); }
.col.is-editing .col-tools { opacity: 1; transform: translate(-50%, -50%); }
.col-insert {
  position: absolute;
  top: 50%;
  left: 0;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #fff;
  color: #15151b;
  font-size: 19px;
  font-weight: 600;
  line-height: 1;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .35);
  opacity: 0;
  transform: translate(-50%, -50%) scale(.6);
  transition: opacity .15s, transform .15s;
  cursor: pointer;
}
.col:hover .col-insert, .col-insert:focus-visible { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.col-insert:hover { transform: translate(-50%, -50%) scale(1.12); }

/* Éditeur de couleur (popover). */
.ceditor {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 5;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 272px;
  max-height: calc(100% - 20px);
  padding: 12px;
  overflow-y: auto;
  border: 1px solid #4a4a50;
  border-radius: 10px;
  background: color-mix(in oklab, var(--panel) 94%, transparent);
  box-shadow: 0 18px 48px rgba(0, 0, 0, .55);
  backdrop-filter: blur(10px);
  scrollbar-width: thin;
}
.ceditor-head { display: grid; grid-template-columns: 46px 1fr auto; align-items: center; gap: 10px; }
.ceditor-swatch {
  position: relative;
  width: 46px;
  height: 46px;
  border-radius: 8px;
  background: var(--ce, #888);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .18), 0 0 0 1px #111;
  cursor: pointer;
}
.ceditor-swatch input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.ceditor-swatch:focus-within { outline: 2px solid #fff; outline-offset: 2px; }
.ceditor-id { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.ceditor-title { color: var(--muted); font-size: 11px; font-weight: 600; }
.ceditor .hex-input { text-transform: none; }
.ceditor .icon-btn { align-self: start; width: 24px; height: 24px; font-size: 11px; }
.ce-name-field { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 8px; color: var(--muted); }
.ce-name-field input {
  height: 26px;
  min-width: 0;
  padding: 0 8px;
  border: 1px solid var(--line-dark);
  border-radius: 4px;
  background: var(--field);
  color: var(--text);
  font: inherit;
}
.ce-name-field input:focus { border-color: var(--accent); outline: none; }
.ceditor .field { margin: 0; }
.ce-meta { display: flex; flex-direction: column; gap: 2px; color: var(--muted); font: 11px var(--mono); }
.ce-actions { display: flex; flex-wrap: wrap; gap: 4px; }
.ce-actions .btn { gap: 5px; padding: 0 8px; }
.ce-actions .btn:disabled { opacity: .4; cursor: default; }
.ce-actions svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ce-lock[aria-pressed="true"] { border-color: transparent; background: var(--ce); color: var(--ce-on); }
.ce-remove:hover:not(:disabled) { border-color: #d0566b; color: #ff9aa9; }

/* Saisie de codes couleur. */
#codes-dialog { width: min(620px, 94vw); }
#share-dialog { width: min(560px, 94vw); }
.share-strip { display: flex; height: 64px; overflow: hidden; border-radius: 10px; }
.share-strip i { flex: 1 1 0; background: var(--c); }
.share-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.share-field { display: flex; flex-direction: column; gap: 5px; color: var(--muted); font-size: 12px; }
.share-field em { color: #6f6f78; font-style: normal; }
.share-url { width: 100%; color: var(--muted); font: 11.5px var(--code); }

/* Export du design system */
.ds-export { width: min(1080px, 96vw); max-height: 90vh; padding: 0; }
.ds-export-inner { display: flex; flex-direction: column; gap: 12px; height: min(760px, 86vh); padding: 16px; }
.ds-export-body { display: grid; flex: 1; grid-template-columns: 200px minmax(0, 1fr); gap: 16px; min-height: 0; }
.ds-formats { display: flex; flex-direction: column; gap: 12px; overflow-y: auto; }
.ds-formats-group { display: flex; flex-direction: column; gap: 2px; }
.ds-formats-group > span { margin: 0 0 4px 10px; color: var(--muted); font-size: 10.5px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; }
.ds-formats button { padding: 6px 10px; border: 0; border-radius: 7px; background: none; color: #c9c9d2; font: 13px var(--font); text-align: left; cursor: pointer; }
.ds-formats button:hover { background: #303034; color: var(--text); }
.ds-formats button[aria-pressed="true"] { background: #3a3a40; color: #fff; font-weight: 700; }
.ds-export-main { display: flex; flex-direction: column; gap: 10px; min-width: 0; min-height: 0; }
.ds-export-top { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; }
.ds-export-hint { margin: 0; color: var(--muted); font-size: 12.5px; }
.ds-export-file { flex: none; padding: 2px 7px; border-radius: 5px; background: var(--field); color: #c9c9d2; font: 11.5px var(--code); }
.ds-export-code { flex: 1; min-height: 0; margin: 0; overflow: auto; padding: 14px 16px; border: 1px solid var(--line); border-radius: 10px; background: #161618; color: #d6d6dd; font: 12px/1.6 var(--code); white-space: pre-wrap; word-break: break-word; }
.codes-input {
  width: 100%;
  min-height: 110px;
  padding: 10px;
  border: 1px solid var(--line-dark);
  border-radius: 6px;
  background: var(--field);
  color: var(--text);
  font: 13px/1.5 var(--code);
  resize: vertical;
}
.codes-input:focus { border-color: var(--accent); outline: none; }
.codes-preview { display: flex; height: 54px; overflow: hidden; border-radius: 8px; background: var(--field); }
.codes-preview i { flex: 1 1 0; background: var(--c); }
.codes-count { margin-right: auto; }
.btn:disabled { opacity: .45; cursor: default; filter: none; }
.btn kbd { margin-left: 8px; }

/* Options avancées de l'export de code. */
.export-opts { display: flex; flex-wrap: wrap; gap: 10px 16px; }
.export-opts label { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; }
.export-opts select, .export-opts input {
  height: 26px;
  padding: 0 8px;
  border: 1px solid var(--line-dark);
  border-radius: 5px;
  background: var(--field);
  color: var(--text);
  font: 12.5px var(--font);
}
.export-opts input { width: 120px; font-family: var(--mono); }
.export-opts select:focus, .export-opts input:focus { border-color: var(--accent); outline: none; }

/* ================= Palette depuis un logo ================= */

.logo-dialog { width: min(1180px, 96vw); }
.logo-inner { display: flex; flex-direction: column; gap: 14px; height: min(760px, 92vh); padding: 16px; }
.logo-head p { max-width: 80ch; margin-top: 3px; font-size: 12px; }
.logo-body { display: grid; flex: 1; grid-template-columns: minmax(0, 1.25fr) minmax(330px, 1fr); gap: 16px; min-height: 0; }
.logo-stage { display: flex; flex-direction: column; gap: 10px; min-height: 0; }
.logo-drop {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 24px;
  border: 2px dashed #4a4a52;
  border-radius: 12px;
  background: var(--field);
  color: var(--muted);
  text-align: center;
  transition: border-color .15s, background .15s;
}
.logo-drop svg { width: 46px; height: 46px; margin-bottom: 6px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.logo-drop b { color: var(--text); font-size: 16px; }
.logo-drop .btn { margin-top: 10px; }
.logo-drop.is-over { border-color: var(--accent); background: color-mix(in oklab, var(--accent) 10%, var(--field)); }

.logo-area { display: grid; flex: 1; place-items: center; min-height: 0; }
.logo-canvas-wrap {
  position: relative;
  border-radius: 10px;
  box-shadow: 0 0 0 1px var(--line);
  cursor: crosshair;
  touch-action: none;
}
.logo-canvas-wrap[data-bg="checker"] { background: repeating-conic-gradient(#3a3a40 0 25%, #2c2c31 0 50%) 0 0 / 18px 18px; }
.logo-canvas-wrap[data-bg="light"] { background: #fff; }
.logo-canvas-wrap[data-bg="dark"] { background: #111114; }
.logo-canvas-wrap canvas { display: block; width: 100%; height: 100%; border-radius: inherit; }
.logo-markers { position: absolute; inset: 0; pointer-events: none; }
.logo-marker {
  position: absolute;
  width: 26px;
  height: 26px;
  margin: -13px 0 0 -13px;
  padding: 0;
  border: 3px solid #fff;
  border-radius: 50%;
  background: var(--c);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .55), 0 6px 16px rgba(0, 0, 0, .45);
  cursor: grab;
  pointer-events: auto;
  transition: box-shadow .15s;
}
.logo-marker:hover { box-shadow: 0 0 0 1px rgba(0, 0, 0, .55), 0 0 0 6px rgba(255, 255, 255, .25); }
.logo-marker.is-drag { width: 38px; height: 38px; margin: -19px 0 0 -19px; cursor: grabbing; }
.logo-marker.is-off { opacity: .45; }
.logo-stage-bar { display: flex; align-items: center; gap: 10px; }
.logo-file-name { flex: 1; min-width: 0; overflow: hidden; color: var(--muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }

.logo-side { display: flex; flex-direction: column; gap: 16px; min-height: 0; padding-right: 4px; overflow-y: auto; scrollbar-width: thin; }
.logo-side.is-empty section { opacity: .4; pointer-events: none; }
.logo-side h3 { display: flex; align-items: baseline; gap: 8px; margin: 0 0 8px; color: var(--muted); font-size: 11.5px; letter-spacing: .05em; text-transform: uppercase; }
.logo-side h3 .muted { font-size: 11px; letter-spacing: 0; text-transform: none; }
.logo-colors { display: flex; flex-direction: column; gap: 4px; }
.logo-color { display: flex; align-items: center; gap: 8px; padding: 4px 6px 4px 4px; border-radius: 7px; }
.logo-color:hover { background: #36363a; }
.logo-color.is-off .logo-color-text, .logo-color.is-off .logo-color-chip { opacity: .4; }
.logo-color-main { display: flex; flex: 1; align-items: center; gap: 10px; min-width: 0; cursor: pointer; }
.logo-color-main input { width: 15px; height: 15px; margin: 0; accent-color: var(--accent); }
.logo-color-chip { flex: none; width: 32px; height: 32px; border-radius: 6px; background: var(--c); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .14), 0 0 0 1px #111; }
.logo-color-text { display: flex; flex-direction: column; min-width: 0; }
.logo-color-text b { font: 700 13px var(--mono); letter-spacing: .03em; }
.logo-color-text small { overflow: hidden; color: var(--muted); font-size: 11.5px; text-overflow: ellipsis; white-space: nowrap; }
.logo-color-share { color: var(--muted); font: 11.5px var(--mono); white-space: nowrap; }
.logo-color-remove { width: 22px; height: 22px; padding: 0; border: 0; border-radius: 5px; background: none; color: var(--muted); cursor: pointer; }
.logo-color-remove:hover { background: #45454b; color: #fff; }
.logo-toggle { margin-top: 8px; }

.logo-facts { display: flex; flex-direction: column; gap: 6px; margin: 0; padding: 0; list-style: none; font-size: 12px; }
.logo-facts li { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 8px; }
.logo-facts span { color: var(--muted); }
.logo-facts b { display: flex; align-items: flex-start; gap: 6px; font-weight: 600; }
.logo-facts b i { flex: none; width: 12px; height: 12px; margin-top: 2px; border-radius: 3px; background: var(--c); box-shadow: 0 0 0 1px rgba(255, 255, 255, .25); }
.logo-facts li.is-warn b { color: #ffcf7a; }
.logo-facts li.is-ok b { color: #7fe0ae; }

.logo-modes { display: flex; width: 100%; }
.logo-modes button { flex: 1; }
.logo-options { display: flex; flex-wrap: wrap; gap: 14px; margin: 10px 0; }
.logo-opt { display: flex; align-items: center; gap: 8px; }
.logo-opt output { display: grid; place-items: center; width: 34px; height: 100%; border-inline: 1px solid var(--line-dark); font: 700 13px var(--mono); }
.logo-select { height: 26px; padding: 0 6px; border: 1px solid var(--line-dark); border-radius: 5px; background: var(--field); color: var(--text); font: inherit; }
.logo-result { display: flex; height: 76px; overflow: hidden; border-radius: 8px; box-shadow: 0 0 0 1px var(--line); }
.logo-result-chip { display: flex; flex: 1 1 0; flex-direction: column; justify-content: flex-end; min-width: 0; padding: 6px; background: var(--c); color: var(--on); }
.logo-result-chip b { font: 700 11px var(--mono); letter-spacing: .02em; }
.logo-result-chip small { overflow: hidden; font-size: 9.5px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; opacity: .8; }
.logo-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: auto; padding-top: 4px; }

.drop-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  background: rgba(10, 10, 14, .72);
  backdrop-filter: blur(6px);
  pointer-events: none;
}
.drop-overlay div {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 40px 60px;
  border: 2px dashed var(--accent);
  border-radius: 18px;
  color: var(--muted);
  font-size: 14px;
}
.drop-overlay b { color: #fff; font-size: 22px; }

@media (max-width: 860px) {
  .logo-inner { height: auto; max-height: 92vh; overflow-y: auto; }
  .logo-body { grid-template-columns: 1fr; }
  .logo-area { height: 50vh; flex: none; }
}

/* ================= Administration ================= */

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.user-btn.is-admin .user-avatar { box-shadow: 0 0 0 2px #fece3d; }
.admin-dialog { width: min(1020px, 96vw); }
.admin-inner { gap: 16px; max-height: 88vh; overflow-y: auto; }
.admin-sub { margin-top: 2px; font-size: 12px; }
.admin-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.admin-sales { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--field); }
.admin-sales h3 { margin-bottom: 2px; }
.admin-sales p { margin: 0; font-size: 12.5px; }
.admin-sales.is-closed { border-color: rgba(255, 99, 120, .45); background: rgba(255, 99, 120, .08); }
.admin-sales-toggle { flex: none; font-weight: 600; }
.admin-stat { padding: 12px 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--field); }
.admin-stat b { display: block; font-size: 22px; font-weight: 800; line-height: 1.2; }
.admin-stat span { color: var(--muted); font-size: 11.5px; }
.admin-section h3 { margin: 0 0 8px; font-size: 12px; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.admin-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 8px; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.admin-table th { padding: 8px 10px; background: var(--panel-head); color: var(--muted); font-weight: 600; text-align: left; white-space: nowrap; }
.admin-table td { padding: 8px 10px; border-top: 1px solid var(--line); vertical-align: middle; }
.admin-table td small { display: block; color: var(--muted); }
.admin-actions { display: flex; justify-content: flex-end; gap: 4px; white-space: nowrap; }
.admin-pill { display: inline-block; padding: 2px 8px; border-radius: 99px; font-size: 11px; font-weight: 700; white-space: nowrap; }
.admin-pill.is-active { background: rgba(67, 209, 138, .16); color: #6be3a5; }
.admin-pill.is-gift { background: rgba(58, 162, 253, .16); color: #7cc0ff; }
.admin-pill.is-expired { background: rgba(253, 109, 97, .16); color: #ff9a90; }
.admin-pill.is-free { background: rgba(255, 255, 255, .08); color: var(--muted); }
.admin-pw { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) auto; gap: 8px; }
.admin-pw input {
  height: 30px;
  padding: 0 10px;
  border: 1px solid var(--line-dark);
  border-radius: 5px;
  background: var(--field);
  color: var(--text);
  font: inherit;
}
.admin-pw input:focus { border-color: var(--accent); outline: none; }
.admin-pw input[aria-invalid="true"] { border-color: #d0566b; }
.admin-pw .btn { height: 30px; }
.admin-msg { min-height: 0; margin-top: 6px; font-size: 12px; font-weight: 600; }
.admin-msg:empty { display: none; }
.admin-msg.is-error { color: #ff8b9a; }
.admin-msg.is-ok { color: #6be3a5; }
.admin-snippet { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; margin-top: 8px; padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--field); font-size: 12px; }
.admin-snippet pre { width: 100%; margin: 0; padding: 10px; overflow-x: auto; border-radius: 6px; background: #151517; font: 12px/1.5 var(--code); }
@media (max-width: 760px) {
  .admin-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-pw { grid-template-columns: 1fr; }
}

/* ================= Petits écrans : empilement et défilement ================= */

@media (max-width: 1100px) {
  :root { --dock-w: 270px; }
  .status-right { display: none; }
}

@media (max-width: 860px) {
  .app { display: block; height: auto; overflow: visible; }
  .menus { display: none; }
  .optionsbar { flex-wrap: wrap; }
  .opt-actions { margin-left: 0; }
  .workspace { display: flex; flex-direction: column; }
  .toolbar { flex-direction: row; justify-content: center; flex-wrap: wrap; padding: 4px; overflow: visible; border-right: 0; border-bottom: 1px solid var(--line-dark); }
  .tool-group { flex-direction: row; }
  .platforms { grid-template-columns: 1fr; }
  .tool-sep { width: 1px; height: 22px; margin: 0 4px; }
  .doc { flex: none; height: 62vh; min-height: 320px; }
  .splitter { display: none; }
  .bdock { height: auto; }
  .bdock-tabs { flex-wrap: wrap; height: auto; padding: 4px 8px 4px 0; }
  .dock { border-left: 0; }
  .dock-scroll { overflow: visible; }
  .decl-hex { display: none; }
  .statusbar { justify-content: center; }
  #status-main, .status-hover, .status-right { display: none; }
  .status-ad { margin: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}
