/* ==========================================================================
   Remotly · Content (Motion Studio) — même direction artistique que app.remotly.fr
   Noir profond, halos violets, verre dépoli ; Satoshi (texte) + Clash Display (titres) + Geist Mono (étiquettes).
   Polices servies depuis cloud/public/fonts (les mêmes fichiers que Remotly).
   ========================================================================== */
@font-face { font-family: "Satoshi"; font-weight: 400; font-style: normal; font-display: swap; src: url("/fonts/satoshi-400.woff2") format("woff2"); }
@font-face { font-family: "Satoshi"; font-weight: 500; font-style: normal; font-display: swap; src: url("/fonts/satoshi-500.woff2") format("woff2"); }
@font-face { font-family: "Satoshi"; font-weight: 600 800; font-style: normal; font-display: swap; src: url("/fonts/satoshi-700.woff2") format("woff2"); }
@font-face { font-family: "Clash Display"; font-weight: 500 600; font-style: normal; font-display: swap; src: url("/fonts/clash-display-600.woff2") format("woff2"); }
@font-face { font-family: "Clash Display"; font-weight: 700 800; font-style: normal; font-display: swap; src: url("/fonts/clash-display-700.woff2") format("woff2"); }
@font-face { font-family: "Geist Mono"; font-weight: 100 900; font-style: normal; font-display: swap; src: url("/fonts/geist-mono.woff2") format("woff2"); }

:root {
  --frame: #000;
  --bg: #040306;
  --bg-2: rgba(255, 255, 255, 0.035);
  --surface: rgba(12, 10, 18, 0.72);
  --surface-2: rgba(255, 255, 255, 0.045);
  --surface-3: rgba(255, 255, 255, 0.08);
  --line: rgba(255, 255, 255, 0.08);
  --line-2: rgba(255, 255, 255, 0.14);
  --text: #fff;
  --text-2: rgba(255, 255, 255, 0.66);
  --text-3: rgba(255, 255, 255, 0.42);
  --accent: #a78bfa;
  --accent-2: #8b5cf6;
  --accent-ink: #fff;
  --grad: linear-gradient(180deg, #9d74fa, #7c3aed);
  --grad-text: linear-gradient(120deg, #c4b5fd, #8b5cf6);
  --glow: 0 0 0 1px rgba(196, 181, 253, 0.25) inset, 0 10px 30px -8px rgba(139, 92, 246, 0.65);
  --ok: #34d399;
  --warn: #fbbf24;
  --err: #f87171;
  --info: #60a5fa;
  --r-sm: 10px;
  --r: 12px;
  --r-lg: 16px;
  --shadow: 0 40px 120px -40px rgba(139, 92, 246, 0.35), 0 30px 60px -30px rgba(0, 0, 0, 0.9), 0 0 0 1px var(--line);
  --ease: cubic-bezier(0.2, 0.9, 0.2, 1);
  --font: "Satoshi", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-display: "Clash Display", "Satoshi", sans-serif;
  --font-mono: "Geist Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
  --sidebar-w: 248px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background:
    radial-gradient(60rem 30rem at 18% -10%, rgba(139, 92, 246, 0.16), transparent 60%),
    radial-gradient(50rem 28rem at 100% 110%, rgba(124, 58, 237, 0.10), transparent 60%),
    #000;
  color: var(--text);
  font: 400 13px/1.5 var(--font);
  letter-spacing: -0.006em;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
::selection { background: rgba(139, 92, 246, 0.35); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.08); border-radius: 10px; border: 3px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background-color: rgba(255, 255, 255, 0.16); }
:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; border-radius: 6px; }
h1, h2, h3, h4 { font-family: var(--font-display); letter-spacing: -0.02em; font-weight: 600; }

svg.i { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; flex: none; }
svg.i.sm { width: 15px; height: 15px; }
svg.i.lg { width: 26px; height: 26px; }

/* ---------- Coque : cadre noir + panneau arrondi (comme Remotly) ---------- */
.app-container { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); gap: 8px; padding: 8px; height: 100dvh; }
.sidebar { display: flex; flex-direction: column; min-height: 0; overflow-y: auto; padding: 4px 4px 4px 6px; }
.brand { display: flex; align-items: center; gap: 9px; padding: 8px 8px 14px; }
.brand-logo, .auth-logo { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; color: #fff;
  background: linear-gradient(140deg, #a78bfa, #7c3aed 60%, #5b21b6); box-shadow: 0 6px 20px -6px rgba(139, 92, 246, 0.8), inset 0 1px 0 rgba(255,255,255,.3); }
.brand-logo svg.i { width: 15px; height: 15px; stroke-width: 2.2; }
.brand-name { font-family: var(--font-display); font-size: 19px; font-weight: 600; letter-spacing: -0.03em; }
.brand-badge { margin-left: auto; font-family: var(--font-mono); font-size: 10.5px; color: var(--accent); padding: 2px 7px; border-radius: 6px; background: rgba(139, 92, 246, 0.14); box-shadow: inset 0 0 0 1px rgba(167, 139, 250, 0.22); }

.nav { display: flex; flex-direction: column; gap: 1px; }
.nav-item { position: relative; display: flex; align-items: center; gap: 10px; min-height: 32px; padding: 0 10px; border-radius: var(--r); font-size: 13px; font-weight: 500;
  color: var(--text-2); cursor: pointer; user-select: none; border: 0; background: transparent; text-align: left;
  transition: background-color .3s var(--ease), color .3s var(--ease), transform .3s var(--ease); }
.nav-item .nav-icon { width: 16px; height: 16px; color: var(--text-3); }
.nav-item .nav-label { flex: 1; }
@media (hover: hover) and (pointer: fine) { .nav-item:hover:not(.active) { background: var(--surface); color: var(--text); transform: translateX(2px); } }
.nav-item.active { color: var(--text); font-weight: 600; background: linear-gradient(90deg, rgba(139, 92, 246, 0.22), rgba(139, 92, 246, 0.04)); box-shadow: inset 0 0 0 1px rgba(167, 139, 250, 0.22); }
.nav-item.active .nav-icon { color: var(--accent); }
.nav-item.active::before { content: ""; position: absolute; left: -6px; top: 9px; bottom: 9px; width: 3px; border-radius: 3px; background: #a78bfa; box-shadow: 0 0 12px 1px rgba(167, 139, 250, 0.8); }
.nav-badge { font-family: var(--font-mono); font-size: 11.5px; font-weight: 600; color: var(--text-3); font-style: normal; }
.nav-badge:empty { display: none; }
.nav-item.active .nav-badge { color: var(--text-2); }
.nav-ext svg.i:last-child { width: 14px; height: 14px; opacity: .55; transition: opacity .3s var(--ease), transform .3s var(--ease); }
@media (hover: hover) and (pointer: fine) { .nav-ext:hover svg.i:last-child { opacity: 1; transform: translate(1px, -1px); } }

.sidebar-bottom { margin-top: auto; display: flex; flex-direction: column; gap: 1px; padding-top: 8px; }
.engine, .credits { margin: 0 0 6px; padding: 10px 12px; border-radius: var(--r); background: rgba(255, 255, 255, 0.035); border: 1px solid var(--line); font-size: 12px; }
.engine-row { display: flex; align-items: center; gap: 8px; }
.engine-row b { font-weight: 600; }
.engine small, .credits small { color: var(--text-3); display: block; margin-top: 2px; font-family: var(--font-mono); font-size: 10.5px; }
.credits .amount { font-family: var(--font-mono); font-size: 16px; font-weight: 600; margin-top: 2px; font-variant-numeric: tabular-nums; }
.user-card { display: flex; align-items: center; gap: 10px; margin-top: 8px; padding: 8px; border-radius: var(--r); background: rgba(255, 255, 255, 0.035); border: 1px solid rgba(255, 255, 255, 0.08); }
.user-avatar { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; font-weight: 600; font-size: 12px; color: #fff; background: #8b5cf6; flex: none; }
.user-meta { min-width: 0; flex: 1; }
.user-email { font-size: 12.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-role { font-family: var(--font-mono); font-size: 11px; color: var(--text-3); }
.icon-btn { width: 32px; height: 32px; border-radius: var(--r); display: grid; place-items: center; background: transparent; border: 0; color: var(--text-3); cursor: pointer; }
.icon-btn svg.i { width: 16px; height: 16px; }
@media (hover: hover) and (pointer: fine) { .icon-btn:hover { background: var(--surface-2); color: var(--text); } }

.dot { width: 6px; height: 6px; border-radius: 50%; background: var(--text-3); flex: none; display: inline-block; }
.dot.ok { background: var(--ok); box-shadow: 0 0 0 4px rgba(52, 211, 153, 0.14); }
.dot.run { background: #a78bfa; box-shadow: 0 0 0 4px rgba(167, 139, 250, 0.18); animation: pulse 1.6s infinite; }
.dot.warn { background: var(--warn); }
.dot.err { background: var(--err); }
@keyframes pulse { 50% { box-shadow: 0 0 0 7px rgba(167, 139, 250, 0); } }

.main-wrapper { position: relative; isolation: isolate; min-height: 0; display: flex; flex-direction: column; overflow: hidden; border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  background: radial-gradient(70rem 26rem at 50% -12%, rgba(139, 92, 246, 0.10), transparent 65%), rgba(6, 5, 10, 0.82);
  box-shadow: 0 40px 120px -50px rgba(139, 92, 246, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.04); }
.main-wrapper::before { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; opacity: 0.5;
  background-image: radial-gradient(1px 1px at 12% 18%, rgba(255,255,255,.35), transparent 60%), radial-gradient(1px 1px at 72% 8%, rgba(255,255,255,.25), transparent 60%),
    radial-gradient(1px 1px at 88% 42%, rgba(255,255,255,.2), transparent 60%), radial-gradient(1px 1px at 34% 64%, rgba(255,255,255,.18), transparent 60%),
    radial-gradient(1px 1px at 56% 88%, rgba(255,255,255,.22), transparent 60%), radial-gradient(1px 1px at 6% 82%, rgba(255,255,255,.18), transparent 60%); }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 52px; padding: 6px 20px; border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(0, 0, 0, 0.35); backdrop-filter: blur(24px) saturate(140%); -webkit-backdrop-filter: blur(24px) saturate(140%); }
.topbar-left { display: flex; align-items: center; gap: 8px; min-width: 0; }
.crumb-ico { color: var(--text-3); display: grid; }
.view-title { margin: 0; font-size: 15px; font-weight: 600; white-space: nowrap; }
.stats-pills { display: flex; align-items: center; gap: 16px; }
.stat-pill { display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-2); white-space: nowrap; font-variant-numeric: tabular-nums; }
.stat-pill b { color: var(--text); font-weight: 600; }
.stat-pill.online .dot { background: var(--ok); }
.stat-pill.warn .dot { background: var(--warn); }
.stat-pill.error .dot { background: var(--err); }
.main { flex: 1; min-height: 0; overflow-y: auto; position: relative; scroll-behavior: smooth; }
.view { display: none; padding: 26px 28px 100px; max-width: 1400px; margin: 0 auto; animation: fade 0.45s var(--ease); }
.view.active { display: block; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head h1 { font-family: var(--font-display); font-weight: 600; font-size: 30px; line-height: 1.1; margin: 0; letter-spacing: -0.03em; }
.page-head h1 em { font-style: normal; background: var(--grad-text); -webkit-background-clip: text; background-clip: text; color: transparent; }
.page-head p { color: var(--text-2); margin: 8px 0 0; max-width: 640px; }
.head-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* ---------- Buttons & inputs ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 38px; padding: 0 15px; border-radius: var(--r-sm); border: 0; cursor: pointer;
  background: var(--surface-2); color: var(--text); font-weight: 500; white-space: nowrap;
  box-shadow: inset 0 0 0 1px var(--line-2);
  transition: transform 0.15s var(--ease), background 0.2s, box-shadow 0.2s, opacity 0.2s;
}
.btn:hover { background: var(--surface-3); }
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }
.btn.primary { background: var(--grad); color: #fff; font-weight: 600; box-shadow: var(--glow); }
.btn.primary:hover { background: linear-gradient(180deg, #ad8afb, #8b5cf6); transform: translateY(-1px); box-shadow: 0 0 0 1px rgba(196, 181, 253, 0.35) inset, 0 16px 40px -10px rgba(139, 92, 246, 0.85); }
.btn.ghost { background: transparent; box-shadow: none; color: var(--text-2); }
.btn.ghost:hover { background: rgba(255, 255, 255, 0.05); color: var(--text); }
.btn.danger:hover { color: var(--err); }
.btn.sm { height: 30px; padding: 0 10px; font-size: 12.5px; border-radius: 8px; }
.btn.lg { height: 50px; font-size: 15px; border-radius: var(--r); }
.btn.icon { width: 34px; padding: 0; }
.btn.sm.icon { width: 30px; }
.btn.block { width: 100%; }

.field { display: flex; flex-direction: column; gap: 7px; }
.field + .field { margin-top: 14px; }
.grid-2 > .field + .field, .grid-3 > .field + .field { margin-top: 0; }
.label { font-size: 12px; font-weight: 600; color: var(--text-2); letter-spacing: 0.2px; display: flex; align-items: center; gap: 6px; }
.label .hint { font-weight: 400; color: var(--text-3); margin-left: auto; }
.input, .select, .textarea {
  width: 100%; background: var(--bg-2); border: 0; border-radius: var(--r-sm);
  box-shadow: inset 0 0 0 1px var(--line-2); padding: 10px 12px; outline: none;
  transition: box-shadow 0.2s;
}
.input:focus, .select:focus, .textarea:focus { box-shadow: inset 0 0 0 1px var(--accent), 0 0 0 4px rgba(167, 139, 250, 0.14); }
.textarea { resize: vertical; min-height: 110px; line-height: 1.55; font-size: 13px; }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23a9a8b8' stroke-width='2.5'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 34px; }
.muted { color: var(--text-3); }
.small { font-size: 12.5px; }

/* Segmented control */
.seg { display: flex; padding: 3px; gap: 3px; background: var(--bg-2); border-radius: 12px; box-shadow: inset 0 0 0 1px var(--line); }
.seg button { flex: 1; height: 34px; border: 0; background: transparent; border-radius: 9px; color: var(--text-2); cursor: pointer; font-weight: 500; font-size: 13px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; transition: all 0.2s var(--ease); }
.seg button:hover { color: var(--text); }
.seg button.on { background: var(--surface-3); color: var(--text); box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06) inset, 0 4px 12px -4px rgba(0, 0, 0, 0.6); }
.seg.big button { height: 42px; font-size: 14px; }
.seg.big button.on { background: var(--grad); color: #fff; font-weight: 600; box-shadow: var(--glow); }

/* Chips */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 11px; border-radius: 999px;
  background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); color: var(--text-2);
  font-size: 12.5px; cursor: pointer; user-select: none; border: 0; transition: all 0.18s var(--ease); white-space: nowrap;
}
.chip:hover { color: var(--text); box-shadow: inset 0 0 0 1px var(--line-2); }
.chip.on { background: rgba(167, 139, 250, 0.16); color: #ddd2ff; box-shadow: inset 0 0 0 1px rgba(167, 139, 250, 0.55); }
.chip.static { cursor: default; }
.chip img { width: 18px; height: 18px; border-radius: 50%; object-fit: cover; margin-left: -6px; }
.tag { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 6px; font-size: 11.5px; font-weight: 500; background: rgba(255, 255, 255, 0.06); color: var(--text-2); white-space: nowrap; }
.tag.accent { background: rgba(167, 139, 250, 0.15); color: #d4c7ff; }
.tag.warn { background: rgba(251, 191, 36, 0.12); color: #fcd34d; }

/* Switch */
.switch { position: relative; width: 38px; height: 22px; flex: none; }
.switch input { opacity: 0; position: absolute; inset: 0; cursor: pointer; z-index: 1; margin: 0; }
.switch span { position: absolute; inset: 0; border-radius: 22px; background: var(--surface-3); box-shadow: inset 0 0 0 1px var(--line-2); transition: background 0.2s; }
.switch span::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform 0.25s var(--ease); }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::after { transform: translateX(16px); }
.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 4px 0; }
.toggle-row .t { font-weight: 500; font-size: 13px; }
.toggle-row .d { font-size: 12px; color: var(--text-3); }

/* Cards */
.card { background: var(--surface); border-radius: var(--r-lg); box-shadow: inset 0 0 0 1px var(--line); }
.card-pad { padding: 20px; }
.section-title { font-size: 12px; text-transform: uppercase; letter-spacing: 1.1px; color: var(--text-3); font-weight: 600; margin: 0 0 12px; display: flex; align-items: center; gap: 8px; }
.section-title .step { width: 20px; height: 20px; border-radius: 6px; background: var(--surface-3); color: var(--text-2); display: grid; place-items: center; font-size: 11px; letter-spacing: 0; }
.divider { height: 1px; background: var(--line); margin: 20px 0; }

/* ---------- Studio ---------- */
.studio { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 24px; align-items: start; }
.drop {
  position: relative; border-radius: var(--r-lg); padding: 38px 24px; text-align: center; cursor: pointer;
  background:
    linear-gradient(var(--surface), var(--surface)) padding-box,
    repeating-linear-gradient(135deg, rgba(255,255,255,0.14) 0 8px, transparent 8px 16px) border-box;
  border: 1.5px dashed rgba(255, 255, 255, 0.14);
  transition: all 0.25s var(--ease);
}
.drop:hover, .drop.over { border-color: var(--accent); background: linear-gradient(180deg, rgba(167, 139, 250, 0.08), rgba(167, 139, 250, 0.02)), var(--surface); }
.drop.over { transform: scale(1.005); }
.drop .drop-icon { width: 56px; height: 56px; margin: 0 auto 14px; border-radius: 16px; display: grid; place-items: center; background: var(--surface-3); color: var(--accent); box-shadow: inset 0 0 0 1px var(--line-2); }
.drop h3 { margin: 0; font-size: 17px; font-weight: 600; }
.drop p { margin: 6px 0 0; color: var(--text-2); font-size: 13px; }
.drop.compact { padding: 16px; display: flex; align-items: center; gap: 14px; text-align: left; }
.drop.compact .drop-icon { margin: 0; width: 42px; height: 42px; border-radius: 12px; }
.drop.compact h3 { font-size: 14px; }
.drop.compact p { margin: 2px 0 0; font-size: 12.5px; }

.staged-head { display: flex; align-items: center; justify-content: space-between; margin: 26px 0 12px; }
.staged-head h2 { margin: 0; font-size: 15px; font-weight: 600; }
.staged { display: flex; flex-direction: column; gap: 12px; }
.vcard { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 16px; padding: 14px; border-radius: var(--r-lg); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); animation: fade 0.35s var(--ease); }
.thumb { position: relative; width: 96px; aspect-ratio: 9/16; border-radius: 12px; overflow: hidden; background: var(--surface-3); }
.thumb img, .thumb video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.thumb .dur { position: absolute; bottom: 6px; right: 6px; font-size: 10.5px; font-weight: 600; padding: 2px 6px; border-radius: 6px; background: rgba(0, 0, 0, 0.65); backdrop-filter: blur(6px); }
.vcard-body { min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.vcard-top { display: flex; align-items: flex-start; gap: 10px; }
.vcard-title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vcard-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.vcard-top .btn { margin-left: auto; flex: none; }
.analysis { padding: 12px; border-radius: 12px; background: var(--bg-2); box-shadow: inset 0 0 0 1px var(--line); }
.analysis-head { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-2); margin-bottom: 9px; }
.analysis-head b { color: var(--text); font-weight: 600; }
.analysis-head .btn { margin-left: auto; }
.shimmer { height: 28px; border-radius: 999px; background: linear-gradient(90deg, var(--surface-2) 0%, var(--surface-3) 50%, var(--surface-2) 100%); background-size: 200% 100%; animation: shimmer 1.3s infinite linear; }
@keyframes shimmer { to { background-position: -200% 0; } }
.shimmer-row { display: flex; gap: 6px; }
.spinner { width: 14px; height: 14px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, 0.15); border-top-color: var(--accent); animation: spin 0.8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }

.empty { text-align: center; padding: 44px 20px; color: var(--text-3); }
.empty .empty-icon { width: 54px; height: 54px; margin: 0 auto 12px; border-radius: 16px; display: grid; place-items: center; background: var(--surface-2); color: var(--text-2); }
.empty h3 { margin: 0 0 4px; color: var(--text); font-size: 15px; font-weight: 600; }
.empty p { margin: 0 auto; max-width: 380px; font-size: 13px; }

.panel { position: sticky; top: 16px; max-height: calc(100vh - 32px); overflow: auto; border-radius: var(--r-lg); scrollbar-width: thin; }
.panel .card-pad { padding: 22px; }
.model-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 8px; }
.mp { position: relative; border-radius: 14px; overflow: hidden; aspect-ratio: 3/4; cursor: pointer; background: var(--surface-3); box-shadow: inset 0 0 0 1px var(--line); transition: transform 0.2s var(--ease), box-shadow 0.2s; border: 0; padding: 0; }
.mp img { width: 100%; height: 100%; object-fit: cover; display: block; opacity: 0.85; transition: opacity 0.2s; }
.mp span { position: absolute; left: 0; right: 0; bottom: 0; padding: 18px 6px 6px; font-size: 11.5px; font-weight: 600; text-align: center; background: linear-gradient(transparent, rgba(0, 0, 0, 0.8)); }
.mp:hover img { opacity: 1; }
.mp.on { box-shadow: 0 0 0 2px var(--accent), 0 10px 26px -8px rgba(167, 139, 250, 0.6); }
.mp.on img { opacity: 1; }
.mp.on::after { content: ''; position: absolute; top: 6px; right: 6px; width: 16px; height: 16px; border-radius: 50%; background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230b0b10' stroke-width='3.5' stroke-linecap='round'%3E%3Cpath d='M5 12l5 5L19 7'/%3E%3C/svg%3E") center/10px no-repeat; }
.mp .noimg { display: grid; place-items: center; height: 100%; color: var(--text-3); font-family: var(--font-display); font-weight: 600; font-size: 26px; }

.outfit-pick { display: flex; flex-direction: column; gap: 6px; max-height: 220px; overflow: auto; padding: 2px; }
.op { display: flex; align-items: center; gap: 10px; padding: 7px 10px 7px 7px; border-radius: 11px; cursor: pointer; background: var(--bg-2); box-shadow: inset 0 0 0 1px var(--line); border: 0; text-align: left; transition: all 0.18s; }
.op:hover { box-shadow: inset 0 0 0 1px var(--line-2); }
.op.on { box-shadow: inset 0 0 0 1px var(--accent); background: rgba(167, 139, 250, 0.08); }
.op .op-img { width: 34px; height: 34px; border-radius: 8px; flex: none; background: var(--surface-3) center/cover; display: grid; place-items: center; color: var(--text-2); }
.op .op-t { font-size: 13px; font-weight: 500; }
.op .op-d { font-size: 11.5px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.op > div:last-child { min-width: 0; }

.auto-box { margin-top: 14px; padding: 14px; border-radius: 14px; background: linear-gradient(180deg, rgba(167, 139, 250, 0.08), rgba(167, 139, 250, 0.02)); box-shadow: inset 0 0 0 1px rgba(167, 139, 250, 0.2); }
.auto-box ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.auto-box li { display: flex; gap: 9px; font-size: 12.5px; color: var(--text-2); }
.auto-box li svg { color: var(--accent); margin-top: 1px; }
.auto-box li b { color: var(--text); font-weight: 500; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.prompt-preview { margin-top: 10px; padding: 12px; border-radius: 12px; background: var(--bg-2); box-shadow: inset 0 0 0 1px var(--line); font-size: 12.5px; color: var(--text-2); line-height: 1.6; max-height: 180px; overflow: auto; }
.prompt-preview mark { background: rgba(167, 139, 250, 0.16); color: #ddd2ff; border-radius: 4px; padding: 0 3px; }
.tokens { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.tokens code { font-size: 11.5px; padding: 3px 7px; border-radius: 6px; background: var(--surface-3); color: var(--text-2); cursor: pointer; }
.tokens code:hover { color: var(--text); }
.launch { margin-top: 20px; }
.launch-meta { display: flex; justify-content: space-between; font-size: 12px; color: var(--text-3); margin-top: 10px; }
.stepper { display: flex; align-items: center; background: var(--bg-2); border-radius: var(--r-sm); box-shadow: inset 0 0 0 1px var(--line-2); height: 40px; }
.stepper button { width: 38px; height: 100%; border: 0; background: transparent; cursor: pointer; color: var(--text-2); font-size: 17px; }
.stepper button:hover { color: var(--text); }
.stepper input { flex: 1; min-width: 0; text-align: center; background: transparent; border: 0; outline: none; font-weight: 600; }

/* ---------- Queue ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 20px; }
.stat { padding: 16px 18px; border-radius: var(--r-lg); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.stat .k { font-size: 12px; color: var(--text-3); display: flex; align-items: center; gap: 7px; }
.stat .v { font-size: 26px; font-weight: 600; letter-spacing: -0.6px; margin-top: 4px; }
.queue-bar { display: flex; align-items: center; gap: 14px; padding: 12px 14px 12px 18px; border-radius: var(--r-lg); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); margin-bottom: 16px; flex-wrap: wrap; }
.queue-bar .state { display: flex; align-items: center; gap: 10px; font-weight: 500; }
.queue-bar .spacer { flex: 1; }
.par { display: flex; align-items: center; gap: 10px; font-size: 12.5px; color: var(--text-2); }
.par .seg button { width: 32px; flex: none; height: 28px; }
.jobs { display: flex; flex-direction: column; gap: 8px; }
.job { display: grid; grid-template-columns: 52px minmax(0, 1.4fr) minmax(0, 1fr) 150px auto; gap: 16px; align-items: center; padding: 12px 14px; border-radius: var(--r); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); transition: box-shadow 0.2s; }
.job:hover { box-shadow: inset 0 0 0 1px var(--line-2); }
.job .jthumb { position: relative; width: 52px; height: 70px; border-radius: 9px; overflow: hidden; background: var(--surface-3); }
.job .jthumb img { width: 100%; height: 100%; object-fit: cover; }
.job .jthumb .av { position: absolute; right: 3px; bottom: 3px; width: 22px; height: 22px; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 2px var(--surface); }
.job .jt { font-weight: 600; display: flex; align-items: center; gap: 8px; min-width: 0; }
.job .jt span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.job .js { font-size: 12px; color: var(--text-3); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.job .jtags { display: flex; gap: 5px; flex-wrap: wrap; }
.job .jerr { grid-column: 2 / -1; font-size: 12px; color: #fca5a5; background: rgba(248, 113, 113, 0.08); padding: 7px 10px; border-radius: 8px; word-break: break-word; }
.job .jwarn { grid-column: 2 / -1; font-size: 12px; color: #fcd34d; background: rgba(251, 191, 36, 0.08); padding: 7px 10px; border-radius: 8px; }
.job .jact { display: flex; gap: 4px; justify-content: flex-end; }
.status { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 500; }
.prog { height: 5px; border-radius: 5px; background: var(--surface-3); overflow: hidden; margin-top: 7px; }
.prog i { display: block; height: 100%; border-radius: 5px; background: var(--grad); transition: width 0.8s var(--ease); position: relative; overflow: hidden; }
.prog i::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.45), transparent); animation: sweep 1.6s infinite; }
@keyframes sweep { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
.prog.done i { background: var(--ok); }
.prog.done i::after, .prog.fail i::after { display: none; }
.prog.fail i { background: var(--err); }
.prog-meta { display: flex; justify-content: space-between; font-size: 11px; color: var(--text-3); margin-top: 4px; }
.st-pending { color: var(--text-2); }
.st-run { color: #d4c7ff; }
.st-ok { color: var(--ok); }
.st-err { color: var(--err); }
.st-cancel { color: var(--text-3); }

/* ---------- Gallery ---------- */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
.gcard { position: relative; border-radius: var(--r-lg); overflow: hidden; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); animation: fade 0.4s var(--ease); }
.gmedia { position: relative; aspect-ratio: 9/16; background: #000; cursor: pointer; }
.gmedia video { width: 100%; height: 100%; object-fit: cover; display: block; }
.gmedia .play { position: absolute; inset: 0; display: grid; place-items: center; opacity: 1; transition: opacity 0.25s; pointer-events: none; }
.gmedia .play div { width: 46px; height: 46px; border-radius: 50%; background: rgba(0, 0, 0, 0.45); backdrop-filter: blur(10px); display: grid; place-items: center; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.2); }
.gcard:hover .play { opacity: 0; }
.ginfo { padding: 12px 14px 14px; }
.ginfo .gt { font-weight: 600; display: flex; align-items: center; gap: 8px; }
.ginfo .gt img { width: 22px; height: 22px; border-radius: 50%; object-fit: cover; }
.ginfo .gs { font-size: 12px; color: var(--text-3); margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gact { display: flex; gap: 6px; margin-top: 10px; }
.gact .btn { flex: 1; }
.filters { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 18px; }

/* ---------- Models ---------- */
.models { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 18px; }
.mcard { position: relative; border-radius: var(--r-lg); overflow: hidden; cursor: pointer; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); transition: transform 0.3s var(--ease), box-shadow 0.3s; text-align: left; border: 0; padding: 0; }
.mcard:hover { transform: translateY(-3px); box-shadow: inset 0 0 0 1px var(--line-2), 0 24px 50px -24px rgba(0, 0, 0, 0.9); }
.mcard .mimg { aspect-ratio: 4/5; background: var(--surface-3) center/cover; position: relative; }
.mcard .mimg::after { content: ''; position: absolute; inset: 50% 0 0; background: linear-gradient(transparent, rgba(10, 10, 14, 0.95)); }
.mcard .minfo { position: absolute; left: 0; right: 0; bottom: 0; padding: 16px; z-index: 1; }
.mcard .mname { font-family: var(--font-display); font-weight: 600; font-size: 24px; line-height: 1; letter-spacing: -0.03em; }
.mcard .mmeta { font-size: 12px; color: var(--text-2); margin-top: 6px; display: flex; gap: 6px; align-items: center; }
.mcard.add { display: grid; place-items: center; aspect-ratio: 4/5; background: transparent; box-shadow: inset 0 0 0 1.5px var(--line-2); color: var(--text-2); }
.mcard.add:hover { color: var(--text); box-shadow: inset 0 0 0 1.5px var(--accent); }
.mcard.add div { text-align: center; }
.mcard.add .plus { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; margin: 0 auto 10px; background: var(--surface-2); }

/* Dressing */
.dressing { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.ocard { border-radius: var(--r); overflow: hidden; background: var(--bg-2); box-shadow: inset 0 0 0 1px var(--line); display: flex; flex-direction: column; }
.ocard .oimg { aspect-ratio: 1; background: var(--surface-2) center/cover; display: grid; place-items: center; color: var(--text-3); }
.ocard .oinfo { padding: 10px 11px 11px; flex: 1; display: flex; flex-direction: column; gap: 3px; }
.ocard .ot { font-weight: 600; font-size: 13px; }
.ocard .od { font-size: 11.5px; color: var(--text-3); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.ocard .oact { display: flex; gap: 2px; margin-top: auto; padding-top: 6px; }
.ocard.add { cursor: pointer; display: grid; place-items: center; min-height: 200px; box-shadow: inset 0 0 0 1.5px var(--line-2); background: transparent; color: var(--text-2); border: 0; }
.ocard.add:hover { box-shadow: inset 0 0 0 1.5px var(--accent); color: var(--text); }

/* Upload tile */
.upload-tile { position: relative; border-radius: var(--r); overflow: hidden; background: var(--bg-2) center/cover; box-shadow: inset 0 0 0 1.5px var(--line-2); display: grid; place-items: center; cursor: pointer; color: var(--text-3); text-align: center; font-size: 12.5px; transition: box-shadow 0.2s; }
.upload-tile:hover { box-shadow: inset 0 0 0 1.5px var(--accent); color: var(--text-2); }
.upload-tile.has { color: transparent; }
.upload-tile.has:hover::after { content: 'Changer'; position: absolute; inset: 0; display: grid; place-items: center; background: rgba(0, 0, 0, 0.5); color: #fff; font-weight: 500; }
.upload-tile input { display: none; }

/* ---------- Modal ---------- */
.modal-root { position: fixed; inset: 0; z-index: 50; pointer-events: none; }
.overlay { position: absolute; inset: 0; background: rgba(5, 5, 8, 0.6); backdrop-filter: blur(8px); pointer-events: auto; animation: fadeIn 0.25s var(--ease); display: grid; place-items: center; padding: 30px; }
@keyframes fadeIn { from { opacity: 0; } }
.modal { width: min(980px, 100%); max-height: calc(100vh - 60px); overflow: auto; background: var(--surface); border-radius: 24px; box-shadow: var(--shadow); animation: pop 0.35s var(--ease); }
.modal.sm { width: min(520px, 100%); }
@keyframes pop { from { opacity: 0; transform: translateY(14px) scale(0.98); } }
.modal-head { display: flex; align-items: center; gap: 12px; padding: 20px 22px 0; }
.modal-head h2 { margin: 0; font-family: var(--font-display); font-weight: 600; font-size: 22px; line-height: 1.2; letter-spacing: -0.02em; }
.modal-head .btn { margin-left: auto; }
.modal-body { padding: 20px 22px 22px; }
.modal-foot { display: flex; gap: 8px; justify-content: flex-end; padding: 0 22px 22px; }
.model-detail { display: grid; grid-template-columns: 260px 1fr; gap: 26px; }

/* Player */
.player { display: grid; grid-template-columns: minmax(0, 360px) 1fr; gap: 24px; }
.player video { width: 100%; border-radius: 16px; background: #000; max-height: 72vh; }
.kv { display: grid; grid-template-columns: 110px 1fr; gap: 8px 12px; font-size: 13px; }
.kv dt { color: var(--text-3); }
.kv dd { margin: 0; }
.prompt-box { font-size: 12.5px; color: var(--text-2); background: var(--bg-2); padding: 12px; border-radius: 12px; box-shadow: inset 0 0 0 1px var(--line); line-height: 1.6; }

/* ---------- Toasts ---------- */
.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 60; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
.toast { display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-radius: 12px; background: var(--surface-3); box-shadow: var(--shadow); font-size: 13px; max-width: 420px; animation: toastIn 0.35s var(--ease); }
.toast.out { animation: toastOut 0.25s var(--ease) forwards; }
.toast.ok svg { color: var(--ok); }
.toast.err svg { color: var(--err); }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px) scale(0.97); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(6px); } }

/* ---------- Settings ---------- */
.settings { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; max-width: 1100px; }
.settings .card h3 { margin: 0 0 4px; font-size: 15px; }
.settings .card > p { margin: 0 0 16px; color: var(--text-3); font-size: 12.5px; }
.input-row { display: flex; gap: 8px; }
.input-row .input { flex: 1; }
.acc { margin-top: 14px; font-size: 12.5px; }
.acc pre { white-space: pre-wrap; word-break: break-word; font-size: 11.5px; color: var(--text-3); background: var(--bg-2); padding: 10px; border-radius: 10px; max-height: 160px; overflow: auto; margin: 8px 0 0; }

@media (max-width: 1180px) {
  .studio { grid-template-columns: 1fr; }
  .panel { position: static; }
  .job { grid-template-columns: 52px minmax(0, 1fr) 140px auto; }
  .job .jcol-tags { display: none; }
}
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; flex-direction: row; padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); border-right: 0; border-top: 1px solid var(--line); background: rgba(14, 14, 19, 0.92); }
  .brand, .sidebar-foot { display: none; }
  .nav { flex-direction: row; width: 100%; justify-content: space-around; }
  .nav a { flex-direction: column; gap: 2px; padding: 6px 8px; font-size: 10.5px; position: relative; }
  .nav a .badge { position: absolute; top: 0; right: 2px; margin: 0; min-width: 16px; height: 16px; font-size: 9.5px; }
  .view { padding: 22px 16px 100px; }
  .page-head h1 { font-size: 32px; }
  .grid-2 { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .settings, .model-detail, .player { grid-template-columns: 1fr; }
  .job { grid-template-columns: 52px minmax(0, 1fr) auto; }
  .job .jcol-prog { grid-column: 2 / -1; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

.cost-est { display: flex; align-items: center; gap: 8px; margin-top: 12px; padding: 10px 12px; border-radius: 12px; background: var(--bg-2); box-shadow: inset 0 0 0 1px var(--line); font-size: 12.5px; color: var(--text-2); }
.cost-est svg { color: var(--accent); }
.cost-est b { color: var(--text); font-weight: 600; }
.price-grid { display: grid; grid-template-columns: 90px repeat(3, minmax(0, 1fr)); gap: 8px 10px; align-items: center; }
.price-grid .ph { font-size: 12px; color: var(--text-3); font-weight: 600; }
.price-grid .pl { font-size: 13px; font-weight: 500; }
.price-grid .pc small { display: block; font-size: 11px; color: var(--text-3); margin-top: 3px; }

.promos { display: flex; flex-direction: column; gap: 8px; margin-bottom: 18px; }
.promo { display: flex; align-items: center; gap: 10px; padding: 10px 12px 10px 14px; border-radius: 14px; font-size: 13px; color: var(--text-2);
  background: linear-gradient(90deg, rgba(167, 139, 250, 0.12), rgba(249, 168, 212, 0.06)); box-shadow: inset 0 0 0 1px rgba(167, 139, 250, 0.25); }
.promo svg { color: var(--accent); flex: none; }
.promo b { color: var(--text); font-weight: 600; }
.promo .btn { margin-left: auto; flex: none; }
.promo.bad { background: rgba(248, 113, 113, 0.10); box-shadow: inset 0 0 0 1px rgba(248, 113, 113, 0.35); }
.promo.bad svg { color: var(--err); }
.promo.good { background: rgba(74, 222, 128, 0.08); box-shadow: inset 0 0 0 1px rgba(74, 222, 128, 0.3); }
.promo.good svg { color: var(--ok); }
.ptable { width: 100%; border-collapse: collapse; font-size: 13px; }
.ptable th { text-align: left; font-size: 12px; color: var(--text-3); font-weight: 600; padding: 6px 8px; border-bottom: 1px solid var(--line); }
.ptable td { padding: 9px 8px; border-bottom: 1px solid var(--line); }
.ptable s { font-size: 11.5px; }

#login { position: fixed; inset: 0; display: none; place-items: center; padding: 20px; z-index: 40; }
.login-card { width: min(400px, 100%); padding: 28px; border-radius: 24px; background: var(--surface); box-shadow: var(--shadow); animation: pop 0.35s var(--ease); }
.login-card h1 { font-family: var(--font-display); font-weight: 600; font-size: 22px; margin: 0; letter-spacing: -0.02em; }
.login-err { color: var(--err); font-size: 13px; min-height: 18px; margin-top: 10px; }


/* ==========================================================================
   Ajustements « Remotly » des composants du Studio
   ========================================================================== */
.btn { border-radius: 999px; transition: transform .45s var(--ease), box-shadow .45s var(--ease), background-color .3s, border-color .3s, color .3s; }
.btn:not(.primary):not(.ghost) { background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); }
@media (hover: hover) and (pointer: fine) { .btn:not(.primary):not(.ghost):hover { background: rgba(139, 92, 246, 0.1); box-shadow: inset 0 0 0 1px rgba(167, 139, 250, 0.4); } }
.btn.lg { border-radius: 999px; }
.card, .vcard, .stat, .queue-bar, .job, .gcard, .mcard, .analysis, .auto-box, .prompt-preview, .cost-est, .promo { backdrop-filter: blur(20px) saturate(130%); -webkit-backdrop-filter: blur(20px) saturate(130%); }
.card, .vcard, .stat, .queue-bar, .job, .gcard, .mcard { background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.input, .select, .textarea, .stepper, .seg { background: var(--surface-2); }
.input:focus, .select:focus, .textarea:focus { box-shadow: inset 0 0 0 1px rgba(167, 139, 250, 0.55), 0 0 0 4px rgba(139, 92, 246, 0.15); }
.seg { border-radius: 999px; }
.seg button { border-radius: 999px; }
.seg button.on { background: rgba(139, 92, 246, 0.16); color: #fff; box-shadow: inset 0 0 0 1px rgba(167, 139, 250, 0.3); }
.chip.on { background: rgba(139, 92, 246, 0.16); color: #fff; box-shadow: inset 0 0 0 1px rgba(167, 139, 250, 0.4); }
.tag, .stat .k, .section-title, .label .hint, .prog-meta, .job .js, .launch-meta, .vcard-meta, .ptable th, .thumb .dur, .tokens code, .badge, .op .op-d { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.tag { letter-spacing: 0; }
.section-title { font-size: 10.5px; letter-spacing: 0.12em; }
.section-title .step { font-family: var(--font-mono); background: rgba(139, 92, 246, 0.16); color: #c4b5fd; }
.stat .v { font-family: var(--font-display); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.tag.accent { background: rgba(139, 92, 246, 0.16); color: #c4b5fd; }
.mp.on { box-shadow: 0 0 0 2px #8b5cf6, 0 10px 26px -8px rgba(139, 92, 246, 0.7); }
.mp.on::after { background-color: #8b5cf6; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round'%3E%3Cpath d='M5 12l5 5L19 7'/%3E%3C/svg%3E"); }
.op.on { box-shadow: inset 0 0 0 1px rgba(167, 139, 250, 0.55); background: rgba(139, 92, 246, 0.1); }
.switch input:checked + span { background: #8b5cf6; }
.drop:hover, .drop.over { border-color: #8b5cf6; background: linear-gradient(180deg, rgba(139, 92, 246, 0.1), rgba(139, 92, 246, 0.02)), var(--surface); }
.drop .drop-icon, .empty .empty-icon { color: #c4b5fd; background: rgba(139, 92, 246, 0.12); box-shadow: inset 0 0 0 1px rgba(167, 139, 250, 0.22); }
.auto-box { background: linear-gradient(180deg, rgba(139, 92, 246, 0.1), rgba(139, 92, 246, 0.02)); box-shadow: inset 0 0 0 1px rgba(167, 139, 250, 0.22); }
.auto-box li svg, .cost-est svg, .promo svg { color: #a78bfa; }
.prompt-preview mark { background: rgba(139, 92, 246, 0.2); color: #ddd6fe; }
.modal { background: rgba(12, 10, 18, 0.92); border-radius: 18px; backdrop-filter: blur(30px); -webkit-backdrop-filter: blur(30px); }
.overlay { background: rgba(0, 0, 0, 0.6); }
.toast { background: rgba(20, 17, 30, 0.95); font-family: var(--font); }

/* Connexion */
#login { background: radial-gradient(40rem 20rem at 50% -8%, rgba(139, 92, 246, 0.16), transparent 70%), #000; }
.login-card { background: rgba(12, 10, 18, 0.72); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); backdrop-filter: blur(30px); -webkit-backdrop-filter: blur(30px); }
.auth-logo { width: 44px; height: 44px; border-radius: 14px; margin-bottom: 14px; }
.auth-logo svg.i { width: 22px; height: 22px; stroke-width: 2.1; }
.auth-kicker { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-3); margin-bottom: 14px; }

@media (max-width: 860px) {
  .app-container { grid-template-columns: 1fr; padding: 0; gap: 0; }
  .main-wrapper { border-radius: 0; border: 0; }
  .sidebar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; flex-direction: row; padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: rgba(6, 5, 10, 0.94); backdrop-filter: blur(20px); }
  .brand, .engine, .credits, .user-card, .nav-ext { display: none; }
  .nav, .sidebar-bottom { flex-direction: row; margin: 0; padding: 0; }
  .nav { flex: 1; justify-content: space-around; }
  .nav-item { flex-direction: column; gap: 2px; padding: 6px 8px; font-size: 10.5px; min-height: 0; }
  .nav-item.active::before { display: none; }
  .nav-badge { position: absolute; top: 0; right: 4px; }
  .topbar-right { display: none; }
  .view { padding: 20px 16px 110px; }
}
