/* src/darkmoon/web/static/css/app.css — interface du site (spec C). Jetons et polices : tokens.css.
   Une section par composant ; aucun style en ligne (CSP stricte). */

/* ===== Base ============================================================================================ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 15px/1.6 var(--font-text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
[hidden] { display: none !important; }
a { color: var(--accent-ink); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; line-height: 1.25; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
::selection { background: #dbe6ff; }
::placeholder { color: var(--muted); opacity: 1; }

.display { font-family: var(--font-display); font-weight: 500; letter-spacing: -0.01em; }
.mono { font-family: var(--font-mono); font-size: .86em; font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }
.row { display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.grow { flex: 1; min-width: 0; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.skip-link {
  position: absolute; left: var(--s3); top: -60px; z-index: 100;
  padding: var(--s2) var(--s3); border-radius: var(--r-sm); background: var(--ink); color: #fff;
}
.skip-link:focus { top: var(--s3); }

.icon {
  width: 18px; height: 18px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round;
}
.icon.sm { width: 16px; height: 16px; }
.icon.lg { width: 22px; height: 22px; }
.icon.xl { width: 28px; height: 28px; }

.brand {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--font-display); font-weight: 600; font-size: 17px; letter-spacing: -0.02em;
  color: var(--ink); text-decoration: none; white-space: nowrap;
}
.brand:hover { text-decoration: none; }
.brand::before {
  content: ""; width: 12px; height: 12px; border-radius: 50%;
  background: var(--accent); box-shadow: inset -4px -3px 0 0 #93b4ff;
}
.brand.lg { font-size: 26px; }
.brand.lg::before { width: 18px; height: 18px; box-shadow: inset -6px -4px 0 0 #93b4ff; }

/* ===== Boutons ========================================================================================= */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  min-height: 38px; padding: 0 var(--s4);
  border: 1px solid transparent; border-radius: var(--r-sm);
  background: var(--soft); color: var(--ink);
  font-weight: 600; font-size: 14px; line-height: 1.1; white-space: nowrap; text-decoration: none;
  transition: background var(--t-fast), border-color var(--t-fast), color var(--t-fast), box-shadow var(--t-fast);
}
.btn:hover { background: var(--soft-2); text-decoration: none; }
.btn.primary { background: var(--accent); color: #fff; box-shadow: 0 1px 2px rgba(37, 99, 235, .25); }
.btn.primary:hover { background: var(--accent-ink); }
.btn.ghost { background: var(--bg); border-color: var(--line-2); }
.btn.ghost:hover { background: var(--soft); }
.btn.danger { color: var(--err-ink); }
.btn.danger:hover, .btn.armed { background: var(--err-bg); border-color: var(--err-line); color: var(--err-ink); }
.btn.sm { min-height: 32px; padding: 0 var(--s3); font-size: 13px; border-radius: 9px; }
.btn.lg { min-height: 46px; padding: 0 22px; font-size: 15px; border-radius: 12px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; box-shadow: none; }
.btn:disabled:hover { background: var(--soft); }
.btn.primary:disabled:hover { background: var(--accent); }

.icon-btn {
  display: inline-grid; place-items: center; width: 36px; height: 36px; padding: 0;
  border: 1px solid transparent; border-radius: var(--r-sm); background: transparent; color: var(--ink-2);
  transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast);
}
.icon-btn:hover { background: var(--soft); color: var(--ink); }
.icon-btn.bordered { border-color: var(--line-2); background: var(--bg); }
.icon-btn.xs { width: 28px; height: 28px; border-radius: 8px; }
.icon-btn.xs .icon { width: 16px; height: 16px; }
.icon-btn[aria-expanded="true"] { background: var(--soft); color: var(--ink); }
.link { padding: 0; border: 0; background: none; color: var(--accent-ink); font-weight: 600; }
.link:hover { text-decoration: underline; }

/* ===== Champs ========================================================================================== */
.field { display: grid; gap: 6px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.input, .field input, .field textarea, .field select {
  width: 100%; min-height: 40px; padding: 9px 12px;
  border: 1px solid var(--line-2); border-radius: var(--r-sm); background: var(--bg); color: var(--ink);
  font-size: 14px; font-weight: 400;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.field textarea { resize: vertical; line-height: 1.55; }
.input:focus, .field input:focus, .field textarea:focus, .field select:focus {
  outline: none; border-color: var(--accent); box-shadow: var(--focus-ring);
}
.check { display: inline-flex; align-items: center; gap: var(--s2); font-size: 14px; font-weight: 500; cursor: pointer; }
.check input { width: 16px; height: 16px; margin: 0; accent-color: var(--accent); }

/* ===== Pastilles, points d'état, alertes ================================================================ */
.pill {
  display: inline-flex; align-items: center; gap: 6px; max-width: 100%;
  padding: 3px 10px; border-radius: var(--r-pill); background: var(--soft); color: var(--ink-2);
  font-size: 12px; font-weight: 600; line-height: 1.5; white-space: nowrap;
}
.pill .icon { width: 14px; height: 14px; }
.pill.accent { background: var(--accent-soft); color: var(--accent-ink); }
.pill.ok { background: var(--ok-bg); color: var(--ok-ink); }
.pill.warn { background: var(--warn-bg); color: var(--warn-ink); white-space: normal; }
.pill.err { background: var(--err-bg); color: var(--err-ink); }
.pill.api { background: var(--accent-soft); color: var(--accent-ink); }

.dot { width: 8px; height: 8px; flex: none; border-radius: 50%; background: currentColor; color: var(--st-none); }
.dot.start { color: var(--st-start); }
.dot.gen { color: var(--st-gen); }
.dot.ok { color: var(--st-ok); }
.dot.err { color: var(--st-err); }
.dot.pulse { animation: pulse 1.6s var(--ease) infinite; }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, currentColor 45%, transparent); }
  70%, 100% { box-shadow: 0 0 0 7px color-mix(in srgb, currentColor 0%, transparent); }
}

.alert {
  display: flex; align-items: flex-start; gap: var(--s2);
  padding: 10px 14px; border-radius: var(--r-sm); font-size: 14px; line-height: 1.5;
}
.alert .icon { margin-top: 2px; }
.alert.error { background: var(--err-bg); color: var(--err-ink); }
.alert.warn { background: var(--warn-bg); color: var(--warn-ink); }
.alert.info { background: var(--accent-soft); color: var(--accent-ink); }

.section-label {
  font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted);
}
.kbd {
  display: inline-block; padding: 0 6px; border: 1px solid var(--line-2); border-bottom-width: 2px;
  border-radius: 6px; background: var(--bg); color: var(--ink-2); font: 500 11px/18px var(--font-mono);
}
.skeleton {
  display: block; height: 12px; border-radius: 6px;
  background: linear-gradient(90deg, var(--soft) 25%, #f9fafd 50%, var(--soft) 75%);
  background-size: 200% 100%; animation: shimmer 1.2s linear infinite;
}
.skeleton.w60 { width: 60%; }
.skeleton.w40 { width: 40%; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ===== Menus =========================================================================================== */
.menu-wrap { position: relative; }
.menu {
  position: absolute; z-index: 40; top: calc(100% + 6px); left: 0;
  min-width: 220px; max-width: min(360px, calc(100vw - 24px)); padding: 6px;
  background: var(--bg); border: 1px solid var(--line-2); border-radius: 14px; box-shadow: var(--shadow-2);
  animation: pop var(--t) var(--ease);
}
.menu.menu-right { left: auto; right: 0; }
.menu.menu-up { top: auto; bottom: calc(100% + 8px); }
.menu form { margin: 0; }
.menu-item {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px;
  border: 0; border-radius: 9px; background: none; color: var(--ink);
  font-size: 14px; font-weight: 500; text-align: left; text-decoration: none;
}
.menu-item:hover, .menu-item:focus-visible { background: var(--soft); text-decoration: none; }
.menu-item:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.menu-item.danger { color: var(--err-ink); }
.menu-item.danger:hover, .menu-item.armed { background: var(--err-bg); color: var(--err-ink); }
.menu-label { padding: 6px 10px 4px; font-size: 12px; color: var(--muted); }
.menu-empty { padding: 10px; font-size: 14px; color: var(--muted); }
@keyframes pop { from { opacity: 0; transform: translateY(-4px) scale(.98); } }

/* ===== Fenêtres (dialog natif : rôle, piège du focus, Échap) ============================================ */
dialog { padding: 0; border: 0; background: transparent; color: inherit; max-width: none; max-height: none; }
dialog::backdrop { background: rgba(20, 24, 36, .32); }
.modal { width: min(720px, calc(100vw - 32px)); margin: auto; }
.modal.wide { width: min(980px, calc(100vw - 32px)); }
.modal[open] { animation: pop var(--t) var(--ease); }
.modal-card {
  display: flex; flex-direction: column; max-height: min(88vh, 900px);
  background: var(--bg); border-radius: var(--r-lg); box-shadow: var(--shadow-2); overflow: hidden;
}
.modal-head { display: flex; align-items: center; gap: var(--s3); padding: 20px 24px 8px; }
.modal-head h2 { flex: 1; font-size: 18px; }
.modal-body { flex: 1 1 auto; min-height: 0; display: grid; align-content: start; gap: var(--s4); padding: var(--s3) 24px 20px; overflow-y: auto; }
.modal-foot {
  display: flex; align-items: center; gap: var(--s4); padding: var(--s4) 24px;
  border-top: 1px solid var(--line); background: var(--surface);
}
.modal-foot .grow { font-size: 13px; }

/* ===== Toasts (aria-live) ============================================================================== */
.toasts {
  position: fixed; z-index: 90; left: 50%; bottom: 24px; transform: translateX(-50%);
  display: grid; gap: var(--s2); width: min(520px, calc(100vw - 32px)); pointer-events: none;
}
.toast {
  display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 14px;
  border: 1px solid transparent; border-radius: 14px; background: var(--ink); color: #fff;
  box-shadow: var(--shadow-2); font-size: 14px; pointer-events: auto;
  animation: toast-in var(--t) var(--ease);
}
.toast-text { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.toast.success > .icon { color: #4ade80; }
.toast.error { background: var(--bg); color: var(--err-ink); border-color: var(--err-line); }
.toast .icon-btn { color: inherit; }
.toast .icon-btn:hover { background: rgba(255, 255, 255, .14); color: inherit; }
.toast.error .icon-btn:hover { background: var(--err-bg); }
.toast .btn { min-height: 28px; padding: 0 10px; font-size: 13px; }
.toast.leaving { opacity: 0; transform: translateY(6px); transition: opacity var(--t), transform var(--t); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

/* ===== Connexion ======================================================================================= */
.login-page {
  min-height: 100vh; display: grid; place-items: center; padding: var(--s5);
  background: radial-gradient(1100px 520px at 50% -12%, var(--accent-soft), transparent 62%), var(--bg);
}
.login-card {
  width: min(400px, 100%); display: grid; gap: var(--s5); padding: 40px 32px 32px;
  background: var(--bg); border: 1px solid var(--line); border-radius: 24px; box-shadow: var(--shadow-1);
}
.login-card header { display: grid; gap: var(--s2); }
.login-form { display: grid; gap: var(--s4); }
.privacy-card { width: min(680px, 100%); gap: var(--s4); }
.privacy-title { margin: 0; font-size: 24px; }
.privacy-card ul { margin: 0; padding-left: 1.2em; display: grid; gap: var(--s2); }
.privacy-card p { margin: 0; }
.login-form .btn { white-space: normal; overflow-wrap: anywhere; text-align: center; padding-block: var(--s2); }

/* ===== Barre du haut ================================================================================== */
.topbar {
  position: relative; z-index: 30;
  display: flex; align-items: center; gap: var(--s3);
  height: var(--topbar-h); padding: 0 var(--s4) 0 var(--s5);
  background: var(--bg); border-bottom: 1px solid var(--line);
}
.topbar .brand { margin-right: var(--s2); }
.topbar-end { display: flex; align-items: center; gap: var(--s2); margin-left: auto; }

.topbar-space { font-weight: 700; font-size: 15px; }

/* ===== Barre d'espaces (spec S §3.1) : à gauche, en onglets en bas sur téléphone ; Réglages à son pied (l'état des
   pods est dans le bandeau du haut, spec T) ========================================================== */
:root { --rail-w: 84px; --tabs-h: 0px; }
.spaces {
  position: fixed; z-index: 40; top: 0; bottom: 0; left: 0; width: var(--rail-w);
  display: flex; flex-direction: column; gap: var(--s2);
  padding: var(--s3) 6px; background: var(--surface); border-right: 1px solid var(--line);
}
.rail-brand { justify-content: center; gap: 0; margin: 2px 0 var(--s2); font-size: 0; }   /* le point-lune ; le nom reste lu */
.space-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.space-link {
  position: relative; display: grid; justify-items: center; gap: 4px; min-height: 56px; padding: 9px 4px;
  border-radius: var(--r-sm); color: var(--muted); font-size: 11.5px; font-weight: 600; line-height: 1.2;
  text-align: center; transition: background var(--t-fast), color var(--t-fast);
}
.space-link .icon { width: 22px; height: 22px; }
.space-link:hover { background: var(--soft); color: var(--ink); text-decoration: none; }
.space-link[aria-current="page"] { background: var(--accent-soft); color: var(--accent-ink); }
.space-badge {
  position: absolute; top: 4px; right: 12px; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: var(--r-pill); background: var(--accent); color: #fff; font-size: 11px; line-height: 18px;
}
.rail-foot { display: grid; justify-items: center; gap: var(--s1); margin-top: auto; }
.menu-rail { top: auto; bottom: 0; left: calc(100% + 8px); }

/* ===== Corps : barre latérale + zone principale ======================================================= */
.topbar, .app-body { margin-left: var(--rail-w); }
.app-body {
  display: flex; height: calc(100vh - var(--topbar-h) - var(--podbar-h) - var(--tabs-h));
  height: calc(100dvh - var(--topbar-h) - var(--podbar-h) - var(--tabs-h));
}

/* ===== Bandeau du pod (spec T §3) : une ligne au-dessus du contenu de chaque page ===================== */
:root { --podbar-h: 40px; }
.podbar {
  position: relative; z-index: 31;
  display: flex; align-items: center; gap: var(--s2); height: var(--podbar-h); margin-left: var(--rail-w);
  padding: 0 var(--s3) 0 var(--s4); background: var(--surface); border-bottom: 1px solid var(--line); font-size: 13px;
}
.podbar[data-tone="late"] { background: var(--warn-bg); border-bottom-color: #fed7aa; }
.podbar[data-tone="error"] { background: var(--err-bg); border-bottom-color: var(--err-line); }
.podbar-main {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: var(--s2); height: 100%; padding: 0;
  border: 0; background: none; color: var(--ink); font: inherit; text-align: left; cursor: pointer;
}
.podbar-main:focus-visible { outline: none; box-shadow: var(--focus-ring); border-radius: var(--r-sm); }
.podbar-title {
  flex: 0 1 auto; min-width: 0; max-width: 45%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-weight: 700;
}
.podbar[data-tone="late"] .podbar-title { color: var(--warn-ink); }
.podbar[data-tone="error"] .podbar-title { color: var(--err-ink); max-width: none; }
.podbar-detail { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
.podbar-stop { flex: none; color: var(--ink-2); font-weight: 600; white-space: nowrap; }
.podbar .dot[hidden], .podbar [hidden] { display: none; }
.podbar-progress {
  position: absolute; left: 0; right: 0; bottom: -1px; width: 100%; height: 3px;
  -webkit-appearance: none; appearance: none; border: 0; background: transparent;
}
.podbar-progress::-webkit-progress-bar { background: transparent; }
.podbar-progress::-webkit-progress-value { background: var(--st-start); transition: width var(--t); }
.podbar-progress::-moz-progress-bar { background: var(--st-start); }
.podbar-bg-wrap { flex: 0 1 auto; min-width: 0; }
.podbar-bg {
  display: flex; align-items: center; gap: 6px; max-width: 34vw; min-height: 28px; padding: 3px 10px;
  border: 1px solid var(--accent-line); border-radius: var(--r-pill); background: var(--bg); color: var(--ink-2);
  font: inherit; font-size: 12.5px; cursor: pointer;
}
.podbar-bg[aria-expanded="true"], .podbar-bg:hover { background: var(--accent-soft); }
.podbar-bg .dot { color: var(--st-gen); }
.podbar-bg .dot[data-phase="launching"], .podbar-bg .dot[data-phase="switching"] { color: var(--st-start); }
.podbar-bg-title { flex: none; font-weight: 700; }
.podbar-bg-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
.bgpod-menu { top: calc(100% + 6px); width: min(340px, calc(100vw - 24px)); }
.podbar-extend { flex: none; }
@media (min-width: 961px) {   /* la barre d'espaces porte la marque, le pod et Réglages : pas de barre du haut */
  :root { --topbar-h: 0px; }
  .topbar { display: none; }
}

.sidebar {
  flex: none; width: var(--sidebar-w); display: flex; flex-direction: column; gap: var(--s1);
  padding: var(--s4) var(--s3); background: var(--surface); border-right: 1px solid var(--line); overflow-y: auto;
}
.new-conv {
  display: flex; align-items: center; gap: var(--s2); padding: 10px 12px;
  border: 1px dashed #cdd6ea; border-radius: 12px; color: var(--accent-ink);
  font-size: 14px; font-weight: 600; transition: background var(--t-fast), border-color var(--t-fast);
}
.new-conv:hover { background: var(--accent-soft); border-color: var(--accent-line); text-decoration: none; }
.side-head { display: flex; align-items: stretch; gap: 6px; }   /* spec S §4 : « Nouvelle discussion » et « Prompts » */
.side-head .new-conv { flex: 1; min-width: 0; }
.side-prompts { flex: none; }
.new-conv[aria-current="page"] { background: var(--accent-soft); border-style: solid; border-color: var(--accent-line); }
.conv-list { list-style: none; display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px; }
.conv-item { position: relative; }
.conv-link {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--r-sm);
  color: var(--ink-2); font-size: 14px;
}
.conv-link:hover { background: var(--soft); text-decoration: none; }
.conv-link[aria-current="page"] { background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; }
.conv-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conv-badge {   /* discussion créée par l'API (spec E §9) */
  flex: none; padding: 0 6px; border-radius: var(--r-pill); background: var(--accent-soft); color: var(--accent-ink);
  font-size: 10.5px; font-weight: 700; line-height: 1.7; letter-spacing: .03em;
}
.conv-meta { flex: none; font-size: 12px; color: var(--muted); }
.conv-link[aria-current="page"] .conv-meta { color: var(--accent-ink); }
.conv-item[data-status="queued"] .dot { color: var(--st-start); }
.conv-item[data-status="running"] .dot { color: var(--st-gen); animation: pulse 1.6s var(--ease) infinite; }
.conv-item[data-status="done"] .dot { color: var(--st-ok); }
.conv-item[data-status="error"] .dot { color: var(--st-err); }
.conv-item[data-status="error"] .conv-meta { color: var(--err-ink); }
.conv-actions { position: absolute; top: 4px; right: 4px; opacity: 0; transition: opacity var(--t-fast); }
.conv-item:hover .conv-actions, .conv-item:focus-within .conv-actions { opacity: 1; }
.conv-item:hover .conv-meta, .conv-item:focus-within .conv-meta { visibility: hidden; }
.conv-actions .icon-btn { background: var(--bg); }
.conv-empty { padding: 4px 10px; }
/* spec D : recherche, groupes par date, type de la première pièce jointe (le point d'état se pose sur l'icône) */
.side-search {
  display: flex; align-items: center; gap: var(--s2); margin: var(--s2) 0 var(--s1); padding: 0 10px;
  border: 1px solid var(--line-2); border-radius: var(--r-sm); background: var(--bg); color: var(--muted);
}
.side-search:focus-within { border-color: var(--accent); box-shadow: var(--focus-ring); }
.side-search input {
  flex: 1; min-width: 0; height: 34px; padding: 0; border: 0; outline: none; background: none;
  color: var(--ink); font-size: 14px;
}
.conv-groups { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s1); }
.conv-group-label { margin: var(--s3) 10px var(--s1); }
.conv-kind {
  position: relative; display: inline-grid; place-items: center; flex: none; width: 20px; height: 20px;
  color: var(--muted);
}
.conv-kind .dot { position: absolute; right: -3px; bottom: -2px; width: 7px; height: 7px; box-shadow: 0 0 0 2px var(--surface); }
.conv-item[data-status="done"] .conv-kind .dot, .conv-item[data-status="empty"] .conv-kind .dot { display: none; }
.conv-link[aria-current="page"] .conv-kind { color: var(--accent-ink); }

.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.main { position: relative; flex: 1; min-width: 0; display: flex; flex-direction: column; }
.chat-scroll { flex: 1; overflow-y: auto; padding: var(--s6) var(--s5) var(--s5); }
.chat { max-width: var(--read-w); margin: 0 auto; }
.chat-head {
  display: flex; align-items: flex-start; gap: var(--s3);
  margin-bottom: var(--s5); padding-bottom: var(--s4); border-bottom: 1px solid var(--line);
}
.chat-head-text { flex: 1; min-width: 0; display: grid; gap: 10px; }
.chat-title { font-family: var(--font-display); font-size: 20px; font-weight: 500; overflow-wrap: anywhere; }

/* ===== Accueil « Que voulez-vous faire ? » (spec D §8) : saisie centrée, modèle et capacités, suggestions ===== */
.home { max-width: var(--read-w); margin: 0 auto; display: grid; gap: var(--s4); padding-top: 8vh; }
.home .hero-title { margin-bottom: var(--s2); text-align: center; font-size: 28px; }
.home .composer { width: 100%; margin: 0; }
.home .composer textarea { min-height: 76px; }
.caps { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.cap {
  display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border: 1px solid transparent;
  border-radius: var(--r-pill); background: var(--soft); color: var(--ink-2);
  font-size: 12px; font-weight: 600; line-height: 1.6; white-space: nowrap;
}
.cap .icon { width: 14px; height: 14px; }
.cap.no { border-color: var(--line-2); border-style: dashed; background: none; color: var(--muted); text-decoration: line-through; }
.suggestions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s3); }
.suggestion {
  display: grid; gap: 4px; padding: 12px 14px; text-align: left;
  border: 1px solid var(--line-2); border-radius: 14px; background: var(--bg); color: var(--ink);
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.suggestion:hover { border-color: var(--accent-line); box-shadow: var(--shadow-1); }
.model-chip { max-width: 260px; }
.model-chip .ellipsis { min-width: 0; }

/* ===== Cartes de prompts ================================================================================ */
.hero-title { font-family: var(--font-display); font-size: 26px; font-weight: 500; letter-spacing: -0.02em; overflow-wrap: anywhere; }
.prompt-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: var(--s3); }
.prompt-card {
  display: grid; align-content: start; gap: 6px; padding: 14px 16px; text-align: left;
  border: 1px solid var(--line-2); border-radius: 14px; background: var(--bg); color: var(--ink);
  transition: border-color var(--t-fast), box-shadow var(--t-fast), transform var(--t-fast);
}
button.prompt-card:hover { border-color: var(--accent-line); box-shadow: var(--shadow-1); transform: translateY(-1px); }
.pc-title { display: flex; align-items: center; gap: 6px; font-size: 14.5px; font-weight: 700; overflow-wrap: anywhere; }
.pc-text {
  display: -webkit-box; -webkit-line-clamp: 3; line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
  color: var(--muted); font-size: 13px; line-height: 1.5;
}
.prompt-card.run-all { border-style: dashed; border-color: #cdd6ea; background: var(--surface); }
.prompt-card.run-all .pc-title { color: var(--accent-ink); }
.prompt-card.none { grid-column: 1 / -1; justify-items: start; background: var(--surface); }
.prompt-card.loading { opacity: .6; pointer-events: none; }

/* ===== Quantifications proposées après une erreur du pod (panneau de détails) ============================ */
.pod-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.pod-tags[hidden] { display: none; }
.tag-chip {
  padding: 3px 10px; border: 1px solid var(--accent-line); border-radius: var(--r-pill);
  background: var(--accent-soft); color: var(--accent-ink); font-size: 12px;
}
.tag-chip:hover { background: #e2eaff; }
.bar {
  -webkit-appearance: none; appearance: none; width: 100%; height: 5px;
  border: 0; border-radius: 9px; background: var(--soft-2); overflow: hidden;
}
.bar::-webkit-progress-bar { background: var(--soft-2); border-radius: 9px; }
.bar::-webkit-progress-value { background: var(--accent); border-radius: 9px; transition: width var(--t); }
.bar::-moz-progress-bar { background: var(--accent); border-radius: 9px; }

/* ===== Panneau de détails du pod (dialog à droite) ===================================================== */
.drawer { position: fixed; inset: 0 0 0 auto; width: min(380px, 100vw); height: 100%; max-height: 100%; margin: 0; }
.drawer[open] { animation: slide-in var(--t) var(--ease); }
.drawer-card {
  display: flex; flex-direction: column; gap: var(--s4); height: 100%; padding: 20px 22px;
  background: var(--bg); box-shadow: var(--shadow-2); overflow-y: auto;
}
.drawer-head { display: flex; align-items: center; gap: 10px; }
.drawer-head h2 { flex: 1; font-size: 18px; }
.stepbar { list-style: none; display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; }
.stepbar li { height: 5px; border-radius: 9px; background: var(--soft-2); }
.stepbar li.done { background: var(--accent); }
.stepbar li.current { background: linear-gradient(90deg, var(--accent) 50%, var(--soft-2) 50%); }
.step-caption { margin-top: calc(-1 * var(--s2)); color: var(--accent-ink); font-size: 13px; font-weight: 600; }
.kv { display: grid; grid-template-columns: max-content 1fr; margin: 0; font-size: 14px; }
.kv dt, .kv dd { margin: 0; padding: 9px 0; border-bottom: 1px solid var(--line); }
.kv dt { padding-right: var(--s4); color: var(--muted); }
.kv dd { display: grid; gap: 2px; text-align: right; overflow-wrap: anywhere; }
.kv dd .mono { font-size: 11px; }
.drawer-empty { margin: var(--s2) 0; font-size: 14px; line-height: 1.6; }
.keep {
  display: flex; align-items: center; gap: var(--s2); padding: 8px 8px 8px 12px;
  border-radius: var(--r-sm); background: var(--accent-soft); color: var(--accent-ink); font-size: 13.5px;
}
.queue { list-style: none; display: grid; gap: 2px; margin-top: var(--s2); }
.queue a { display: flex; align-items: center; gap: var(--s2); padding: 8px 10px; border-radius: var(--r-sm); color: var(--ink-2); font-size: 14px; }
.queue a:hover { background: var(--soft); text-decoration: none; }
.drawer-foot { display: grid; gap: var(--s2); margin-top: auto; }
@keyframes slide-in { from { opacity: 0; transform: translateX(24px); } }


/* ===== Fenêtre « Clés d'API » (spec E §4.2) ============================================================ */
.key-list { list-style: none; display: grid; gap: 6px; margin: 0; padding: 0; }
.key-item { display: flex; align-items: center; gap: var(--s3); padding: 10px 12px; border: 1px solid var(--line-2); border-radius: var(--r-sm); }
/* Serveurs MCP (spec P §4) */
.mcp-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.mcp-item { border: 1px solid var(--line-2); border-radius: var(--r-sm); padding: 10px 12px; }
.mcp-item[data-status="error"] { border-color: var(--err-line); }
.mcp-head { display: flex; gap: 12px; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; }
.mcp-head .key-text { flex: 1 1 16rem; }   /* faute de place, « Rafraîchir » et « Supprimer » passent sous le nom et l'adresse */
.mcp-head code { word-break: break-all; }
.mcp-item .error-text { color: var(--err-ink); }
.mcp-tools summary { cursor: pointer; color: var(--muted); font-size: 13px; margin-top: 6px; }
.mcp-tool-list { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 4px; }
.mcp-tool { display: flex; gap: 8px; justify-content: space-between; align-items: flex-start; }
.mcp-tool .check-row { flex: 1; min-width: 0; }
.mcp-badges { display: flex; gap: 4px; flex-wrap: wrap; flex-shrink: 0; padding-top: 8px; }
.mcp-badges .badge { background: var(--soft-2); color: var(--ink-2); }
.mcp-badges .badge.warn { background: var(--warn-bg); color: var(--warn-ink); }
.key-text { flex: 1; min-width: 0; display: grid; gap: 2px; }
.key-text .small { overflow-wrap: anywhere; }
.key-name { font-size: 14px; overflow-wrap: anywhere; }
.key-name code { color: var(--muted); font: 500 12px var(--font-mono); }
.key-created { display: grid; gap: var(--s2); padding: 12px 14px; border: 1px solid var(--accent-line); border-radius: var(--r-md); background: var(--accent-soft); }
.key-secret-row { display: flex; align-items: center; gap: var(--s2); }
.key-secret {
  flex: 1; min-width: 0; padding: 6px 8px; border-radius: var(--r-sm); background: var(--bg);
  font: 500 12.5px var(--font-mono); overflow-wrap: anywhere; user-select: all;
}
.key-example {
  margin: 0; padding: 8px 10px; border-radius: var(--r-sm); background: var(--bg);
  font: 11.5px/1.5 var(--font-mono); white-space: pre-wrap; overflow-wrap: anywhere;
}
.key-form { display: grid; gap: var(--s3); }
.key-scope { display: grid; gap: 6px; margin: 0; padding: 0; border: 0; }
.key-models { display: grid; gap: 4px; padding-left: 24px; }

/* ===== Fenêtre « Choisir un modèle » =================================================================== */
/* liste compacte : une ligne par modèle (bouton radio) ; seul le modèle sélectionné déplie son détail (frère du
   bouton : un bouton ne contient ni lien ni bouton) */
.model-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; }
.model-slot {
  display: grid; min-width: 0; border: 1px solid var(--line-2); border-radius: 12px; background: var(--bg);
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.model-slot:hover { border-color: var(--accent-line); }
.model-slot.selected { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(37, 99, 235, .12); }
.model-slot.loading { gap: 8px; padding: 14px 16px; }
.model-card {
  /* colonnes fixes pour la qualité et le prix : les lignes s'alignent comme un tableau */
  display: grid; grid-template-columns: 16px minmax(0, 1fr) 10rem 5.5rem; align-items: center; gap: 4px 10px;
  grid-template-areas: "radio title quality price" "radio sub run run";
  width: 100%; min-width: 0; padding: 10px 14px; border: 0; border-radius: 12px; background: none; color: var(--ink);
  text-align: left;
}
.mc-radio {
  grid-area: radio; width: 14px; height: 14px; border: 1.5px solid color-mix(in srgb, var(--muted) 70%, white);
  border-radius: 50%;
}
.model-card.selected .mc-radio { border: 4px solid var(--accent); }
.mc-title { grid-area: title; display: flex; align-items: center; gap: 6px; min-width: 0; }
.mc-name {
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-family: var(--font-display); font-size: 14px; font-weight: 500;
}
.mc-title .pill { flex: none; padding: 1px 8px; font-size: 11px; }
.mc-quality { grid-area: quality; justify-self: start; }
.mc-price { grid-area: price; justify-self: end; color: var(--ink); font-size: 14px; font-weight: 600; white-space: nowrap; }
.mc-sub { grid-area: sub; display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; min-width: 0; font-size: 12px; }
.mc-sub .pill { padding: 0 8px; font-size: 11px; }
.mc-run {
  grid-area: run; justify-self: end; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: var(--muted); font-size: 12px;
}
.mc-run.warn { color: var(--warn-ink); }
.mc-error { grid-column: 2 / -1; grid-row: 2; color: var(--err-ink); font-size: 13px; line-height: 1.45; }
.model-card .skeleton.mc-price { width: 56px; }
.model-group { margin-top: 6px; }
/* détail du modèle sélectionné */
.mc-details { display: grid; gap: 8px; min-width: 0; padding: 10px 14px 12px 40px; border-top: 1px dashed var(--line-2); }
.mc-spec, .mc-words { color: var(--ink-2); font-size: 12.5px; overflow-wrap: anywhere; }
.mc-source { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 11.5px; }
.mc-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.queue-other { display: flex; align-items: center; gap: 8px; padding: 6px 8px; font-size: 14px; }

/* Page « Membres » (spec F §5.4, §5.5) */
.members-page { overflow-y: auto; }
.members { display: grid; gap: var(--s4); width: 100%; max-width: 880px; margin: 0 auto; padding: var(--s5) var(--s4) var(--s6); }
.members-head { display: grid; gap: var(--s2); }
.members > .btn, .members-head > .pill, .member-section > .btn { justify-self: start; }
.invite-form { display: flex; flex-wrap: wrap; align-items: end; gap: var(--s3); }
.member-list, .member-items, .mod-messages { list-style: none; display: grid; gap: var(--s3); padding: 0; margin: 0; }
.access-requests { display: grid; gap: var(--s2); }   /* inscriptions libres en attente (page « Membres ») */
.menu-count {
  margin-left: auto; min-width: 20px; padding: 0 6px; border-radius: var(--r-pill);
  background: var(--accent); color: #fff; font: 600 11px/18px var(--font-text); text-align: center;
}
.member-row, .member-section, .mod-message { display: grid; gap: var(--s2); padding: var(--s3) var(--s4); border: 1px solid var(--line); border-radius: 14px; background: var(--bg); }
.member-main, .member-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2); }
.member-name { font-weight: 700; }
.member-stats { display: grid; grid-template-columns: max-content 1fr; gap: 2px var(--s3); font-size: 14px; }
.member-stats dt { color: var(--muted); }
.member-item { display: flex; align-items: center; gap: var(--s2); min-width: 0; }
.field.inline { display: inline-flex; align-items: center; gap: var(--s2); }
.field.inline input { width: 90px; }
.danger-zone { border-color: var(--err-bg); }
.mod-message.assistant { background: var(--surface); }
.mod-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.mod-image img { max-width: min(320px, 100%); border-radius: 10px; }
.mc-forget.armed { background: var(--err-bg); border-color: var(--err-line); color: var(--err-ink); }
.hf-zone { display: grid; gap: var(--s2); }
.hf-field {
  display: flex; align-items: center; gap: 10px; padding: 5px 5px 5px 12px;
  border: 1px solid var(--line-2); border-radius: 12px; color: var(--muted);
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.hf-field:focus-within {
  border-color: var(--accent); box-shadow: var(--focus-ring); outline: 2px solid var(--accent); outline-offset: -1px;
}
.hf-field input { flex: 1; min-width: 0; padding: 6px 0; border: 0; outline: none; background: none; color: var(--ink); font-size: 14px; }
#model-dialog .modal-foot .btn.primary { min-width: 240px; }

/* ===== Variantes : niveau de qualité, barre « Comparer », vue « Quantification » (spec G §8) ============== */
#model-dialog .modal-body { container-type: inline-size; }
.head-text { flex: 1; min-width: 0; display: grid; gap: 2px; }
.head-sub { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; color: var(--muted); font-size: 12.5px; }
.head-sub .mono { overflow-wrap: anywhere; }
.list-view, .quant-view { display: grid; align-content: start; gap: var(--s4); min-width: 0; }
.meter { display: inline-flex; gap: 3px; flex: none; }
.meter i { width: 7px; height: 7px; border-radius: 50%; background: var(--soft-2); }
.meter[data-level="1"] i:nth-child(-n+1) { background: var(--st-err); }
.meter[data-level="2"] i:nth-child(-n+2) { background: var(--st-start); }
.meter[data-level="3"] i:nth-child(-n+3), .meter[data-level="4"] i:nth-child(-n+4),
.meter[data-level="5"] i:nth-child(-n+5), .meter[data-level="6"] i { background: var(--accent); }
.tier-word { font-weight: 700; }
.tier-word[data-level="1"] { color: var(--err-ink); }
.tier-word[data-level="2"] { color: var(--warn-ink); }
.qpill {
  display: inline-flex; align-items: center; gap: 7px; justify-self: start; max-width: 100%; padding: 3px 10px 3px 8px;
  border-radius: var(--r-pill); background: var(--soft); font-size: 12px; white-space: nowrap;
}
.qpill .mono { overflow: hidden; text-overflow: ellipsis; }
.mc-strip {
  display: inline-flex; align-items: center; gap: 8px; min-height: 32px; padding: 0 12px;
  border: 1px solid var(--line-2); border-radius: 9px; background: var(--surface); color: var(--ink-2);
  font-size: 12.5px; font-weight: 600; text-align: left;
}
.mc-strip:hover { background: var(--accent-soft); color: var(--accent-ink); }
.mc-strip .go { display: inline-flex; align-items: center; gap: 4px; color: var(--accent-ink); }
.mc-extra { display: grid; gap: 8px; min-width: 0; padding: 0 14px 12px 40px; }
.mc-extra .chips { display: flex; flex-wrap: wrap; gap: 6px; }
.mc-extra .tag-chip { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mc-extra .btn { justify-self: start; }
.mc-extra-title { color: var(--ink-2); font-size: 12.5px; font-weight: 600; }
.mc-detail summary { cursor: pointer; color: var(--muted); font-size: 12.5px; }
.mc-detail p { margin-top: 4px; color: var(--muted); font-size: 11.5px; overflow-wrap: anywhere; }
.reco {
  display: grid; gap: 8px; padding: 14px 16px; border: 1px solid var(--accent-line); border-radius: 14px;
  background: linear-gradient(180deg, var(--accent-soft), #f7f9ff);
}
.reco.none { border-color: var(--line-2); background: var(--surface); }
.reco-kicker {
  display: flex; align-items: center; gap: 6px; color: var(--accent-ink);
  font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
}
.reco.none .reco-kicker { color: var(--muted); }
.reco-main { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
.reco-name.mono { font-size: 16px; font-weight: 600; }
.reco-price.mono { margin-left: auto; font-size: 16px; font-weight: 700; }
.reco-why { color: var(--ink-2); font-size: 14px; line-height: 1.5; }
.reco-facts { color: var(--muted); font-size: 12.5px; }
.reco-alts {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding-top: 8px;
  border-top: 1px dashed var(--accent-line); font-size: 13px;
}
.alt {
  display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 0 12px;
  border: 1px solid var(--line-2); border-radius: 9px; background: var(--bg); font-size: 13px;
}
.alt:hover { border-color: var(--accent-line); background: var(--accent-soft); }
.alt b { font-family: var(--font-mono); font-weight: 600; font-size: 12.5px; }
.note { display: flex; align-items: flex-start; gap: 8px; color: var(--muted); font-size: 12.5px; }
.note .icon { margin-top: 2px; }
.help { border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.help > summary {
  display: flex; align-items: center; gap: 8px; padding: 10px 14px; list-style: none; cursor: pointer;
  color: var(--ink-2); font-size: 14px; font-weight: 600;
}
.help > summary::-webkit-details-marker, .tier > summary::-webkit-details-marker { display: none; }
.help .chev, .tier .chev { margin-left: auto; transition: transform var(--t); }
.help[open] > summary .chev, .tier[open] > summary .chev { transform: rotate(180deg); }
.help-body { display: grid; gap: 12px; padding: 0 14px 14px; color: var(--ink-2); font-size: 13.5px; line-height: 1.55; }
.levels { list-style: none; display: grid; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--bg); }
.level {
  display: grid; grid-template-columns: 150px 120px 1fr; gap: 12px; align-items: baseline; padding: 8px 12px;
  border-top: 1px solid var(--line); font-size: 13px;
}
.level:first-child { border-top: 0; }
.level-name { display: flex; align-items: center; gap: 8px; }
.level-ex { color: var(--muted); }
.glossary { display: grid; gap: 4px; padding-left: 18px; font-size: 13px; }
.variants { display: grid; gap: 8px; min-width: 0; margin: 0; padding: 0; border: 0; }
.variants > legend {
  padding: 0; margin-bottom: 6px; color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase;
}
.tiers { display: grid; gap: 8px; }
.cols, .qrow { display: grid; grid-template-columns: 18px minmax(0, 1fr) 64px 70px 74px 64px 78px; gap: 10px; align-items: center; }
.cols { padding: 0 14px; color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.cols span:nth-child(n+3), .qrow .num { text-align: right; }
.tier { border: 1px solid var(--line); border-radius: 12px; background: var(--bg); }
.tier > summary {
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; padding: 9px 12px; border-radius: 12px;
  list-style: none; cursor: pointer;
}
.tier > summary:hover { background: var(--surface); }
.tier-bits, .tier-note { color: var(--muted); font-size: 12.5px; }
.tier-meta { margin-left: auto; display: inline-flex; align-items: center; gap: 8px; color: var(--ink-2); font-size: 12.5px; font-weight: 600; }
.tier-rows { display: grid; gap: 2px; padding: 0 4px 6px; }
.qrow { padding: 7px 8px; border: 1px solid transparent; border-radius: 10px; cursor: pointer; font-size: 13px; }
.qrow:hover { background: var(--surface); }
.qrow input { width: 16px; height: 16px; margin: 0; accent-color: var(--accent); }
.qrow:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.qrow:has(input:focus-visible) { box-shadow: var(--focus-ring); }
.qrow:has(input:disabled) { cursor: not-allowed; }
.qrow:has(input:disabled) .qvar, .qrow:has(input:disabled) .num { color: var(--muted); }
.qname { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; min-width: 0; }
.qvar { font-family: var(--font-mono); font-size: 12.5px; overflow-wrap: anywhere; }
.qvar .fam { color: var(--muted); }
.badge { padding: 1px 8px; border-radius: var(--r-pill); font-size: 11px; font-weight: 700; white-space: nowrap; }
.badge.reco { background: var(--accent); color: #fff; }
.badge.best { background: var(--soft-2); color: var(--ink-2); }
.badge.cheap { background: var(--ok-bg); color: var(--ok-ink); }
.num { color: var(--ink-2); font-family: var(--font-mono); font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.num.price { color: var(--ink); font-size: 12.5px; font-weight: 700; }
.why-off { grid-column: 2 / -1; color: var(--warn-ink); font-size: 12px; }
.qrow .mob { display: none; }
/* corps de la fenêtre étroit (téléphone) : deux lignes par variante, sans en-tête de colonnes (spec G §8.4) */
@container (max-width: 560px) {
  .model-card {
    grid-template-columns: 16px auto minmax(0, 1fr) auto;
    grid-template-areas: "radio title title price" "radio quality run run" "radio sub sub sub";
  }
  .mc-quality { justify-self: start; }
  .mc-run { justify-self: start; max-width: 100%; }
  .mc-details, .mc-extra { padding-left: 14px; }
  .cols { display: none; }
  .qrow { grid-template-columns: 18px minmax(0, 1fr) auto; row-gap: 2px; padding: 9px 8px; }
  .qrow .num:not(.price) { display: none; }
  .qrow .mob { display: block; grid-column: 2 / -1; color: var(--muted); font-size: 12px; }
  .tier-note { display: none; }
  .level { grid-template-columns: 1fr; gap: 2px; }
  .reco-price.mono { margin-left: 0; }
}

/* ===== Benchmarks : « Trier par », notes des cartes, volet « Benchmarks » (spec H §8) ===================== */
.sort-bar { display: grid; gap: 6px; }
.sort-tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.sort-tab {
  min-height: 32px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: var(--r-pill);
  background: var(--bg); color: var(--ink-2); font-size: 13px; font-weight: 600;
  transition: background var(--t-fast), border-color var(--t-fast), color var(--t-fast);
}
.sort-tab:hover { border-color: var(--accent-line); }
.sort-tab[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-ink); }
.sort-select { display: none; align-items: center; gap: var(--s2); color: var(--ink-2); font-size: 13px; font-weight: 600; }
.sort-select select {
  flex: 1; min-width: 0; min-height: 36px; padding: 0 10px;
  border: 1px solid var(--line-2); border-radius: var(--r-sm); background: var(--bg); font-weight: 500;
}
.sort-select select:focus { outline: none; border-color: var(--accent); box-shadow: var(--focus-ring); }
.pill.rank { background: var(--accent); color: #fff; }
.mc-notes { color: var(--ink-2); font-size: 12px; font-variant-numeric: tabular-nums; }
.mc-notes > * { white-space: nowrap; }   /* une catégorie et sa note restent ensemble ; la ligne passe à la ligne */
.mc-notes b { color: var(--ink); font-weight: 700; }
.mc-advice { color: var(--ink-2); font-size: 12px; }
.mc-advice b { color: var(--ink); font-weight: 600; }
.mc-bench { border: 1px solid var(--line-2); border-radius: 10px; background: var(--bg); }
.mc-bench > summary {
  display: flex; align-items: center; gap: 8px; min-height: 34px; padding: 0 12px; list-style: none; cursor: pointer;
  color: var(--ink-2); font-size: 12.5px; font-weight: 600;
}
.mc-bench > summary::-webkit-details-marker { display: none; }
.mc-bench > summary:hover { color: var(--accent-ink); }
.mc-bench .chev { margin-left: auto; transition: transform var(--t); }
.mc-bench[open] > summary .chev { transform: rotate(180deg); }
.bench-body { display: grid; gap: 6px; padding: 0 14px 12px; }
.bench-title { margin-top: 4px; color: var(--ink-2); font-size: 12.5px; font-weight: 700; }
.bench-list { list-style: none; display: grid; gap: 2px; }
.bench-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 8px; font-size: 12.5px; }
.bench-name { font-weight: 600; overflow-wrap: anywhere; }
.bench-list .mono { grid-column: 1 / -1; grid-row: 2; color: var(--muted); }   /* nom et lien, puis les faits */
.bench-list a { grid-column: 2; grid-row: 1; }
.bench-body .icon { vertical-align: -2px; margin-right: 4px; }
/* corps de la fenêtre étroit : la liste déroulante remplace les boutons */
@container (max-width: 560px) {
  .sort-tabs { display: none; }
  .sort-select { display: flex; }
}

/* ===== Page « Benchmarks » : conclusions, barres, prix vs score, tableau complet (spec I) ================== */
.bench-page { overflow-y: auto; }
.bench-wrap { display: grid; gap: var(--s5); width: 100%; max-width: 1080px; margin: 0 auto; padding: var(--s5) var(--s4) var(--s6); }
.bench-head { display: grid; gap: var(--s2); }
.bench-section { display: grid; gap: var(--s3); min-width: 0; }
.bench-conclusions, .bench-errors { list-style: none; display: grid; gap: 6px; margin: 0; padding: 0; }
.bench-conclusions li { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; color: var(--ink-2); font-size: 14px; line-height: 1.45; }
.bench-errors li { color: var(--err-ink); font-size: 13px; }
.bench-bars { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s3); }
.bench-card, .bench-scatter {
  display: grid; align-content: start; gap: 8px; min-width: 0; padding: 14px 16px;
  border: 1px solid var(--line-2); border-radius: 14px; background: var(--bg);
}
.bench-card h3 { font-size: 14px; font-weight: 600; }
.chart-bars { display: grid; gap: 6px; }
.bar-row { display: grid; grid-template-columns: minmax(0, 38%) minmax(0, 1fr) 3.2em; align-items: center; gap: 8px; font-size: 13px; }
.bar-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-2); }
.bar-row-top .bar-name { color: var(--ink); font-weight: 600; }
.bar-track { display: block; width: 100%; height: 14px; border-radius: 4px; background: var(--soft); }
.bench-bar { fill: color-mix(in srgb, var(--accent) 38%, white); }   /* « .bar » : barre de progression du pod */
.bench-bar-top { fill: var(--accent); }
.bar-value { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.chart-scatter { display: block; max-width: 100%; height: auto; margin: 0 auto; overflow: visible; }
.chart-scatter text { fill: var(--ink-2); font: 12px var(--font-text); }
.chart-scatter .tick, .chart-scatter .axis-title { fill: var(--muted); font-size: 11px; }
.chart-scatter .grid { stroke: var(--line); }
.chart-scatter .axis { stroke: var(--line-2); }
.chart-scatter .frontier { fill: none; stroke: var(--accent); stroke-width: 2; }
.chart-scatter .pt { fill: var(--accent); stroke: var(--bg); stroke-width: 2; }
.chart-scatter .pt-dominated { fill: var(--bg); stroke: var(--muted); }
.chart-scatter .pt-label { fill: var(--ink); font-weight: 600; }
.chart-scatter .pt-label-dominated { fill: var(--muted); font-weight: 400; }
.bench-legend { color: var(--muted); font-size: 12.5px; }
.bench-table-wrap { overflow-x: auto; border: 1px solid var(--line-2); border-radius: 14px; background: var(--bg); }
.bench-table { min-width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
.bench-table th, .bench-table td {
  padding: 7px 10px; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums;
}
.bench-table thead th { background: var(--surface); color: var(--ink-2); font-size: 12px; font-weight: 600; }
.bench-table thead th[scope="colgroup"] { text-align: center; border-left: 1px solid var(--line); }
.bench-table tbody tr:last-child > * { border-bottom: 0; }
.bench-table .model-col { position: sticky; left: 0; z-index: 1; background: var(--bg); text-align: left; border-right: 1px solid var(--line); }
.bench-table thead .model-col { background: var(--surface); }
.bench-row-head { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; max-width: 280px; white-space: normal; }
.bench-model { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; color: var(--ink); font-weight: 600; }
.heat-1 { background: color-mix(in srgb, var(--accent) 6%, white); }
.heat-2 { background: color-mix(in srgb, var(--accent) 13%, white); }
.heat-3 { background: color-mix(in srgb, var(--accent) 21%, white); }
.heat-4 { background: color-mix(in srgb, var(--accent) 30%, white); }
.heat-5 { background: color-mix(in srgb, var(--accent) 40%, white); color: var(--ink); font-weight: 600; }
.heat-none { color: var(--muted); }
@media (max-width: 700px) {
  .bench-wrap { padding: var(--s4) var(--s3) var(--s5); }
  .bench-bars { grid-template-columns: 1fr; }
  .bench-row-head { max-width: 150px; }
}

/* ===== Messages de la conversation ===================================================================== */
.messages { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s6); }   /* piste bornée : un titre de source sur une ligne n'élargit pas le fil (téléphone) */
.msg.user { display: flex; justify-content: flex-end; }
.bubble { max-width: min(78%, 620px); padding: 12px 16px; border-radius: 18px 18px 6px 18px; background: var(--soft); }
.user-text { white-space: pre-wrap; overflow-wrap: anywhere; color: var(--ink); line-height: 1.6; }
.attach { display: flex; align-items: center; gap: 6px; margin-top: var(--s2); color: var(--muted); font-size: 12.5px; }
.bubble .att-chips { margin-top: var(--s2); }
.bubble .att-chip { background: var(--bg); }
.mc-caps { justify-content: flex-start; }
/* une ligne discrète de capacités entières : celles qui n'y tiennent pas passent sur une seconde ligne, cachée (toutes
   restent dans « Détails ») ; jamais une capacité coupée au milieu d'un mot */
.kv dd .caps { justify-content: flex-end; }
.msg.assistant { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s3); }   /* tableaux et code défilent dans la réponse */
.thinking { justify-self: start; max-width: 100%; }
.thinking summary {
  display: inline-flex; align-items: center; gap: var(--s2); padding: 5px 12px; list-style: none; cursor: pointer;
  border-radius: var(--r-pill); background: var(--soft); color: var(--muted); font-size: 13px; font-weight: 600;
  user-select: none;
}
.thinking summary::-webkit-details-marker { display: none; }
.thinking summary:hover { color: var(--ink-2); }
.think-toggle::after { content: "afficher"; color: var(--accent-ink); }
.thinking[open] .think-toggle::after { content: "masquer"; }
.thinking-body {
  margin-top: var(--s3); padding: 2px 0 2px var(--s4); border-left: 2px solid var(--line-2);
  color: var(--muted); font-size: 14px;
}

/* Markdown assaini des réponses : titres en Unbounded, corps 15 px / 1,7 */
.md { color: var(--ink-2); font-size: 15px; line-height: 1.7; overflow-wrap: anywhere; }
.md > :first-child { margin-top: 0; }
.md > :last-child { margin-bottom: 0; }
.md p, .md ul, .md ol, .md pre, .md table, .md blockquote { margin: 0 0 14px; }
.md h1, .md h2, .md h3 {
  margin: 26px 0 10px; color: var(--ink); font-family: var(--font-display); font-weight: 500;
  letter-spacing: -0.01em; line-height: 1.35;
}
.md h1 { font-size: 21px; }
.md h2 { font-size: 18px; }
.md h3 { font-size: 15.5px; }
.md h4, .md h5, .md h6 { margin: 20px 0 8px; color: var(--ink); font-size: 15px; font-weight: 700; }
.md ul, .md ol { padding-left: 22px; }
.md li { margin: 4px 0; }
.md li::marker { color: var(--muted); }
.md strong { color: var(--ink); font-weight: 700; }
.md a { text-decoration: underline; text-underline-offset: 2px; }
.md blockquote { padding: 2px 0 2px var(--s4); border-left: 3px solid var(--accent-line); color: var(--muted); }
.md code { padding: 1px 6px; border-radius: 6px; background: var(--soft); font: .86em var(--font-mono); }
.md pre { padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); overflow-x: auto; }
.md pre code { padding: 0; background: none; font-size: 13px; line-height: 1.6; }
.md table { display: block; max-width: 100%; overflow-x: auto; border-collapse: collapse; font-size: 14px; }
.md th, .md td { padding: 8px 12px; border: 1px solid var(--line-2); text-align: left; }
.md th { background: var(--surface); color: var(--ink); font-weight: 700; }
.md hr { height: 1px; margin: 24px 0; border: 0; background: var(--line); }
.md img { max-width: 100%; }
.answer.streaming > :last-child::after {
  content: ""; display: inline-block; width: 7px; height: 1.05em; margin-left: 3px; vertical-align: -2px;
  border-radius: 2px; background: var(--accent); animation: blink 1s steps(2) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.msg-wait { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 14px; }
.msg-wait::before {
  content: ""; width: 8px; height: 8px; flex: none; border-radius: 50%;
  background: currentColor; color: var(--st-start); animation: pulse 1.6s var(--ease) infinite;
}
.msg[data-status="running"] .msg-wait::before { color: var(--st-gen); }
.msg[data-status="cancelled"] .msg-wait::before { color: var(--st-none); animation: none; }
.warnings { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; }
.warnings:empty { display: none; }
.msg-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px var(--s4); }
.msg-actions { display: flex; flex-wrap: wrap; gap: 2px; margin-left: -8px; }
.act {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 8px;
  border: 0; border-radius: 8px; background: none; color: var(--muted); font-size: 13px; font-weight: 600;
}
.act:hover { background: var(--soft); color: var(--ink); text-decoration: none; }
.act[data-action="retry"] { color: var(--accent-ink); }
.act[data-action="cancel"] { color: var(--err-ink); }
.msg-meta { color: var(--muted); font-size: 11.5px; }
.msg-meta:empty { display: none; }
.jump {
  position: absolute; z-index: 20; left: 50%; bottom: calc(var(--composer-h) + 16px); transform: translateX(-50%);
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px;
  border: 1px solid var(--line-2); border-radius: var(--r-pill); background: var(--bg); color: var(--ink-2);
  font-size: 13px; font-weight: 600; box-shadow: var(--shadow-1);
}
.jump:hover { color: var(--ink); }

/* ===== Zone de saisie ================================================================================= */
.composer {
  position: relative; flex: none; display: grid; gap: var(--s2); container: composer / inline-size;
  width: min(var(--read-w), calc(100% - 48px)); margin: 0 auto 20px; padding: 10px 10px 10px 14px;
  background: var(--bg); border: 1px solid var(--line-2); border-radius: 18px; box-shadow: var(--shadow-1);
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.composer:focus-within {
  border-color: #c7d5f5; box-shadow: var(--shadow-1), var(--focus-ring); outline: 2px solid var(--accent); outline-offset: -1px;
}
.composer textarea {
  width: 100%; min-height: 30px; padding: 6px 4px 2px; border: 0; outline: none; resize: none;
  background: none; color: var(--ink); font-size: 15px; line-height: 1.55;
}
/* Trois groupes : outils, modèle et raisonnement (accueil), envoi. La barre passe à la ligne entre les groupes, jamais
   au milieu d'un groupe ni hors de la saisie ; l'envoi reste en bas à droite. Le nom du modèle et le raisonnement se
   tassent ; l'aide clavier se raccourcit puis disparaît (composer.js). */
.composer-bar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2); min-width: 0; }   /* min-width : sans quoi la grille de la saisie s’élargit à la somme des puces */
.composer-tools, .composer-settings, .composer-end { display: flex; align-items: center; gap: var(--s2); min-width: 0; }
.composer-tools, .composer-settings { flex-wrap: wrap; }   /* plutôt une puce à la ligne qu'une puce coupée */
.composer-end { flex: 1 1 auto; }   /* la place libre de sa ligne va à l'aide clavier */
:where(.composer-tools, .composer-settings, .composer-end) > * { flex: none; }   /* :where, sans poids : l'aide, la jauge et les puces qui se tassent gardent leur règle */
.composer-bar :is(.model-chip, .chip.select, .chip.static) { flex: 0 1 auto; min-width: 0; overflow: hidden; }
/* raisonnement figé d'une suite : le libellé se coupe avant la valeur */
.chip-key { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.chip-value { flex: none; margin-left: -2px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px;
  border: 1px solid var(--line-2); border-radius: var(--r-pill); background: var(--bg); color: var(--ink-2);
  font-size: 13px; font-weight: 600; white-space: nowrap;
}
button.chip:hover { background: var(--soft); }
.chip.accent { border-color: var(--accent-line); background: var(--accent-soft); color: var(--accent-ink); }
button.chip.accent:hover { background: #e2eaff; }
.chip.static { color: var(--muted); }
.chip.select { padding-right: 8px; }
.chip.select select {
  min-width: 0; overflow: hidden; text-overflow: ellipsis; field-sizing: content;   /* la largeur du choix affiché, pas du plus long */
  -webkit-appearance: none; appearance: none; padding: 0 2px 0 0; border: 0; outline: none;
  background: none; color: inherit; font: inherit; cursor: pointer;
}
.chip.select:focus-within { border-color: var(--accent); box-shadow: var(--focus-ring); }
.gauge { min-width: 0; overflow: hidden; text-overflow: ellipsis; color: var(--muted); font-size: 11.5px; white-space: nowrap; }
.gauge.warn { flex-shrink: 1; color: var(--warn-ink); }   /* l'alerte, longue, se coupe plutôt que de pousser l'envoi */
.composer-hint {   /* width 0 : sa longueur ne fait pas passer l'envoi à la ligne, elle prend la place qui reste */
  flex: 1 1 0; min-width: 0; width: 0; overflow: hidden; text-align: right; white-space: nowrap; text-overflow: ellipsis;
  color: var(--muted); font-size: 12px;
}
.composer-hint.short .hint-more { display: none; }
.composer-hint.cramped { visibility: hidden; }
.composer-bar .send { flex: none; margin-left: auto; }
.send {
  display: grid; place-items: center; width: 38px; height: 38px; padding: 0;
  border: 0; border-radius: 12px; background: var(--accent); color: #fff;
  transition: background var(--t-fast), opacity var(--t-fast);
}
.send:hover { background: var(--accent-ink); }
.send:disabled { opacity: .35; cursor: not-allowed; }
.send:disabled:hover { background: var(--accent); }
.composer-block {
  display: flex; align-items: center; gap: 10px; padding: 7px 7px 7px 12px; border-radius: 12px;
  background: var(--warn-bg); color: var(--warn-ink); font-size: 13.5px; font-weight: 600;
}
.composer-block.info { background: var(--accent-soft); color: var(--accent-ink); }
.composer-block [data-role="text"] { flex: 1; }
.composer-block .btn { border: 1px solid var(--line-2); background: var(--bg); color: var(--ink); }

/* ===== Pièces jointes (spec D §8) : puces compactes, voile de dépôt, aperçu ============================== */
.attach-btn { flex: none; }
.att-chips { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; }
.att-chip {
  display: flex; align-items: center; gap: 2px; max-width: min(280px, 100%); padding: 3px;
  border: 1px solid var(--line-2); border-radius: 12px; background: var(--surface);
}
.att-chip.warn { border-color: #fcd9b6; background: var(--warn-bg); }
.att-chip[data-state="error"] { border-color: var(--err-line); background: var(--err-bg); }
.att-open {
  display: flex; align-items: center; gap: 8px; min-width: 0; padding: 0 6px 0 0;
  border: 0; border-radius: 9px; background: none; color: inherit; text-align: left;
}
.att-open:disabled { cursor: default; }
.att-thumb {
  display: grid; place-items: center; flex: none; width: 30px; height: 30px; overflow: hidden;
  border-radius: 8px; background: #475569; color: #fff; font: 700 9.5px var(--font-mono);
}
.att-thumb img { width: 100%; height: 100%; object-fit: cover; }
.att-thumb[data-label="PDF"] { background: #e11d48; }
.att-thumb[data-label="DOC"] { background: #2563eb; }
.att-thumb[data-label="XLS"] { background: #16a34a; }
.att-thumb[data-label="PPT"] { background: #ea580c; }
.att-thumb[data-label="{ }"] { background: #7c3aed; }
.att-thumb[data-label="IMG"] { background: #0ea5e9; }
.att-chip[data-state="loading"] .att-thumb { opacity: .55; animation: pulse 1.6s var(--ease) infinite; }
.att-text { display: grid; min-width: 0; line-height: 1.3; }
.att-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; font-weight: 600; }
.att-meta { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 11px; }
.att-chip.warn .att-meta { color: var(--warn-ink); }
.att-chip[data-state="error"] .att-meta { color: var(--err-ink); }
.drop-veil {
  position: fixed; z-index: 80; inset: 0; display: grid; place-items: center; pointer-events: none;
  border: 2px dashed var(--accent); background: rgba(238, 243, 255, .92);
}
.drop-card { display: grid; justify-items: center; gap: 6px; color: var(--accent-ink); font-size: 16px; text-align: center; }
.preview-images { display: grid; gap: var(--s3); }
.preview-images img { justify-self: center; max-width: 100%; height: auto; border: 1px solid var(--line); border-radius: 12px; }
.preview-text {
  max-height: 60vh; margin: 0; padding: 14px 16px; overflow: auto;
  border: 1px solid var(--line); border-radius: 12px; background: var(--surface);
  font: 13px/1.6 var(--font-mono); white-space: pre-wrap; overflow-wrap: anywhere;
}
.prompts-menu { width: 380px; }
.prompts-menu-list { display: grid; gap: 2px; max-height: 300px; overflow-y: auto; }
.check-row { display: flex; align-items: flex-start; gap: 10px; padding: 8px 10px; border-radius: 10px; cursor: pointer; }
.check-row:hover { background: var(--soft); }
.check-row input { width: 16px; height: 16px; margin: 3px 0 0; accent-color: var(--accent); }
.check-text { display: grid; gap: 2px; min-width: 0; font-size: 14px; }
.check-text .small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-foot { display: flex; align-items: center; gap: var(--s2); margin-top: 6px; padding: 8px 4px 2px 10px; border-top: 1px solid var(--line); }
.menu-foot .btn { margin-left: auto; }
.slash-menu { top: auto; bottom: calc(100% + 8px); left: 10px; width: min(440px, calc(100% - 20px)); max-width: none; }
.slash-menu [role="listbox"] { max-height: min(300px, 50vh); overflow-y: auto; }
/* accueil : la saisie est dans .chat-scroll, un menu ouvert vers le haut y serait coupé : il s'ouvre vers le bas */
body[data-page="home"] .menu.menu-up, body[data-page="home"] .slash-menu { top: calc(100% + 6px); bottom: auto; }
.slash-item { display: flex; align-items: baseline; gap: 10px; padding: 8px 10px; border-radius: 9px; cursor: pointer; }
.slash-item[aria-selected="true"], .slash-item:hover { background: var(--accent-soft); }
.slash-name { flex: none; color: var(--accent-ink); font-size: 13px; font-weight: 600; }
.slash-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 13px; }

/* ===== Bibliothèque de prompts ========================================================================= */
#prompts-dialog .modal-card { height: min(88vh, 760px); }
.library { flex: 1; min-height: 0; display: grid; grid-template-columns: 280px 1fr; border-top: 1px solid var(--line); }
.library-side {
  display: flex; flex-direction: column; gap: 10px; padding: var(--s4);
  border-right: 1px solid var(--line); background: var(--surface); overflow-y: auto;
}
.library-items { list-style: none; display: grid; gap: 2px; }
.library-group { padding: 10px 10px 2px; }
.library-item {
  display: grid; gap: 2px; width: 100%; padding: 8px 10px; border: 0; border-radius: 10px;
  background: none; color: var(--ink); text-align: left;
}
.library-item:hover { background: var(--soft); }
.library-item.current { background: var(--accent-soft); color: var(--accent-ink); }
.li-name { font-size: 14px; font-weight: 700; overflow-wrap: anywhere; }
.li-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 12.5px; }
.library-editor { display: flex; flex-direction: column; gap: 14px; padding: 18px 24px 22px; overflow-y: auto; }
.library-editor .field.grow { flex: 1; display: flex; flex-direction: column; }
.library-editor textarea { flex: 1; min-height: 240px; }

/* Toasts au-dessus de la saisie dans l'espace de travail */
body[data-page="conversation"] .toasts { bottom: calc(var(--composer-h) + 8px); }
body .toasts.in-dialog { bottom: 24px; }

/* ===== Responsive, écrans tactiles, mouvement réduit (spec C §6, §7.6) ================================== */
.sidebar-toggle { display: none; }
.scrim { display: none; }

@media (max-width: 960px) {
  .sidebar-toggle { display: inline-grid; margin-left: -8px; }
  .topbar { gap: var(--s2); padding-left: var(--s4); }
  .topbar .brand { display: none; }   /* la marque est dans la barre d'espaces */
  .sidebar {
    position: fixed; z-index: 45; top: calc(var(--topbar-h) + var(--podbar-h)); bottom: var(--tabs-h); left: var(--rail-w);
    width: min(300px, 86vw);
    box-shadow: var(--shadow-2); transform: translateX(-105%); visibility: hidden;
    transition: transform var(--t) var(--ease), visibility var(--t);
  }
  body.sidebar-open .sidebar { transform: none; visibility: visible; }
  .scrim {
    display: block; position: fixed; z-index: 44; inset: calc(var(--topbar-h) + var(--podbar-h)) 0 var(--tabs-h) var(--rail-w);
    background: rgba(20, 24, 36, .28);
  }
  /* iOS Safari zoome la page sur un champ de moins de 16 px */
  .side-search input, .composer textarea, .hf-field input { font-size: 16px; }
}

@media (max-width: 640px) {
  :root { --topbar-h: 56px; }
  .hide-sm { display: none; }
  .topbar { padding: 0 var(--s3); }
  .topbar .brand { gap: 0; margin-right: 0; font-size: 0; }   /* le point-lune seul ; le nom reste lu */
  .topbar-end { gap: 2px; }
  .chat-scroll { padding: var(--s5) var(--s4) var(--s4); }
  .jump { left: 12px; transform: none; }
  .bubble { max-width: 88%; }
  .composer { width: calc(100% - 16px); margin-bottom: 8px; border-radius: 16px; }
  .composer-hint { display: none; }
  .prompt-cards { grid-template-columns: 1fr; }
  .modal, .modal.wide { width: 100vw; height: 100dvh; margin: 0; }
  .modal-card, #prompts-dialog .modal-card { height: 100%; max-height: none; border-radius: 0; }
  .modal-foot { flex-direction: column; align-items: stretch; }
  #model-dialog .modal-foot .btn.primary { min-width: 0; }
  .model-grid { grid-template-columns: 1fr; }
  .head-sub { display: grid; gap: 0; }
  .head-sub > * { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .library { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .library-side { max-height: 34vh; border-right: 0; border-bottom: 1px solid var(--line); }
  .drawer { width: 100vw; }
  .prompts-menu { width: min(360px, calc(100vw - 24px)); }
  /* spec D : accueil, pièces jointes, capacités */
  .home { padding-top: 3vh; gap: var(--s3); }
  .home .hero-title { font-size: 22px; }
  .home .composer textarea { min-height: 56px; }
  .suggestions { grid-template-columns: 1fr; }
  .att-chip { max-width: 100%; }
  .preview-text { max-height: none; }
}

@media (pointer: coarse) {
  .icon-btn, .icon-btn.xs, .sidebar-toggle, .toast .icon-btn { min-width: 44px; min-height: 44px; }
  .toast .btn { min-height: 44px; }
  .btn.sm, .conv-link, .menu-item, .chip { min-height: 40px; }
  .att-open, .suggestion { min-height: 44px; }
  .chip { display: inline-flex; align-items: center; }
  .qrow, .mc-strip, .alt, .help > summary, .tier > summary { min-height: 44px; }
  .sort-tab, .sort-select select, .mc-bench > summary { min-height: 44px; }
}

@media (hover: none) {   /* bouton d'actions toujours visible, sa place réservée : l'état reste écrit, pas seulement la couleur */
  .conv-actions { opacity: 1; }
  .conv-link { padding-right: 52px; }
  .conv-item:hover .conv-meta, .conv-item:focus-within .conv-meta { visibility: visible; }
}

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

/* génération d'images (spec L §6) : grille des images d'une réponse. Barre de génération « A » (spec Q §10.1) :
   réglages, LoRA, « À éviter », force d'une image de départ, ligne d'aide ; mêmes gardes que la barre de la saisie
   (rien hors du cadre) : les lignes passent à la ligne dans une saisie large, défilent en largeur dans une étroite. */
.gen-bar { display: grid; gap: 6px; min-width: 0; padding: 0 2px 2px; }
.gen-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-width: 0; }
.gen-row > * { flex: none; }
.gen-row .chip { padding-left: 10px; padding-right: 10px; }   /* les réglages tiennent sur une ligne au bureau */
.gen-row .chip.select { padding-right: 6px; }
.gen-row .chip.select select { max-width: 13em; }
.chip.filled { border-color: var(--accent-line); color: var(--accent-ink); }
.icon-chip { width: 32px; padding: 0; justify-content: center; }
.lora-chips { display: flex; flex: 0 1 auto; flex-wrap: wrap; gap: 6px; min-width: 0; margin: 0; padding: 0; list-style: none; }
.lora-chips[hidden] { display: none; }
.lora-chip {
  display: inline-flex; align-items: center; gap: 4px; max-width: 100%; height: 32px; padding: 0 3px 0 11px;
  border: 1px solid var(--accent-line); border-radius: var(--r-pill); background: var(--accent-soft);
  color: var(--accent-ink); font-size: 13px; font-weight: 600;
}
.lora-chip[data-fit="warn"] { border-color: #fcd9b6; background: var(--warn-bg); color: var(--warn-ink); }
.lora-chip[data-status="error"] { border-color: var(--err-line); background: var(--err-bg); color: var(--err-ink); }
.lora-name { min-width: 0; max-width: 14em; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.lora-chip[data-status="downloading"] .lora-name { animation: pulse 1.6s var(--ease) infinite; }
.lora-weight {
  width: 4.4em; height: 24px; padding: 0 4px; border: 1px solid var(--line-2); border-radius: 8px;
  background: var(--bg); color: var(--ink); font-size: 12.5px; text-align: center;
}
.lora-remove {
  display: grid; place-items: center; flex: none; width: 24px; height: 24px; padding: 0;
  border: 0; border-radius: 50%; background: none; color: inherit;
}
.lora-remove:hover { background: rgba(15, 23, 42, .08); }
.lora-menu { width: min(340px, calc(100vw - 32px)); }
.lora-menu-list { display: grid; max-height: 260px; overflow-y: auto; }
.gen-label { color: var(--ink-2); font-size: 12.5px; font-weight: 600; }
.gen-negative { display: grid; gap: 4px; min-width: 0; }
.gen-negative textarea {
  width: 100%; min-height: 44px; padding: 6px 8px; resize: vertical; border: 1px solid var(--line-2);
  border-radius: 10px; background: var(--surface); color: var(--ink); font: inherit; font-size: 13.5px;
}
.gen-negative textarea:focus { border-color: var(--accent); outline: none; box-shadow: var(--focus-ring); }
.gen-strength { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; min-width: 0; }
.gen-strength input[type="range"] { flex: 1 1 120px; min-width: 0; max-width: 260px; accent-color: var(--accent); }
.gen-strength output { min-width: 2.6em; color: var(--ink-2); font-size: 12.5px; }
.gen-help {   /* la seule aide (spec Q §10.1) : une ligne grise, coupée plutôt que d'élargir la saisie */
  display: flex; align-items: center; gap: 4px; min-width: 0; overflow: hidden; margin: 0;
  color: var(--muted); font-size: 12.5px;
}
.gen-help[hidden] { display: none; }
.gen-help-text { flex: 1 1 auto; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.gen-help .icon-btn { flex: none; width: 24px; height: 24px; }
.gen-estimate {   /* près de l'envoi : se coupe plutôt que de le pousser hors de sa ligne, comme la jauge */
  min-width: 0; flex-shrink: 1; overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
  color: var(--muted); font-size: 12px;
}
.att-chip[data-gen-role]::after {   /* rôle d'une image jointe à une génération (spec Q §10.1), avant le ✕ */
  content: attr(data-gen-role); order: 1; flex: none; margin: 0 4px 0 2px; padding: 1px 7px; border-radius: var(--r-pill);
  background: var(--accent-soft); color: var(--accent-ink); font-size: 11px; font-weight: 700;
}
.att-chip[data-gen-role] [data-field="remove"] { order: 2; }
.gen-images { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); gap: 10px;
              margin: 10px 0 4px; }
.gen-image { display: grid; gap: 6px; margin: 0; min-width: 0; }
/* spec U §6.2 : le PDF d'une réponse */
.pdf-slot { margin: 10px 0 4px; }
.pdf-card { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 12px; border: 1px solid var(--line-2);
            border-radius: 12px; background: var(--soft); max-width: 100%; }
.pdf-card > .icon { color: var(--accent); }
.pdf-name { flex: 1 1 160px; min-width: 0; font-weight: 600; overflow-wrap: anywhere; }
.gen-open { display: block; border: 1px solid var(--line-2); border-radius: 12px; overflow: hidden; background: var(--soft); }
.gen-open img { display: block; width: 100%; height: auto; }
.gen-image figcaption { display: flex; flex-wrap: wrap; gap: 6px; }

/* Appels d'outils d'une réponse, résultats renvoyés par l'utilisateur (spec K §4.5) : repliés, en JSON lisible */
.tool-calls, .tool-results { display: grid; gap: 6px; margin: 6px 0; justify-items: start; }
.tool-results:not([hidden]) + .user-text:empty { display: none; }
.tool-call { max-width: 100%; }
.tool-call summary {
  display: inline-flex; align-items: center; gap: var(--s2); padding: 5px 12px; list-style: none; cursor: pointer;
  border-radius: var(--r-pill); background: var(--soft); color: var(--muted); font-size: 13px; font-weight: 600;
}
.tool-call summary::-webkit-details-marker { display: none; }
.tool-call summary code { color: var(--ink-2); }
.tool-json {
  margin: 6px 0 0; padding: 8px 12px; max-height: 320px; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere;
  border-left: 2px solid var(--line-2); color: var(--ink-2); font-size: 12.5px;
}

/* Page « Guide » : API, MCP et consignes pour un agent */
.guide-page { overflow-y: auto; }
.guide-wrap { max-width: 860px; margin: 0 auto; padding: var(--s6) var(--s5) 96px; display: grid; gap: var(--s5); min-width: 0; }
.guide-head { display: grid; gap: var(--s3); }
.guide-toc ol { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 0; padding: 0; list-style: none; font-size: 14px; }
.guide-toc a { color: var(--accent-ink); }
.guide-body { min-width: 0; }
.guide-body h2 { margin-top: var(--s6); padding-top: var(--s3); border-top: 1px solid var(--line); scroll-margin-top: 72px; }
.guide-body h3 { scroll-margin-top: 72px; }
.guide-body pre { overflow-x: auto; max-width: 100%; }
.guide-body table { display: block; overflow-x: auto; max-width: 100%; }
.guide-copy-row { display: flex; justify-content: flex-end; margin: var(--s3) 0 -6px; }
.guide-body pre code.language-markdown { white-space: pre-wrap; overflow-wrap: anywhere; }   /* consignes : du texte, pas du code */


/* Recherche web (spec N §6) : bouton de la saisie, étapes d'une réponse, sources et repères [n] */
.chip.toggle[aria-pressed="true"] { border-color: var(--accent-line); background: var(--accent-soft); color: var(--accent-ink); }
button.chip.toggle[aria-pressed="true"]:hover { background: #e2eaff; }
.chip.toggle:disabled { opacity: .55; cursor: not-allowed; }
button.chip.toggle:disabled:hover { background: var(--bg); }
@container composer (max-width: 619px) {   /* saisie étroite : les outils en icônes (aria-label garde le nom), la jauge sans unité */
  .chip.toggle > span { display: none; }
  .chip.toggle { padding: 0 10px; }
  .gauge-unit { display: none; }
  /* « Prompts » et « Outils MCP » s'ouvrent sur la largeur de la saisie (au-dessus, vers le bas à l'accueil) : jamais hors de l'écran */
  .composer-tools .menu-wrap { position: static; }
  .composer-tools .menu { left: 8px; right: 8px; width: auto; min-width: 0; max-width: none; }
}
@container composer (max-width: 340px) {   /* 320 px, pointeur tactile compris : les cinq boutons d'outils tiennent sur une ligne */
  .composer-tools { gap: 4px; }
  .composer-tools .chip { padding: 0 8px; }
}
@container composer (max-width: 619px) {   /* barre de génération : lignes défilantes, menu « + LoRA » sur la largeur de la saisie */
  .gen-row { flex-wrap: nowrap; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none; }
  .gen-row::-webkit-scrollbar { display: none; }
  .lora-chips { flex: none; flex-wrap: nowrap; }
  .gen-row .menu-wrap { position: static; }
  .gen-row .menu { left: 8px; right: 8px; width: auto; min-width: 0; max-width: none; }
}
.web-steps { max-width: 100%; margin: 6px 0; }
.web-steps summary {
  display: inline-flex; align-items: center; gap: var(--s2); padding: 5px 12px; list-style: none; cursor: pointer;
  border-radius: var(--r-pill); background: var(--soft); color: var(--muted); font-size: 13px; font-weight: 600;
}
.web-steps summary::-webkit-details-marker { display: none; }
.web-step-list { display: grid; gap: 4px; margin: 8px 0 0; padding: 0 0 0 18px; color: var(--ink-2); font-size: 13px; }
.web-step { display: flex; flex-wrap: wrap; gap: 2px 10px; min-width: 0; overflow-wrap: anywhere; }
.web-step-status { color: var(--muted); }
.web-step[data-status="error"] .web-step-status { color: var(--err-ink); }
.python-step .python-code, .python-step .python-output { flex-basis: 100%; min-width: 0; }
.mcp-menu-list { display: grid; gap: 4px; max-height: 16rem; overflow: auto; }
.python-code summary { cursor: pointer; color: var(--muted); font-size: 12px; }
.python-code pre, .python-output { margin: 4px 0 0; padding: 8px 10px; max-height: 16rem; overflow: auto;
  border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink-2);
  font: 12px/1.5 var(--font-mono); white-space: pre-wrap; overflow-wrap: anywhere; }
.sources { margin: 12px 0 4px; padding-top: 10px; border-top: 1px solid var(--line); }
.sources-title { margin: 0 0 6px; color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.source-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px; margin: 0; padding: 0; list-style: none; font-size: 13.5px; }
.source-list a { display: flex; align-items: baseline; gap: 8px; min-width: 0; color: var(--ink-2); text-decoration: none; }
.source-list a[href]:hover .source-title { text-decoration: underline; }
.source-n { flex: none; min-width: 1.4em; color: var(--accent-ink); font-size: 12px; }
.source-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.source-domain { flex: none; color: var(--muted); font-size: 12px; }
a.cite { padding: 0 2px; color: var(--accent-ink); font-size: .75em; font-weight: 700; line-height: 0; text-decoration: none; vertical-align: super; }
a.cite:hover { text-decoration: underline; }

/* ===== « Choisir un modèle » : onglets et catalogue de Civitai (spec Q §3) ================================ */
.source-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); }
.source-tab {
  min-height: 38px; padding: 0 14px; margin-bottom: -1px; border: 0; border-bottom: 2px solid transparent;
  background: none; color: var(--muted); font-size: 14px; font-weight: 600;
  transition: color var(--t-fast), border-color var(--t-fast);
}
.source-tab:hover { color: var(--ink); }
.source-tab[aria-selected="true"] { color: var(--accent-ink); border-bottom-color: var(--accent); }
.civitai-view { display: grid; gap: var(--s3); min-width: 0; }
.cv-help { line-height: 1.5; }
.cv-filters { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2) var(--s3); min-width: 0; }
.cv-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.cv-chip {
  display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 0 12px;
  border: 1px solid var(--line-2); border-radius: var(--r-pill); background: var(--bg); color: var(--ink-2);
  font-size: 13px; font-weight: 600; transition: background var(--t-fast), border-color var(--t-fast), color var(--t-fast);
}
.cv-chip:hover:not(:disabled) { border-color: var(--accent-line); }
.cv-chip[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-ink); }
.cv-chip:disabled { cursor: not-allowed; color: var(--muted); }
.cv-chip .soon { font-size: 11px; font-weight: 500; }
.cv-select { display: inline-flex; align-items: center; gap: 6px; min-width: 0; color: var(--ink-2); font-size: 13px; font-weight: 600; }
.cv-select select {
  min-width: 0; max-width: 180px; min-height: 32px; padding: 0 8px;
  border: 1px solid var(--line-2); border-radius: var(--r-sm); background: var(--bg); font-weight: 500;
}
.cv-select select:focus { outline: none; border-color: var(--accent); box-shadow: var(--focus-ring); }
.cv-check { font-size: 13px; }
.cv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: var(--s3); }
.cv-card {
  display: flex; flex-direction: column; min-width: 0; overflow: hidden;
  border: 1px solid var(--line); border-radius: var(--r-md); background: var(--bg);
}
.cv-card.loading { min-height: 300px; gap: var(--s2); padding-bottom: var(--s3); }
.cv-card.loading .skeleton.cv-media { width: 100%; height: 220px; border-radius: 0; }
.cv-frame { aspect-ratio: 3 / 4; overflow: hidden; background: var(--soft); }
.cv-media { display: block; width: 100%; height: 100%; object-fit: cover; }
.cv-media.empty { display: grid; place-items: center; color: var(--muted); }
.cv-body { display: flex; flex: 1; flex-direction: column; gap: 4px; min-width: 0; padding: 10px 12px 12px; }
.cv-title { overflow: hidden; font-size: 14px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.cv-badges { display: flex; flex-wrap: wrap; gap: 4px; }
.cv-price { color: var(--ink); font-weight: 600; }
.cv-note { color: var(--warn-ink); }
.cv-actions { display: flex; align-items: center; justify-content: space-between; gap: var(--s2); margin-top: auto; padding-top: 4px; flex-wrap: wrap; }   /* alignées d'une carte à l'autre */
.cv-link { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); }
.cv-propose { display: grid; gap: 6px; justify-items: start; color: var(--ink-2); }
.cv-none { grid-column: 1 / -1; }
.cv-more { display: flex; justify-content: center; padding: var(--s2); }
.cv-all-row { display: flex; justify-content: center; }
@media (max-width: 640px) {
  .cv-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s2); }
  .cv-frame { aspect-ratio: 4 / 5; }
  .cv-select select { max-width: 140px; }
  .cv-body { padding: 8px 10px 10px; }
}

/* ===== Page « Découvrir » (spec Q §8) : filtres, galerie en colonnes, détail ============================== */
.dc-wrap { display: grid; gap: var(--s4); padding: var(--s5) var(--s5) var(--s7); }
.dc-head { display: grid; gap: var(--s2); max-width: 760px; }
.dc-head h1 { font-size: 26px; }
.dc-layout { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: var(--s5); align-items: start; }
.dc-layout.has-detail { grid-template-columns: 200px minmax(0, 1fr) minmax(320px, 400px); }
.dc-filters { position: sticky; top: var(--s4); display: grid; gap: var(--s3); }
.dc-filters .cv-select { display: grid; gap: 4px; }
.dc-filters .cv-select select { width: 100%; max-width: none; }
.dc-main { display: grid; gap: var(--s3); min-width: 0; }
.dc-gallery { columns: 4 200px; column-gap: var(--s3); }
.dc-tile {
  display: block; width: 100%; margin: 0 0 var(--s3); padding: 0; overflow: hidden; break-inside: avoid;
  border: 0; border-radius: var(--r-md); background: var(--soft); cursor: zoom-in;
}
.dc-tile.skeleton { height: 260px; }
.dc-tile .cv-media, .dc-hero .cv-media { height: auto; }
/* colonne (flex, enfants sans rétrécissement) : une grille d'une hauteur bornée écrasait l'image ; la place de l'îlot
   du pod est laissée en bas */
.dc-detail {
  position: sticky; top: var(--s4); display: flex; flex-direction: column; gap: var(--s3);
  max-height: max(320px, calc(100vh - 330px)); overflow-y: auto;   /* sous l'en-tête de la page, au-dessus de l'îlot */
  padding: var(--s4); border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--bg);
}
.dc-detail > * { flex: none; }
.dc-detail-head { display: flex; align-items: center; justify-content: space-between; }
.dc-hero { overflow: hidden; border-radius: var(--r-md); background: var(--soft); }
.dc-hero .cv-media { max-height: 30vh; object-fit: contain; }
.dc-model, .dc-settings, .dc-loras { display: grid; gap: 6px; }
.dc-title { font-size: 17px; }
.dc-badges, .dc-actions, .dc-links { display: flex; flex-wrap: wrap; gap: var(--s2); }
.dc-links a { display: inline-flex; align-items: center; gap: 4px; }
.dc-run.warn { color: var(--warn-ink); }
.dc-prompt { font-size: 13.5px; white-space: pre-wrap; overflow-wrap: anywhere; }
.dc-negative { color: var(--ink-2); overflow-wrap: anywhere; }
.dc-facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 2px var(--s3); margin: 0; font-size: 13px; }
.dc-facts dt { color: var(--muted); }
.dc-facts dd { margin: 0; overflow-wrap: anywhere; }
.dc-lora { display: flex; align-items: center; gap: var(--s2); font-size: 13px; }
.dc-others-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.dc-other { aspect-ratio: 3 / 4; padding: 0; overflow: hidden; border: 0; border-radius: var(--r-sm); background: var(--soft); }
@media (max-width: 960px) {
  .dc-wrap { padding: var(--s4) var(--s3) var(--s6); }
  .dc-layout, .dc-layout.has-detail { grid-template-columns: minmax(0, 1fr); }
  .dc-filters { position: static; display: flex; flex-wrap: wrap; align-items: center; }
  .dc-filters .cv-select { display: inline-flex; }
  .dc-detail { position: fixed; inset: 0; z-index: 60; max-height: none; border: 0; border-radius: 0; }   /* plein écran */
  .dc-hero .cv-media { max-height: 55vh; }
  body.dc-detail-open { overflow: hidden; }
}
@media (max-width: 640px) {
  .dc-gallery { columns: 2; column-gap: var(--s2); }
  .dc-tile { margin-bottom: var(--s2); }
}

/* --- Personas (spec R §6, §8) : bibliothèque et assistants ------------------------------------------------------ */
.persona-chip[hidden] { display: none; }
.pp-wrap { display: grid; gap: var(--s5); padding: var(--s5) var(--s5) var(--s7); max-width: 1180px; }
.pp-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: var(--s4); }
.pp-intro { display: grid; gap: var(--s2); max-width: 680px; min-width: 0; }
.pp-intro h1 { font-size: 26px; }
.pp-head-actions { display: flex; flex-wrap: wrap; gap: var(--s2); }
.pp-start .check-text .small { white-space: normal; }
.pp-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: var(--s3); }
.pp-empty { grid-column: 1 / -1; }
.pp-card {
  display: flex; gap: var(--s3); align-items: center; min-width: 0; padding: var(--s3);
  border: 1px solid var(--line-2); border-radius: var(--r-md); background: var(--bg); color: var(--ink);
  text-decoration: none; transition: box-shadow var(--t) var(--ease), border-color var(--t) var(--ease);
}
.pp-card:hover { border-color: var(--accent-line); box-shadow: var(--shadow-1); text-decoration: none; }
.pp-face {
  display: grid; place-items: center; flex: none; width: 64px; height: 64px; overflow: hidden;
  border-radius: 50%; background: var(--soft); color: var(--muted);
}
.pp-face img { width: 100%; height: 100%; object-fit: cover; }
.pp-card-body { display: grid; gap: 3px; min-width: 0; }
.pp-card-name { display: flex; align-items: center; gap: var(--s2); min-width: 0; font-family: var(--font-display); font-weight: 500; }
.pp-card-line { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pp-card-line.wrap { white-space: normal; }
.pp-card-body .pill { justify-self: start; }
.pp-assistant {
  display: grid; gap: var(--s4); padding: var(--s5); border: 1px solid var(--line-2); border-radius: var(--r-lg);
  background: var(--surface); box-shadow: var(--shadow-1); scroll-margin-top: calc(var(--topbar-h) + var(--s3));
}
.pp-assistant[hidden] { display: none; }
.pp-assistant-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); }
.pp-assistant-head h2 { font-size: 19px; }
.pp-steps { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; counter-reset: step; }
.pp-steps li {
  counter-increment: step; display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 11px;
  border: 1px solid var(--line-2); border-radius: var(--r-pill); background: var(--bg); color: var(--muted);
  font-size: 13px; font-weight: 600;
}
.pp-steps li::before { content: counter(step); font-family: var(--font-mono); font-size: 12px; }
.pp-steps li.current { border-color: var(--accent-line); background: var(--accent-soft); color: var(--accent-ink); }
.pp-form, .pp-step { display: grid; gap: var(--s3); min-width: 0; }
.pp-form[hidden], .pp-step[hidden] { display: none; }
.pp-grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s3); }
.pp-form input:not([type="checkbox"]):not([type="file"]), .pp-form select, .pp-form textarea, .pp-step select {
  width: 100%; min-width: 0;
}
.pp-more summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.pp-more[open] { display: grid; gap: var(--s2); }
.pp-import { display: grid; gap: var(--s3); margin: 0; padding: var(--s3); border: 1px dashed var(--line-2); border-radius: var(--r-sm); }
.pp-import[hidden] { display: none; }
.pp-guide { padding: var(--s3); border-radius: var(--r-sm); background: var(--accent-soft); color: var(--accent-ink); }
.pp-guide ul { margin: 6px 0 0; padding-left: 18px; }
.pp-price { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2); min-width: 0; }
.pp-price:empty { display: none; }
.pp-price-text { margin: 0; font-size: 14px; font-weight: 600; color: var(--ink-2); overflow-wrap: anywhere; }
.pp-photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: var(--s2); }
.pp-photos.faces { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.pp-photo { position: relative; display: grid; gap: 4px; margin: 0; min-width: 0; }
.pp-photo img {
  width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: var(--r-sm); background: var(--soft);
  border: 2px solid transparent;
}
.pp-photo.chosen img { border-color: var(--accent); }
.pp-photo figcaption { display: flex; flex-wrap: wrap; align-items: center; gap: 4px var(--s2); }
.pp-photo .check { font-size: 12.5px; }
.pp-pick {
  position: absolute; left: 6px; top: 6px; height: 26px; padding: 0 9px; border: 0; border-radius: var(--r-pill);
  background: rgba(20, 24, 36, .72); color: #fff; font-size: 12px; font-weight: 600;
}
.pp-pick[aria-pressed="true"] { background: var(--accent); }
.pp-rows { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 6px; margin: 0;
           padding: 0; list-style: none; }
.pp-row {
  display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; align-items: center; gap: var(--s3);
  padding: 6px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--bg);
}
.pp-row.flagged { border-color: #fcd9b6; background: var(--warn-bg); }
.pp-row img, .pp-row-empty {
  display: grid; place-items: center; width: 48px; height: 60px; object-fit: cover; border-radius: 8px; background: var(--soft);
}
.pp-row-text { display: grid; gap: 2px; min-width: 0; }
.pp-row-text b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pp-flag { color: var(--warn-ink); font-weight: 600; }
.pp-shots { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 4px var(--s3); }
.pp-shots .check { align-items: flex-start; }
.pp-shots .check input { margin-top: 2px; flex: none; }
@media (max-width: 720px) {
  .pp-wrap { padding: var(--s4) var(--s3) var(--s6); }
  .pp-assistant { padding: var(--s4) var(--s3); }
  .pp-grid2 { grid-template-columns: minmax(0, 1fr); }
  .pp-photos.faces { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pp-cards { grid-template-columns: minmax(0, 1fr); }
}

/* --- Page d'un persona (spec R §8, maquette A) et pastille du pod de fond --------------------------------------- */
.pa-wrap { display: grid; gap: var(--s3); padding: var(--s4) var(--s5) var(--s6); max-width: 1320px; }
.pa-crumb { color: var(--muted); font-weight: 600; }
.pa-crumb b { color: var(--ink); }
.pa-main {
  display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); border: 1px solid var(--line-2);
  border-radius: var(--r-lg); overflow: hidden; background: var(--bg);
}
.pa-left { display: grid; gap: var(--s4); align-content: start; padding: var(--s4); border-right: 1px solid var(--line-2); min-width: 0; }
.pa-prof { display: flex; gap: var(--s4); align-items: flex-start; min-width: 0; }
.pa-face { width: 88px; height: 88px; }
.pa-who { display: grid; gap: var(--s2); min-width: 0; }
.pa-who h1 { font-size: 22px; }
.pa-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.pa-chips:empty { display: none; }
.pa-chips .chip { height: 26px; font-size: 12px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.pa-chips .chip.adult { border-color: #f6cfd9; background: #fdf0f3; color: #9d174d; }
.pa-chips .chip.later { border-style: dashed; color: var(--muted); }
.pa-chips .lora-state[data-status="ready"] { border-color: #bfe8d3; background: var(--ok-bg); color: var(--ok-ink); }
.pa-chips .lora-state[data-status="failed"] { border-color: var(--err-line); background: var(--err-bg); color: var(--err-ink); }
.pa-note { display: flex; gap: 6px; align-items: flex-start; margin: 0; padding: 6px 10px; border-radius: var(--r-sm);
           background: var(--warn-bg); color: var(--warn-ink); }
.pa-actions .btn { flex: none; }
.pa-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; }
.pa-empty { grid-column: 1 / -1; }
.pa-tile {
  position: relative; display: grid; place-content: center; justify-items: center; gap: 4px; aspect-ratio: 4 / 5;
  min-width: 0; padding: 4px; overflow: hidden; border: 0; border-radius: 8px; background: var(--soft);
  color: var(--ink-2); font-size: 13px; text-align: center;
}
.pa-tile.proposal { border: 1.5px dashed #b8c3dc; }
.pa-tile.sel { outline: 2px solid var(--accent); outline-offset: 1px; }
.pa-tile.proposal.sel { border-color: var(--accent); background: var(--accent-soft); }
.pa-tile img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.pa-tag {
  position: absolute; left: 5px; bottom: 5px; max-width: calc(100% - 10px); padding: 1px 7px; overflow: hidden;
  border-radius: var(--r-pill); background: rgba(20, 24, 36, .72); color: #fff; font-size: 11px; font-weight: 600;
  white-space: nowrap; text-overflow: ellipsis;
}
.pa-tag.warn { bottom: auto; top: 5px; background: var(--warn-ink); }
.pa-badge { display: inline-block; padding: 1px 8px; border-radius: var(--r-pill); background: var(--soft-2);
            color: var(--ink-2); font-size: 11px; font-weight: 700; white-space: nowrap; }
.pa-badge.todo { background: #fef3c7; color: #92400e; }
.pa-badge.done { background: var(--ok-bg); color: var(--ok-ink); }
.pa-badge.run { background: var(--accent-soft); color: var(--accent-ink); }
.pa-badge.choose { background: #ede9fe; color: #5b21b6; }
.pa-badge.err { background: var(--err-bg); color: var(--err-ink); }
.pa-panel { display: grid; gap: var(--s3); align-content: start; padding: var(--s4); background: var(--surface); min-width: 0; }
.pa-panel-title { font-size: 16px; }
.pa-field { display: grid; gap: 4px; min-width: 0; }
.pa-field textarea { width: 100%; }
.pa-quote { margin: 0; padding: 6px 8px; border-radius: 8px; background: var(--soft); }
.pa-variants { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); }
.pa-variants .pp-photo { cursor: pointer; }
.pa-rank { position: absolute; top: 6px; right: 6px; min-width: 22px; padding: 0 6px; border-radius: var(--r-pill);
           background: var(--accent); color: #fff; font-size: 12px; font-weight: 700; text-align: center; }
.pa-rank:empty { display: none; }
.pa-journal { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; max-height: 340px; overflow-y: auto; }
.pa-journal-item { display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: var(--s2); align-items: center; }
.pa-journal-item img, .pa-event { width: 36px; height: 45px; border-radius: 6px; object-fit: cover; }
.pa-event { display: grid; place-items: center; background: #fef3c7; color: #92400e; font-size: 10px; font-weight: 700; }
.pa-event-form { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 6px; align-items: center; }
.pa-checks { display: flex; flex-wrap: wrap; gap: 4px var(--s3); }
.pa-rights p { margin: 0 0 2px; overflow-wrap: anywhere; }
.pa-lora { display: grid; gap: 4px; padding: 6px 0; border-top: 1px solid var(--line); min-width: 0; }
.pa-lora p { margin: 0; overflow-wrap: anywhere; }
.pa-danger { padding-top: var(--s2); border-top: 1px solid var(--line-2); }
.pa-prodbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--s3); padding: 10px var(--s4);
  border: 1px solid var(--line-2); border-radius: var(--r-md); background: var(--soft);
}
.pa-video { opacity: .75; }
.bgpod-pill {   /* spec T §3.3 : dans le menu du segment du pod de fond (bandeau du haut) */
  display: flex; align-items: center; gap: var(--s2); padding: 8px 10px 8px 14px; background: var(--bg);
  border: 1px solid var(--accent-line); border-radius: var(--r-md);
}
.bgpod-pill[hidden] { display: none; }
.bgpod-pill .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--st-gen); flex: none; }
.bgpod-pill .dot[data-phase="launching"], .bgpod-pill .dot[data-phase="switching"] { background: var(--st-start); }
.bgpod-text { display: grid; min-width: 0; }
.bgpod-text .muted { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 960px) {
  .pa-main { grid-template-columns: minmax(0, 1fr); }
  .pa-left { border-right: 0; border-bottom: 1px solid var(--line-2); }
}
@media (max-width: 720px) {
  .pa-wrap { padding: var(--s3) var(--s3) var(--s6); }
  .pa-prof { flex-direction: column; }
  .pa-face { width: 72px; height: 72px; }
  .pa-left, .pa-panel { padding: var(--s3); }
}
@media (max-width: 720px) {
  .pa-event-form { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "text text" "date add"; }
  .pa-event-form input[type="text"] { grid-area: text; }
  .pa-event-form input[type="date"] { grid-area: date; }
  .pa-event-form button { grid-area: add; }
}

/* ===== Téléphone (spec S §3.1) : les espaces en onglets en bas, le pod et Réglages dans la barre du haut ====== */
@media (max-width: 720px) {
  :root { --rail-w: 0px; --tabs-h: 64px; }
  .topbar .brand { display: inline-flex; }
  .topbar { padding-right: 64px; }   /* place du pied de la barre d'espaces (Réglages), posé dans la barre du haut */
  .spaces {
    top: auto; bottom: 0; left: 0; right: 0; width: auto; height: calc(var(--tabs-h) + env(safe-area-inset-bottom));
    flex-direction: row; padding: 4px 4px env(safe-area-inset-bottom); border-right: 0; border-top: 1px solid var(--line);
  }
  .rail-brand { display: none; }
  .space-list { flex: 1; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); }
  .space-link { min-height: 52px; padding: 6px 2px; font-size: 11px; }
  .space-badge { right: calc(50% - 22px); }
  .rail-foot {
    position: fixed; z-index: 41; top: 0; right: var(--s2); height: var(--topbar-h); margin: 0;
    grid-auto-flow: column; align-items: center;
  }
  .menu-rail { top: calc(100% + 6px); bottom: auto; left: auto; right: 0; }
  .toasts { bottom: calc(var(--tabs-h) + 12px); }
}

/* ===== Créer (spec S §5) : les générations, la plus récente en haut ; les images en grille, puis la ligne du prompt,
   de la légende (réglages, graines) et de la durée ; le prompt n'a pas de bulle à part ================================ */
body[data-space="creer"] .messages { display: flex; flex-direction: column-reverse; gap: var(--s5); }
body[data-space="creer"] .msg.user { display: none; }
.generation { display: flex; flex-direction: column; gap: 6px; }
.generation .gen-images {
  order: -1; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: var(--s2);
}
.generation .gen-image { margin: 0; }
.generation .gen-image figcaption { display: flex; flex-wrap: wrap; gap: 4px; }
.generation .gen-image [aria-pressed="true"] { color: var(--accent-ink); background: var(--accent-soft); }
.gen-prompt { order: -1; margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.generation .answer { color: var(--muted); font-size: 13px; }
.create-home .create-hint { text-align: center; }
.title-input { width: 100%; font: inherit; font-size: 20px; font-weight: 700; padding: 2px 6px; }
.conv-item .title-input { flex: 1; min-width: 0; margin: 2px 0; font-size: 14px; font-weight: 600; }
.side-tools { display: grid; gap: 2px; margin-top: var(--s3); }
.side-tool {
  display: flex; align-items: center; gap: var(--s2); padding: 8px 10px; border-radius: var(--r-sm);
  color: var(--ink-2); font-size: 14px;
}
a.side-tool:hover { background: var(--soft); text-decoration: none; }
.side-tool[aria-disabled="true"] { color: var(--muted); }
body[data-space="creer"] .msg-actions :is([data-action="copy"], [data-action="export"], [data-action="export-pdf"]) { display: none; }

/* ===== Personas (spec S §6) : la colonne des personas, à côté de la bibliothèque et de chaque page ================= */
.side-new .new-conv { width: 100%; cursor: pointer; background: none; font: inherit; font-weight: 600; }
.side-new .menu { width: 100%; }
.persona-list { list-style: none; margin: var(--s2) 0 0; padding: 0; display: grid; gap: 2px; }
.persona-link {
  display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: var(--r-sm); color: var(--ink-2);
  font-size: 14px; min-height: 44px;
}
.persona-link:hover { background: var(--soft); text-decoration: none; }
.persona-link[aria-current="page"] { background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; }
.persona-face {
  flex: none; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; overflow: hidden;
  background: var(--soft); color: var(--muted);
}
.persona-face img { width: 100%; height: 100%; object-fit: cover; }
.persona-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.persona-link .count {
  flex: none; min-width: 20px; height: 20px; padding: 0 6px; border-radius: var(--r-pill); background: var(--accent);
  color: #fff; font-size: 11.5px; line-height: 20px; text-align: center;
}
.persona-side .archived { margin-top: var(--s3); }
.persona-side .archived summary { cursor: pointer; }

/* ===== Mes créations (spec S §7) : filtres dans la colonne, mosaïque, visionneuse ================================ */
.creations-page { overflow-y: auto; }
.creations-wrap { display: grid; gap: var(--s4); width: 100%; max-width: 1280px; margin: 0 auto; padding: var(--s5) var(--s4) var(--s6); }
.creations-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s3); flex-wrap: wrap; }
.creations-filters { display: grid; gap: var(--s3); }
.creations-filters .filter-group { display: grid; gap: 2px; margin: 0; padding: 0; border: 0; min-width: 0; }
.creations-filters .check { display: flex; align-items: center; gap: var(--s2); min-height: 32px; overflow-wrap: anywhere; }
.filter-field { display: grid; gap: 4px; }
.filter-field select { width: 100%; }
.creations-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 170px), 1fr)); gap: var(--s2); }
.creation-tile {
  position: relative; display: block; aspect-ratio: 4 / 5; overflow: hidden; border-radius: var(--r-sm);
  background: var(--soft); border: 1px solid var(--line);
}
.creation-tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.creation-tile:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.creation-tile.skeleton { animation: pulse 1.6s var(--ease) infinite; }
.tile-fav { position: absolute; top: 6px; right: 6px; display: grid; place-items: center; width: 26px; height: 26px;
  border-radius: 50%; background: var(--bg); color: var(--accent-ink); }
.tile-tags { position: absolute; left: 6px; bottom: 6px; right: 6px; display: flex; flex-wrap: wrap; gap: 4px; }
.tile-tag { padding: 2px 8px; border-radius: var(--r-pill); background: var(--bg); font-size: 11px; font-weight: 600; }
.creations-more { height: 1px; }
.empty-state { display: grid; justify-items: center; gap: var(--s3); padding: var(--s6) var(--s4); text-align: center; }
.viewer {
  width: min(1100px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); padding: 0; border: 0; border-radius: var(--r-md);
  background: var(--bg); color: var(--ink); box-shadow: var(--shadow-2);
}
.viewer::backdrop { background: rgba(20, 24, 36, .55); }
.viewer-card { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; max-height: calc(100dvh - 24px); }
.viewer-head { display: flex; align-items: center; gap: var(--s3); padding: var(--s3) var(--s4); border-bottom: 1px solid var(--line); }
.viewer-title { flex: 1; min-width: 0; margin: 0; font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.viewer-body { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(260px, 1fr); gap: var(--s4); padding: var(--s4); overflow-y: auto; }
.viewer-figure { margin: 0; display: grid; place-items: center; background: var(--soft); border-radius: var(--r-sm); min-height: 240px; }
.viewer-figure img { max-width: 100%; max-height: calc(100dvh - 220px); object-fit: contain; }
.viewer-side { display: grid; align-content: start; gap: var(--s3); min-width: 0; }
.viewer-settings { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px var(--s3); margin: 0; }
.viewer-settings dt { color: var(--muted); }
.viewer-settings dd { margin: 0; overflow-wrap: anywhere; }
.viewer-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.viewer-actions [aria-pressed="true"] { color: var(--accent-ink); background: var(--accent-soft); }
.viewer-missing { display: grid; justify-items: center; gap: var(--s3); padding: var(--s6) var(--s4); text-align: center; }
.viewer-nav { display: flex; justify-content: space-between; gap: var(--s2); padding: var(--s3) var(--s4); border-top: 1px solid var(--line); }
@media (max-width: 720px) {
  .viewer-body { grid-template-columns: minmax(0, 1fr); }
  .creations-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; }
  .creations-wrap { padding: var(--s4) var(--s3) var(--s6); }
}

/* Spec S : sur téléphone, les discussions ou sessions récentes à un geste sous la saisie (la colonne est un tiroir) */
.recents { display: grid; gap: var(--s2); width: 100%; }
.recent-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.recent-link {
  display: flex; align-items: center; gap: var(--s2); min-height: 44px; padding: 8px 10px; border-radius: var(--r-sm);
  color: var(--ink-2); font-size: 14px;
}
.recent-link span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recent-link:hover { background: var(--soft); text-decoration: none; }
@media (min-width: 961px) { .recents { display: none; } }
@media (max-width: 960px) { .conv-link { min-height: 44px; } }   /* spec S §8 : cibles de 44 px au moins (tiroir) */
@media (max-width: 720px) { .rail-settings { width: 44px; height: 44px; } }

/* Revue finale de la spec S : la colonne se replie sur ordinateur (état retenu), une case vide pendant une
   génération de Créer, des boutons de visionneuse à 44 px sur téléphone */
.rail-collapse { align-self: center; margin-bottom: var(--s1); }
.rail-collapse[hidden] { display: none; }
@media (max-width: 960px) { .rail-collapse { display: none; } }
@media (min-width: 961px) {
  body.sidebar-collapsed .sidebar, body.sidebar-collapsed #sidebar-scrim { display: none; }
  body.sidebar-collapsed .rail-collapse { color: var(--accent-ink); }
}
body[data-space="creer"] .generation:is([data-status="queued"], [data-status="running"]) .gen-images[hidden] {
  display: grid;
}
body[data-space="creer"] .generation:is([data-status="queued"], [data-status="running"]) .gen-images:empty::before {
  content: ""; aspect-ratio: 1; border-radius: var(--r-sm); background: var(--soft); animation: pulse 1.6s var(--ease) infinite;
}
@media (max-width: 720px) {
  .viewer-actions .btn, .viewer-nav .btn, .viewer-head .icon-btn { min-height: 44px; min-width: 44px; }
}

/* ===== Bandeau du pod : téléphone (spec T §3.1) — l'état, le pourcentage ou l'heure d'arrêt, et le bouton restent ;
   le GPU, le prix et le reste se cachent ; le pod de fond se replie en pastille, un toucher ouvre son détail ===== */
@media (max-width: 720px) {
  :root { --podbar-h: 44px; }
  .podbar { margin-left: 0; padding: 0 var(--s2) 0 var(--s3); gap: 6px; }
  .podbar-detail { display: none; }
  .podbar-title { max-width: none; }
  .podbar-bg { max-width: none; min-height: 32px; padding: 4px 8px; }
  .podbar-bg-text { display: none; }
  .podbar-extend { min-height: 36px; padding-inline: 10px; }
}
