/* =====================================================================================================
   DEETO · système de design v20
   Calme, précis, éditorial. Une seule famille de gris, un seul accent (le texte lui-même), des filets fins,
   des rayons cohérents (8 · 12 · 18 · 26), une typographie serrée. Chargé en dernier : il a le dernier mot.
   ===================================================================================================== */

:root {
  --bg: #fbfbfa; --panel: #f4f4f2; --surface: #ffffff; --elev: #ffffff;
  --fill: rgba(20,20,25,.055); --fill-2: rgba(20,20,25,.035);
  --text: #18181b; --text-2: #52525b; --muted: #8a8a93;
  --border: rgba(20,20,25,.09); --sep: rgba(20,20,25,.07);
  --accent: #18181b; --accent-soft: rgba(20,20,25,.06);
  --link: #2563eb;
  --user-bubble: #efefec; --user-text: #18181b; --code-bg: #f4f4f1;
  --danger: #dc2626; --ok: #16a34a; --warn: #d97706;
  --shadow: 0 1px 2px rgba(20,20,25,.04), 0 8px 24px -8px rgba(20,20,25,.10);
  --shadow-lg: 0 2px 4px rgba(20,20,25,.04), 0 18px 48px -12px rgba(20,20,25,.18);
  --sidebar-w: 280px; --col: 744px;
  --r-s: 8px; --r-m: 12px; --r-l: 18px; --r-xl: 26px;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --serif: var(--font);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e0e10; --panel: #131315; --surface: #18181b; --elev: #202024;
    --fill: rgba(255,255,255,.07); --fill-2: rgba(255,255,255,.045);
    --text: #ededf0; --text-2: #b4b4bc; --muted: #86868f;
    --border: rgba(255,255,255,.085); --sep: rgba(255,255,255,.06);
    --accent: #ededf0; --accent-soft: rgba(255,255,255,.07);
    --link: #7aa7ff;
    --user-bubble: #212125; --user-text: #ededf0; --code-bg: #141416;
    --danger: #f87171; --ok: #4ade80; --warn: #fbbf24;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px -8px rgba(0,0,0,.6);
    --shadow-lg: 0 2px 4px rgba(0,0,0,.4), 0 18px 48px -12px rgba(0,0,0,.7);
  }
}
:root[data-theme="dark"] {
  --bg: #0e0e10; --panel: #131315; --surface: #18181b; --elev: #202024;
  --fill: rgba(255,255,255,.07); --fill-2: rgba(255,255,255,.045);
  --text: #ededf0; --text-2: #b4b4bc; --muted: #86868f;
  --border: rgba(255,255,255,.085); --sep: rgba(255,255,255,.06);
  --accent: #ededf0; --accent-soft: rgba(255,255,255,.07);
  --link: #7aa7ff;
  --user-bubble: #212125; --user-text: #ededf0; --code-bg: #141416;
  --danger: #f87171; --ok: #4ade80; --warn: #fbbf24;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px -8px rgba(0,0,0,.6);
  --shadow-lg: 0 2px 4px rgba(0,0,0,.4), 0 18px 48px -12px rgba(0,0,0,.7);
}

html body { font-family: var(--font); font-feature-settings: "cv11", "ss03", "calt"; letter-spacing: -.011em; background: var(--bg); color: var(--text); -webkit-font-smoothing: antialiased; }
body a { color: var(--link); }
body ::selection { background: color-mix(in srgb, var(--text) 18%, transparent); }
body :focus-visible { outline: 2px solid color-mix(in srgb, var(--text) 55%, transparent); outline-offset: 2px; }

/* ---------- Boutons génériques ---------- */
body .btn-primary { background: var(--text); color: var(--bg); border-radius: var(--r-m); font-weight: 600; letter-spacing: -.01em; box-shadow: none; }
body .btn-primary:active { transform: scale(.985); }
body .logo { background: var(--text); border-radius: 12px; box-shadow: none; }
body .logo::after { background: var(--bg); box-shadow: none; width: 28%; height: 28%; }

/* ---------- Connexion ---------- */
body .login { background: radial-gradient(100% 60% at 50% 0%, color-mix(in srgb, var(--text) 5%, var(--bg)) 0%, var(--bg) 70%); }
body .login-card { background: transparent; border: 0; box-shadow: none; padding: 0; width: min(340px, 100%); }
body .login-card h1 { font-size: 26px; font-weight: 650; letter-spacing: -.03em; }
body .login-card input { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-m); height: 48px; padding: 0 14px; font-size: 16px; }
body .login-card input:focus { border-color: color-mix(in srgb, var(--text) 40%, transparent); outline: 0; box-shadow: 0 0 0 4px var(--fill); }

/* ---------- Barre latérale ---------- */
body .sidebar { background: var(--panel); border-right: 1px solid var(--border); box-shadow: none; width: var(--sidebar-w); }
body .sidebar-head { padding: 14px 12px 6px; }
body .sidebar-title h1 { font-size: 15px; font-weight: 650; letter-spacing: -.02em; color: var(--text); display: flex; align-items: center; gap: 9px; }
body .sidebar-title h1::before { content: ""; width: 18px; height: 18px; border-radius: 6px; background: var(--text); box-shadow: inset 0 0 0 5.5px var(--text), inset 0 0 0 9px var(--bg); flex: none; }
body .sidebar-title { margin-bottom: 10px; }
body #new-chat { width: auto; height: 32px; padding: 0 11px 0 9px; gap: 6px; flex-direction: row; display: inline-flex; align-items: center; border-radius: var(--r-s); background: var(--surface); border: 1px solid var(--border); color: var(--text); box-shadow: 0 1px 1px rgba(0,0,0,.03); }
body #new-chat::after { content: "Nouveau"; font-size: 13px; font-weight: 550; letter-spacing: -.01em; }
body #new-chat svg { width: 15px; height: 15px; }
body .search { background: var(--fill-2); border: 1px solid transparent; border-radius: var(--r-s); height: 34px; transition: border-color .15s, background .15s; }
body .search:focus-within { background: var(--surface); border-color: var(--border); }
body .search input { font-size: 14px; }
body .conv-group { font-size: 11.5px; font-weight: 600; letter-spacing: .02em; color: var(--muted); text-transform: none; padding: 16px 14px 5px; }
body .conv-item { border-radius: var(--r-s); margin: 1px 6px; padding: 7px 10px; font-size: 14px; letter-spacing: -.01em; color: var(--text-2); min-height: 34px; background: transparent; transition: background .12s, color .12s; }
body .conv-item:hover { background: var(--fill-2); color: var(--text); }
body .conv-item.active { background: var(--fill); color: var(--text); font-weight: 520; }
body .sidebar-foot { border-top: 1px solid var(--border); padding: 8px; background: transparent; }
body .settings-row { background: transparent; border-radius: var(--r-s); height: 40px; box-shadow: none; padding: 0 10px; }
body .settings-row:hover { background: var(--fill-2); }
body .settings-row .gear { background: transparent; color: var(--text-2); }
body .settings-row-t { font-size: 14px; font-weight: 520; }
body .proj-chip, body .proj-strip button { border-radius: 999px; font-size: 12.5px; }

/* ---------- Barre du haut : plate, discrète ---------- */
body .topbar { background: linear-gradient(var(--bg) 62%, transparent); backdrop-filter: none; -webkit-backdrop-filter: none; padding: calc(6px + env(safe-area-inset-top)) 12px 16px; gap: 4px; min-height: 52px; box-shadow: none; }
body .glass { background: transparent; border: 0; box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none; }
body .glass.round, body .pill-btn, body .ctx-ring { width: 36px; height: 36px; border-radius: var(--r-m); color: var(--text-2); background: transparent; display: grid; place-items: center; transition: background .12s, color .12s; }
body .glass.round:hover, body .pill-btn:hover, body .conv-head:hover { background: var(--fill-2); color: var(--text); }
body .glass.round:active, body .pill-btn:active { background: var(--fill); }
body .right-pill { padding: 0; gap: 2px; height: auto; display: flex; align-items: center; }
body .conv-head { flex: 1; min-width: 0; border-radius: var(--r-m); padding: 5px 10px; text-align: left; align-items: flex-start; height: auto; display: flex; flex-direction: column; justify-content: center; }
body .conv-title { font-size: 15px; font-weight: 600; letter-spacing: -.02em; text-align: left; }
body .conv-sub-line, body .conv-sub { font-size: 12px; color: var(--muted); text-align: left; letter-spacing: 0; }
body .pill-btn svg, body .glass.round svg { width: 19px; height: 19px; stroke-width: 1.7; }

/* ---------- Conversation ---------- */
body .messages { max-width: var(--col); padding: 8px 18px 28px; }
body .msg { margin: 18px 0; }
body .msg.user .bubble { background: var(--user-bubble); color: var(--user-text); border-radius: 20px 20px 6px 20px; padding: 10px 15px; font-size: 15.5px; line-height: 1.5; letter-spacing: -.011em; max-width: min(82%, 560px); box-shadow: none; }
body .msg.assistant .content { font: 15.5px/1.7 var(--font); letter-spacing: -.011em; color: var(--text); }
body .msg.assistant .content p { margin: 0 0 .85em; }
body .msg.assistant .content h1, body .msg.assistant .content h2, body .msg.assistant .content h3 { letter-spacing: -.025em; font-weight: 650; margin: 1.3em 0 .45em; }
body .msg.assistant .content h1 { font-size: 1.35em; } body .msg.assistant .content h2 { font-size: 1.18em; } body .msg.assistant .content h3 { font-size: 1.04em; }
body .msg.assistant .content ul, body .msg.assistant .content ol { padding-left: 1.3em; margin: 0 0 .85em; }
body .msg.assistant .content li { margin: .25em 0; }
body .msg.assistant .content :not(pre) > code { background: var(--fill); border-radius: 6px; padding: .12em .38em; font-size: .88em; }
body .msg.assistant .content pre { background: var(--code-bg); border: 1px solid var(--border); border-radius: var(--r-m); box-shadow: none; }
body .msg.assistant .content blockquote { border-left: 2px solid var(--border); color: var(--text-2); padding-left: 14px; margin-left: 0; }
body .msg.assistant .content table { border: 1px solid var(--border); border-radius: var(--r-m); border-collapse: separate; border-spacing: 0; overflow: hidden; font-size: 14px; }
body .msg.assistant .content th { background: var(--fill-2); font-weight: 600; text-align: left; }
body .msg.assistant .content th, body .msg.assistant .content td { padding: 8px 12px; border-bottom: 1px solid var(--border); }
body .msg.assistant .content tr:last-child td { border-bottom: 0; }
body .msg .actions { gap: 2px; margin-top: 6px; }
body .msg .actions button, body .msg .actions .act-btn { width: 30px; height: 30px; border-radius: var(--r-s); color: var(--muted); }
body .msg .actions button:hover { background: var(--fill-2); color: var(--text); }
body .msg .actions .meta, body .msg .actions span { font-size: 12px; color: var(--muted); }
body .think, body details.think summary { font-size: 13px; color: var(--muted); }

/* Étapes d'outils : sobres, en filets */
body .act-row { border-radius: var(--r-m); background: transparent; border: 1px solid var(--border); box-shadow: none; }
body .act-row:hover { background: var(--fill-2); }

/* ---------- Bannière ---------- */
body .banner { margin: 4px 12px 0; padding: 8px 12px; border-radius: var(--r-m); background: var(--fill-2); border: 1px solid var(--border); color: var(--text-2); font-size: 12.5px; line-height: 1.4; box-shadow: none; }

/* ---------- Accueil ---------- */
body .empty { gap: 6px; padding-bottom: 14vh; }
body .empty .logo.big { width: 44px; height: 44px; border-radius: 14px; margin-bottom: 14px; }
body .empty h2 { font-size: 30px; font-weight: 650; letter-spacing: -.035em; margin: 0 0 22px; }
body .suggestions { width: min(560px, 100%); gap: 8px; }
body .suggestion { background: transparent; border: 1px solid var(--border); border-radius: var(--r-l); padding: 13px 15px; text-align: left; box-shadow: none; transition: background .12s, border-color .12s, transform .12s; }
body .suggestion:hover { background: var(--fill-2); border-color: color-mix(in srgb, var(--text) 18%, transparent); }
body .suggestion:active { transform: scale(.985); }
body .suggestion b, body .suggestion strong { font-size: 14px; font-weight: 600; letter-spacing: -.015em; }
body .suggestion span { font-size: 13px; color: var(--muted); }

/* ---------- Zone de saisie ---------- */
body .composer { padding: 0 14px max(14px, env(safe-area-inset-bottom)); background: linear-gradient(to top, var(--bg) 62%, transparent); }
body .composer-box { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-xl); box-shadow: var(--shadow); max-width: var(--col); margin: 0 auto; padding: 8px 8px 8px 8px; transition: border-color .15s, box-shadow .15s; }
body .composer-box:focus-within { border-color: color-mix(in srgb, var(--text) 24%, transparent); box-shadow: var(--shadow-lg); }
body .composer-box textarea { font-size: 16px; line-height: 1.5; padding: 8px 10px 4px; letter-spacing: -.011em; }
body .composer-box textarea::placeholder { color: var(--muted); }
body .composer-row { padding: 2px 2px 0; gap: 4px; }
body .round-btn { width: 34px; height: 34px; border-radius: 50%; background: transparent; border: 0; color: var(--text-2); transition: background .12s; }
body .round-btn:hover { background: var(--fill); color: var(--text); }
body .model-pill { height: 30px; padding: 0 11px; border-radius: 999px; background: transparent; border: 1px solid var(--border); font-size: 13px; color: var(--text-2); gap: 6px; }
body .model-pill b { font-weight: 600; color: var(--text); letter-spacing: -.01em; }
body .model-pill:hover { background: var(--fill-2); }
body .send-btn { width: 34px; height: 34px; border-radius: 50%; background: var(--text); color: var(--bg); box-shadow: none; transition: transform .12s, opacity .15s, background .15s; }
body .send-btn:disabled { opacity: .22; }
body .send-btn:not(:disabled):active { transform: scale(.92); }
body .send-btn.talk { background: var(--fill); color: var(--text); }
body .send-btn.stop { background: var(--text); color: var(--bg); }
body .send-btn svg, body .round-btn svg { width: 18px; height: 18px; stroke-width: 1.9; }
body .to-bottom { background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); color: var(--text-2); }
body .live-pill { background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); border-radius: 999px; }

/* ---------- Feuilles, dialogues, menus ---------- */
body .sheet { background: var(--elev); border: 1px solid var(--border); box-shadow: var(--shadow-lg); border-radius: 22px 22px 0 0; }
body .sheet-grip { background: var(--fill); }
body dialog, body .dlg { background: var(--elev); border: 1px solid var(--border); border-radius: 20px; box-shadow: var(--shadow-lg); color: var(--text); }
body .slash-menu, body .menu { background: var(--elev); border: 1px solid var(--border); border-radius: var(--r-l); box-shadow: var(--shadow-lg); }

/* ---------- Bureau : colonne centrée, barre latérale fixe ---------- */
@media (min-width: 821px) {
  body .topbar { padding-left: 16px; padding-right: 16px; }
  body .conv-head { flex: 0 1 auto; max-width: 52%; }
  body .topbar #island { margin-left: auto; }
  body .right-pill { margin-left: auto; }
  body .messages { padding-top: 14px; }
}
@media (max-width: 820px) {
  body .messages { padding-left: 16px; padding-right: 16px; }
  body .suggestions { grid-template-columns: 1fr; }
  body .empty h2 { font-size: 26px; }
  body .conv-head { align-items: center; text-align: center; }
  body .conv-title, body .conv-sub-line, body .conv-sub { text-align: center; }
  body #new-chat::after { content: none; }
  body #new-chat { width: 34px; padding: 0; justify-content: center; }
}
@media (prefers-reduced-motion: reduce) { body * { scroll-behavior: auto !important; } }

/* visibilité responsive (les règles display ci-dessus ne doivent pas réveiller ces boutons) */
@media (min-width: 821px) { body .only-mobile { display: none !important; } }
@media (max-width: 820px) { body .only-wide { display: none !important; } }
body [hidden] { display: none !important; }
body .code-block { border: 1px solid var(--border); border-radius: var(--r-m); background: var(--code-bg); box-shadow: none; }
body .code-head { border-bottom: 1px solid var(--border); font-size: 11.5px; padding: 4px 6px 4px 12px; }
body .code-block pre { border: 0 !important; border-radius: 0 !important; background: transparent !important; }
body .banner { margin-top: calc(60px + env(safe-area-inset-top)); }
body .sidebar-title h1 { font-size: 0; }
body .sidebar-title h1::after { content: "DEETO"; font-size: 15px; }
body .banner { height: 34px; padding: 0 6px 0 12px; margin-bottom: -34px; font-size: 12.5px; }
body .banner > span { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body .banner .ctx-close { width: 26px; height: 26px; flex: none; }
body .main:has(#banner:not([hidden])) .messages { padding-top: 48px; }
body .main:has(#banner:not([hidden])) .empty { padding-top: 40px; }
body .banner { background: var(--surface); }
body .login-card input:focus-visible { outline: 0; }

/* Comptes utilisateurs : ce qui touche au serveur ou aux réglages communs est réservé à l'admin */
html[data-role="user"] [data-admin] { display: none !important; }

/* ---------- Installation obligatoire sur téléphone (tuto) ---------- */
html.needs-install body > *:not(#install-gate) { display: none !important; }
#install-gate { position: fixed; inset: 0; z-index: 2147483000; background: var(--bg); color: var(--text); display: flex; justify-content: center; align-items: flex-start; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: max(28px, env(safe-area-inset-top)) 20px max(28px, env(safe-area-inset-bottom)); }
#install-gate .ig-card { width: 100%; max-width: 420px; display: flex; flex-direction: column; gap: 18px; margin: auto 0; }
#install-gate .ig-logo { width: 72px; height: 72px; border-radius: 20px; background: var(--text); display: grid; place-items: center; margin: 0 auto; }
#install-gate .ig-logo span { width: 24px; height: 24px; border-radius: 50%; background: var(--bg); }
#install-gate h1 { font-size: 28px; line-height: 1.15; text-align: center; margin: 0; letter-spacing: -.02em; }
#install-gate .ig-intro { font-size: 18px; line-height: 1.45; text-align: center; color: var(--text-2); margin: 0; }
#install-gate .ig-steps { list-style: none; margin: 4px 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
#install-gate .ig-steps li { display: flex; gap: 14px; align-items: flex-start; background: var(--surface); border: 1px solid var(--line, rgba(128,128,128,.22)); border-radius: 18px; padding: 16px; }
#install-gate .ig-steps.ig-small li { opacity: .75; }
#install-gate .ig-n { flex: none; width: 34px; height: 34px; border-radius: 50%; background: var(--text); color: var(--bg); display: grid; place-items: center; font-weight: 700; font-size: 17px; }
#install-gate .ig-t { font-size: 18px; line-height: 1.45; }
#install-gate .ig-ic { display: inline-grid; place-items: center; vertical-align: middle; width: 30px; height: 30px; border-radius: 9px; background: var(--accent-soft); margin: 0 2px; }
#install-gate .ig-ic svg { width: 19px; height: 19px; }
#install-gate .ig-btn { appearance: none; border: 0; border-radius: 16px; background: var(--text); color: var(--bg); font: inherit; font-size: 19px; font-weight: 650; padding: 17px; width: 100%; }
#install-gate .ig-btn[hidden] { display: none; }
#install-gate .ig-alt { background: var(--accent-soft); color: var(--text); }
#install-gate .ig-note { font-size: 16px; line-height: 1.45; color: var(--text-2); text-align: center; margin: 0; }
#install-gate .ig-note .ig-ic { width: 26px; height: 26px; }
#install-gate .ig-done { width: 84px; height: 84px; border-radius: 50%; background: var(--text); color: var(--bg); display: grid; place-items: center; margin: 0 auto; }
#install-gate .ig-done svg { width: 44px; height: 44px; }

/* ---------- Passkeys : bouton biométrique, anneau animé, feuille de proposition ---------- */
.pk-btn { appearance: none; width: 100%; display: flex; align-items: center; gap: 14px; text-align: left; border: 1px solid var(--border); background: var(--surface); color: var(--text); border-radius: var(--r-l, 18px); padding: 12px 16px 12px 12px; font: inherit; cursor: pointer; transition: transform .16s ease, border-color .2s, box-shadow .2s; }
.pk-btn:active { transform: scale(.985); }
.pk-btn[hidden], .pk-or[hidden] { display: none; }
.pk-btn .pk-ring { position: relative; flex: none; width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; background: var(--text); color: var(--bg); }
.pk-btn .pk-ring svg { width: 25px; height: 25px; position: relative; z-index: 1; }
.pk-btn .pk-ring::before { content: ""; position: absolute; inset: -5px; border-radius: 50%; border: 1.5px solid color-mix(in srgb, var(--text) 25%, transparent); opacity: 0; transform: scale(.9); }
.pk-btn .pk-txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pk-btn .pk-txt b { font-size: 16px; font-weight: 640; letter-spacing: -.01em; }
.pk-btn .pk-txt i { font-style: normal; font-size: 13px; color: var(--muted); }
.has-passkey .pk-btn { padding: 16px 18px 16px 14px; border-color: color-mix(in srgb, var(--text) 30%, transparent); box-shadow: 0 8px 28px -12px color-mix(in srgb, var(--text) 40%, transparent); }
.has-passkey .pk-btn .pk-ring::before { animation: pkPulse 2.6s ease-out infinite; }
.has-passkey #password, .has-passkey #login-form .btn-primary { opacity: .92; }
@keyframes pkPulse { 0% { opacity: .9; transform: scale(.92); } 80%, 100% { opacity: 0; transform: scale(1.5); } }
.pk-or { margin-top: 12px !important; display: flex; align-items: center; gap: 12px; margin: 4px 0; color: var(--muted); font-size: 12.5px; }
.pk-or::before, .pk-or::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.login-card.pk-busy .pk-btn { pointer-events: none; border-color: var(--text); }
.login-card.pk-busy .pk-ring { animation: pkSpin 1.1s linear infinite; background: conic-gradient(from 0deg, var(--text), color-mix(in srgb, var(--text) 10%, transparent) 70%, var(--text)); }
.login-card.pk-busy .pk-ring::after { content: ""; position: absolute; inset: 3px; border-radius: 50%; background: var(--bg); }
.login-card.pk-busy .pk-ring svg { color: var(--text); animation: pkSpin 1.1s linear infinite reverse; }
.login-card.pk-ok .pk-ring { animation: none; background: var(--text); transform: scale(1.12); transition: transform .3s cubic-bezier(.2,1.4,.4,1); }
.login-card.pk-ok .pk-ring::after { display: none; }
.login-card.pk-ok .pk-ring svg { color: var(--bg); animation: none; }
@keyframes pkSpin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .has-passkey .pk-btn .pk-ring::before, .login-card.pk-busy .pk-ring, .login-card.pk-busy .pk-ring svg { animation: none; } }

.pk-offer { position: fixed; inset: 0; z-index: 900; display: flex; align-items: flex-end; justify-content: center; background: rgba(0,0,0,0); transition: background .26s; padding: 0 12px max(14px, env(safe-area-inset-bottom)); }
.pk-offer[hidden] { display: none; }
.pk-offer.show { background: rgba(0,0,0,.42); }
.pk-offer-card { width: min(420px, 100%); background: var(--elev, var(--surface)); border: 1px solid var(--border); border-radius: 28px; padding: 28px 22px 16px; text-align: center; transform: translateY(40px); opacity: 0; transition: transform .38s cubic-bezier(.2,1,.3,1), opacity .26s; box-shadow: 0 30px 80px -20px rgba(0,0,0,.5); }
.pk-offer.show .pk-offer-card { transform: none; opacity: 1; }
.pk-offer-ic { width: 68px; height: 68px; margin: 0 auto 16px; border-radius: 22px; background: var(--text); color: var(--bg); display: grid; place-items: center; }
.pk-offer-ic svg { width: 36px; height: 36px; }
.pk-offer h2 { margin: 0 0 8px; font-size: 22px; letter-spacing: -.02em; }
.pk-offer p { margin: 0 0 20px; color: var(--text-2); font-size: 15.5px; line-height: 1.45; }
.pk-offer .btn-primary { width: 100%; height: 50px; border-radius: 16px; font-size: 16.5px; }
.pk-later { appearance: none; border: 0; background: none; color: var(--muted); font: inherit; font-size: 15px; padding: 14px; width: 100%; cursor: pointer; }

/* ---------- Clé de récupération des sauvegardes ---------- */
.bk-key { display: block; font: 600 15px/1.6 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .02em; word-break: break-all; background: var(--surface); border: 1px dashed color-mix(in srgb, var(--text) 35%, transparent); border-radius: 14px; padding: 14px; margin: 0 0 6px; user-select: all; -webkit-user-select: all; }
.bk-actions { display: flex; gap: 8px; margin-bottom: 6px; }
.bk-actions .pk-later { padding: 10px; color: var(--text); }
.bk-ok { display: flex; gap: 10px; align-items: center; justify-content: center; font-size: 15px; margin: 10px 0 14px; color: var(--text-2); }
.bk-ok input { width: 20px; height: 20px; accent-color: var(--text); }
#bk-done:disabled { opacity: .4; }

/* ---------- Quotas ---------- */
.qbar { display: block; height: 6px; border-radius: 6px; background: var(--accent-soft); overflow: hidden; margin-top: 8px; }
.qbar i { display: block; height: 100%; border-radius: 6px; background: var(--text); transition: width .5s cubic-bezier(.2,1,.3,1); }
.qbar.warn i { background: #d99a2b; }
.qbar.full i { background: #d9534f; }
.user-row { align-items: flex-start; flex-wrap: wrap; row-gap: 8px; }
.user-row .row-t { flex: 1 1 100%; }
.user-acts { display: flex; gap: 14px; flex-wrap: wrap; }
.row-t.danger { color: #d9534f; }

/* Tableaux : défilement horizontal propre, colonnes jamais écrasées lettre par lettre (mobile) */
body .msg.assistant .content table, body .content table { display: block; width: max-content; max-width: 100%; overflow-x: auto; overflow-y: hidden; -webkit-overflow-scrolling: touch; border-collapse: separate; }
body .content th, body .content td { min-width: 5.5em; vertical-align: top; overflow-wrap: normal; word-break: normal; hyphens: none; }
body .content th { white-space: nowrap; }
body .content td { min-width: 7em; }
