/* ==========================================================================
   Signature Studio — feuille de style de l'application
   Identité du CM Hub (gestion-projet-cm) : mêmes couleurs, typographie Geist,
   rail de navigation, menus, onglets segmentés, fenêtres et notifications.
   Les mesures reprennent les classes Tailwind du Hub (indiquées en commentaire).
   ========================================================================== */

:root {
  --brand: #5146f0;
  --primary: var(--brand);
  --primary-hover: color-mix(in oklab, var(--brand) 85%, black);
  --primary-soft: color-mix(in oklab, var(--brand) 10%, white);
  --primary-fg: #ffffff;

  --bg: #f6f6fa;
  --surface: #ffffff;
  --surface-2: #f0f0f6;
  --surface-3: #f0f0f6;
  --text: #14151f;
  --text-2: #5c5f73;
  --text-3: #8b8ea2;
  --border: #e5e5ee;
  --border-strong: #cfd0dc;
  --danger: #d7372f;
  --danger-bg: #fde9e7;
  --warn: #b45309;
  --warn-bg: #fdf1df;
  --ok: #0f8a5f;
  --ok-bg: #e3f6ee;
  --info: #1b74d6;
  --info-bg: #e6f1fd;
  --sidebar: #f0f0f6;
  --rail: #17182b;
  --rail-fg: #a3a6c2;

  --radius: 0.75rem;        /* rounded-card */
  --radius-sm: 0.5rem;      /* rounded-lg */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-pop: 0 10px 30px -8px rgb(15 23 42 / 0.25), 0 2px 6px rgb(15 23 42 / 0.08);
  --header-h: 56px;         /* h-14 */
  --font: "Geist", ui-sans-serif, system-ui, "Segoe UI Variable", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "Geist Mono", ui-monospace, Consolas, monospace;
  color-scheme: light;
}

html[data-theme="dark"] {
  --primary: color-mix(in oklab, var(--brand) 65%, white);
  --primary-hover: color-mix(in oklab, var(--brand) 50%, white);
  --primary-soft: color-mix(in oklab, var(--brand) 22%, #14151f);
  --primary-fg: #0c0d14;

  --bg: #0c0d14;
  --surface: #14151f;
  --surface-2: #1b1c29;
  --surface-3: #1b1c29;
  --text: #e9e9f2;
  --text-2: #a0a2b8;
  --text-3: #6f7189;
  --border: #262838;
  --border-strong: #363950;
  --danger: #ff7a70;
  --danger-bg: #321716;
  --warn: #f2b64b;
  --warn-bg: #2d2311;
  --ok: #3fd29b;
  --ok-bg: #10291f;
  --info: #4fa8ff;
  --info-bg: #0f2236;
  --sidebar: #10111a;
  --rail: #08090f;
  --rail-fg: #8b8ea8;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / .35);
  --shadow-pop: 0 10px 30px -8px rgb(0 0 0 / .6), 0 2px 6px rgb(0 0 0 / .3);
  color-scheme: dark;
}

* { box-sizing: border-box; border-color: var(--border); }

/* `display` des composants prime sinon sur l'attribut hidden. */
[hidden] { display: none !important; }

html, body { height: 100%; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
html.has-modal { overflow: hidden; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

/* Halo flou de la couleur principale, en bas au centre (identique au Hub) */
body::before {
  content: "";
  position: fixed;
  left: 50%;
  bottom: -30vh;
  width: min(1100px, 120vw);
  height: 60vh;
  transform: translateX(-50%);
  background: radial-gradient(closest-side, color-mix(in oklab, var(--primary) 22%, transparent), transparent);
  filter: blur(40px);
  pointer-events: none;
  z-index: -1;
}

h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -0.01em; }
p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }

:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 6px; }
::selection { background: color-mix(in srgb, var(--primary) 25%, transparent); }
* { scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }

.icon { width: 16px; height: 16px; flex: 0 0 auto; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop { from { transform: translateY(6px) scale(.98); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes slide-left { from { transform: translateX(-24px); opacity: 0; } to { transform: none; opacity: 1; } }

.skip-link { position: absolute; left: -9999px; top: 0; z-index: 100; background: var(--primary); color: var(--primary-fg); padding: 10px 16px; border-radius: 0 0 8px 0; }
.skip-link:focus { left: 0; }

kbd { font-family: var(--mono); font-size: 11px; padding: 1px 5px; border: 1px solid var(--border); border-radius: 4px; background: var(--surface-2); }
/* kbd dans un bouton principal : ml-auto rounded bg-white/20 px-1.5 text-[10px] */
.kbd-inverse { margin-left: auto; border: 0; border-radius: 4px; background: rgb(255 255 255 / .2); color: inherit; padding: 0 6px; font-family: var(--font); font-size: 10px; font-weight: 600; }

/* --------------------------------- Boutons --------------------------------- */
/* components/ui/button.tsx : rounded-lg font-medium, h-9 px-3.5 text-sm gap-2 */

.btn {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 36px;
  padding: 0 14px;
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  user-select: none;
  transition: background-color .15s, color .15s, border-color .15s;
}
.btn:hover { background: var(--border); }
.btn--primary { background: var(--primary); color: var(--primary-fg); box-shadow: var(--shadow-sm); }
.btn--primary:hover { background: var(--primary-hover); }
.btn--outline { border: 1px solid var(--border-strong); background: var(--surface); }
.btn--outline:hover { background: var(--surface-2); }
.btn--ghost { background: transparent; color: var(--text-2); }
.btn--ghost:hover { background: var(--surface-2); color: var(--text); }
.btn--danger { background: var(--danger); color: #fff; }
.btn--danger:hover { opacity: .9; }
.btn--sm, .btn--small { height: 32px; padding: 0 10px; font-size: 13px; gap: 6px; }
.btn--icon { width: 36px; padding: 0; }
.btn--block { width: 100%; }
.btn--start { justify-content: flex-start; }
.btn:disabled, .btn[disabled] { opacity: .5; pointer-events: none; }

/* Bouton icône discret (fermer, actions de ligne) : rounded-md p-1.5 text-muted hover:bg-surface-2 */
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; padding: 0;
  border: 0; border-radius: 6px; background: transparent; color: var(--text-2);
  transition: background-color .15s, color .15s;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn.is-danger:hover { background: var(--danger-bg); color: var(--danger); }

.row { display: flex; gap: 8px; align-items: center; }
.row--wrap { flex-wrap: wrap; }

/* ---------------------------- Badges et avatars ---------------------------- */
/* components/ui/badge.tsx : rounded-md px-1.5 py-0.5 text-xs font-medium */

.badge, .chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 6px; border-radius: 6px;
  background: var(--surface-2); color: var(--text-2);
  font-size: 12px; font-weight: 500; line-height: 16px; white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.badge--success { background: var(--ok-bg); color: var(--ok); }
.badge--neutral { background: var(--surface-2); color: var(--text-2); }
.badge--primary { background: var(--primary-soft); color: var(--primary); }
.badge--info { background: var(--info-bg); color: var(--info); }
.badge--warning { background: var(--warn-bg); color: var(--warn); }
.badge .icon { width: 12px; height: 12px; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 999px; background: currentColor; }
.text-warning { color: var(--warn); }
.avatar--lg { width: 36px; height: 36px; font-size: 14.4px; }
.chip.is-warn { background: var(--warn-bg); color: var(--warn); }
.chip.is-error { background: var(--danger-bg); color: var(--danger); }

/* components/ui/avatar.tsx : rond, initiales blanches, couleur stable par personne, ring-2 ring-surface */
.avatar {
  display: inline-flex; flex: 0 0 auto; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 999px;
  background: #6366f1; color: #fff;
  font-size: 12.8px; font-weight: 600;
  box-shadow: 0 0 0 2px var(--surface);
}
.avatar-btn { padding: 0; border: 0; background: none; border-radius: 999px; margin-left: 4px; }

/* -------------------------------- Menus ----------------------------------- */
/* components/ui/menu.tsx : rounded-xl border bg-surface p-1 shadow-pop, éléments rounded-lg px-2.5 py-1.5 text-sm */

.menu { position: relative; }
.menu__panel {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 50;
  min-width: 11rem;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-pop);
  animation: pop .15s ease-out;
}
.menu__panel--up { top: auto; bottom: calc(100% + 6px); left: 0; right: auto; min-width: 100%; }
.menu__panel--account { min-width: 15rem; }
.menu__panel [role="menuitem"] {
  display: flex; align-items: center; gap: 8px;
  width: 100%; padding: 6px 10px;
  border: 0; border-radius: var(--radius-sm); background: transparent;
  font-size: 14px; text-align: left; white-space: nowrap;
  outline: none; user-select: none;
}
.menu__panel [role="menuitem"] .icon { color: var(--text-2); }
.menu__panel [role="menuitem"]:focus { background: var(--surface-2); }
.menu__panel [role="menuitem"].is-danger, .menu__panel [role="menuitem"].is-danger .icon { color: var(--danger); }
.menu__label { padding: 6px 10px; font-size: 12px; font-weight: 500; color: var(--text-3); }
.menu__sep { height: 1px; margin: 4px 0; background: var(--border); }
.menu__account { padding: 8px 10px; }
.menu__account p:first-child { font-size: 14px; font-weight: 500; }
.menu__account p { font-size: 12px; color: var(--text-2); }
.menu__account .menu__role { margin-top: 4px; color: var(--primary); }

/* --------------------------- Structure du Hub ------------------------------ */
/* components/shell/shell.tsx : rail w-[72px] bg-rail, panneau w-60 bg-sidebar, en-tête h-14 */

.shell { display: flex; min-height: 100vh; }
.nav { position: sticky; top: 0; z-index: 40; display: flex; height: 100vh; flex: 0 0 auto; }

.rail {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  width: 72px; flex: 0 0 auto;
  padding: 12px 0; overflow-y: auto; scrollbar-width: none;
  background: var(--rail); color: var(--rail-fg);
}
.rail__logo { display: flex; margin-bottom: 12px; }
.rail__logo img { width: 32px; height: 32px; object-fit: contain; }
.rail__bottom { margin-top: auto; display: flex; flex-direction: column; align-items: center; gap: 4px; }
/* w-14 flex-col items-center gap-1 rounded-xl py-2 text-[10.5px] font-medium */
.rail__item {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  width: 56px; padding: 8px 0;
  border: 0; border-radius: 12px; background: transparent; color: inherit;
  font-size: 10.5px; font-weight: 500;
  transition: background-color .15s, color .15s;
}
.rail__item .icon { width: 20px; height: 20px; transition: color .15s; }
.rail__item:hover { background: rgb(255 255 255 / .05); color: #fff; }
.rail__item:hover .icon { color: var(--primary); }
.rail__item.is-active { background: rgb(255 255 255 / .1); color: #fff; }
.rail__item.is-active .icon { color: var(--primary); }

.sidebar {
  display: flex; flex-direction: column;
  width: 240px; flex: 0 0 auto;
  border-right: 1px solid var(--border);
  background: var(--sidebar);
}
.shell.is-collapsed .sidebar { display: none; }
/* Panneau masqué : aperçu au survol du rail (absolute left-[72px] shadow-pop animate-fade-in) */
.shell.is-collapsed.is-peek .sidebar {
  display: flex; position: absolute; top: 0; bottom: 0; left: 72px;
  box-shadow: var(--shadow-pop); animation: fade .15s ease-out;
}
/* Un volet de panneau et une vue par espace (Signatures, Administration), comme les espaces du rail du Hub */
.sidebar__panel { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; }
.shell:not([data-space="admin"]) [data-panel="admin"], .shell[data-space="admin"] [data-panel="signatures"],
.shell:not([data-space="admin"]) [data-view="admin"], .shell[data-space="admin"] [data-view="signatures"] { display: none; }
.view { display: contents; }
.sidebar__section { flex: 0 0 auto; padding: 8px 12px 0; border-top: 1px solid var(--border); }
.nav-list { display: flex; flex-direction: column; gap: 2px; }
a.nav-link { text-decoration: none; }
/* Lien actif du panneau : bg-surface text-fg shadow-sm ring-1 ring-border, icône text-primary */
.nav-link.is-active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm), 0 0 0 1px var(--border); }
.nav-link.is-active .icon { color: var(--primary); }
html[data-theme="dark"] .nav-link.is-active { background: var(--surface-2); }
.rail__item { text-decoration: none; }

.sidebar__head { display: flex; align-items: center; justify-content: space-between; height: var(--header-h); padding: 0 16px; flex: 0 0 auto; }
.sidebar__head p { font-size: 15px; font-weight: 600; letter-spacing: -0.015em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar__body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden; padding: 0 12px 12px; display: flex; flex-direction: column; gap: 12px; }
.sidebar__body .btn--primary { margin-bottom: 4px; }
.sidebar__body .field { margin-bottom: 0; }
.sidebar__foot { flex: 0 0 auto; padding: 0 12px 12px; }
.drawer-close, .drawer-account, .drawer-backdrop { display: none; }

/* Titre de groupe : px-2.5 pb-1 text-[11px] font-semibold uppercase tracking-wider text-subtle */
.nav-label { display: flex; align-items: center; justify-content: space-between; padding: 4px 10px 0; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--text-3); }
.count { font-size: 11px; font-variant-numeric: tabular-nums; }

/* Lien du panneau : h-9 rounded-lg px-2.5 text-[13.5px] font-medium text-muted hover:bg-surface-2 */
.nav-link {
  display: flex; align-items: center; gap: 12px;
  width: 100%; height: 36px; padding: 0 10px;
  border: 0; border-radius: var(--radius-sm); background: transparent;
  color: var(--text-2); font-size: 13.5px; font-weight: 500; text-align: left;
  transition: background-color .15s, color .15s;
}
.nav-link span { flex: 1 1 auto; }
.nav-link .icon:first-child { width: 18px; height: 18px; }
.nav-link:hover, .nav-link[aria-expanded="true"] { background: var(--surface-2); color: var(--text); }
html:not([data-theme="dark"]) .sidebar .nav-link:hover, html:not([data-theme="dark"]) .sidebar .nav-link[aria-expanded="true"] { background: color-mix(in srgb, var(--surface) 70%, transparent); }

.credits { margin: 10px 10px 0; font-size: 11px; line-height: 1.6; color: var(--text-3); }
.credits span { font-weight: 500; }
.credits a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.credits a:hover { color: var(--primary); }

/* Bibliothèque : même rendu que les liens du panneau ; actif = bg-surface shadow-sm ring-1 ring-border */
.library { list-style: none; margin: -6px 0 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.library__item {
  position: relative; display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 6px 8px;
  border-radius: var(--radius-sm); color: var(--text-2);
  cursor: pointer; transition: background-color .15s, color .15s;
}
.library__item:hover { background: color-mix(in srgb, var(--surface) 70%, transparent); color: var(--text); }
html[data-theme="dark"] .library__item:hover { background: var(--surface-2); }
.library__item.is-active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm), 0 0 0 1px var(--border); }
.library__item .avatar { width: 28px; height: 28px; font-size: 11.2px; box-shadow: none; }
.library__text { min-width: 0; flex: 1 1 auto; }
.library__name { display: block; font-size: 13.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.library__role { display: block; font-size: 12px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.library__actions { display: flex; gap: 2px; opacity: 0; transition: opacity .15s; }
.library__item:hover .library__actions, .library__item.is-active .library__actions, .library__actions:focus-within { opacity: 1; }
.library__actions button { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border: 0; border-radius: 6px; background: transparent; color: var(--text-3); }
.library__actions button:hover { background: var(--surface-2); color: var(--text); }
.library__actions button:last-child:hover { background: var(--danger-bg); color: var(--danger); }
.field--search { position: relative; }
.field--search .icon { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--text-3); pointer-events: none; }
.field--search input[type="search"] { padding-left: 32px; }
.empty { padding: 24px 8px; text-align: center; font-size: 13px; color: var(--text-2); }

.main { display: flex; flex-direction: column; flex: 1 1 auto; min-width: 0; }

/* sticky top-0 h-14 border-b bg-surface/85 backdrop-blur px-5 */
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 12px;
  height: var(--header-h); padding: 0 20px;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 85%, transparent);
  backdrop-filter: blur(8px);
}
.topbar__title { flex: 1 1 auto; min-width: 0; }
.topbar__title h1, .topbar__title p { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar__title h1 { font-size: 15px; line-height: 1.25; letter-spacing: -0.015em; }
.topbar__title p { font-size: 12px; color: var(--text-2); }
.topbar__right { display: flex; align-items: center; gap: 4px; }

.save-state { display: inline-flex; align-items: center; gap: 6px; padding: 0 8px; font-size: 12px; color: var(--text-2); white-space: nowrap; }
.save-state::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--ok); }
.save-state.is-saving::before { background: var(--warn); }
.save-state.is-error { color: var(--danger); }
.save-state.is-error::before { background: var(--danger); }

.workspace-banner {
  display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap;
  padding: 8px 20px;
  border-bottom: 1px solid color-mix(in srgb, var(--primary) 25%, transparent);
  background: var(--primary-soft); color: var(--primary); font-size: 13.5px;
}
.workspace-banner:not([hidden]) ~ .layout { height: calc(100vh - var(--header-h) - 49px); }

.layout {
  display: grid;
  grid-template-columns: minmax(380px, 1fr) minmax(430px, 1.05fr);
  gap: 16px;
  width: 100%; max-width: 1600px; margin: 0 auto;
  height: calc(100vh - var(--header-h));
  padding: 20px 24px;
  align-items: stretch;
}

.tabbar { display: none; }

/* --------------------------------- Cartes --------------------------------- */
/* components/ui/card.tsx : rounded-card border bg-surface, survol hover:border-primary/50 + halo 3px */

.panel {
  display: flex; flex-direction: column; min-height: 0; overflow: hidden;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface);
  transition: border-color .2s, box-shadow .2s;
}
.panel:hover { border-color: color-mix(in srgb, var(--primary) 50%, transparent); box-shadow: 0 0 0 3px color-mix(in oklab, var(--primary) 14%, transparent); }
/* CardHeader : border-b px-4 py-3 */
.panel__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--border); flex: 0 0 auto; }
.panel__head h2 { font-size: 14px; font-weight: 600; }
.panel__body { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 16px; }
.panel__foot { flex: 0 0 auto; padding: 12px 16px; border-top: 1px solid var(--border); background: color-mix(in srgb, var(--surface-2) 50%, transparent); }

/* ---------------------------- Onglets segmentés ---------------------------- */
/* Segmented (components/ui/card.tsx) : rounded-lg bg-surface-2 p-0.5 ; onglet h-8 px-3 text-[13px] rounded-md ;
   actif bg-surface text-fg shadow-sm, sinon text-muted hover:text-fg */

.tabs { position: relative; display: inline-flex; max-width: 100%; overflow-x: auto; scrollbar-width: none; padding: 2px; border-radius: var(--radius-sm); background: var(--surface-2); }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  display: inline-flex; flex: 0 0 auto; align-items: center; gap: 6px;
  height: 32px; padding: 0 12px;
  border: 0; border-radius: 6px; background: transparent;
  color: var(--text-2); font-size: 13px; font-weight: 500; white-space: nowrap;
  transition: background-color .15s, color .15s;
}
.tab .icon { width: 14px; height: 14px; }
.tab:hover { color: var(--text); }
.tab.is-active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
html[data-theme="dark"] .tab.is-active { background: var(--border-strong); }

.tabpanel { display: none; }
.tabpanel.is-active { display: block; animation: fade .15s ease-out; }

/* -------------------------------- Formulaire ------------------------------ */

.section { padding-bottom: 20px; margin-bottom: 20px; border-bottom: 1px solid var(--border); }
.section:last-child { border-bottom: 0; margin-bottom: 0; padding-bottom: 0; }
.section__title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-3);
  margin-bottom: 12px;
}

.grid { display: grid; gap: 12px; }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.field--full { grid-column: 1 / -1; }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.grid .field { margin-bottom: 0; }
.field__label { font-size: 13px; font-weight: 500; color: var(--text); }
.field__label em { font-style: normal; color: var(--text-3); font-weight: 400; }

input[type="text"], input[type="email"], input[type="password"], input[type="tel"], input[type="number"],
input[type="search"], select, textarea {
  width: 100%;
  height: 36px;
  padding: 0 11px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font-size: 14px;
  transition: border-color .15s ease, box-shadow .15s ease;
}
textarea { height: auto; padding: 8px 11px; resize: vertical; min-height: 64px; }
input:hover, select:hover, textarea:hover { border-color: color-mix(in srgb, var(--text-3) 60%, var(--border-strong)); }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 20%, transparent);
}
input::placeholder, textarea::placeholder { color: var(--text-3); }
select { appearance: none; background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="%238a93a4" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="m6 9 6 6 6-6"/></svg>'); background-position: right .6rem center; background-size: 16px; background-repeat: no-repeat; padding-right: 32px; }
select option, select optgroup { background-color: var(--surface); color: var(--text); }

input[type="range"] { width: 100%; accent-color: var(--primary); padding: 0; background: transparent; border: 0; }

.hint { margin: 8px 0 0; font-size: 12.5px; color: var(--text-2); line-height: 1.45; }

/* Écrans tactiles : iOS zoome sur tout champ dont le texte fait moins de 16 px */
@media (pointer: coarse) {
  input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]):not([type="file"]), select, textarea { font-size: 16px; }
}

/* Couleurs */
.color-grid { margin-bottom: 14px; }
.color-input { display: flex; align-items: center; gap: 6px; }
.color-input input[type="color"] {
  flex: 0 0 auto;
  width: 36px; height: 36px;
  padding: 3px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  cursor: pointer;
}
.color-input input[type="text"] { font-family: var(--mono); font-size: 12.5px; text-transform: uppercase; }

/* Logo */
.logo-row { display: grid; grid-template-columns: 132px 1fr; gap: 14px; align-items: start; }
.logo-preview {
  height: 104px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-sm);
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
  overflow: hidden;
}
.logo-preview img { max-width: 100%; max-height: 100%; display: block; }
.logo-preview span { font-size: 11.5px; color: #8b8ea2; }
.logo-fields { min-width: 0; }

/* Sélecteur de logo (dépôt GitHub) */
.picker { display: flex; gap: 6px; align-items: center; }
.picker select { min-width: 0; flex: 1 1 auto; }
.picker .btn--icon { flex: 0 0 auto; height: 36px; font-size: 15px; }

.hint--error { color: var(--danger); }

.repo-config { margin-top: 12px; border-top: 1px solid var(--border); padding-top: 10px; }
.repo-config summary, .code summary {
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
  user-select: none;
  padding: 4px 0;
}
.repo-config summary:hover, .code summary:hover { color: var(--text); }
.repo-config .grid { margin-top: 10px; }

/* Partenaires */
.partners { display: flex; flex-direction: column; gap: 10px; margin-bottom: 10px; }

.partner {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr) 30px;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}
.partner__thumb {
  height: 56px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
  overflow: hidden;
  color: #8b8ea2;
  font-size: 13px;
}
.partner__thumb img { max-width: 100%; max-height: 100%; display: block; }
.partner__fields { min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.partner__fields .field { margin-bottom: 0; }
.partner__actions { display: flex; flex-direction: column; gap: 4px; }
.partner__btn {
  width: 28px; height: 26px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text-2);
  cursor: pointer;
  font-size: 12px;
  line-height: 1;
  padding: 0;
}
.partner__btn:hover { color: var(--text); border-color: var(--border-strong); }
.partner__actions .partner__btn:last-child:hover { color: var(--danger); border-color: var(--danger); }

.partners + .btn--small, .row .btn--small { align-self: flex-start; }
.empty--inline { padding: 14px 8px; text-align: left; }

/* Variantes */
.variants { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.variant { position: relative; display: block; cursor: pointer; }
.variant input { position: absolute; opacity: 0; width: 0; height: 0; }
.variant__body {
  display: block;
  height: 100%;
  padding: 12px 13px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  transition: border-color .15s ease, background .15s ease;
}
.variant:hover .variant__body { border-color: var(--text-3); }
.variant input:checked + .variant__body {
  border-color: var(--primary);
  background: var(--primary-soft);
  box-shadow: 0 0 0 1px var(--primary);
}
.variant input:checked + .variant__body .variant__name { color: var(--primary); }
.variant input:focus-visible + .variant__body { outline: 2px solid var(--primary); outline-offset: 2px; }
.variant__name { display: block; font-weight: 600; font-size: 13.5px; }
.variant__desc { display: block; font-size: 12px; color: var(--text-2); margin-top: 3px; line-height: 1.4; }

/* Interrupteurs */
.switches { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 4px; }
.switch {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 13.5px;
}
.switch:hover { background: var(--surface-2); }
.switch input { appearance: none; margin: 0; flex: 0 0 auto; width: 34px; height: 20px; border-radius: 999px; background: var(--border-strong); position: relative; cursor: pointer; transition: background .15s ease; }
.switch input::after {
  content: "";
  position: absolute; top: 2px; left: 2px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: var(--shadow-sm);
  transition: transform .15s ease;
}
.switch input:checked { background: var(--primary); }
.switch input:checked::after { transform: translateX(14px); }

/* --------------------------------- Aperçu -------------------------------- */

.panel__head--preview { flex-wrap: wrap; row-gap: 10px; }
.preview-controls { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.swatches { display: inline-flex; gap: 6px; }
.swatch {
  width: 22px; height: 22px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--sw);
  cursor: pointer;
  padding: 0;
}
.swatch.is-active { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--primary); }

.panel__body--preview { background: var(--surface-2); }

.preview-stage {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: max-width .2s ease;
  margin: 0 auto;
  max-width: 100%;
}
.preview-stage.is-mobile { max-width: 390px; }
/* L'iframe garde la largeur réelle de la signature ; l'échelle l'adapte au panneau. */
.preview-stage iframe { display: block; border: 0; min-height: 180px; transform-origin: top left; }

.meta-row { display: flex; gap: 6px; flex-wrap: wrap; margin: 12px 0 16px; }

.quality { margin-bottom: 14px; }
.quality ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.quality li {
  display: flex;
  gap: 9px;
  padding: 8px 11px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  line-height: 1.45;
  background: var(--surface);
  color: var(--text-2);
}
.quality li::before { flex: 0 0 auto; width: 14px; text-align: center; }
.quality li.is-ok { background: var(--ok-bg); color: var(--ok); }
.quality li.is-ok::before { content: "✓"; }
.quality li.is-warn { background: var(--warn-bg); color: var(--warn); }
.quality li.is-warn::before { content: "!"; font-weight: 700; }
.quality li.is-error { background: var(--danger-bg); color: var(--danger); }
.quality li.is-error::before { content: "✕"; font-weight: 700; }

.code pre {
  margin: 6px 0 0;
  padding: 12px;
  background: var(--rail);
  color: #d4d5e6;
  border-radius: var(--radius-sm);
  overflow: auto;
  max-height: 260px;
  font-family: var(--mono);
  font-size: 11.5px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}

.export-bar { display: flex; gap: 8px; flex-wrap: wrap; }
.export-bar .btn { flex: 1 1 auto; }
.export-bar .btn--primary { flex: 2 1 auto; height: 40px; font-size: 14.5px; }
.export-bar .btn:not(.btn--primary) { height: 40px; }

/* ----------------------------- Page Administration -------------------------- */
/* app/(app)/admin : PageHeader (text-xl/2xl font-semibold, description text-sm text-muted),
   admin/users : en-tête de section, filtres, Card avec une ligne par compte (divide-y, px-4 py-3.5) */

.page { width: 100%; max-width: 1600px; margin: 0 auto; padding: 20px 24px 32px; }
.page-header { margin-bottom: 20px; }
.page-header h1 { font-size: 24px; font-weight: 600; letter-spacing: -0.025em; }
.page-header p { margin-top: 4px; max-width: 42rem; font-size: 14px; color: var(--text-2); }
.page-tabs { display: none; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.section-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.section-head h2 { font-size: 16px; font-weight: 600; }
.section-head p { font-size: 14px; color: var(--text-2); }
.filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.filters__search { flex: 1 1 12rem; max-width: 18rem; margin: 0; }
.tabs--sm .tab { height: 28px; padding: 0 10px; font-size: 12px; }
.card { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); transition: border-color .2s, box-shadow .2s; }
.card:hover { border-color: color-mix(in srgb, var(--primary) 50%, transparent); box-shadow: 0 0 0 3px color-mix(in oklab, var(--primary) 14%, transparent); }

.user-list { list-style: none; margin: 0; padding: 0; }
.user-row {
  display: grid; gap: 12px; align-items: center;
  grid-template-columns: minmax(15rem, 1fr) minmax(12rem, 1fr) auto;
  padding: 14px 16px;
}
.user-row + .user-row { border-top: 1px solid var(--border); }
.user-row.is-inactive { background: color-mix(in srgb, var(--warn-bg) 30%, transparent); }
.user-row__who { display: flex; align-items: center; gap: 12px; min-width: 0; }
.user-row__ident { min-width: 0; }
.user-row__name { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-weight: 500; }
.user-row__name > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-row__email { font-size: 12px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-row__access { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-2); }
.user-row__side { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.menu__panel--manage { width: 15rem; }
.empty-state { padding: 48px 24px; text-align: center; font-size: 14px; color: var(--text-2); }
.empty-state__title { font-weight: 600; color: var(--text); }

/* Choix sous forme de cartes (fenêtre « Accès » du Hub) : border rounded-lg px-3 py-2.5, sélection border-primary bg-primary-soft */
.choices { display: grid; gap: 8px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.choice { position: relative; display: block; cursor: pointer; }
.choice input { position: absolute; opacity: 0; width: 0; height: 0; }
.choice > span { display: block; height: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); transition: background-color .15s, border-color .15s; }
.choice:hover > span { background: color-mix(in srgb, var(--surface-2) 60%, transparent); }
.choice strong { display: block; font-size: 14px; font-weight: 500; }
.choice small { display: block; margin-top: 2px; font-size: 12px; color: var(--text-2); }
.choice input:checked + span { border-color: var(--primary); background: var(--primary-soft); }
.choice input:checked + span strong { color: var(--primary); }
.choice input:focus-visible + span { outline: 2px solid var(--primary); outline-offset: 2px; }
fieldset.field { border: 0; padding: 0; margin: 0 0 12px; min-width: 0; }
fieldset.field legend { padding: 0; margin-bottom: 6px; }
.form-stack .field:last-child { margin-bottom: 0; }
.form-stack > .grid { margin-bottom: 12px; }
.field > .tabs { align-self: flex-start; }
.req { margin-left: 2px; color: var(--danger); font-weight: 500; }
.danger-note { display: flex; gap: 10px; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--warn-bg); color: var(--warn); font-size: 13px; }

/* --------------------------------- Fenêtres -------------------------------- */
/* components/ui/dialog.tsx : fond bg-slate-950/50 backdrop-blur-[2px], rounded-2xl border shadow-pop,
   en-tête px-5 py-4 (titre text-base, description text-sm text-muted), corps px-5 py-4 */

.modal { position: fixed; inset: 0; z-index: 80; display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal__backdrop { position: absolute; inset: 0; background: rgb(2 6 23 / .5); backdrop-filter: blur(2px); animation: fade .15s ease-out; }
.modal__dialog {
  position: relative; display: flex; flex-direction: column;
  width: min(32rem, 100%); max-height: calc(100dvh - 2rem);
  border: 1px solid var(--border); border-radius: 16px;
  background: var(--surface); box-shadow: var(--shadow-pop);
  overflow: hidden; outline: none; animation: pop .15s ease-out;
}
.modal__dialog--wide, #adminCreate .modal__dialog { width: min(42rem, 100%); }
.modal__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.modal__head h2 { font-size: 16px; font-weight: 600; }
.modal__desc { margin-top: 2px; font-size: 14px; color: var(--text-2); }
.modal__close { margin: -2px -6px 0 0; display: inline-flex; padding: 6px; border: 0; border-radius: 6px; background: transparent; color: var(--text-2); }
.modal__close:hover { background: var(--surface-2); color: var(--text); }
.modal__tabs { padding: 12px 20px 0; }
.modal__body { min-height: 0; flex: 1 1 auto; overflow-y: auto; padding: 16px 20px; }
.modal__foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; padding: 12px 20px; border-top: 1px solid var(--border); background: color-mix(in srgb, var(--surface-2) 50%, transparent); }
.guide { display: none; }
.guide.is-active { display: block; animation: fade .15s ease-out; }
.guide ol { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 9px; font-size: 14px; }

/* Console d'administration */
.admin-table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); }
.admin-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.admin-table th { padding: 8px 12px; background: color-mix(in srgb, var(--surface-2) 60%, transparent); text-align: left; font-size: 12px; font-weight: 500; color: var(--text-2); }
.admin-table td { padding: 8px 12px; border-top: 1px solid var(--border); vertical-align: middle; }
.admin-table tr:hover td { background: color-mix(in srgb, var(--surface-2) 40%, transparent); }
.admin-table__who { display: flex; align-items: center; gap: 10px; min-width: 220px; }
.admin-table__who .avatar { width: 28px; height: 28px; font-size: 11.2px; }
.admin-table__who strong { display: block; font-weight: 500; }
.admin-table__who span:not(.avatar) { font-size: 12px; color: var(--text-2); }
.admin-table select { width: auto; min-width: 150px; height: 32px; font-size: 13px; }
.admin-table tr.is-inactive .admin-table__who { opacity: .6; }
.admin-table__actions { white-space: nowrap; text-align: right; }

/* -------------------------------- Connexion ------------------------------- */
/* Page /login du Hub : carte centrée, logo, bouton principal pleine largeur */

.is-locked > :not(.auth):not(.toasts):not(script) { display: none !important; }
.auth { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px 16px; }
.auth__card { width: min(400px, 100%); padding: 28px 24px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); animation: pop .15s ease-out; }
.auth__brand { display: flex; align-items: center; gap: 12px; margin-bottom: 24px; }
.auth__brand img { width: 40px; height: 40px; object-fit: contain; }
.auth__brand h1 { font-size: 17px; letter-spacing: -0.02em; }
.auth__brand p { font-size: 13px; color: var(--text-2); }
.auth__form h2 { font-size: 15px; margin-bottom: 16px; }
.auth__form .btn--primary { height: 40px; margin-top: 4px; }
.auth__link { display: block; margin: 12px auto 0; padding: 4px; border: 0; background: none; font-size: 13px; color: var(--primary); }
.auth__link:hover { text-decoration: underline; text-underline-offset: 2px; }
.auth__message { margin-top: 16px; font-size: 13px; color: var(--text-2); text-align: center; }
.auth__message.is-error { padding: 9px 11px; border-radius: var(--radius-sm); background: var(--danger-bg); color: var(--danger); text-align: left; }

/* ------------------------------ Notifications ----------------------------- */
/* <Toaster position="bottom-right" richColors closeButton /> (sonner) */

.toasts { position: fixed; right: 24px; bottom: 24px; z-index: 90; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; pointer-events: none; }
.toast {
  position: relative; display: flex; align-items: center; gap: 8px;
  width: min(356px, calc(100vw - 32px)); padding: 16px;
  border: 1px solid var(--border); border-radius: 8px;
  background: var(--surface); color: var(--text);
  font-size: 13px; box-shadow: 0 4px 12px rgb(0 0 0 / .1);
  pointer-events: auto; animation: pop .2s ease-out; transition: opacity .2s, transform .2s;
}
.toast.is-success { background: #ecfdf3; border-color: #bffcd9; color: #008a2e; }
.toast.is-error { background: #fff0f0; border-color: #ffe0e1; color: #e60000; }
html[data-theme="dark"] .toast.is-success { background: #001f0f; border-color: #003d1c; color: #59f3a6; }
html[data-theme="dark"] .toast.is-error { background: #2d0607; border-color: #4d0408; color: #ff9ea1; }
.toast.is-leaving { opacity: 0; transform: translateY(6px); }
.toast__close {
  position: absolute; top: -7px; left: -7px;
  display: inline-flex; align-items: center; justify-content: center;
  width: 20px; height: 20px; padding: 0;
  border: 1px solid currentColor; border-radius: 999px;
  background: inherit; color: inherit; opacity: 0; transition: opacity .15s;
}
.toast:hover .toast__close, .toast__close:focus-visible { opacity: 1; }

/* ------------------------------- Responsive ------------------------------- */

/* Entre 1024 et 1240 px : éditeur et aperçu l'un sous l'autre */
@media (max-width: 1240px) {
  .layout { grid-template-columns: minmax(0, 1fr); height: auto; }
  .workspace-banner:not([hidden]) ~ .layout { height: auto; }
  .panel--editor { max-height: 70vh; }
}

/* Mobile et tablette (lg du Hub) : barre d'onglets en bas, panneau en tiroir */
@media (max-width: 1023px) {
  /* z-index: auto : un élément flex avec z-index crée un contexte d'empilement et passerait sous le fond du tiroir */
  .nav { position: static; height: auto; z-index: auto; }
  .rail { display: none; }
  /* Tiroir : w-80 max-w-[88vw] border-r bg-surface p-3 shadow-pop animate-slide-in */
  .sidebar, .shell.is-collapsed .sidebar {
    position: fixed; inset: 0 auto 0 0; z-index: 60;
    display: none; width: min(320px, 88vw);
    background: var(--surface); box-shadow: var(--shadow-pop);
    padding-bottom: env(safe-area-inset-bottom);
  }
  .shell.is-drawer .sidebar { display: flex; animation: slide-left .2s ease-out; }
  .shell.is-drawer .drawer-backdrop { display: block; position: fixed; inset: 0; z-index: 55; background: rgb(2 6 23 / .5); animation: fade .15s ease-out; }
  .sidebar__head { padding: 0 6px 0 16px; }
  .drawer-close { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--text-2); }
  .drawer-close:hover { background: var(--surface-2); }
  .drawer-account { display: flex; align-items: center; gap: 12px; margin-top: 8px; padding: 8px; border-top: 1px solid var(--border); }
  .drawer-account__text { display: flex; flex-direction: column; flex: 1 1 auto; min-width: 0; font-size: 14px; font-weight: 500; }
  .drawer-account__text span:last-child { font-size: 12px; font-weight: 400; color: var(--text-2); }
  .drawer-account .icon-btn { width: 44px; height: 44px; border: 1px solid var(--border); border-radius: var(--radius-sm); }
  .nav-link, .library__item { min-height: 48px; font-size: 15px; }
  .library__actions { opacity: 1; }

  .topbar { padding: 0 12px; }
  .topbar__title h1 { font-size: 17px; }
  .page { padding: 16px 12px calc(88px + env(safe-area-inset-bottom)); }
  .page-header h1 { font-size: 20px; }
  /* Menu de l'administration en pastilles défilantes (lg:hidden dans le Hub) */
  .page-tabs { display: flex; gap: 4px; overflow-x: auto; margin-bottom: 16px; padding-bottom: 4px; }
  .page-tabs a { display: inline-flex; align-items: center; gap: 10px; height: 36px; padding: 0 12px; border-radius: var(--radius-sm); color: var(--text-2); font-size: 13.5px; font-weight: 500; text-decoration: none; white-space: nowrap; }
  .page-tabs a.is-active { background: var(--primary-soft); color: var(--primary); }
  .user-row { grid-template-columns: minmax(0, 1fr); }
  .user-row__side { justify-content: flex-start; }
  .choices { grid-template-columns: minmax(0, 1fr); }
  .card:hover { border-color: var(--border); box-shadow: none; }
  .layout { padding: 12px 12px calc(88px + env(safe-area-inset-bottom)); gap: 12px; }
  .panel, .panel__body { overflow: visible; }
  .panel--editor { max-height: none; }
  .panel:hover { border-color: var(--border); box-shadow: none; }
  .grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .logo-row { grid-template-columns: 1fr; }
  .logo-preview { height: 86px; }
  .partner { grid-template-columns: 60px minmax(0, 1fr) 30px; }

  /* fixed bottom-0 grid grid-cols-5 border-t bg-surface/90 backdrop-blur ; onglet h-16 text-[10.5px], icône 22 px */
  .tabbar {
    position: fixed; inset: auto 0 0 0; z-index: 30;
    display: grid; grid-template-columns: repeat(5, 1fr);
    padding-bottom: env(safe-area-inset-bottom);
    border-top: 1px solid var(--border);
    background: color-mix(in srgb, var(--surface) 90%, transparent);
    backdrop-filter: blur(8px);
  }
  .tabbar__item { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; height: 64px; border: 0; background: none; color: var(--text-2); font-size: 10.5px; font-weight: 500; }
  .tabbar__item .icon { width: 22px; height: 22px; }
  .tabbar__item.is-active { color: var(--primary); }
  .tabbar__fab { display: flex; align-items: center; justify-content: center; }
  /* size-12 rounded-2xl bg-primary text-primary-fg shadow-pop active:scale-95 */
  .tabbar__fab button { display: inline-flex; align-items: center; justify-content: center; width: 48px; height: 48px; border: 0; border-radius: 16px; background: var(--primary); color: var(--primary-fg); box-shadow: var(--shadow-pop); transition: transform .1s; }
  .tabbar__fab button:active { transform: scale(.95); }
  .tabbar__fab .icon { width: 24px; height: 24px; }

  .toasts { right: 16px; left: 16px; align-items: center; bottom: calc(88px + env(safe-area-inset-bottom)); }
}

@media (max-width: 560px) {
  .grid--2, .grid--3, .variants { grid-template-columns: minmax(0, 1fr); }
  .topbar__title p { display: none; }
  .save-state { font-size: 0; gap: 0; }
  .export-bar .btn { flex: 1 1 100%; }
  .switches { grid-template-columns: minmax(0, 1fr); }
  .panel__head--preview { align-items: flex-start; }
}

/* Écrans tactiles : pas de survol, les actions révélées au survol restent visibles */
@media (hover: none) { .library__actions { opacity: 1; } .kbd-inverse { display: none; } }

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

@media print {
  .nav, .topbar, .tabbar, body::before { display: none !important; }
}
