/* ============================================================
   CryptInfo — Design System v3 "banger"
   Glassmorphism · aurora ambient · neon glows · motion
   ============================================================ */

:root {
  --bg: #06050d;
  --bg-2: #0a0814;
  --surface: #14121f;
  --surface-2: #1a1730;
  --surface-3: #241f3e;
  --glass: rgba(22, 19, 36, 0.66);
  --glass-2: rgba(16, 14, 28, 0.72);
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(168, 130, 255, 0.34);

  --text: #efecfb;
  --muted: #9d97bb;
  --faint: #6b6690;

  --violet: #8b5cf6;
  --indigo: #6366f1;
  --cyan: #22d3ee;
  --sky: #38bdf8;
  --pink: #ec4899;
  --accent: #8b5cf6;
  --accent-2: #b6a4ff;
  --green: #34d399;
  --red: #fb7185;
  --amber: #fbbf24;

  --grad: linear-gradient(135deg, #8b5cf6 0%, #6366f1 100%);
  --grad-hero: linear-gradient(110deg, #d6c8ff 0%, #a78bfa 38%, #22d3ee 100%);
  --grad-soft: linear-gradient(135deg, rgba(139, 92, 246, 0.2), rgba(34, 211, 238, 0.12));
  --border-grad: linear-gradient(135deg, rgba(139, 92, 246, 0.55), rgba(34, 211, 238, 0.18));

  --r-sm: 11px;
  --r: 14px;
  --r-lg: 18px;
  --r-xl: 24px;
  --glow: 0 0 0 1px rgba(139, 92, 246, 0.25), 0 18px 50px -20px rgba(124, 58, 237, 0.5);
  --shadow-soft: 0 10px 30px -16px rgba(0, 0, 0, 0.8);
  --ring: 0 0 0 3px rgba(139, 92, 246, 0.25);

  --nav-h: 66px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }

body {
  margin: 0;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-size: 15px;
  line-height: 1.55;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Aurora ambiante animée */
body::before {
  content: "";
  position: fixed;
  inset: -25%;
  z-index: -2;
  pointer-events: none;
  background:
    radial-gradient(38% 38% at 18% 22%, rgba(139, 92, 246, 0.30), transparent 60%),
    radial-gradient(36% 36% at 82% 14%, rgba(34, 211, 238, 0.18), transparent 60%),
    radial-gradient(44% 44% at 72% 82%, rgba(236, 72, 153, 0.16), transparent 60%),
    radial-gradient(40% 40% at 24% 86%, rgba(99, 102, 241, 0.22), transparent 60%);
  filter: blur(36px) saturate(120%);
  animation: drift 26s ease-in-out infinite alternate;
}
@keyframes drift {
  from { transform: translate3d(0, 0, 0) scale(1) rotate(0deg); }
  to { transform: translate3d(0, -3%, 0) scale(1.1) rotate(4deg); }
}
/* Grille de points discrète */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.45;
  background-image: radial-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px);
  background-size: 26px 26px;
  -webkit-mask-image: radial-gradient(ellipse 85% 65% at 50% -5%, #000 28%, transparent 78%);
  mask-image: radial-gradient(ellipse 85% 65% at 50% -5%, #000 28%, transparent 78%);
}

a { color: inherit; text-decoration: none; }
h1, h2, h3 { font-family: "Sora", "Inter", sans-serif; letter-spacing: -0.025em; margin: 0; font-weight: 800; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.error { color: var(--red); }
::selection { background: rgba(139, 92, 246, 0.4); color: #fff; }
.grad-text { background: var(--grad-hero); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #2c2550; border-radius: 20px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: #3d3470; background-clip: content-box; }

/* ============================================================
   App shell — top nav (glass)
   ============================================================ */
#app-root { display: flex; flex-direction: column; flex: 1; min-height: 100vh; width: 100%; }

.topbar {
  height: var(--nav-h);
  display: flex; align-items: center; gap: 22px; padding: 0 26px;
  position: sticky; top: 0; z-index: 30;
  background: rgba(10, 8, 20, 0.6);
  backdrop-filter: blur(18px) saturate(140%);
  border-bottom: 1px solid var(--border);
}
#app-root.guest .topbar,
#app-root.guest .app-footer,
#app-root.guest ~ #aiFab { display: none; }

.brand { display: flex; align-items: center; gap: 11px; flex-shrink: 0; }
.brand-logo {
  width: 36px; height: 36px; border-radius: 11px;
  display: grid; place-items: center; font-size: 18px;
  background: var(--grad);
  box-shadow: 0 0 22px -2px rgba(139, 92, 246, 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}
.brand-name { font-family: "Sora", sans-serif; font-weight: 800; font-size: 19px; letter-spacing: -0.02em; }

.topnav { display: flex; align-items: center; gap: 4px; flex: 1; }
.nav-item {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 15px; border-radius: 999px;
  color: var(--muted); font-weight: 600; font-size: 14px;
  transition: background 0.18s, color 0.18s, box-shadow 0.18s;
}
.nav-item svg { width: 17px; height: 17px; opacity: 0.85; }
.nav-item:hover { color: var(--text); background: rgba(255, 255, 255, 0.05); }
.nav-item.active { color: #fff; background: rgba(139, 92, 246, 0.2); box-shadow: 0 0 20px -6px rgba(139, 92, 246, 0.8), inset 0 0 0 1px rgba(139, 92, 246, 0.4); }
.nav-item.active svg { color: var(--accent-2); opacity: 1; }

.userbox { flex-shrink: 0; }
.user-chip {
  display: flex; align-items: center; gap: 10px;
  padding: 5px 6px 5px 5px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.04); border: 1px solid var(--border);
}
.avatar {
  width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0;
  display: grid; place-items: center; font-weight: 800; font-size: 13px; color: #fff;
  background: var(--grad); box-shadow: 0 0 14px -2px rgba(139, 92, 246, 0.7);
}
.user-meta { display: flex; flex-direction: column; line-height: 1.15; }
.user-meta strong { font-size: 13.5px; }
.user-meta span { font-size: 11.5px; }
.icon-btn {
  width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0;
  display: grid; place-items: center; cursor: pointer;
  background: transparent; border: 1px solid var(--border); color: var(--muted);
  transition: all 0.14s;
}
.icon-btn:hover { color: var(--red); border-color: var(--red); box-shadow: 0 0 14px -4px var(--red); }
.icon-btn svg { width: 16px; height: 16px; }

main#app { flex: 1; width: 100%; max-width: 1180px; margin: 0 auto; padding: 36px 32px 72px; }
.app-footer { text-align: center; color: var(--faint); font-size: 12.5px; padding: 24px; border-top: 1px solid var(--border); }

/* Entrée en scène */
@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
main#app .page-head,
main#app .card,
main#app .stat-card,
main#app .hero { animation: rise 0.5s cubic-bezier(0.2, 0.7, 0.3, 1) both; }

/* ============================================================
   Floating assistant (FAB)
   ============================================================ */
.fab {
  position: fixed; right: 26px; bottom: 26px; z-index: 40;
  display: inline-flex; align-items: center; gap: 9px;
  padding: 14px 19px 14px 16px; border: none; cursor: pointer;
  border-radius: 999px; color: #fff; font-weight: 700; font-size: 14px;
  background: var(--grad);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12) inset, 0 16px 40px -10px rgba(124, 58, 237, 0.85);
  animation: floaty 4s ease-in-out infinite;
  transition: transform 0.14s;
}
.fab:hover { transform: translateY(-3px) scale(1.03); }
.fab svg { width: 19px; height: 19px; }
@keyframes floaty { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }

/* ============================================================
   Page header
   ============================================================ */
.page-head { margin-bottom: 28px; }
.page-head h1 { font-size: 32px; font-weight: 800; }
.page-head .sub { color: var(--muted); margin-top: 7px; font-size: 15px; }

/* ============================================================
   Cards (glass + gradient border) & grid
   ============================================================ */
.card {
  background:
    linear-gradient(180deg, var(--glass), var(--glass-2)) padding-box,
    var(--border-grad) border-box;
  border: 1px solid transparent;
  border-radius: var(--r-lg);
  padding: 22px;
  backdrop-filter: blur(16px) saturate(130%);
  box-shadow: var(--shadow-soft);
}
.card + .card { margin-top: 18px; }
.card-title { display: flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 700; margin-bottom: 14px; }
.card-title svg { width: 18px; height: 18px; color: var(--accent-2); }

.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-auto { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }

.stat-card {
  display: flex; align-items: center; gap: 16px;
  background:
    linear-gradient(180deg, var(--glass), var(--glass-2)) padding-box,
    var(--border-grad) border-box;
  border: 1px solid transparent; border-radius: var(--r-lg); padding: 20px 22px;
  backdrop-filter: blur(16px); position: relative; overflow: hidden;
  transition: transform 0.18s, box-shadow 0.18s;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--glow); }
.stat-card::after {
  content: ""; position: absolute; right: -26px; top: -26px; width: 120px; height: 120px;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.22), transparent 70%);
}
.stat-ico {
  width: 50px; height: 50px; border-radius: 14px; flex-shrink: 0;
  display: grid; place-items: center; color: #fff; background: var(--grad);
  box-shadow: 0 0 20px -4px rgba(139, 92, 246, 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}
.stat-ico svg { width: 22px; height: 22px; }
.stat-ico.blue { background: linear-gradient(135deg, #38bdf8, #6366f1); box-shadow: 0 0 20px -4px rgba(56, 189, 248, 0.8); }
.stat-ico.violet { background: linear-gradient(135deg, #a855f7, #ec4899); box-shadow: 0 0 20px -4px rgba(236, 72, 153, 0.7); }
.stat-val { font-family: "Sora", sans-serif; font-size: 28px; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.stat-label { color: var(--muted); font-size: 13px; margin-top: 5px; }

.hero {
  position: relative; overflow: hidden;
  background:
    radial-gradient(620px 220px at 88% -40%, rgba(139, 92, 246, 0.35), transparent 70%),
    linear-gradient(180deg, var(--surface-2), var(--surface));
  border: 1px solid var(--border-strong); border-radius: var(--r-lg); padding: 30px;
  box-shadow: var(--glow);
}
.hero h2 { font-size: 24px; font-weight: 800; }
.hero p { color: var(--muted); margin: 9px 0 0; max-width: 62ch; }

/* ============================================================
   Buttons (gradient + reflet)
   ============================================================ */
.btn {
  position: relative; overflow: hidden;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: none; cursor: pointer; color: #fff; font-weight: 700; font-size: 14px;
  padding: 12px 20px; border-radius: var(--r-sm);
  background: var(--grad);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12) inset, 0 12px 28px -12px rgba(124, 58, 237, 0.85);
  transition: transform 0.12s, box-shadow 0.18s;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.18) inset, 0 16px 34px -12px rgba(124, 58, 237, 1); }
.btn::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(120deg, transparent 28%, rgba(255, 255, 255, 0.28), transparent 72%);
  transform: translateX(-130%); transition: transform 0.6s ease;
}
.btn:hover::after { transform: translateX(130%); }
.btn.full { width: 100%; }
.btn svg { width: 17px; height: 17px; }

.btn-ghost {
  display: inline-flex; align-items: center; gap: 7px;
  background: rgba(255, 255, 255, 0.04); color: var(--text);
  border: 1px solid var(--border-strong); cursor: pointer;
  padding: 10px 15px; border-radius: var(--r-sm); font-size: 13px; font-weight: 600;
  transition: border-color 0.14s, background 0.14s, box-shadow 0.14s;
}
.btn-ghost:hover { border-color: var(--accent); background: rgba(139, 92, 246, 0.1); box-shadow: 0 0 18px -8px var(--accent); }
.btn-ghost.danger:hover { border-color: var(--red); color: var(--red); box-shadow: 0 0 18px -8px var(--red); }
.btn-ghost svg { width: 15px; height: 15px; }

/* ============================================================
   Forms
   ============================================================ */
.field { display: block; margin-bottom: 16px; }
.field > span { display: block; font-size: 13px; color: var(--muted); margin-bottom: 7px; font-weight: 500; }
input, select, textarea {
  width: 100%; padding: 12px 14px;
  background: rgba(8, 6, 16, 0.6); border: 1px solid var(--border-strong); border-radius: var(--r-sm);
  color: var(--text); font-size: 14.5px; font-family: inherit;
  transition: border-color 0.14s, box-shadow 0.14s;
}
input::placeholder { color: var(--faint); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: var(--ring); }

/* ============================================================
   Badges, lists, rows
   ============================================================ */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.03em; text-transform: uppercase;
  padding: 3px 9px; border-radius: 999px; background: var(--surface-3); color: var(--muted);
}
.badge.green { background: rgba(52, 211, 153, 0.16); color: var(--green); }
.badge.red { background: rgba(251, 113, 133, 0.16); color: var(--red); }
.badge.blue { background: rgba(56, 189, 248, 0.16); color: var(--sky); }
.badge.violet { background: rgba(139, 92, 246, 0.22); color: var(--accent-2); }
.badge.dot::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; box-shadow: 0 0 8px currentColor; }

.list { display: flex; flex-direction: column; }
.row { display: flex; align-items: center; gap: 12px; padding: 13px 4px; border-bottom: 1px solid var(--border); }
.row:last-child { border-bottom: none; }
.row .spacer { flex: 1; }
code.code {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  background: rgba(8, 6, 16, 0.7); border: 1px solid var(--border);
  padding: 4px 9px; border-radius: 7px; font-size: 13px; letter-spacing: 0.04em;
}
.av-sm {
  width: 32px; height: 32px; border-radius: 9px; flex-shrink: 0;
  display: grid; place-items: center; font-size: 12px; font-weight: 700; color: #fff; background: var(--grad);
}
.av-sm.violet { background: linear-gradient(135deg, #a855f7, #ec4899); }

/* ============================================================
   Empty states
   ============================================================ */
.empty { text-align: center; padding: 46px 20px; color: var(--muted); }
.empty .empty-ico {
  width: 60px; height: 60px; margin: 0 auto 16px; border-radius: 17px;
  display: grid; place-items: center; color: var(--accent-2);
  background: var(--grad-soft); border: 1px solid var(--border-strong);
  box-shadow: 0 0 30px -10px rgba(139, 92, 246, 0.6);
}
.empty .empty-ico svg { width: 26px; height: 26px; }
.empty h3 { font-size: 16px; color: var(--text); margin-bottom: 6px; }
.empty p { font-size: 14px; max-width: 44ch; margin: 0 auto; }
.soon { display: inline-block; margin-top: 14px; }

/* ============================================================
   Auth screens (showpiece)
   ============================================================ */
.auth-screen { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.auth-card {
  width: 100%; max-width: 420px;
  background: linear-gradient(180deg, var(--glass), var(--glass-2)) padding-box, var(--border-grad) border-box;
  border: 1px solid transparent; border-radius: var(--r-xl); padding: 38px 32px;
  backdrop-filter: blur(20px) saturate(140%);
  box-shadow: 0 0 0 1px rgba(139, 92, 246, 0.2), 0 30px 80px -30px rgba(124, 58, 237, 0.7);
  animation: rise 0.5s cubic-bezier(0.2, 0.7, 0.3, 1) both;
}
.auth-brand { display: flex; align-items: center; justify-content: center; gap: 11px; margin-bottom: 4px; }
.auth-brand .brand-logo { width: 44px; height: 44px; font-size: 22px; }
.auth-brand .brand-name { font-size: 23px; }
.auth-card .auth-sub { text-align: center; color: var(--muted); margin: 6px 0 26px; font-size: 14px; }
.auth-foot { text-align: center; color: var(--muted); font-size: 13.5px; margin-top: 20px; }
.auth-foot a { color: var(--accent-2); font-weight: 600; }
.form-error { color: var(--red); font-size: 13.5px; margin-top: 12px; min-height: 18px; text-align: center; }

/* ============================================================
   Chat
   ============================================================ */
.chat-window { display: flex; flex-direction: column; height: calc(100vh - 240px); min-height: 380px; padding: 0; overflow: hidden; }
.chat-scroll { flex: 1; overflow-y: auto; padding: 22px; display: flex; flex-direction: column; gap: 14px; }
.bubble { max-width: 76%; padding: 12px 15px; border-radius: 16px; line-height: 1.5; white-space: pre-wrap; font-size: 14.5px; animation: pop 0.18s ease; }
.bubble.user { align-self: flex-end; background: var(--grad); color: #fff; border-bottom-right-radius: 5px; box-shadow: 0 8px 22px -10px rgba(124, 58, 237, 0.8); }
.bubble.assistant { align-self: flex-start; background: var(--surface-3); border: 1px solid var(--border); border-bottom-left-radius: 5px; }
.bubble.error { background: rgba(251, 113, 133, 0.14); border-color: rgba(251, 113, 133, 0.3); color: #fecdd3; }
/* Markdown rendu dans les réponses de l'IA */
.bubble.assistant { white-space: normal; }
.bubble.assistant p { margin: 0 0 8px; }
.bubble.assistant p:last-child { margin-bottom: 0; }
.bubble.assistant ul, .bubble.assistant ol { margin: 4px 0 8px; padding-left: 20px; }
.bubble.assistant li { margin: 2px 0; }
.bubble.assistant h4 { font-family: "Sora", sans-serif; font-size: 14px; margin: 6px 0 6px; color: var(--accent-2); }
.bubble.assistant code { background: rgba(139, 92, 246, 0.16); border: 1px solid var(--border); padding: 1px 5px; border-radius: 6px; font-size: 12.5px; font-family: "JetBrains Mono", ui-monospace, monospace; }
.bubble.assistant a { color: var(--accent-2); text-decoration: underline; }
.bubble.assistant strong { color: #fff; font-weight: 700; }
.chat-input { display: flex; gap: 10px; padding: 16px; border-top: 1px solid var(--border); background: rgba(20, 18, 31, 0.5); }
.chat-input input { margin: 0; }
.typing { display: inline-flex; gap: 4px; align-items: center; }
.typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); animation: blink 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: 0.2s; }
.typing i:nth-child(3) { animation-delay: 0.4s; }
@keyframes pop { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@keyframes blink { 0%, 100% { opacity: 0.25; } 50% { opacity: 1; } }

/* ============================================================
   Market / posts / heatmap
   ============================================================ */
.post-card { cursor: pointer; transition: transform 0.16s, box-shadow 0.16s; }
.post-card:hover { transform: translateY(-4px); box-shadow: var(--glow); }
.post-card h3 { font-size: 17px; }

.mtable { display: flex; flex-direction: column; }
.mrow { display: flex; align-items: center; gap: 12px; padding: 11px 4px; border-bottom: 1px solid var(--border); }
.mrow:last-child { border-bottom: none; }
.mrow img { border-radius: 50%; flex-shrink: 0; }
.msym { flex: 1; min-width: 0; }
.mprice { font-variant-numeric: tabular-nums; font-weight: 600; }
.chg { font-variant-numeric: tabular-nums; font-weight: 700; font-size: 13px; min-width: 76px; text-align: right; }
.chg.pos { color: var(--green); }
.chg.neg { color: var(--red); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { background: var(--surface-3); border: 1px solid var(--border); border-radius: 999px; padding: 6px 12px; font-size: 13px; font-weight: 600; }

.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 4px; }
.status-line { display: flex; flex-wrap: wrap; gap: 16px; font-size: 13px; color: var(--muted); margin-top: 14px; }
.status-line b { color: var(--text); font-variant-numeric: tabular-nums; }
.status-line b.ok { color: var(--green); }
.status-line b.ko { color: var(--red); }
.action-res { font-size: 13px; margin-top: 10px; min-height: 18px; }

.sources { margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--border); }
.src-link {
  display: inline-flex; align-items: center; gap: 6px; margin: 4px 8px 4px 0; padding: 8px 13px; border-radius: 9px;
  background: var(--surface-3); border: 1px solid var(--border-strong); font-size: 13px; font-weight: 600; color: var(--accent-2);
}
.src-link:hover { border-color: var(--accent); box-shadow: 0 0 16px -6px var(--accent); }

.post-thumb {
  height: 162px; background-size: cover; background-position: center; background-color: var(--surface-3);
  background-image: linear-gradient(135deg, rgba(139, 92, 246, 0.35), rgba(34, 211, 238, 0.25));
  display: flex; align-items: center; justify-content: center;
}
.post-thumb span { font-family: "Sora", sans-serif; font-weight: 800; font-size: 24px; color: rgba(255, 255, 255, 0.5); letter-spacing: 0.05em; }
.post-banner { height: 250px; border-radius: 14px; background-size: cover; background-position: center; margin-bottom: 18px; box-shadow: 0 14px 40px -18px rgba(0, 0, 0, 0.8); }

.ls-heat { display: grid; grid-template-columns: repeat(auto-fill, minmax(94px, 1fr)); gap: 8px; }
.ls-tile { border-radius: 12px; padding: 11px 8px; text-align: center; border: 1px solid var(--border); display: flex; flex-direction: column; gap: 2px; transition: transform 0.14s; }
.ls-tile:hover { transform: translateY(-2px); }
.ls-tile b { font-size: 14px; font-family: "Sora", sans-serif; }
.ls-tile span { font-size: 12px; font-variant-numeric: tabular-nums; }

/* Plus fortes variations 24h */
.mv-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.mv-h { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.6px; margin-bottom: 8px; }
.mv-h.up { color: var(--green); }
.mv-h.down { color: var(--red); }
.mv-row { display: flex; align-items: center; gap: 9px; padding: 7px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.mv-row:last-child { border-bottom: none; }
.mv-row b { font-family: "Sora", sans-serif; font-size: 13.5px; }
.mv-price { font-size: 12.5px; font-variant-numeric: tabular-nums; }
@media (max-width: 560px) { .mv-grid { grid-template-columns: 1fr; gap: 10px; } }

/* Filtres catégories */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 22px; }
.filter-chip {
  cursor: pointer; user-select: none;
  background: rgba(255, 255, 255, 0.04); border: 1px solid var(--border); border-radius: 999px;
  padding: 8px 15px; font-size: 13px; font-weight: 600; color: var(--muted);
  transition: background 0.14s, color 0.14s, border-color 0.14s, box-shadow 0.14s;
}
.filter-chip:hover { color: var(--text); border-color: var(--border-strong); }
.filter-chip.active { background: rgba(139, 92, 246, 0.2); color: #fff; border-color: var(--accent); box-shadow: 0 0 18px -6px var(--accent); }
.filter-chip.active .muted { color: rgba(255, 255, 255, 0.7); }

/* Recherche/tri du feed + bouton favori */
.feed-controls { display: flex; gap: 10px; margin-bottom: 16px; }
.feed-controls input { flex: 1; }
.bm-btn {
  position: absolute; top: 12px; right: 12px; z-index: 2;
  width: 34px; height: 34px; border-radius: 50%;
  background: rgba(0, 0, 0, 0.45); backdrop-filter: blur(6px);
  border: 1px solid var(--border); color: #fff; cursor: pointer;
  font-size: 16px; line-height: 1; display: grid; place-items: center; transition: all 0.12s;
}
.bm-btn:hover { border-color: var(--amber); transform: scale(1.08); }
.bm-btn.on { color: var(--amber); border-color: var(--amber); box-shadow: 0 0 16px -4px var(--amber); }
.bm-inline { background: var(--surface-3); border: 1px solid var(--border); border-radius: 999px; padding: 7px 13px; font-size: 13px; font-weight: 600; color: var(--muted); cursor: pointer; transition: all 0.12s; }
.bm-inline:hover { border-color: var(--amber); color: var(--text); }
.bm-inline.on { color: var(--amber); border-color: var(--amber); box-shadow: 0 0 14px -5px var(--amber); }

/* Sentiment marché */
.gauge-num { font-family: "Sora", sans-serif; font-size: 42px; font-weight: 800; line-height: 1; }
.gauge-bar { height: 10px; border-radius: 999px; margin-top: 16px; position: relative; background: linear-gradient(90deg, #fb7185 0%, #fb923c 30%, #fbbf24 50%, #a3e635 72%, #34d399 100%); box-shadow: 0 0 16px -6px rgba(139, 92, 246, 0.5); }
.gauge-marker { position: absolute; top: -4px; width: 18px; height: 18px; border-radius: 50%; background: #fff; border: 3px solid var(--surface); transform: translateX(-50%); box-shadow: 0 2px 10px rgba(0, 0, 0, 0.6); }
.ls-split { display: flex; height: 36px; border-radius: 11px; overflow: hidden; margin-top: 14px; font-size: 12px; font-weight: 700; }
.ls-long { background: rgba(52, 211, 153, 0.9); color: #06140e; display: flex; align-items: center; padding-left: 12px; min-width: 0; }
.ls-short { background: rgba(251, 113, 133, 0.9); color: #1a0509; display: flex; align-items: center; justify-content: flex-end; padding-right: 12px; min-width: 0; }

/* Positionnement long/short — donut + verdict */
.pos-wrap { display: flex; align-items: center; gap: 20px; padding-top: 4px; }
.pos-donut { --sz: 116px; width: var(--sz); height: var(--sz); border-radius: 50%; position: relative; flex-shrink: 0; box-shadow: 0 0 26px -10px rgba(52, 211, 153, 0.5); }
.pos-donut::after { content: ""; position: absolute; inset: 13px; border-radius: 50%; background: radial-gradient(circle at 50% 38%, #1a1730, #110f1f); }
.pos-hole { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; z-index: 1; }
.pos-hole b { font-family: "Sora", sans-serif; font-size: 30px; font-weight: 800; line-height: 1; color: #fff; }
.pos-hole b span { font-size: 15px; color: var(--muted); margin-left: 1px; }
.pos-hole small { font-size: 11px; text-transform: uppercase; letter-spacing: 1.5px; color: var(--faint); margin-top: 3px; }
.pos-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 11px; }
.pos-verdict { align-self: flex-start; font-family: "Sora", sans-serif; font-weight: 700; font-size: 16px; padding: 7px 15px; border-radius: 999px; border: 1.5px solid currentColor; background: rgba(255, 255, 255, 0.03); }
.pos-legend { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; color: var(--text); }
.pos-legend span { display: flex; align-items: center; gap: 8px; }
.pos-legend i { width: 11px; height: 11px; border-radius: 3px; display: inline-block; }

/* Carte ratio long/short — readout */
.ls-canvas-wrap { height: 240px; position: relative; margin-top: 4px; }
.ls-readout { margin: 2px 0 6px; }
.mini-sel { width: auto; padding: 7px 12px; }
.ls-pills { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 9px; }
.ls-pill { display: inline-flex; align-items: center; gap: 7px; font-weight: 700; font-size: 14px; padding: 5px 13px; border-radius: 999px; border: 1px solid transparent; transition: all 0.15s; }
.ls-pill i { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.ls-pill.long { color: #34d399; background: rgba(52, 211, 153, 0.1); }
.ls-pill.long i { background: #34d399; }
.ls-pill.short { color: #fb7185; background: rgba(251, 113, 133, 0.1); }
.ls-pill.short i { background: #fb7185; }
.ls-pill.lead { border-color: currentColor; box-shadow: 0 0 18px -5px currentColor; }
.ls-ratio { font-size: 12px; color: var(--faint); font-weight: 600; letter-spacing: 0.2px; }
.ls-splitbar { display: flex; height: 8px; border-radius: 999px; overflow: hidden; background: rgba(255, 255, 255, 0.05); }
.ls-splitbar .seg { height: 100%; transition: width 0.4s ease; }
.ls-splitbar .seg.long { background: linear-gradient(90deg, #22d3a0, #34d399); }
.ls-splitbar .seg.short { background: linear-gradient(90deg, #fb7185, #f43f5e); }

/* Sources web sous les réponses de l'IA */
.msg-src { margin-top: 10px; padding-top: 9px; border-top: 1px dashed var(--border); display: flex; flex-direction: column; gap: 4px; }
.msg-src-h { font-size: 11px; text-transform: uppercase; letter-spacing: 0.6px; color: var(--faint); font-weight: 700; margin-bottom: 2px; }
.msg-src a { font-size: 12.5px; color: var(--accent-2); text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.msg-src a:hover { text-decoration: underline; }

/* ============================================================
   Chat flottant (widget CryptIA)
   ============================================================ */
.chat-widget {
  position: fixed; right: 24px; bottom: 24px; z-index: 50;
  width: 384px; max-width: calc(100vw - 32px);
  height: 568px; max-height: calc(100vh - 48px);
  display: flex; flex-direction: column;
  background: linear-gradient(180deg, rgba(20, 18, 33, 0.94), rgba(13, 11, 24, 0.96)) padding-box, var(--border-grad) border-box;
  border: 1px solid transparent; border-radius: 22px;
  backdrop-filter: blur(22px) saturate(140%);
  box-shadow: 0 0 0 1px rgba(139, 92, 246, 0.22), 0 34px 80px -26px rgba(124, 58, 237, 0.8);
  overflow: hidden;
  transform: translateY(18px) scale(0.97); opacity: 0; pointer-events: none;
  transition: transform 0.22s cubic-bezier(0.2, 0.7, 0.3, 1), opacity 0.22s;
}
.chat-widget.open { transform: none; opacity: 1; pointer-events: auto; }
.cw-head { display: flex; align-items: center; gap: 11px; padding: 14px 16px; border-bottom: 1px solid var(--border); background: linear-gradient(135deg, rgba(139, 92, 246, 0.2), rgba(34, 211, 238, 0.06)); }
.cw-head .avatar { width: 38px; height: 38px; border-radius: 12px; font-size: 18px; }
.cw-title { line-height: 1.2; }
.cw-title strong { font-size: 15px; display: block; }
.cw-title span { font-size: 12px; }
.cw-close { margin-left: auto; width: 30px; height: 30px; border-radius: 9px; background: transparent; border: 1px solid var(--border); color: var(--muted); cursor: pointer; font-size: 13px; transition: all 0.12s; }
.cw-close:hover { color: #fff; border-color: var(--accent); }
.cw-body { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.cw-body .bubble { max-width: 88%; }
.cw-suggest { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 14px 12px; }
.cw-chip { cursor: pointer; background: var(--surface-3); border: 1px solid var(--border); border-radius: 999px; padding: 8px 13px; font-size: 12.5px; font-weight: 600; color: var(--muted); transition: all 0.12s; }
.cw-chip:hover { border-color: var(--accent); color: #fff; }
.cw-input { display: flex; gap: 8px; padding: 12px 14px; border-top: 1px solid var(--border); align-items: center; }
.cw-input input { margin: 0; }
.cw-attach { width: 42px; height: 42px; flex-shrink: 0; background: var(--surface-3); border: 1px solid var(--border); border-radius: var(--r-sm); color: var(--muted); cursor: pointer; display: grid; place-items: center; transition: all 0.12s; }
.cw-attach:hover { color: #fff; border-color: var(--accent); }
.cw-attach svg { width: 18px; height: 18px; }
.cw-preview { padding: 0 14px 8px; position: relative; }
.cw-preview img { height: 54px; border-radius: 9px; border: 1px solid var(--border-strong); }
.cw-preview button { position: absolute; top: -4px; left: 56px; width: 22px; height: 22px; border-radius: 50%; background: var(--red); color: #fff; border: none; cursor: pointer; font-size: 11px; }
.cw-foot { text-align: center; font-size: 11px; color: var(--faint); padding: 0 14px 12px; }
@media (max-width: 480px) {
  .chat-widget { right: 12px; left: 12px; width: auto; bottom: 12px; height: calc(100vh - 24px); }
}

/* Chat plein écran (page dédiée) */
.chat-page {
  display: flex; flex-direction: column;
  height: calc(100vh - var(--nav-h) - 168px); min-height: 440px;
  background: linear-gradient(180deg, var(--glass), var(--glass-2)) padding-box, var(--border-grad) border-box;
  border: 1px solid transparent; border-radius: var(--r-lg); overflow: hidden;
  backdrop-filter: blur(16px) saturate(130%); box-shadow: var(--shadow-soft);
}
.cp-body { flex: 1; overflow-y: auto; padding: 24px; display: flex; flex-direction: column; gap: 14px; }
.cp-body .bubble { max-width: 70%; }

/* Conversations (liste latérale) */
.chat-shell { display: flex; gap: 16px; height: calc(100vh - var(--nav-h) - 168px); min-height: 460px; }
.chat-shell .chat-page { flex: 1; height: 100%; min-height: 0; }
.chat-side { width: 248px; flex-shrink: 0; display: flex; flex-direction: column; gap: 10px; }
.conv-list { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; padding-right: 2px; }
.conv-item { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 10px; cursor: pointer; border: 1px solid transparent; color: var(--muted); transition: all 0.12s; }
.conv-item:hover { background: rgba(255, 255, 255, 0.04); color: var(--text); }
.conv-item.active { background: rgba(139, 92, 246, 0.16); color: #fff; border-color: rgba(139, 92, 246, 0.4); }
.conv-title { flex: 1; font-size: 13.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv-del { opacity: 0; flex-shrink: 0; width: 26px; height: 26px; border-radius: 7px; background: transparent; border: none; color: var(--muted); cursor: pointer; display: grid; place-items: center; }
.conv-del svg { width: 14px; height: 14px; }
.conv-item:hover .conv-del { opacity: 1; }
.conv-del:hover { color: var(--red); }

@media (max-width: 860px) {
  .cp-body .bubble { max-width: 88%; }
  .chat-shell { flex-direction: column; height: auto; }
  .chat-side { width: auto; }
  .conv-list { max-height: 140px; flex-direction: row; flex-wrap: wrap; }
  .conv-item { flex: 0 0 auto; }
  .chat-shell .chat-page { height: calc(100vh - var(--nav-h) - 340px); }
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 860px) {
  .topbar { gap: 10px; padding: 0 14px; overflow-x: auto; }
  .brand-name { display: none; }
  .nav-item span:not(.nav-ico) { display: none; }
  .nav-item { padding: 9px 11px; }
  .user-meta { display: none; }
  main#app { padding: 22px 16px 90px; }
  .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .page-head h1 { font-size: 25px; }
  .fab span { display: none; }
  .fab { padding: 15px; }
}
@media (prefers-reduced-motion: reduce) {
  body::before, .fab { animation: none; }
  main#app .card, main#app .stat-card, main#app .page-head, main#app .hero, .auth-card { animation: none; }
}
