/* ═══════════════════════════════════════════════════════════════
   JOJO — design system « Aurora »
   Palette iris / aqua / rose sur fond profond, verre dépoli,
   profondeur subtile, mouvement fluide.
   ═══════════════════════════════════════════════════════════════ */

:root {
  --font: "Inter", "SF Pro Text", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: "SF Pro Display", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", "SF Mono", ui-monospace, Menlo, Consolas, monospace;

  --iris: #8b7bff;
  --sky: #5cc8ff;
  --aqua: #3de0d0;
  --rose: #ff7ac6;
  --grad: linear-gradient(135deg, var(--iris) 0%, var(--sky) 55%, var(--aqua) 100%);
  --grad-soft: linear-gradient(135deg, rgba(139,123,255,.18), rgba(61,224,208,.12));

  --r-xs: 8px; --r-sm: 12px; --r-md: 16px; --r-lg: 22px; --r-xl: 28px;
  --ease: cubic-bezier(.22, 1, .36, 1);
  --ease-spring: cubic-bezier(.34, 1.56, .64, 1);
  --sidebar-w: 280px;
  --topbar-h: 60px;

  /* Thème sombre (par défaut) */
  --bg: #06070b;
  --bg-2: #0b0d13;
  --surface: rgba(255,255,255,.035);
  --surface-2: rgba(255,255,255,.06);
  --surface-3: rgba(255,255,255,.09);
  --glass: rgba(16,18,26,.62);
  --glass-strong: rgba(18,20,30,.86);
  --border: rgba(255,255,255,.075);
  --border-strong: rgba(255,255,255,.14);
  --text: #eef0f7;
  --text-2: #a7acbd;
  --text-3: #6c7184;
  --accent: var(--iris);
  --accent-text: #b7adff;
  --on-accent: #fff;
  --danger: #ff5d73;
  --success: #3ddc97;
  --warn: #ffc857;
  --shadow: 0 10px 40px -10px rgba(0,0,0,.6), 0 2px 8px -2px rgba(0,0,0,.4);
  --shadow-lg: 0 30px 80px -20px rgba(0,0,0,.75), 0 8px 24px -8px rgba(0,0,0,.5);
  --code-bg: #0d0f16;
  --aurora-1: rgba(139,123,255,.20);
  --aurora-2: rgba(61,224,208,.12);
  --aurora-3: rgba(255,122,198,.08);
  --noise-opacity: .035;
  color-scheme: dark;
}

[data-theme="light"] {
  --bg: #f4f5fa;
  --bg-2: #eceef6;
  --surface: rgba(255,255,255,.55);
  --surface-2: rgba(255,255,255,.8);
  --surface-3: rgba(20,22,40,.06);
  --glass: rgba(255,255,255,.66);
  --glass-strong: rgba(255,255,255,.92);
  --border: rgba(20,24,50,.08);
  --border-strong: rgba(20,24,50,.16);
  --text: #11131c;
  --text-2: #4f5568;
  --text-3: #8a8fa3;
  --accent: #6a5af9;
  --accent-text: #5847e8;
  --iris: #6a5af9;
  --aqua: #0fb5a6;
  --sky: #2f9be8;
  --shadow: 0 10px 30px -12px rgba(30,30,80,.18), 0 2px 6px -2px rgba(30,30,80,.08);
  --shadow-lg: 0 30px 70px -24px rgba(30,30,80,.28), 0 8px 20px -10px rgba(30,30,80,.12);
  --code-bg: #10121a;
  --aurora-1: rgba(106,90,249,.16);
  --aurora-2: rgba(15,181,166,.12);
  --aurora-3: rgba(255,122,198,.10);
  --noise-opacity: .025;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; height: 100%; }
body {
  margin: 0; min-height: 100%; background: var(--bg); color: var(--text);
  font-family: var(--font); font-size: 15px; line-height: 1.55;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  transition: background-color .5s var(--ease), color .3s var(--ease);
}
/* Aurore + grain en arrière-plan */
body::before {
  content: ""; position: fixed; inset: -20%; z-index: -2; pointer-events: none;
  background:
    radial-gradient(40% 35% at 15% 10%, var(--aurora-1), transparent 70%),
    radial-gradient(35% 30% at 85% 20%, var(--aurora-2), transparent 70%),
    radial-gradient(45% 40% at 60% 95%, var(--aurora-3), transparent 70%);
  animation: aurora 28s ease-in-out infinite alternate;
}
body::after {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: var(--noise-opacity);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
@keyframes aurora {
  0% { transform: translate3d(0,0,0) rotate(0deg) scale(1); }
  50% { transform: translate3d(3%, -2%, 0) rotate(6deg) scale(1.05); }
  100% { transform: translate3d(-3%, 2%, 0) rotate(-4deg) scale(1.02); }
}

::selection { background: color-mix(in srgb, var(--accent) 35%, transparent); }
a { color: var(--accent-text); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
img { max-width: 100%; display: block; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 10px; border: 3px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: var(--border-strong); background-clip: content-box; border: 3px solid transparent; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.hidden { display: none !important; }
.muted { color: var(--text-2); }
.faint { color: var(--text-3); }
.grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.spacer { flex: 1; }
.stack { display: flex; flex-direction: column; gap: 12px; }

/* ─── Icônes ─── */
.icon { display: inline-flex; width: 18px; height: 18px; flex: none; }
.icon svg { width: 100%; height: 100%; }

/* ─── Logo JOJO ─── */
.logo { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none !important; }
.logo-mark { width: 30px; height: 30px; flex: none; filter: drop-shadow(0 4px 14px rgba(139,123,255,.45)); }
.logo-word { font-family: var(--font-display); font-weight: 800; letter-spacing: .16em; font-size: 17px; }
.logo:hover .logo-mark .orbit { animation-duration: 1.2s; }
.logo-mark .orbit { transform-origin: 32px 32px; animation: spin 9s linear infinite; }

/* ─── Boutons ─── */
.btn {
  --b-bg: var(--surface-2); --b-fg: var(--text); --b-border: var(--border);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 16px; border-radius: 12px; border: 1px solid var(--b-border);
  background: var(--b-bg); color: var(--b-fg); font-weight: 560; font-size: 14px; white-space: nowrap;
  transition: transform .25s var(--ease-spring), background .2s, border-color .2s, box-shadow .3s, opacity .2s;
  position: relative; user-select: none; -webkit-tap-highlight-color: transparent;
}
.btn:hover { background: var(--surface-3); border-color: var(--border-strong); }
.btn:active { transform: scale(.96); }
.btn:disabled { opacity: .45; pointer-events: none; }
.btn.primary {
  --b-bg: var(--grad); --b-fg: #fff; border: 0;
  background: var(--grad); background-size: 160% 160%; background-position: 0% 50%;
  box-shadow: 0 8px 26px -8px rgba(139,123,255,.65), inset 0 1px 0 rgba(255,255,255,.25);
  transition: transform .25s var(--ease-spring), background-position .6s var(--ease), box-shadow .3s;
}
.btn.primary:hover { background-position: 100% 50%; box-shadow: 0 12px 34px -8px rgba(92,200,255,.6), inset 0 1px 0 rgba(255,255,255,.3); }
.btn.ghost { --b-bg: transparent; --b-border: transparent; }
.btn.ghost:hover { --b-bg: var(--surface-2); background: var(--surface-2); }
.btn.danger { --b-fg: var(--danger); }
.btn.danger.solid { background: var(--danger); color: #fff; border: 0; }
.btn.sm { height: 32px; padding: 0 11px; font-size: 13px; border-radius: 10px; }
.btn.lg { height: 52px; padding: 0 26px; font-size: 16px; border-radius: 16px; }
.btn.block { width: 100%; }
.icon-btn {
  width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center; border-radius: 11px;
  border: 1px solid transparent; background: transparent; color: var(--text-2); flex: none; position: relative;
  transition: background .2s, color .2s, transform .25s var(--ease-spring);
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn:active { transform: scale(.9); }
.icon-btn.active { color: var(--accent-text); background: color-mix(in srgb, var(--accent) 14%, transparent); }
.icon-btn.sm { width: 30px; height: 30px; border-radius: 9px; }
.icon-btn.sm .icon { width: 16px; height: 16px; }
.icon-btn:disabled { opacity: .4; pointer-events: none; }
.btn .spinner, .icon-btn .spinner { width: 16px; height: 16px; }

/* ─── Formulaires ─── */
.field { display: flex; flex-direction: column; gap: 7px; }
.field > label, .label { font-size: 13px; font-weight: 560; color: var(--text-2); }
.input, .select, .textarea {
  width: 100%; height: 44px; padding: 0 14px; border-radius: 12px;
  background: var(--surface); border: 1px solid var(--border); color: var(--text); outline: none;
  transition: border-color .2s, box-shadow .25s, background .2s;
}
.textarea { height: auto; min-height: 90px; padding: 12px 14px; resize: vertical; line-height: 1.5; }
.input::placeholder, .textarea::placeholder { color: var(--text-3); }
.input:focus, .select:focus, .textarea:focus { border-color: color-mix(in srgb, var(--accent) 60%, transparent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 16%, transparent); background: var(--surface-2); }
.select { appearance: none; padding-right: 36px; 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='%238a8fa3' stroke-width='2.5'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; }
.select option { background: var(--bg-2); color: var(--text); }
.input-wrap { position: relative; }
.input-wrap .input { padding-right: 44px; }
.input-wrap .icon-btn { position: absolute; right: 4px; top: 4px; }
.form-error { color: var(--danger); font-size: 13px; min-height: 18px; }
.hint { font-size: 12.5px; color: var(--text-3); }

/* Interrupteur */
.switch { position: relative; width: 46px; height: 27px; flex: none; display: inline-block; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch span { position: absolute; inset: 0; border-radius: 99px; background: var(--surface-3); border: 1px solid var(--border-strong); transition: background .3s; cursor: pointer; }
.switch span::after { content: ""; position: absolute; width: 21px; height: 21px; left: 2px; top: 2px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.3); transition: transform .35s var(--ease-spring); }
.switch input:checked + span { background: var(--grad); border-color: transparent; }
.switch input:checked + span::after { transform: translateX(19px); }
.switch input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.switch input:disabled + span { opacity: .45; cursor: not-allowed; }

/* Contrôle segmenté */
.segmented { display: inline-flex; padding: 4px; gap: 4px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); }
.segmented button { border: 0; background: transparent; color: var(--text-2); height: 34px; padding: 0 14px; border-radius: 10px; font-weight: 560; font-size: 13.5px; display: inline-flex; align-items: center; gap: 8px; transition: background .25s, color .2s; }
.segmented button:hover { color: var(--text); }
.segmented button.on { background: var(--surface-3); color: var(--text); box-shadow: 0 2px 10px -4px rgba(0,0,0,.4); }

/* Puces */
.chip { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 11px; border-radius: 99px; font-size: 12.5px; font-weight: 560; background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2); white-space: nowrap; }
button.chip { cursor: pointer; transition: all .2s; }
button.chip:hover { color: var(--text); border-color: var(--border-strong); }
button.chip.on { background: color-mix(in srgb, var(--accent) 18%, transparent); border-color: color-mix(in srgb, var(--accent) 45%, transparent); color: var(--accent-text); }
.badge { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 7px; font-size: 11.5px; font-weight: 650; letter-spacing: .02em; background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border); white-space: nowrap; }
.badge.accent { background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent-text); border-color: transparent; }
.badge.warn { background: color-mix(in srgb, var(--warn) 16%, transparent); color: var(--warn); border-color: transparent; }
[data-theme="light"] .badge.warn { color: #9a6a00; }
.badge.danger { background: color-mix(in srgb, var(--danger) 14%, transparent); color: var(--danger); border-color: transparent; }
.badge.success { background: color-mix(in srgb, var(--success) 14%, transparent); color: var(--success); border-color: transparent; }
[data-theme="light"] .badge.success { color: #138a59; }

/* ─── Verre ─── */
.glass { background: var(--glass); backdrop-filter: blur(22px) saturate(160%); -webkit-backdrop-filter: blur(22px) saturate(160%); border: 1px solid var(--border); }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 20px; transition: border-color .25s, background .25s, transform .4s var(--ease), box-shadow .4s var(--ease); }
.card.hover:hover { border-color: var(--border-strong); background: var(--surface-2); transform: translateY(-2px); box-shadow: var(--shadow); }
.card h3 { margin: 0 0 6px; font-size: 16px; }

/* ─── Spinner / chargement ─── */
.spinner { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--surface-3); border-top-color: var(--accent); animation: spin .8s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
.skeleton { border-radius: 10px; background: linear-gradient(90deg, var(--surface) 25%, var(--surface-3) 50%, var(--surface) 75%); background-size: 200% 100%; animation: shimmer 1.4s infinite; }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.boot { position: fixed; inset: 0; display: grid; place-items: center; }

/* ─── Toasts ─── */
.toasts { position: fixed; z-index: 1000; bottom: 24px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 10px; pointer-events: none; width: min(92vw, 440px); }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: 14px; background: var(--glass-strong); backdrop-filter: blur(20px); border: 1px solid var(--border-strong); box-shadow: var(--shadow-lg); font-size: 14px; animation: toastIn .45s var(--ease-spring); max-width: 100%; }
.toast.out { animation: toastOut .3s var(--ease) forwards; }
.toast.error .icon { color: var(--danger); }
.toast.success .icon { color: var(--success); }
@keyframes toastIn { from { opacity: 0; transform: translateY(16px) scale(.95); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(8px) scale(.97); } }

/* ─── Modales ─── */
.modal-backdrop { position: fixed; inset: 0; z-index: 500; background: rgba(4,5,10,.55); backdrop-filter: blur(6px); display: grid; place-items: center; padding: 16px; animation: fadeIn .25s var(--ease); }
.modal-backdrop.out { animation: fadeOut .2s var(--ease) forwards; }
.modal { width: min(520px, 100%); max-height: calc(100vh - 32px); overflow: auto; background: var(--glass-strong); backdrop-filter: blur(30px) saturate(160%); border: 1px solid var(--border-strong); border-radius: var(--r-xl); box-shadow: var(--shadow-lg); padding: 24px; animation: modalIn .45s var(--ease-spring); }
.modal.wide { width: min(760px, 100%); }
.modal-backdrop.out .modal { animation: modalOut .2s var(--ease) forwards; }
.modal-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.modal-head h2 { margin: 0; font-size: 18px; font-weight: 680; flex: 1; letter-spacing: -.01em; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; flex-wrap: wrap; }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes fadeOut { to { opacity: 0; } }
@keyframes modalIn { from { opacity: 0; transform: translateY(18px) scale(.96) rotateX(6deg); } }
@keyframes modalOut { to { opacity: 0; transform: translateY(8px) scale(.98); } }

/* ─── Menus déroulants ─── */
.menu { position: fixed; z-index: 600; min-width: 210px; padding: 6px; border-radius: 16px; background: var(--glass-strong); backdrop-filter: blur(24px) saturate(160%); border: 1px solid var(--border-strong); box-shadow: var(--shadow-lg); animation: menuIn .25s var(--ease-spring); transform-origin: top left; }
.menu.up { transform-origin: bottom left; }
.menu button { display: flex; width: 100%; align-items: center; gap: 10px; padding: 9px 11px; border: 0; background: transparent; border-radius: 10px; text-align: left; font-size: 14px; color: var(--text); transition: background .15s; }
.menu button:hover, .menu button:focus-visible { background: var(--surface-3); outline: none; }
.menu button .icon { color: var(--text-2); width: 17px; height: 17px; }
.menu button.danger, .menu button.danger .icon { color: var(--danger); }
.menu button:disabled { opacity: .45; pointer-events: none; }
.menu hr { border: 0; height: 1px; background: var(--border); margin: 5px 4px; }
.menu .menu-label { padding: 6px 11px 4px; font-size: 11.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--text-3); font-weight: 650; }
@keyframes menuIn { from { opacity: 0; transform: scale(.94) translateY(-4px); } }

/* ─── Tooltip ─── */
[data-tip] { position: relative; }
@media (hover: hover) {
  [data-tip]:hover::after { content: attr(data-tip); position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%); padding: 5px 9px; border-radius: 8px; background: var(--glass-strong); border: 1px solid var(--border-strong); color: var(--text); font-size: 12px; font-weight: 520; white-space: nowrap; pointer-events: none; z-index: 50; box-shadow: var(--shadow); animation: tipIn .2s var(--ease) .35s both; }
  [data-tip-pos="bottom"]:hover::after { bottom: auto; top: calc(100% + 8px); }
  [data-tip-pos="right"]:hover::after { bottom: auto; top: 50%; left: calc(100% + 8px); transform: translateY(-50%); }
}
@keyframes tipIn { from { opacity: 0; } }

/* ═════════════ Transitions de page ═════════════ */
.page { animation: pageIn .55s var(--ease) both; }
@keyframes pageIn { from { opacity: 0; transform: translateY(14px) scale(.995); filter: blur(6px); } }
::view-transition-old(root) { animation: vtOut .25s var(--ease) both; }
::view-transition-new(root) { animation: vtIn .45s var(--ease) both; }
@keyframes vtOut { to { opacity: 0; transform: scale(.99); } }
@keyframes vtIn { from { opacity: 0; transform: translateY(10px); } }
.reveal { opacity: 0; transform: translateY(26px); transition: opacity .9s var(--ease), transform .9s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

/* ═════════════ Orbe JOJO (3D) ═════════════ */
.orb { --s: 120px; width: var(--s); height: var(--s); position: relative; perspective: 600px; transform-style: preserve-3d; flex: none; }
.orb-core { position: absolute; inset: 18%; border-radius: 50%;
  background: radial-gradient(circle at 32% 28%, rgba(255,255,255,.95), rgba(255,255,255,0) 22%), conic-gradient(from 0deg, var(--iris), var(--sky), var(--aqua), var(--rose), var(--iris));
  box-shadow: 0 0 calc(var(--s) * .35) rgba(139,123,255,.55), inset 0 0 calc(var(--s) * .12) rgba(255,255,255,.35);
  animation: orbSpin 8s linear infinite; }
.orb-core::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: radial-gradient(circle at 65% 75%, rgba(6,7,11,.55), transparent 55%); }
.orb-halo { position: absolute; inset: -12%; border-radius: 50%; background: radial-gradient(circle, rgba(139,123,255,.35), transparent 62%); filter: blur(10px); animation: pulse 4s ease-in-out infinite; }
.orb-ring { position: absolute; inset: 0; border-radius: 50%; border: 1.5px solid rgba(183,173,255,.55); transform: rotateX(72deg) rotateZ(0deg); animation: ring 6s linear infinite; }
.orb-ring.r2 { inset: 8%; border-color: rgba(61,224,208,.5); transform: rotateY(68deg) rotateX(20deg); animation: ring2 7.5s linear infinite; }
.orb-ring::before { content: ""; position: absolute; width: 8%; height: 8%; top: -4%; left: 46%; border-radius: 50%; background: #fff; box-shadow: 0 0 12px 3px rgba(183,173,255,.9); }
.orb-ring.r2::before { background: var(--aqua); box-shadow: 0 0 12px 3px rgba(61,224,208,.8); }
@keyframes orbSpin { to { transform: rotate(360deg); } }
@keyframes ring { to { transform: rotateX(72deg) rotateZ(360deg); } }
@keyframes ring2 { to { transform: rotateY(68deg) rotateX(20deg) rotateZ(-360deg); } }
@keyframes pulse { 0%,100% { opacity: .7; transform: scale(1); } 50% { opacity: 1; transform: scale(1.08); } }
.orb.small { --s: 34px; }
.orb.small .orb-ring::before { display: none; }
.orb.small .orb-halo { filter: blur(4px); }

/* « JOJO réfléchit… » */
.thinking { display: inline-flex; align-items: center; gap: 14px; padding: 6px 0; }
.thinking .orb { --s: 34px; }
.thinking .orb-core { animation-duration: 1.6s; }
.thinking .orb-ring { animation-duration: 1.4s; }
.thinking .orb-ring.r2 { animation-duration: 1.9s; }
.thinking-text { font-weight: 600; font-size: 14.5px; background: linear-gradient(90deg, var(--text-3) 0%, var(--text) 40%, var(--accent-text) 50%, var(--text-3) 70%); background-size: 250% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: textShine 2.2s linear infinite; }
@keyframes textShine { from { background-position: 125% 0; } to { background-position: -125% 0; } }
.dots span { display: inline-block; animation: dot 1.3s infinite; }
.dots span:nth-child(2) { animation-delay: .15s; } .dots span:nth-child(3) { animation-delay: .3s; }
@keyframes dot { 0%, 60%, 100% { opacity: .2; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-2px); } }

/* ═════════════ Landing ═════════════ */
.landing { min-height: 100vh; }
.landing-nav { position: fixed; top: 0; left: 0; right: 0; z-index: 40; display: flex; align-items: center; padding: 16px clamp(16px, 4vw, 40px); transition: background .4s, backdrop-filter .4s, border-color .4s; border-bottom: 1px solid transparent; }
.landing-nav.scrolled { background: var(--glass); backdrop-filter: blur(18px); border-color: var(--border); }
.hero { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 110px 16px 60px; position: relative; perspective: 1200px; }
.hero .orb { --s: clamp(150px, 22vw, 220px); margin-bottom: 26px; animation: float 7s ease-in-out infinite; }
@keyframes float { 0%,100% { transform: translateY(0) rotateX(0); } 50% { transform: translateY(-14px) rotateX(6deg); } }
.hero-title { font-family: var(--font-display); font-weight: 850; font-size: clamp(72px, 15vw, 168px); line-height: .9; letter-spacing: .14em; margin: 0 0 0 .14em; background: linear-gradient(180deg, var(--text) 30%, color-mix(in srgb, var(--text) 45%, transparent)); -webkit-background-clip: text; background-clip: text; color: transparent; animation: titleIn 1.2s var(--ease) both .1s; }
@keyframes titleIn { from { opacity: 0; letter-spacing: .5em; filter: blur(12px); } }
.hero-sub { font-size: clamp(17px, 2.4vw, 22px); color: var(--text-2); margin: 22px 0 38px; font-weight: 450; animation: fadeUp 1s var(--ease) both .45s; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(16px); } }
.hero-cta { animation: fadeUp 1s var(--ease) both .65s; display: flex; flex-direction: column; align-items: center; gap: 18px; }
.hero-cta .btn.lg { min-width: 220px; }
.cta-glow { position: relative; }
.cta-glow::before { content: ""; position: absolute; inset: -3px; border-radius: 19px; background: var(--grad); filter: blur(16px); opacity: .55; z-index: -1; animation: pulse 3s ease-in-out infinite; }
.auth-choice { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; animation: choiceIn .6s var(--ease-spring) both; }
@keyframes choiceIn { from { opacity: 0; transform: translateY(-10px) scale(.96); } }
.scroll-hint { position: absolute; bottom: 26px; left: 50%; transform: translateX(-50%); color: var(--text-3); font-size: 12px; letter-spacing: .14em; text-transform: uppercase; display: flex; flex-direction: column; align-items: center; gap: 8px; animation: fadeUp 1s var(--ease) both 1.2s; }
.scroll-hint i { width: 1px; height: 34px; background: linear-gradient(var(--text-3), transparent); animation: scrollLine 2s ease-in-out infinite; }
@keyframes scrollLine { 0% { transform: scaleY(0); transform-origin: top; } 50% { transform: scaleY(1); transform-origin: top; } 51% { transform-origin: bottom; } 100% { transform: scaleY(0); transform-origin: bottom; } }
.section { max-width: 1140px; margin: 0 auto; padding: 90px clamp(16px, 4vw, 40px); }
.section-head { text-align: center; max-width: 640px; margin: 0 auto 48px; }
.section-head h2 { font-family: var(--font-display); font-size: clamp(30px, 4.5vw, 46px); letter-spacing: -.025em; line-height: 1.08; margin: 12px 0; font-weight: 760; }
.eyebrow { font-size: 12.5px; letter-spacing: .18em; text-transform: uppercase; font-weight: 700; color: var(--accent-text); }
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 18px; perspective: 1400px; }
.feature { padding: 26px; border-radius: var(--r-xl); background: var(--surface); border: 1px solid var(--border); position: relative; overflow: hidden; transform-style: preserve-3d; transition: transform .5s var(--ease), border-color .3s, background .3s; will-change: transform; }
.feature::before { content: ""; position: absolute; inset: 0; background: radial-gradient(400px circle at var(--mx, 50%) var(--my, 0%), color-mix(in srgb, var(--accent) 16%, transparent), transparent 45%); opacity: 0; transition: opacity .4s; }
.feature:hover::before { opacity: 1; }
.feature:hover { border-color: var(--border-strong); }
.feature-icon { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; background: var(--grad-soft); border: 1px solid var(--border); margin-bottom: 18px; color: var(--accent-text); transform: translateZ(30px); }
.feature-icon .icon { width: 22px; height: 22px; }
.feature h3 { margin: 0 0 8px; font-size: 17.5px; letter-spacing: -.01em; transform: translateZ(20px); }
.feature p { margin: 0; color: var(--text-2); font-size: 14.5px; transform: translateZ(10px); }
.showcase { display: grid; grid-template-columns: 1.1fr 1fr; gap: 40px; align-items: center; }
.mock { border-radius: var(--r-xl); padding: 18px; box-shadow: var(--shadow-lg); transform: perspective(1400px) rotateY(-8deg) rotateX(4deg); transition: transform .8s var(--ease); }
.mock:hover { transform: perspective(1400px) rotateY(-2deg) rotateX(1deg); }
.mock-bar { display: flex; gap: 6px; margin-bottom: 14px; }
.mock-bar i { width: 10px; height: 10px; border-radius: 50%; background: var(--surface-3); }
.mock-msg { padding: 11px 14px; border-radius: 16px; font-size: 14px; margin-bottom: 10px; max-width: 88%; }
.mock-msg.u { margin-left: auto; background: var(--grad-soft); border: 1px solid var(--border); }
.mock-msg.a { background: var(--surface); border: 1px solid var(--border); min-height: 44px; }
.mock-caption { font-size: 11.5px; color: var(--text-3); text-align: center; margin-top: 10px; }
.footer { text-align: center; padding: 40px 16px 60px; color: var(--text-3); font-size: 13px; border-top: 1px solid var(--border); }

/* ═════════════ Pages d'authentification ═════════════ */
.auth-page { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.auth-card { width: min(420px, 100%); padding: 34px 30px; border-radius: var(--r-xl); box-shadow: var(--shadow-lg); }
.auth-card .orb { --s: 64px; margin: 0 auto 18px; }
.auth-card h1 { text-align: center; font-size: 24px; margin: 0 0 6px; letter-spacing: -.02em; }
.auth-card .sub { text-align: center; color: var(--text-2); margin: 0 0 26px; font-size: 14.5px; }
.auth-card form { display: flex; flex-direction: column; gap: 16px; }
.auth-alt { text-align: center; font-size: 14px; color: var(--text-2); margin-top: 20px; }
.divider { display: flex; align-items: center; gap: 12px; color: var(--text-3); font-size: 12px; margin: 4px 0; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.notice { padding: 12px 14px; border-radius: 14px; background: var(--grad-soft); border: 1px solid var(--border); font-size: 13.5px; color: var(--text-2); display: flex; gap: 10px; align-items: flex-start; }
.notice .icon { color: var(--accent-text); margin-top: 2px; }
.notice.warn { background: color-mix(in srgb, var(--warn) 10%, transparent); }
.notice.warn .icon { color: var(--warn); }
.back-link { position: fixed; top: 18px; left: 18px; }

/* ═════════════ Shell de l'application ═════════════ */
.app { display: flex; height: 100vh; height: 100dvh; overflow: hidden; }
.sidebar { width: var(--sidebar-w); flex: none; display: flex; flex-direction: column; height: 100%; padding: 14px 12px; gap: 6px; border-right: 1px solid var(--border); background: var(--glass); backdrop-filter: blur(24px) saturate(150%); -webkit-backdrop-filter: blur(24px) saturate(150%); z-index: 60; transition: transform .45s var(--ease), width .4s var(--ease), padding .4s var(--ease); }
.sidebar-head { display: flex; align-items: center; justify-content: space-between; padding: 4px 4px 10px; }
.sidebar .new-chat { margin: 2px 0 8px; justify-content: flex-start; height: 44px; border-radius: 14px; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a, .nav button { display: flex; align-items: center; gap: 12px; height: 40px; padding: 0 12px; border-radius: 12px; color: var(--text-2); font-weight: 530; font-size: 14.5px; text-decoration: none; border: 0; background: transparent; width: 100%; text-align: left; position: relative; transition: background .2s, color .2s; }
.nav a:hover, .nav button:hover { background: var(--surface-2); color: var(--text); }
.nav a.active { color: var(--text); background: var(--surface-3); }
.nav a.active::before { content: ""; position: absolute; left: -12px; top: 10px; bottom: 10px; width: 3px; border-radius: 0 3px 3px 0; background: var(--grad); }
.nav .kbd { margin-left: auto; font-size: 11px; color: var(--text-3); border: 1px solid var(--border); border-radius: 6px; padding: 1px 6px; font-family: var(--mono); }
.nav .icon { transition: transform .3s var(--ease-spring); }
.nav a:hover .icon, .nav button:hover .icon { transform: scale(1.12); }
.side-section { margin-top: 14px; font-size: 11.5px; text-transform: uppercase; letter-spacing: .1em; color: var(--text-3); font-weight: 650; padding: 0 12px 6px; display: flex; align-items: center; }
.conv-list { flex: 1; overflow-y: auto; overflow-x: hidden; margin: 0 -6px; padding: 0 6px; display: flex; flex-direction: column; gap: 1px; mask-image: linear-gradient(to bottom, transparent, #000 10px, #000 calc(100% - 20px), transparent); }
.conv-item { display: flex; align-items: center; gap: 6px; height: 38px; padding: 0 4px 0 12px; border-radius: 11px; color: var(--text-2); font-size: 14px; text-decoration: none !important; position: relative; transition: background .2s, color .2s; animation: itemIn .4s var(--ease) both; }
@keyframes itemIn { from { opacity: 0; transform: translateX(-8px); } }
.conv-item span.t { flex: 1; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.conv-item:hover { background: var(--surface-2); color: var(--text); }
.conv-item.active { background: var(--surface-3); color: var(--text); }
.conv-item .icon-btn { opacity: 0; transition: opacity .2s; }
.conv-item:hover .icon-btn, .conv-item.active .icon-btn, .conv-item .icon-btn.open { opacity: 1; }
.conv-item .star { color: var(--warn); width: 13px; height: 13px; }
.sidebar-foot { border-top: 1px solid var(--border); padding-top: 10px; margin-top: 4px; }
.user-card { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 14px; border: 0; background: transparent; width: 100%; text-align: left; transition: background .2s; }
.user-card:hover { background: var(--surface-2); }
.user-card .meta { flex: 1; min-width: 0; }
.user-card .name { font-weight: 620; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-card .sub { font-size: 12px; color: var(--text-3); }
.avatar { width: 34px; height: 34px; border-radius: 50%; flex: none; display: grid; place-items: center; font-weight: 700; font-size: 13.5px; color: #fff; background: var(--grad); overflow: hidden; box-shadow: 0 0 0 2px var(--bg), 0 0 0 3px var(--border-strong); }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.lg { width: 84px; height: 84px; font-size: 30px; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; height: 100%; position: relative; }
.topbar { height: var(--topbar-h); flex: none; display: flex; align-items: center; gap: 10px; padding: 0 16px; border-bottom: 1px solid transparent; transition: border-color .3s, background .3s; z-index: 30; }
.topbar.scrolled { border-color: var(--border); background: var(--glass); backdrop-filter: blur(18px); }
.topbar-title { font-weight: 640; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.topbar .menu-toggle { display: none; }
.content { flex: 1; overflow-y: auto; overflow-x: hidden; position: relative; scroll-behavior: smooth; }
.page-wrap { max-width: 1100px; margin: 0 auto; padding: 16px clamp(16px, 3vw, 36px) 80px; }
.page-header { display: flex; align-items: flex-end; gap: 16px; margin: 6px 0 26px; flex-wrap: wrap; }
.page-header h1 { font-family: var(--font-display); font-size: clamp(26px, 3.4vw, 34px); letter-spacing: -.025em; margin: 0; font-weight: 760; }
.page-header p { margin: 4px 0 0; color: var(--text-2); }
.empty { text-align: center; padding: 60px 20px; color: var(--text-2); display: flex; flex-direction: column; align-items: center; gap: 12px; }
.empty .empty-icon { width: 64px; height: 64px; border-radius: 20px; display: grid; place-items: center; background: var(--grad-soft); border: 1px solid var(--border); color: var(--accent-text); margin-bottom: 4px; animation: float 6s ease-in-out infinite; }
.empty .empty-icon .icon { width: 28px; height: 28px; }
.empty h3 { margin: 0; color: var(--text); font-size: 17px; }
.empty p { margin: 0; max-width: 380px; font-size: 14px; }
.sidebar-overlay { display: none; }
.demo-pill { cursor: help; }

/* Repli de la sidebar (bureau) */
.app.collapsed .sidebar { width: 76px; padding: 14px 10px; }
.app.collapsed .sidebar .hide-collapsed { display: none !important; }
.app.collapsed .sidebar .nav a, .app.collapsed .sidebar .nav button { justify-content: center; padding: 0; }
.app.collapsed .sidebar .new-chat { justify-content: center; padding: 0; }
.app.collapsed .sidebar-head { flex-direction: column; gap: 10px; }
.app.collapsed .conv-list { visibility: hidden; }
.app.collapsed .user-card { justify-content: center; }

/* Notifications */
.notif-dot { position: absolute; top: 6px; right: 6px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 99px; background: var(--rose); color: #fff; font-size: 10px; font-weight: 750; display: grid; place-items: center; box-shadow: 0 0 0 2px var(--bg); animation: pop .4s var(--ease-spring); }
@keyframes pop { from { transform: scale(0); } }
.notif-panel { width: min(360px, calc(100vw - 24px)); max-height: 460px; overflow: auto; padding: 8px; }
.notif-item { display: flex; gap: 10px; padding: 10px; border-radius: 12px; cursor: pointer; transition: background .2s; }
.notif-item:hover { background: var(--surface-3); }
.notif-item.unread .nt { font-weight: 650; }
.notif-item.unread::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); margin-top: 7px; flex: none; }
.notif-item .nt { font-size: 14px; }
.notif-item .nd { font-size: 12px; color: var(--text-3); }

/* ═════════════ Chat ═════════════ */
.chat { display: flex; flex-direction: column; height: 100%; }
.chat-scroll { flex: 1; overflow-y: auto; overflow-x: hidden; }
.chat-inner { max-width: 800px; margin: 0 auto; padding: 18px clamp(14px, 3vw, 28px) 30px; }
.welcome { min-height: calc(100vh - 300px); display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 20px 0; }
.welcome .orb { --s: 96px; margin-bottom: 22px; }
.welcome h1 { font-family: var(--font-display); font-size: clamp(26px, 4vw, 38px); letter-spacing: -.03em; margin: 0 0 8px; font-weight: 760; }
.welcome p { color: var(--text-2); margin: 0 0 30px; font-size: 16px; }
.suggestions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; width: 100%; max-width: 640px; perspective: 1000px; }
.suggestion { text-align: left; padding: 15px 16px; border-radius: 18px; background: var(--surface); border: 1px solid var(--border); color: var(--text); display: flex; gap: 12px; align-items: flex-start; transition: transform .45s var(--ease), border-color .25s, background .25s, box-shadow .4s; animation: fadeUp .7s var(--ease) both; }
.suggestion:nth-child(2) { animation-delay: .07s; } .suggestion:nth-child(3) { animation-delay: .14s; } .suggestion:nth-child(4) { animation-delay: .21s; }
.suggestion:hover { border-color: var(--border-strong); background: var(--surface-2); transform: translateY(-3px) rotateX(4deg); box-shadow: var(--shadow); }
.suggestion .icon { color: var(--accent-text); margin-top: 2px; }
.suggestion b { display: block; font-size: 14px; font-weight: 620; }
.suggestion span { font-size: 13px; color: var(--text-2); }

.msg { display: flex; gap: 14px; margin: 0 0 26px; animation: msgIn .5s var(--ease) both; }
@keyframes msgIn { from { opacity: 0; transform: translateY(10px); } }
.msg.user { justify-content: flex-end; }
.msg.user .msg-body { max-width: min(80%, 620px); display: flex; flex-direction: column; align-items: flex-end; }
.bubble { padding: 11px 16px; border-radius: 20px 20px 6px 20px; background: linear-gradient(135deg, color-mix(in srgb, var(--iris) 22%, var(--surface-2)), color-mix(in srgb, var(--aqua) 12%, var(--surface-2))); border: 1px solid var(--border); white-space: pre-wrap; word-wrap: break-word; overflow-wrap: anywhere; }
.msg.assistant .msg-body { flex: 1; min-width: 0; }
.msg-avatar { margin-top: 2px; }
.msg-actions { display: flex; gap: 2px; margin-top: 6px; opacity: 0; transition: opacity .25s; }
.msg:hover .msg-actions, .msg.last .msg-actions, .msg-actions:focus-within { opacity: 1; }
.msg-meta { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.msg-error { margin-top: 8px; padding: 12px 14px; border-radius: 14px; border: 1px solid color-mix(in srgb, var(--danger) 35%, transparent); background: color-mix(in srgb, var(--danger) 8%, transparent); color: var(--text); font-size: 14px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.msg-error .icon { color: var(--danger); }
.edit-box { width: min(620px, 80vw); }
.edit-box .textarea { min-height: 80px; }
.attach-grid { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; justify-content: flex-end; }
.msg.assistant .attach-grid { justify-content: flex-start; margin: 12px 0 4px; }
.attach-img { border-radius: 14px; overflow: hidden; border: 1px solid var(--border); cursor: zoom-in; background: var(--surface); transition: transform .35s var(--ease), box-shadow .35s; max-width: 240px; }
.attach-img img { max-height: 220px; min-width: 64px; min-height: 64px; object-fit: cover; image-rendering: auto; }
.msg.assistant .attach-img { max-width: min(100%, 520px); }
.msg.assistant .attach-img img { max-height: 520px; object-fit: contain; }
.attach-img:hover { transform: scale(1.015); box-shadow: var(--shadow); }
.attach-file { display: inline-flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--border); font-size: 13px; max-width: 260px; color: var(--text); text-decoration: none !important; }
.attach-file .ext { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; background: var(--grad-soft); color: var(--accent-text); font-size: 10px; font-weight: 800; text-transform: uppercase; flex: none; }
.attach-file .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task-card { margin-top: 12px; display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-radius: 16px; background: var(--grad-soft); border: 1px solid var(--border); max-width: 460px; animation: fadeUp .5s var(--ease) both; }
.task-card .tc-icon { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: var(--surface-2); color: var(--accent-text); flex: none; }
.task-card b { display: block; font-size: 14.5px; }
.task-card span { font-size: 12.5px; color: var(--text-2); }
.scroll-bottom { position: absolute; left: 50%; bottom: 150px; transform: translateX(-50%) translateY(10px); opacity: 0; pointer-events: none; transition: all .3s var(--ease); z-index: 10; box-shadow: var(--shadow); background: var(--glass-strong); border: 1px solid var(--border-strong); }
.scroll-bottom.show { opacity: 1; pointer-events: auto; transform: translateX(-50%); }

/* Markdown */
.md { font-size: 15.5px; line-height: 1.7; overflow-wrap: anywhere; }
.md > *:first-child { margin-top: 0; } .md > *:last-child { margin-bottom: 0; }
.md p { margin: 0 0 14px; }
.md h1, .md h2, .md h3, .md h4 { margin: 24px 0 10px; line-height: 1.3; letter-spacing: -.015em; }
.md h1 { font-size: 1.5em; } .md h2 { font-size: 1.3em; } .md h3 { font-size: 1.12em; } .md h4 { font-size: 1em; }
.md ul, .md ol { margin: 0 0 14px; padding-left: 24px; }
.md li { margin: 4px 0; }
.md li::marker { color: var(--text-3); }
.md blockquote { margin: 0 0 14px; padding: 6px 16px; border-left: 3px solid; border-image: var(--grad) 1; color: var(--text-2); background: var(--surface); border-radius: 0 10px 10px 0; }
.md code { font-family: var(--mono); font-size: .86em; padding: 2px 6px; border-radius: 6px; background: var(--surface-3); border: 1px solid var(--border); }
.md a { color: var(--accent-text); text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--accent) 40%, transparent); text-underline-offset: 3px; }
.md hr { border: 0; height: 1px; background: var(--border-strong); margin: 22px 0; }
.md table { border-collapse: separate; border-spacing: 0; width: fit-content; max-width: 100%; margin: 0 0 16px; font-size: 14px; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; display: block; overflow-x: auto; }
.md th, .md td { padding: 9px 12px; text-align: left; border-bottom: 1px solid var(--border); }
.md th { background: var(--surface-2); font-weight: 650; }
.md tr:last-child td { border-bottom: 0; }
.md strong { font-weight: 680; }
.code-block { margin: 0 0 16px; border-radius: 14px; overflow: hidden; border: 1px solid rgba(255,255,255,.08); background: var(--code-bg); color: #e6e8f0; }
.code-head { display: flex; align-items: center; justify-content: space-between; padding: 6px 8px 6px 14px; font-size: 12px; color: #8b90a3; background: rgba(255,255,255,.04); border-bottom: 1px solid rgba(255,255,255,.06); font-family: var(--mono); }
.code-head .icon-btn { color: #8b90a3; }
.code-head .icon-btn:hover { color: #fff; background: rgba(255,255,255,.08); }
.code-block pre { margin: 0; padding: 14px 16px; overflow-x: auto; font-family: var(--mono); font-size: 13.2px; line-height: 1.6; tab-size: 2; }
.code-block code { background: none; border: 0; padding: 0; font-size: inherit; }
.tk-k { color: #c3a6ff; } .tk-s { color: #8be3c4; } .tk-c { color: #6b7187; font-style: italic; } .tk-n { color: #ffb27a; } .tk-f { color: #82c7ff; }
.cursor::after { content: ""; display: inline-block; width: 8px; height: 1.05em; vertical-align: text-bottom; margin-left: 2px; border-radius: 2px; background: var(--grad); animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* Barre de saisie */
.composer-wrap { flex: none; padding: 0 clamp(10px, 3vw, 28px) 14px; position: relative; z-index: 5; }
.composer-wrap::before { content: ""; position: absolute; left: 0; right: 0; top: -40px; height: 40px; background: linear-gradient(transparent, var(--bg)); pointer-events: none; }
.composer { max-width: 800px; margin: 0 auto; border-radius: 26px; padding: 10px; position: relative; background: var(--glass-strong); backdrop-filter: blur(24px) saturate(160%); border: 1px solid var(--border-strong); box-shadow: var(--shadow-lg); transition: box-shadow .35s, border-color .35s, transform .35s var(--ease); }
.composer::before { content: ""; position: absolute; inset: -1px; border-radius: inherit; padding: 1px; background: var(--grad); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; opacity: 0; transition: opacity .4s; pointer-events: none; }
.composer.focus::before { opacity: .9; }
.composer.focus { box-shadow: var(--shadow-lg), 0 0 40px -10px rgba(139,123,255,.45); }
.composer textarea { width: 100%; border: 0; outline: none; resize: none; background: transparent; padding: 8px 10px 4px; font-size: 16px; line-height: 1.5; max-height: 40vh; min-height: 30px; color: var(--text); }
.composer textarea::placeholder { color: var(--text-3); }
.composer-bar { display: flex; align-items: center; gap: 4px; padding-top: 4px; }
.composer .send { width: 40px; height: 40px; border-radius: 14px; border: 0; display: grid; place-items: center; background: var(--grad); color: #fff; box-shadow: 0 6px 20px -6px rgba(139,123,255,.7); transition: transform .3s var(--ease-spring), opacity .2s, box-shadow .3s; }
.composer .send:hover { transform: translateY(-1px) scale(1.04); }
.composer .send:active { transform: scale(.92); }
.composer .send:disabled { opacity: .35; box-shadow: none; pointer-events: none; }
.composer .send.stop { background: var(--text); color: var(--bg); box-shadow: none; }
.composer .send.stop .icon { width: 14px; height: 14px; }
.composer-attachments { display: flex; gap: 8px; flex-wrap: wrap; padding: 4px 4px 8px; }
.att-chip { position: relative; display: flex; align-items: center; gap: 8px; height: 52px; padding: 6px 10px 6px 6px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--border); max-width: 220px; animation: choiceIn .35s var(--ease-spring); }
.att-chip .thumb { width: 40px; height: 40px; border-radius: 10px; object-fit: cover; background: var(--surface-3); flex: none; display: grid; place-items: center; font-size: 10px; font-weight: 800; color: var(--accent-text); text-transform: uppercase; overflow: hidden; }
.att-chip .info { min-width: 0; font-size: 12.5px; }
.att-chip .info b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; max-width: 130px; }
.att-chip .info span { color: var(--text-3); font-size: 11.5px; }
.att-chip .rm { position: absolute; top: -7px; right: -7px; width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--border-strong); background: var(--glass-strong); display: grid; place-items: center; color: var(--text-2); }
.att-chip .rm .icon { width: 12px; height: 12px; }
.att-chip .progress { position: absolute; left: 6px; right: 6px; bottom: 3px; height: 3px; border-radius: 3px; background: var(--surface-3); overflow: hidden; }
.att-chip .progress i { display: block; height: 100%; background: var(--grad); transition: width .2s; }
.att-chip.error { border-color: color-mix(in srgb, var(--danger) 50%, transparent); }
.mode-pill { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 6px 0 10px; border-radius: 11px; background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent-text); font-size: 13px; font-weight: 600; animation: choiceIn .35s var(--ease-spring); }
.mode-pill select { border: 0; background: transparent; color: inherit; font-weight: 600; font-size: 12.5px; outline: none; cursor: pointer; }
.mode-pill select option { color: var(--text); background: var(--bg-2); }
.composer-foot { text-align: center; font-size: 11.5px; color: var(--text-3); margin-top: 8px; }
.drop-overlay { position: absolute; inset: 10px; z-index: 50; border-radius: 26px; border: 2px dashed color-mix(in srgb, var(--accent) 60%, transparent); background: color-mix(in srgb, var(--bg) 70%, transparent); backdrop-filter: blur(8px); display: grid; place-items: center; pointer-events: none; opacity: 0; transition: opacity .25s; }
.drop-overlay.show { opacity: 1; }
.drop-overlay div { text-align: center; font-weight: 650; font-size: 17px; }
.drop-overlay .icon { width: 42px; height: 42px; color: var(--accent-text); margin: 0 auto 10px; animation: float 2s ease-in-out infinite; }

/* Lightbox */
.lightbox { position: fixed; inset: 0; z-index: 700; background: rgba(3,4,8,.88); backdrop-filter: blur(10px); display: grid; place-items: center; padding: 60px 16px 16px; animation: fadeIn .25s; }
.lightbox img { max-width: 100%; max-height: calc(100vh - 90px); border-radius: 16px; box-shadow: var(--shadow-lg); animation: modalIn .45s var(--ease-spring); object-fit: contain; }
.lightbox .lb-bar { position: fixed; top: 12px; right: 12px; display: flex; gap: 6px; }
.lightbox .icon-btn { color: #fff; background: rgba(255,255,255,.08); }

/* ═════════════ Images ═════════════ */
.studio { padding: 18px; border-radius: var(--r-xl); margin-bottom: 30px; box-shadow: var(--shadow); }
.studio .textarea { min-height: 96px; font-size: 16px; background: transparent; border: 0; box-shadow: none !important; padding: 6px 4px; resize: none; }
.studio-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; border-top: 1px solid var(--border); padding-top: 14px; margin-top: 6px; }
.shape { display: inline-block; border: 1.6px solid currentColor; border-radius: 3px; }
.shape.square { width: 12px; height: 12px; } .shape.landscape { width: 15px; height: 10px; } .shape.portrait { width: 10px; height: 15px; }
.source-prev { display: inline-flex; align-items: center; gap: 8px; padding: 4px 4px 4px 4px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); font-size: 13px; }
.source-prev img { width: 32px; height: 32px; border-radius: 8px; object-fit: cover; }
.gallery { columns: 3 260px; column-gap: 16px; }
.gal-item { break-inside: avoid; margin-bottom: 16px; border-radius: 20px; overflow: hidden; position: relative; background: var(--surface); border: 1px solid var(--border); animation: fadeUp .6s var(--ease) both; transition: transform .45s var(--ease), box-shadow .45s; }
.gal-item:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.gal-item img { width: 100%; cursor: zoom-in; }
.gal-over { position: absolute; left: 0; right: 0; bottom: 0; padding: 40px 12px 12px; background: linear-gradient(transparent, rgba(4,5,10,.88)); color: #fff; opacity: 0; transform: translateY(8px); transition: all .35s var(--ease); }
.gal-item:hover .gal-over, .gal-item:focus-within .gal-over { opacity: 1; transform: none; }
.gal-over p { margin: 0 0 10px; font-size: 13px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.gal-over .icon-btn { color: #fff; background: rgba(255,255,255,.12); }
.gal-over .icon-btn:hover { background: rgba(255,255,255,.22); }
.gal-item .badge { position: absolute; top: 10px; left: 10px; backdrop-filter: blur(10px); }
@media (hover: none) { .gal-over { opacity: 1; transform: none; } }
.gen-card { position: relative; border-radius: 20px; overflow: hidden; margin-bottom: 30px; border: 1px solid var(--border); background: var(--bg-2); max-width: 560px; }
.gen-card::before { content: ""; display: block; padding-top: var(--ratio, 100%); }
.gen-mesh { position: absolute; inset: -30%; background:
  radial-gradient(30% 30% at 30% 30%, var(--iris), transparent 70%),
  radial-gradient(30% 30% at 70% 40%, var(--aqua), transparent 70%),
  radial-gradient(35% 35% at 50% 75%, var(--rose), transparent 70%);
  filter: blur(40px) saturate(140%); opacity: .55; animation: mesh 6s ease-in-out infinite alternate; }
@keyframes mesh { 0% { transform: rotate(0deg) scale(1); } 50% { transform: rotate(120deg) scale(1.15); } 100% { transform: rotate(240deg) scale(1); } }
.gen-scan { position: absolute; left: 0; right: 0; height: 30%; background: linear-gradient(transparent, rgba(255,255,255,.14), transparent); animation: scan 2.4s var(--ease) infinite; }
@keyframes scan { from { top: -30%; } to { top: 100%; } }
.gen-grid { position: absolute; inset: 0; background-image: linear-gradient(rgba(255,255,255,.05) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.05) 1px, transparent 1px); background-size: 28px 28px; mask-image: radial-gradient(circle, #000, transparent 75%); }
.gen-label { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; color: #fff; text-align: center; padding: 20px; }
.gen-label .orb { --s: 64px; }
.gen-label b { font-size: 16px; }
.gen-label span { font-size: 13px; opacity: .75; max-width: 360px; }

/* ═════════════ Tâches ═════════════ */
.quick-add { display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 16px; border-radius: 20px; margin-bottom: 8px; box-shadow: var(--shadow); transition: box-shadow .3s; }
.quick-add:focus-within { box-shadow: var(--shadow), 0 0 0 4px color-mix(in srgb, var(--accent) 14%, transparent); }
.quick-add .icon { color: var(--accent-text); }
.quick-add input { flex: 1; border: 0; background: transparent; outline: none; height: 42px; font-size: 15.5px; min-width: 0; }
.parse-preview { min-height: 34px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 4px 6px 18px; font-size: 13px; color: var(--text-2); }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 18px; overflow-x: auto; scrollbar-width: none; }
.tabs button { border: 0; background: transparent; color: var(--text-2); padding: 10px 14px; font-weight: 600; font-size: 14px; position: relative; white-space: nowrap; display: inline-flex; gap: 8px; align-items: center; transition: color .2s; }
.tabs button:hover { color: var(--text); }
.tabs button.on { color: var(--text); }
.tabs button.on::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 2px; border-radius: 2px; background: var(--grad); animation: tabIn .35s var(--ease); }
@keyframes tabIn { from { transform: scaleX(0); } }
.tabs .count { font-size: 11.5px; padding: 1px 7px; border-radius: 99px; background: var(--surface-3); color: var(--text-2); }
.task-group { margin-bottom: 22px; }
.task-group h4 { font-size: 12px; text-transform: uppercase; letter-spacing: .1em; color: var(--text-3); margin: 0 0 8px 4px; font-weight: 700; }
.task-group h4.overdue { color: var(--danger); }
.task { display: flex; align-items: center; gap: 14px; padding: 12px 10px 12px 14px; border-radius: 16px; background: var(--surface); border: 1px solid var(--border); margin-bottom: 8px; transition: background .25s, border-color .25s, transform .3s var(--ease), opacity .4s; animation: fadeUp .45s var(--ease) both; }
.task:hover { background: var(--surface-2); border-color: var(--border-strong); }
.task.done .task-title { text-decoration: line-through; color: var(--text-3); }
.task.leaving { opacity: 0; transform: translateX(20px) scale(.98); }
.check { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--border-strong); background: transparent; flex: none; display: grid; place-items: center; color: transparent; transition: all .3s var(--ease-spring); padding: 0; }
.check:hover { border-color: var(--accent); transform: scale(1.1); }
.check .icon { width: 14px; height: 14px; }
.check.on { background: var(--grad); border-color: transparent; color: #fff; animation: checkPop .45s var(--ease-spring); }
@keyframes checkPop { 50% { transform: scale(1.25); } }
.task-main { flex: 1; min-width: 0; }
.task-title { font-weight: 580; font-size: 15px; overflow-wrap: anywhere; }
.task-meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 4px; font-size: 12.5px; color: var(--text-2); }
.task-meta .icon { width: 13px; height: 13px; }
.task-actions { display: flex; gap: 2px; opacity: .55; transition: opacity .2s; }
.task:hover .task-actions { opacity: 1; }
.day-picker { display: flex; gap: 6px; flex-wrap: wrap; }
.day-picker button { width: 40px; height: 36px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); font-size: 12.5px; font-weight: 650; transition: all .2s; }
.day-picker button.on { background: color-mix(in srgb, var(--accent) 20%, transparent); color: var(--accent-text); border-color: color-mix(in srgb, var(--accent) 50%, transparent); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* ═════════════ Bibliothèque / Historique ═════════════ */
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.search-input { position: relative; flex: 1; min-width: 220px; }
.search-input .icon { position: absolute; left: 14px; top: 13px; color: var(--text-3); pointer-events: none; }
.search-input .input { padding-left: 42px; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 22px; }
.lib-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; }
.lib-card { border-radius: 18px; background: var(--surface); border: 1px solid var(--border); overflow: hidden; display: flex; flex-direction: column; transition: transform .4s var(--ease), box-shadow .4s, border-color .25s; animation: fadeUp .5s var(--ease) both; cursor: pointer; }
.lib-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--border-strong); }
.lib-thumb { aspect-ratio: 4 / 3; background: var(--surface-2); display: grid; place-items: center; overflow: hidden; position: relative; }
.lib-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease); }
.lib-card:hover .lib-thumb img { transform: scale(1.05); }
.lib-thumb .big-icon { width: 54px; height: 54px; border-radius: 16px; display: grid; place-items: center; background: var(--grad-soft); color: var(--accent-text); }
.lib-thumb .big-icon .icon { width: 26px; height: 26px; }
.lib-thumb .excerpt { padding: 14px; font-size: 12.5px; color: var(--text-2); line-height: 1.5; align-self: stretch; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 6; -webkit-box-orient: vertical; text-align: left; }
.lib-thumb .badge { position: absolute; top: 10px; left: 10px; }
.lib-info { padding: 12px 12px 12px 14px; display: flex; align-items: center; gap: 8px; }
.lib-info .tt { flex: 1; min-width: 0; }
.lib-info b { display: block; font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lib-info span { font-size: 12px; color: var(--text-3); display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hist-group { margin-bottom: 26px; }
.hist-group h4 { font-size: 12px; text-transform: uppercase; letter-spacing: .1em; color: var(--text-3); margin: 0 0 8px 4px; font-weight: 700; }
.hist-row { display: flex; align-items: center; gap: 12px; padding: 12px 10px 12px 14px; border-radius: 14px; border: 1px solid transparent; transition: background .2s, border-color .2s; cursor: pointer; animation: fadeUp .4s var(--ease) both; color: var(--text); text-decoration: none !important; }
.hist-row:hover { background: var(--surface-2); border-color: var(--border); }
.hist-row .icon.lead { color: var(--text-3); }
.hist-row .tt { flex: 1; min-width: 0; }
.hist-row b { display: block; font-weight: 560; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 14.5px; }
.hist-row .snip { font-size: 12.5px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.hist-row .snip mark { background: color-mix(in srgb, var(--accent) 30%, transparent); color: var(--text); border-radius: 3px; padding: 0 2px; }
.hist-row time { font-size: 12px; color: var(--text-3); white-space: nowrap; }

/* Recherche (palette) */
.palette { width: min(640px, 100%); padding: 0; overflow: hidden; align-self: start; margin-top: 10vh; }
.palette-input { display: flex; align-items: center; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--border); }
.palette-input input { flex: 1; border: 0; outline: none; background: transparent; font-size: 17px; }
.palette-input .icon { color: var(--text-3); }
.palette-results { max-height: 52vh; overflow-y: auto; padding: 8px; }
.palette-results .hist-row { border-radius: 12px; }
.palette-results .hist-row.sel { background: var(--surface-3); }
.palette-empty { padding: 30px; text-align: center; color: var(--text-3); font-size: 14px; }

/* ═════════════ Paramètres / Admin ═════════════ */
.settings { display: grid; grid-template-columns: 220px 1fr; gap: 30px; align-items: start; }
.settings-nav { position: sticky; top: 10px; display: flex; flex-direction: column; gap: 2px; }
.settings-nav button { display: flex; align-items: center; gap: 12px; height: 40px; padding: 0 12px; border-radius: 12px; border: 0; background: transparent; color: var(--text-2); font-weight: 540; text-align: left; transition: background .2s, color .2s; }
.settings-nav button:hover { background: var(--surface-2); color: var(--text); }
.settings-nav button.on { background: var(--surface-3); color: var(--text); }
.settings-nav button.danger { color: var(--danger); }
.settings-panel { animation: pageIn .45s var(--ease) both; min-width: 0; }
.settings-panel h2 { margin: 0 0 4px; font-size: 21px; letter-spacing: -.02em; }
.settings-panel > p.muted { margin: 0 0 22px; }
.set-section { padding: 20px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--border); margin-bottom: 16px; }
.set-section h3 { margin: 0 0 4px; font-size: 15.5px; }
.set-section > p { margin: 0 0 16px; font-size: 13.5px; color: var(--text-2); }
.set-row { display: flex; align-items: center; gap: 16px; padding: 12px 0; border-top: 1px solid var(--border); }
.set-row:first-of-type { border-top: 0; }
.set-row .txt { flex: 1; min-width: 0; }
.set-row .txt b { display: block; font-weight: 580; font-size: 14.5px; }
.set-row .txt span { font-size: 13px; color: var(--text-2); }
.theme-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.theme-card { border-radius: 16px; border: 2px solid var(--border); background: var(--surface); padding: 10px; text-align: left; transition: border-color .25s, transform .3s var(--ease-spring); }
.theme-card:hover { transform: translateY(-2px); }
.theme-card.on { border-color: var(--accent); }
.theme-card .pv { height: 74px; border-radius: 10px; margin-bottom: 8px; position: relative; overflow: hidden; }
.theme-card .pv.dark { background: linear-gradient(135deg, #0b0d13, #171a26); }
.theme-card .pv.light { background: linear-gradient(135deg, #f4f5fa, #fff); border: 1px solid #e3e5ee; }
.theme-card .pv.system { background: linear-gradient(90deg, #0b0d13 50%, #f4f5fa 50%); }
.theme-card .pv i { position: absolute; left: 10px; top: 10px; width: 40%; height: 8px; border-radius: 4px; background: var(--grad); }
.theme-card .pv i + i { top: 24px; width: 60%; opacity: .35; background: #888; }
.theme-card b { font-size: 13.5px; font-weight: 600; }
.lang-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.lang-card { border-radius: 16px; border: 2px solid var(--border); background: var(--surface); padding: 16px; text-align: left; transition: all .25s; }
.lang-card.on { border-color: var(--accent); background: var(--grad-soft); }
.lang-card .code { font-family: var(--font-display); font-weight: 800; font-size: 22px; letter-spacing: .06em; }
.lang-card span { display: block; font-size: 13px; color: var(--text-2); }
.mem-item { display: flex; align-items: flex-start; gap: 12px; padding: 12px 12px 12px 14px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--border); margin-bottom: 8px; animation: fadeUp .4s var(--ease) both; }
.mem-item .icon.lead { color: var(--accent-text); margin-top: 2px; }
.mem-item p { flex: 1; margin: 0; font-size: 14.5px; overflow-wrap: anywhere; }
.mem-item .mi-actions { display: flex; gap: 2px; }
.session-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--border); font-size: 13.5px; }
.session-row:first-child { border-top: 0; }
.session-row .tt { flex: 1; min-width: 0; }
.session-row .tt b { display: block; font-weight: 580; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.session-row .tt span { color: var(--text-3); font-size: 12.5px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 18px; }
.stat { padding: 16px 18px; border-radius: 18px; background: var(--surface); border: 1px solid var(--border); }
.stat span { font-size: 12.5px; color: var(--text-2); font-weight: 560; }
.stat b { display: block; font-family: var(--font-display); font-size: 28px; letter-spacing: -.02em; margin-top: 4px; font-variant-numeric: tabular-nums; }
.table-wrap { overflow-x: auto; border-radius: 16px; border: 1px solid var(--border); }
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; min-width: 640px; }
.table th { text-align: left; font-weight: 620; color: var(--text-2); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; padding: 11px 14px; background: var(--surface-2); }
.table td { padding: 12px 14px; border-top: 1px solid var(--border); vertical-align: middle; }
.table tr:hover td { background: var(--surface); }
.user-cell { display: flex; align-items: center; gap: 10px; }
.user-cell .avatar { width: 30px; height: 30px; font-size: 12px; }
.user-cell b { display: block; font-weight: 600; }
.user-cell span { font-size: 12px; color: var(--text-3); }
.chart { width: 100%; height: 200px; }
.chart rect.bar { fill: url(#barGrad); transition: opacity .2s; }
.chart rect.bar:hover { opacity: .75; }
.chart text { fill: var(--text-3); font-size: 10px; font-family: var(--font); }
.feature-toggles { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; }
.feature-toggle { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--border); }
.feature-toggle .txt { flex: 1; font-weight: 560; font-size: 14px; }


/* ═════════════ JOJO Plus : offres, limites, compteurs ═════════════ */
.plus-modal { width: min(560px, 100%); padding: 28px; overflow-x: hidden; overflow-y: auto; position: relative; }
.plus-modal.wide { width: min(820px, 100%); }
.plus-modal::before { content: ""; position: absolute; inset: -40% -20% auto; height: 70%; background: radial-gradient(50% 60% at 50% 40%, rgba(139,123,255,.28), transparent 70%), radial-gradient(40% 50% at 75% 30%, rgba(61,224,208,.16), transparent 70%); pointer-events: none; filter: blur(10px); animation: aurora 14s ease-in-out infinite alternate; }
.plus-sheet { position: relative; display: flex; flex-direction: column; gap: 20px; }
.plus-hero { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.plus-hero .orb { --s: 78px; margin: 8px 0 10px; }
.plus-hero h2 { margin: 0; font-family: var(--font-display); font-size: clamp(21px, 3vw, 26px); letter-spacing: -.02em; line-height: 1.2; }
.plus-hero p { margin: 4px 0 0; font-size: 15px; }
.plus-hero.compact h2 { font-size: clamp(22px, 3vw, 28px); }
.limit-clock-wrap { margin-top: 14px; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.limit-clock-wrap .faint { font-size: 12px; text-transform: uppercase; letter-spacing: .12em; font-weight: 650; }
.limit-clock { font-family: var(--mono); font-size: clamp(30px, 6vw, 40px); font-weight: 600; letter-spacing: .04em; font-variant-numeric: tabular-nums; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; animation: fadeUp .6s var(--ease) both; }
.plus-offer { border-radius: 22px; padding: 20px; background: linear-gradient(160deg, color-mix(in srgb, var(--iris) 16%, var(--surface-2)), color-mix(in srgb, var(--aqua) 8%, var(--surface))); border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--border)); box-shadow: 0 20px 60px -30px rgba(139,123,255,.6); animation: fadeUp .7s var(--ease) both .1s; }
.plus-offer-head { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; margin-bottom: 14px; }
.plus-offer-head > div:first-child { flex: 1; min-width: 220px; }
.plus-offer-head h3 { margin: 6px 0 4px; font-size: 19px; letter-spacing: -.01em; }
.plus-offer-head p { margin: 0; font-size: 14px; }
.plus-price { text-align: right; }
.plus-price b { display: block; font-family: var(--font-display); font-size: 30px; letter-spacing: -.03em; }
.plus-price span { font-size: 12.5px; color: var(--text-2); }
.plus-orwait { margin: 14px 0 0; text-align: center; font-size: 13px; color: var(--text-2); }
.plan-feats { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; }
.plus-offer .plan-feats { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.plan-feats li { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--text-2); }
.plan-feats li .icon { width: 16px; height: 16px; margin-top: 2px; color: var(--text-3); flex: none; }
.plan-feats.plus li { color: var(--text); }
.plan-feats.plus li .icon { color: var(--aqua); }
.plan-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.plan-card { position: relative; padding: 22px; border-radius: 22px; background: var(--surface); border: 1px solid var(--border); display: flex; flex-direction: column; gap: 14px; animation: fadeUp .6s var(--ease) both; }
.plan-card.highlight { background: linear-gradient(160deg, color-mix(in srgb, var(--iris) 18%, var(--surface-2)), color-mix(in srgb, var(--aqua) 8%, var(--surface))); border-color: color-mix(in srgb, var(--accent) 45%, transparent); box-shadow: 0 24px 70px -30px rgba(139,123,255,.7); animation-delay: .08s; }
.plan-ribbon { position: absolute; top: 16px; right: 16px; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; padding: 4px 9px; border-radius: 99px; background: var(--grad); color: #fff; }
.plan-name { font-family: var(--font-display); font-weight: 800; letter-spacing: .14em; font-size: 15px; }
.plan-price b { font-family: var(--font-display); font-size: 32px; letter-spacing: -.03em; }
.plan-price span { color: var(--text-2); font-size: 13px; margin-left: 4px; }
.plan-current { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--success); margin-top: auto; }
.plan-current .icon { width: 15px; height: 15px; }
.plus-pill { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 11px; margin: 0 8px 8px; border-radius: 99px; border: 1px solid color-mix(in srgb, var(--accent) 40%, var(--border)); background: color-mix(in srgb, var(--accent) 10%, transparent); color: var(--accent-text); font-size: 12.5px; font-weight: 650; transition: background .25s, transform .3s var(--ease-spring); }
.plus-pill:hover { background: color-mix(in srgb, var(--accent) 20%, transparent); transform: translateY(-1px); }
.plus-pill .icon { width: 14px; height: 14px; }
.plus-badge { display: inline-flex; align-items: center; height: 18px; padding: 0 7px; margin-left: 7px; border-radius: 6px; font-size: 10px; font-weight: 800; letter-spacing: .1em; color: #fff; background: var(--grad); vertical-align: 2px; }
.limit-bar { max-width: 800px; margin: 0 auto 10px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 14px; border-radius: 16px; font-size: 13.5px; background: var(--glass-strong); backdrop-filter: blur(18px); border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--border)); box-shadow: var(--shadow); animation: fadeUp .45s var(--ease) both; position: relative; z-index: 2; }
.limit-bar .icon { color: var(--accent-text); }
.limit-bar b { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.limit-bar .btn { margin-left: auto; }
.images-left { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--text-2); padding: 0 6px; }
.images-left .icon { width: 14px; height: 14px; color: var(--accent-text); }
.images-left.empty { color: var(--warn); }
[data-theme="light"] .images-left.empty { color: #9a6a00; }
.meters { display: grid; gap: 16px; }
.meter { display: flex; flex-direction: column; gap: 7px; }
.meter-head { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; }
.meter-head span { color: var(--text-2); font-variant-numeric: tabular-nums; }
.meter-bar { height: 8px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.meter-bar i { display: block; height: 100%; border-radius: inherit; background: var(--grad); transition: width .8s var(--ease); }
.meter-bar i.full { background: linear-gradient(90deg, var(--warn), var(--rose)); }
.meter > span { font-size: 12.5px; }
.plan-status.is-plus { background: linear-gradient(160deg, color-mix(in srgb, var(--iris) 12%, var(--surface)), var(--surface)); border-color: color-mix(in srgb, var(--accent) 35%, var(--border)); }
.plan-title { font-family: var(--font-display); font-size: 26px !important; letter-spacing: -.02em; margin: 6px 0 0 !important; }
.credit-balance { text-align: right; }
.credit-balance b { display: block; font-family: var(--font-display); font-size: 30px; letter-spacing: -.02em; }
.credit-balance span { font-size: 12px; color: var(--text-2); }
.admin-h { font-size: 12px; text-transform: uppercase; letter-spacing: .12em; color: var(--text-3); margin: 22px 0 10px; font-weight: 700; }
.admin-h:first-of-type { margin-top: 0; }
.stat small { display: block; font-size: 12px; margin-top: 2px; }
.table tr.clickable { cursor: pointer; }
.kv-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }
.kv { padding: 12px 14px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--border); }
.kv span { display: block; font-size: 12px; color: var(--text-3); margin-bottom: 3px; }
.kv b { font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
.admin-actions { display: flex; gap: 8px; flex-wrap: wrap; padding-top: 6px; border-top: 1px solid var(--border); }
details summary { cursor: pointer; font-weight: 600; font-size: 14px; color: var(--text-2); padding: 6px 0; }
details summary:hover { color: var(--text); }
.plan-cfg-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.plan-cfg.is-plus { border-color: color-mix(in srgb, var(--accent) 35%, var(--border)); }
.cfg-row { display: grid; grid-template-columns: minmax(130px, 1fr) auto; gap: 10px; align-items: center; padding: 7px 0; }
.cfg-row label { font-size: 13.5px; font-weight: 560; color: var(--text-2); }
.cfg-inputs { display: flex; align-items: center; gap: 6px; }
.cfg-inputs .input { width: 92px; height: 38px; padding: 0 10px; }
.cfg-unit { font-size: 12.5px; white-space: nowrap; }
.cfg-group { display: flex; align-items: center; gap: 6px; font-size: 11.5px; text-transform: uppercase; letter-spacing: .1em; color: var(--text-3); font-weight: 700; margin: 14px 0 4px; }
.cfg-group .icon { width: 13px; height: 13px; }
@media (max-width: 960px) { .plan-cfg-grid { grid-template-columns: 1fr; } }
@media (max-width: 640px) {
  .plan-grid { grid-template-columns: 1fr; }
  .plus-modal { padding: 20px; }
  .plus-hero .orb { --s: 56px; }
  .plus-modal .modal-foot { flex-direction: column-reverse; }
  .plus-modal .modal-foot .btn { width: 100%; }
  .plus-price { text-align: left; }
  .cfg-row { grid-template-columns: 1fr; }
  .limit-bar .btn { margin-left: 0; }
}

/* ═════════════ Responsive ═════════════ */
@media (max-width: 960px) {
  .showcase { grid-template-columns: 1fr; }
  .mock { transform: none; }
  .settings { grid-template-columns: 1fr; gap: 16px; }
  .settings-nav { position: static; flex-direction: row; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
  .settings-nav button { flex: none; }
}
@media (max-width: 820px) {
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; transform: translateX(-105%); box-shadow: var(--shadow-lg); width: min(300px, 86vw); background: var(--glass-strong); }
  .app.nav-open .sidebar { transform: none; }
  .app.collapsed .sidebar { width: min(300px, 86vw); padding: 14px 12px; }
  .app.collapsed .sidebar .hide-collapsed { display: revert !important; }
  .app.collapsed .conv-list { visibility: visible; }
  .sidebar-overlay { display: block; position: fixed; inset: 0; z-index: 55; background: rgba(0,0,0,.45); backdrop-filter: blur(2px); opacity: 0; pointer-events: none; transition: opacity .35s; }
  .app.nav-open .sidebar-overlay { opacity: 1; pointer-events: auto; }
  .topbar .menu-toggle { display: inline-flex; }
  .collapse-btn { display: none !important; }
}
@media (max-width: 640px) {
  body { font-size: 14.5px; }
  .suggestions { grid-template-columns: 1fr; }
  .suggestion:nth-child(n+3) { display: none; }
  .msg.user .msg-body { max-width: 88%; }
  .msg { gap: 10px; }
  .msg-avatar { display: none; }
  .msg-actions { opacity: 1; }
  .composer { border-radius: 22px; }
  .composer-foot { display: none; }
  .theme-cards, .lang-cards { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
  .gallery { columns: 2 150px; column-gap: 10px; }
  .gal-item { margin-bottom: 10px; border-radius: 16px; }
  .lib-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .task-actions { opacity: 1; }
  .modal { padding: 20px; border-radius: 24px; }
  .page-header { margin-bottom: 18px; }
  .hist-row time { display: none; }
  .auth-card { padding: 28px 20px; }
  .scroll-bottom { bottom: 130px; }
  .lang-select { max-width: 78px; }
  .landing-nav .logo-word { display: none; }
}
@media (hover: none) { .nav .kbd { display: none; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
.reduce-motion *, .reduce-motion *::before, .reduce-motion *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }

/* ═══════════════════════════════════════════════════════════════
   JOJO ADMIN — Control Center
   Mise en page dédiée, mêmes jetons que l'identité Aurora.
   Couleurs de séries (validées daltonisme) : --c1 iris, --c2 teal.
   ═══════════════════════════════════════════════════════════════ */
:root { --c1: #8b7bff; --c2: #1aa497; --ac-side: 252px; }
[data-theme="light"] { --c1: #6a5af9; --c2: #0f9c8f; }

.ac { display: flex; height: 100vh; height: 100dvh; overflow: hidden; }
.ac-sidebar { width: var(--ac-side); flex: none; display: flex; flex-direction: column; gap: 6px; padding: 16px 12px; border-right: 1px solid var(--border); background: var(--glass); backdrop-filter: blur(24px) saturate(1.4); -webkit-backdrop-filter: blur(24px) saturate(1.4); z-index: 30; }
.ac-brand { display: flex; align-items: center; gap: 11px; padding: 6px 10px 16px; text-decoration: none; color: var(--text); }
.ac-brand b { display: block; font-family: var(--font-display); font-size: 15.5px; letter-spacing: .06em; font-weight: 800; }
.ac-brand small { display: block; font-size: 11.5px; color: var(--text-3); letter-spacing: .04em; }
.ac-nav { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; scrollbar-width: thin; }
.ac-nav-group { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--text-3); padding: 14px 12px 6px; }
.ac-nav a { display: flex; align-items: center; gap: 11px; height: 38px; padding: 0 12px; border-radius: 11px; color: var(--text-2); text-decoration: none; font-weight: 560; font-size: 14px; position: relative; transition: background .2s, color .2s; }
.ac-nav a:hover { background: var(--surface-2); color: var(--text); }
.ac-nav a.active { background: var(--surface-3); color: var(--text); }
.ac-nav a.active::before { content: ""; position: absolute; left: -12px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0; background: var(--grad); }
.ac-nav a .icon { width: 18px; height: 18px; }
.ac-nav-badge { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px; font-size: 11px; font-weight: 700; display: none; align-items: center; justify-content: center; background: var(--danger); color: #fff; }
.ac-nav-badge.on { display: inline-flex; }
.ac-side-foot { display: grid; gap: 10px; padding-top: 10px; border-top: 1px solid var(--border); }
.ac-back { justify-content: center; }
.ac-me { padding: 0 6px; font-size: 12px; display: grid; gap: 1px; overflow: hidden; }
.ac-me b { font-weight: 600; font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ac-overlay { display: none; }

.ac-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ac-topbar { height: 62px; flex: none; display: flex; align-items: center; gap: 14px; padding: 0 22px; border-bottom: 1px solid var(--border); background: color-mix(in srgb, var(--bg) 70%, transparent); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); }
.ac-menu { display: none; }
.ac-title { display: flex; align-items: baseline; gap: 8px; white-space: nowrap; }
.ac-title b { font-family: var(--font-display); font-weight: 800; letter-spacing: .06em; font-size: 15px; }
.ac-title span { color: var(--text-3); font-size: 13px; font-weight: 560; }
.ac-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; }
.ac-env, .ac-status, .ac-online, .ac-updated { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 99px; font-size: 12px; font-weight: 620; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); white-space: nowrap; }
.ac-env.dev { color: var(--warn); background: color-mix(in srgb, var(--warn) 10%, transparent); border-color: transparent; }
.ac-env.prod { color: var(--success); background: color-mix(in srgb, var(--success) 10%, transparent); border-color: transparent; }
.ac-status i { width: 8px; height: 8px; border-radius: 50%; background: var(--text-3); }
.ac-status.ok i { background: var(--success); box-shadow: 0 0 0 0 color-mix(in srgb, var(--success) 60%, transparent); animation: acPulse 2.2s infinite; }
.ac-status.warn i { background: var(--warn); }
.ac-status.bad { color: var(--danger); }
.ac-status.bad i { background: var(--danger); }
.ac-updated { border: 0; background: transparent; color: var(--text-3); font-weight: 500; }
.ac-online:empty, .ac-updated:empty { display: none; }
@keyframes acPulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--success) 55%, transparent); } 70% { box-shadow: 0 0 0 7px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }

.ac-content { flex: 1; overflow-y: auto; padding: 26px 28px 60px; scroll-behavior: smooth; }
.ac-section { max-width: 1320px; margin: 0 auto; display: grid; gap: 18px; animation: pageIn .45s var(--ease) both; }
.ac-head { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.ac-head > div:first-child { flex: 1; min-width: 240px; }
.ac-head h1 { margin: 0; font-family: var(--font-display); font-size: 27px; letter-spacing: -.02em; }
.ac-head p { margin: 4px 0 0; color: var(--text-2); font-size: 14px; }
.ac-head-right { display: flex; gap: 8px; flex-wrap: wrap; }
.ac-subhead { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 8px; }
.ac-subhead h2 { margin: 0; flex: 1; font-size: 18px; font-family: var(--font-display); }

.ac-card { padding: 18px 20px; border-radius: 20px; background: var(--surface); border: 1px solid var(--border); display: grid; gap: 12px; align-content: start; min-width: 0; transition: border-color .25s; }
.ac-card:hover { border-color: var(--border-strong); }
.ac-card-head { display: flex; align-items: center; gap: 10px; }
.ac-card-head h3 { margin: 0; flex: 1; font-size: 14.5px; font-weight: 650; }
.ac-card .hint { margin: 0; }

.ac-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.ac-stat { position: relative; overflow: hidden; padding: 16px 18px 14px; border-radius: 20px; background: var(--surface); border: 1px solid var(--border); display: grid; gap: 4px; min-width: 0; }
.ac-stat::after { content: ""; position: absolute; inset: 0 0 auto 0; height: 1px; background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--c1) 50%, transparent), transparent); opacity: .6; }
.ac-stat-head { display: flex; align-items: center; gap: 8px; color: var(--text-2); font-size: 12.5px; font-weight: 600; }
.ac-stat-head .icon { width: 16px; height: 16px; color: var(--accent-text); }
.ac-stat b { font-family: var(--font-display); font-size: 30px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; line-height: 1.15; }
.ac-stat small { color: var(--text-3); font-size: 12.5px; }
.ac-stat .spark { width: 100%; height: 34px; margin-top: 4px; }
.ac-stat.good b { color: var(--success); }
.ac-stat.warn b { color: var(--warn); }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--success); display: inline-block; animation: acPulse 2.2s infinite; margin-left: auto; }
.live-dot.warn { background: var(--warn); animation: none; }
.badge .live-dot { margin: 0; }

.ac-groups { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.ac-mini { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.ac-mini.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ac-mini > div { padding: 10px 12px; border-radius: 13px; background: var(--surface-2); border: 1px solid var(--border); min-width: 0; }
.ac-mini span { display: block; font-size: 11.5px; color: var(--text-3); font-weight: 560; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ac-mini b { display: block; font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; margin-top: 2px; overflow-wrap: anywhere; }
.ac-na { font-size: 13px; font-weight: 600; color: var(--text-3); }
.ac-total { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border-radius: 13px; background: var(--grad-soft); border: 1px solid var(--border); }
.ac-total b { font-size: 20px; font-family: var(--font-display); }

.ac-alert-strip { display: flex; align-items: center; gap: 10px; width: 100%; padding: 12px 16px; border-radius: 14px; border: 1px solid color-mix(in srgb, var(--warn) 30%, transparent); background: color-mix(in srgb, var(--warn) 10%, transparent); color: var(--text); font-weight: 600; text-align: left; }
.ac-alert-strip .icon { color: var(--warn); }
.icon.flip svg { transform: scaleX(-1); }

.ac-budget-line { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.ac-budget-line b { font-size: 18px; font-variant-numeric: tabular-nums; }
.ac-budget-line.small { font-size: 13px; color: var(--text-2); }
.ac-budget-big { display: flex; align-items: baseline; gap: 4px; }
.ac-budget-big b { font-family: var(--font-display); font-size: 30px; letter-spacing: -.02em; }
.progress { position: relative; height: 10px; border-radius: 99px; background: var(--surface-3); overflow: visible; }
.progress > i { position: absolute; inset: 0 auto 0 0; border-radius: 99px; background: var(--c1); transition: width .8s var(--ease); }
.progress.warn > i { background: var(--warn); }
.progress.danger > i { background: var(--danger); }
.progress .mark { position: absolute; top: -3px; bottom: -3px; width: 2px; border-radius: 2px; background: var(--bg); opacity: .9; }
.ac-thresholds { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--text-3); padding: 0 2px; }
.ac-thresholds span.hit { color: var(--text); font-weight: 700; }

.ac-chart-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.ac-chart-grid > .ac-card:last-child:nth-child(odd) { grid-column: 1 / -1; }
.ac-grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.ac-grid-2r { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 14px; }
.ac-grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.ac-skel { display: grid; gap: 14px; }
.ac-skel .skeleton { height: 120px; }
.ac-skel .skeleton.tall { height: 64px; width: 40%; }

/* Graphiques */
.chart-box { position: relative; }
.chart-plot { position: relative; width: 100%; }
.chart-svg { display: block; overflow: visible; }
.chart-svg .grid { stroke: var(--border); stroke-width: 1; }
.chart-svg .axis { stroke: var(--border-strong); stroke-width: 1; }
.chart-svg .tick { fill: var(--text-3); font-size: 11px; font-family: var(--font); font-variant-numeric: tabular-nums; }
.chart-svg .line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart-svg .line.c1, .spark .line.c1 { stroke: var(--c1); }
.chart-svg .line.c2, .spark .line.c2 { stroke: var(--c2); }
.chart-svg .area.c1, .spark .area.c1 { fill: var(--c1); opacity: .13; }
.chart-svg .area.c2, .spark .area.c2 { fill: var(--c2); opacity: .13; }
.spark .line { fill: none; stroke-width: 1.75; vector-effect: non-scaling-stroke; }
.chart-svg .bar.c1 { fill: var(--c1); }
.chart-svg .bar.c2 { fill: var(--c2); }
.chart-svg .bar { transition: opacity .2s; }
.chart-svg .cross { stroke: var(--text-3); stroke-dasharray: 3 3; }
.chart-svg .dot { stroke: var(--bg); stroke-width: 2; }
.chart-svg .dot.c1 { fill: var(--c1); }
.chart-svg .dot.c2 { fill: var(--c2); }
.chart-empty { position: absolute; inset: 0 0 24px 46px; display: grid; place-items: center; color: var(--text-3); font-size: 13px; pointer-events: none; }
.chart-tip { position: absolute; z-index: 3; pointer-events: none; opacity: 0; transform: translateY(4px); transition: opacity .15s, transform .15s; padding: 9px 11px; border-radius: 12px; background: var(--glass-strong); border: 1px solid var(--border-strong); box-shadow: var(--shadow); font-size: 12.5px; display: grid; gap: 4px; min-width: 140px; backdrop-filter: blur(12px); }
.chart-tip.on { opacity: 1; transform: none; }
.chart-tip b { font-size: 12px; color: var(--text-2); }
.chart-tip div { display: flex; align-items: center; gap: 7px; color: var(--text-2); }
.chart-tip strong { margin-left: auto; color: var(--text); font-variant-numeric: tabular-nums; }
.chart-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--text-2); margin-bottom: 8px; }
.chart-legend span { display: inline-flex; align-items: center; gap: 7px; }
.chart-legend.col { flex-direction: column; gap: 10px; margin: 0; }
.chart-legend.col b { margin-left: 6px; color: var(--text); font-variant-numeric: tabular-nums; }
.sw { width: 10px; height: 10px; border-radius: 3px; display: inline-block; flex: none; }
.sw.c1 { background: var(--c1); }
.sw.c2 { background: var(--c2); }
.donut-wrap { display: flex; align-items: center; gap: 28px; flex-wrap: wrap; justify-content: center; padding: 8px 0; }
.donut { width: 170px; height: 170px; }
.donut-track { fill: none; stroke: var(--surface-3); stroke-width: 16; }
.donut-seg { fill: none; stroke-width: 16; stroke-linecap: butt; transition: stroke-dasharray .8s var(--ease); }
.donut-seg.c1 { stroke: var(--c1); }
.donut-seg.c2 { stroke: var(--c2); }
.donut-num { fill: var(--text); font-size: 26px; font-weight: 750; font-family: var(--font-display); dominant-baseline: middle; }

/* Tableaux & listes */
.ac-toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.ac-search { position: relative; flex: 1; min-width: 220px; }
.ac-search .icon { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--text-3); width: 17px; height: 17px; }
.ac-search .input { padding-left: 40px; }
.table.compact { min-width: 560px; }
.table.compact td { padding: 9px 12px; }
.table.compact th { padding: 9px 12px; }
.table td.num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.table td.nowrap { white-space: nowrap; }
.table tr.clickable { cursor: pointer; }
.table tr.clickable:focus-visible td { background: var(--surface-2); outline: none; }
.ac-users { min-width: 1080px; }
.ac-users td { white-space: nowrap; }
.ac-msg { max-width: 420px; font-size: 12.5px; white-space: normal; overflow-wrap: anywhere; }
.ac-id { font-family: var(--mono); font-size: 11.5px; color: var(--text-3); background: var(--surface-2); padding: 2px 6px; border-radius: 6px; overflow-wrap: anywhere; }
.avatar.sm { width: 28px; height: 28px; font-size: 11px; }
.badge.xs { height: 18px; font-size: 10px; padding: 0 6px; margin-left: 6px; vertical-align: middle; }
b.pos { color: var(--success); }
b.neg { color: var(--danger); }
.ac-pager { display: flex; align-items: center; gap: 10px; }
.ac-empty { display: grid; justify-items: center; gap: 8px; padding: 30px 16px; color: var(--text-3); text-align: center; }
.ac-empty .icon { width: 28px; height: 28px; opacity: .7; }
.ac-empty p { margin: 0; max-width: 560px; font-size: 13.5px; }
.ac-empty.big { padding: 46px 20px; }
.ac-empty.big .icon { width: 44px; height: 44px; color: var(--accent-text); opacity: 1; }
.ac-empty.big h3 { margin: 4px 0 0; color: var(--text); font-size: 19px; }
.ac-defs { margin: 0; padding-left: 18px; display: grid; gap: 6px; color: var(--text-2); font-size: 13.5px; }
.ac-defs b { color: var(--text); }
.ac-rank { display: grid; gap: 6px; }
.ac-rank-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 13px; border: 1px solid var(--border); background: var(--surface-2); text-align: left; color: var(--text); width: 100%; transition: border-color .2s, transform .2s; }
.ac-rank-row:hover:not(:disabled) { border-color: var(--border-strong); transform: translateY(-1px); }
.ac-rank-row > div { flex: 1; min-width: 0; display: grid; }
.ac-rank-row b { font-weight: 620; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ac-rank-row strong { font-variant-numeric: tabular-nums; }
.ac-rank-n { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; font-size: 12px; font-weight: 700; background: var(--surface-3); color: var(--text-2); flex: none; }

/* Géographie */
.ac-geo { display: grid; gap: 10px; }
.ac-geo-row { display: grid; grid-template-columns: minmax(110px, 1.2fr) 2fr 60px 50px; align-items: center; gap: 10px; font-size: 13.5px; }
.ac-geo-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ac-geo-bar { height: 8px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.ac-geo-bar i { display: block; height: 100%; border-radius: 99px; background: var(--c1); }
.ac-geo-row b { text-align: right; font-variant-numeric: tabular-nums; }
.ac-geo-row small { text-align: right; }

/* Système */
.ac-res { display: grid; gap: 12px; }
.ac-res-item { display: grid; gap: 6px; font-size: 13.5px; }
.ac-res-item .progress { height: 6px; }
.ac-providers { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 10px; }
.ac-provider { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--border); }
.ac-provider > div { flex: 1; display: grid; min-width: 0; }
.ac-provider .icon { color: var(--accent-text); }

/* Paiements */
.ac-stripe-off { display: flex; gap: 18px; align-items: flex-start; }
.ac-stripe-off h3 { margin: 0 0 6px; }
.ac-stripe-off p { margin: 0 0 10px; color: var(--text-2); font-size: 14px; }
.ac-stripe-icon { width: 52px; height: 52px; flex: none; border-radius: 16px; display: grid; place-items: center; background: var(--grad-soft); color: var(--accent-text); }
.ac-stripe-icon .icon { width: 26px; height: 26px; }
code.ac-env { font-family: var(--mono); font-size: 12px; padding: 4px 8px; border-radius: 8px; background: var(--surface-3); color: var(--text); height: auto; border: 0; }

/* Alertes */
.ac-alerts { display: grid; gap: 10px; }
.ac-alert { display: flex; gap: 14px; align-items: flex-start; padding: 14px 16px; border-radius: 16px; background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--text-3); }
.ac-alert > div { flex: 1; min-width: 0; }
.ac-alert p { margin: 3px 0 4px; color: var(--text-2); font-size: 13.5px; }
.ac-alert.warning { border-left-color: var(--warn); }
.ac-alert.critical { border-left-color: var(--danger); }
.ac-alert.ack { opacity: .62; }
.ac-alert-icon { color: var(--text-3); margin-top: 1px; }
.ac-alert.warning .ac-alert-icon { color: var(--warn); }
.ac-alert.critical .ac-alert-icon { color: var(--danger); }

/* Fiche utilisateur */
.ac-profile-group { display: grid; gap: 8px; }
.ac-profile-group h4 { margin: 2px 0 0; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--text-3); }

@media (max-width: 1180px) {
  .ac-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ac-grid-3 { grid-template-columns: 1fr; }
  .ac-grid-2r { grid-template-columns: 1fr; }
}
@media (max-width: 980px) {
  .ac-sidebar { position: fixed; inset: 0 auto 0 0; transform: translateX(-102%); transition: transform .35s var(--ease); box-shadow: var(--shadow-lg); background: var(--glass-strong); }
  .ac.nav-open .ac-sidebar { transform: none; }
  .ac.nav-open .ac-overlay { display: block; position: fixed; inset: 0; z-index: 25; background: rgba(0,0,0,.45); }
  .ac-menu { display: inline-flex; }
  .ac-groups, .ac-chart-grid, .ac-grid-2 { grid-template-columns: 1fr; }
  .ac-updated { display: none; }
  .ac-topbar { padding: 0 14px; gap: 10px; }
}
@media (max-width: 640px) {
  .ac-content { padding: 18px 14px 50px; }
  .ac-title span, .ac-online { display: none; }
  .ac-meta { gap: 6px; }
  .ac-kpis { gap: 10px; }
  .ac-stat { padding: 13px 14px 12px; }
  .ac-stat b { font-size: 24px; }
  .ac-mini { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ac-head h1 { font-size: 22px; }
  .ac-card { padding: 15px 14px; }
  .ac-geo-row { grid-template-columns: minmax(90px, 1fr) 1.2fr 52px; }
  .ac-geo-row small { display: none; }
  .ac-stripe-off { flex-direction: column; }
  .plan-cfg-grid { grid-template-columns: 1fr; }
}
.ac-stack { display: grid; gap: 18px; min-width: 0; }
.ac-brand, .ac-brand:hover, .ac-brand:focus { text-decoration: none !important; }
[data-theme="light"] .ac-env.dev { color: #8a5d00; }
@media (max-width: 640px) {
  .ac-meta { flex-wrap: nowrap; }
  .ac-title b { font-size: 14px; }
  .ac-env, .ac-status { height: 24px; padding: 0 8px; font-size: 11px; }
}
@media (max-width: 380px) { .ac-env { display: none; } }
