/* InvestmentLens — global styles. Dark, glass, aurora. */
:root {
  --bg-0: #060314;
  --bg-1: #0b0820;
  --bg-2: #12102b;
  --panel: rgba(24, 20, 54, 0.55);
  --panel-strong: rgba(28, 24, 62, 0.82);
  --border: rgba(148, 163, 255, 0.10);
  --border-strong: rgba(148, 163, 255, 0.22);
  --text: #f2f4ff;
  --text-dim: #b8bce0;
  --text-mute: #7d82ac;
  --accent: #7b5cff;
  --accent-2: #22d3ee;
  --accent-3: #ec4899;
  --danger: #ff5c8a;
  --warning: #ffb84d;
  --success: #4ade80;
  --grid: rgba(148, 163, 255, 0.05);
  --radius: 16px;
  --radius-sm: 10px;
  --shadow-sm: 0 8px 24px rgba(6, 3, 20, 0.5);
  --shadow-md: 0 24px 60px rgba(6, 3, 20, 0.6);
  --shadow-glow: 0 0 80px rgba(123, 92, 255, 0.28);
  --font: "Inter", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg-0);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  line-height: 1.6;
}

/* Aurora background */
.aurora {
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(60% 50% at 12% 8%, rgba(123, 92, 255, 0.42), transparent 60%),
    radial-gradient(50% 45% at 88% 22%, rgba(34, 211, 238, 0.28), transparent 60%),
    radial-gradient(70% 60% at 50% 92%, rgba(236, 72, 153, 0.32), transparent 60%),
    radial-gradient(40% 40% at 78% 70%, rgba(168, 85, 247, 0.24), transparent 60%),
    linear-gradient(180deg, #060314 0%, #0a0620 60%, #12082e 100%);
  animation: auroraShift 22s ease-in-out infinite alternate;
}
.aurora.small {
  background:
    radial-gradient(45% 45% at 18% 18%, rgba(123, 92, 255, 0.32), transparent 60%),
    radial-gradient(40% 35% at 82% 82%, rgba(34, 211, 238, 0.2), transparent 60%),
    radial-gradient(35% 40% at 60% 40%, rgba(236, 72, 153, 0.18), transparent 60%),
    linear-gradient(180deg, #060314 0%, #0a0620 100%);
}
@keyframes auroraShift {
  0% { filter: hue-rotate(0deg); }
  100% { filter: hue-rotate(30deg); }
}

.grid-overlay {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(80% 60% at 50% 40%, #000 40%, transparent 100%);
}

/* Layout */
.container { max-width: 1240px; margin: 0 auto; padding: 0 24px; }
.container-narrow { max-width: 920px; margin: 0 auto; padding: 0 24px; }

/* Typography */
h1, h2, h3, h4 { font-family: var(--font); letter-spacing: -0.02em; margin: 0; }
h1 { font-size: clamp(2.6rem, 5.5vw, 4.4rem); font-weight: 700; line-height: 1.05; }
h2 { font-size: clamp(1.9rem, 3.4vw, 2.8rem); font-weight: 700; line-height: 1.1; }
h3 { font-size: 1.3rem; font-weight: 600; }
h4 { font-size: 1.05rem; font-weight: 600; }
p { margin: 0 0 12px; color: var(--text-dim); }
.muted { color: var(--text-mute); }
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-mute);
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
}
.eyebrow .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent-2); box-shadow: 0 0 12px var(--accent-2); }
.gradient-text {
  background: linear-gradient(120deg, #ffffff 0%, #c4b5fd 30%, #22d3ee 65%, #ec4899 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.mono { font-family: var(--font-mono); }

/* Glass */
.glass {
  background: var(--panel);
  border: 1px solid var(--border);
  backdrop-filter: blur(24px) saturate(140%);
  -webkit-backdrop-filter: blur(24px) saturate(140%);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.glass-strong {
  background: var(--panel-strong);
  border: 1px solid var(--border-strong);
  backdrop-filter: blur(28px) saturate(160%);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 20px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 14px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease;
  text-decoration: none;
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
  font-family: inherit;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary {
  background: linear-gradient(120deg, #7b5cff 0%, #a855f7 50%, #ec4899 100%);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.18);
  box-shadow: 0 10px 30px rgba(123, 92, 255, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.28);
}
.btn-primary:hover { box-shadow: 0 14px 40px rgba(168, 85, 247, 0.6); }
.btn-secondary { background: rgba(255, 255, 255, 0.06); border-color: var(--border-strong); }
.btn-secondary:hover { background: rgba(255, 255, 255, 0.1); }
.btn-ghost { background: transparent; border-color: var(--border); }
.btn-ghost:hover { background: rgba(255, 255, 255, 0.05); }
.btn-danger { background: rgba(255, 92, 138, 0.14); border-color: rgba(255, 92, 138, 0.35); color: #ffb1bd; }
.btn-danger:hover { background: rgba(255, 92, 138, 0.22); }
.btn-block { width: 100%; }
.btn-lg { padding: 15px 28px; font-size: 15px; }
.btn-sm { padding: 8px 14px; font-size: 12.5px; }
.btn[disabled] { opacity: 0.6; cursor: not-allowed; transform: none; }
.icon-btn {
  width: 36px; height: 36px; border-radius: 10px;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  color: var(--text-dim);
  cursor: pointer;
  transition: all 0.15s;
}
.icon-btn:hover { color: var(--text); background: rgba(255, 255, 255, 0.08); }

/* Marketing navbar */
.nav-marketing {
  position: fixed; top: 0; left: 0; right: 0; z-index: 40;
  padding: 16px 0;
  transition: background 0.3s, backdrop-filter 0.3s, border-color 0.3s;
  border-bottom: 1px solid transparent;
}
.nav-marketing.scrolled {
  background: rgba(6, 8, 18, 0.7);
  backdrop-filter: blur(18px);
  border-bottom-color: var(--border);
}
.nav-marketing .wrap { display: flex; align-items: center; justify-content: space-between; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); font-weight: 700; letter-spacing: -0.01em; }
.brand-name { font-size: 16px; }
.brand-logo {
  height: 52px;
  width: auto;
  display: inline-block;
}
.nav-links { display: flex; align-items: center; gap: 8px; }
.nav-links a { color: var(--text-dim); text-decoration: none; font-size: 14px; padding: 8px 14px; border-radius: 10px; transition: color 0.2s, background 0.2s; }
.nav-links a:hover { color: var(--text); background: rgba(255, 255, 255, 0.05); }
@media (max-width: 820px) {
  .nav-links a:not(.btn) { display: none; }
}

/* Hero */
.hero { padding: 160px 0 80px; position: relative; }
.hero .headline { max-width: 920px; margin: 0 auto; text-align: center; }
.hero p.lead { font-size: clamp(1.05rem, 1.6vw, 1.25rem); color: var(--text-dim); max-width: 720px; margin: 20px auto 32px; }
.hero .cta-row { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.hero .stats {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px;
  margin: 64px auto 0; max-width: 1000px;
}
.stat-card { padding: 22px; text-align: left; }
.stat-card .k { font-size: 28px; font-weight: 700; letter-spacing: -0.02em; }
.stat-card .l { font-size: 12.5px; color: var(--text-mute); margin-top: 4px; text-transform: uppercase; letter-spacing: 0.12em; }
@media (max-width: 780px) { .hero .stats { grid-template-columns: repeat(2, 1fr); } }

/* Hero live dashboard preview */
.hero-preview { margin: 72px auto 0; max-width: 1120px; padding: 18px; position: relative; }
.hero-preview::before {
  content: ""; position: absolute; inset: -40px -20px; z-index: -1;
  background: radial-gradient(50% 60% at 50% 50%, rgba(123, 92, 255, 0.28), transparent 70%);
  filter: blur(40px);
}
.preview-grid { display: grid; grid-template-columns: 260px 1fr 300px; gap: 14px; }
@media (max-width: 1000px) { .preview-grid { grid-template-columns: 1fr; } }
.preview-panel { padding: 16px; }
.preview-title { font-size: 12px; text-transform: uppercase; letter-spacing: 0.14em; color: var(--text-mute); margin-bottom: 12px; }
.preview-metric { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 10px; }
.preview-metric .v { font-weight: 600; }
.preview-metric .p { font-size: 12px; }
.pill { display: inline-flex; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 500; }
.pill.up { background: rgba(74, 222, 128, 0.15); color: #86efac; }
.pill.down { background: rgba(255, 92, 138, 0.15); color: #fda4af; }
.pill.neutral { background: rgba(163, 173, 194, 0.15); color: var(--text-dim); }
.mini-bars { display: flex; align-items: flex-end; gap: 4px; height: 60px; }
.mini-bars span { flex: 1; background: linear-gradient(180deg, #7b5cff, #22d3ee); border-radius: 3px 3px 0 0; opacity: 0.85; }

/* Sections */
section.block { padding: 100px 0; position: relative; }
.section-head { text-align: center; max-width: 780px; margin: 0 auto 56px; }
.section-head h2 { margin-bottom: 14px; }
.section-head p { font-size: 1.05rem; }

/* Feature grid */
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
@media (max-width: 900px) {
  .grid-3, .grid-4 { grid-template-columns: 1fr 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  .grid-3, .grid-4 { grid-template-columns: 1fr; }
}
.feature-card { padding: 26px; height: 100%; transition: transform 0.2s, border-color 0.2s, background 0.2s; }
.feature-card:hover { transform: translateY(-3px); border-color: var(--border-strong); }
.feature-card .ico {
  width: 42px; height: 42px; border-radius: 11px;
  display: inline-flex; align-items: center; justify-content: center;
  margin-bottom: 16px; font-size: 18px;
  background: linear-gradient(135deg, rgba(123, 92, 255, 0.25), rgba(34, 211, 238, 0.2));
  border: 1px solid var(--border-strong);
}
.feature-card h3 { margin-bottom: 8px; }
.feature-card p { font-size: 14.5px; margin: 0; }

/* Problem cards */
.problem-card { padding: 24px; }
.problem-card .badge { font-size: 11px; padding: 4px 10px; border-radius: 999px; background: rgba(255, 92, 138, 0.14); color: #ffb1bd; text-transform: uppercase; letter-spacing: 0.14em; }
.problem-card h4 { margin: 14px 0 8px; }

/* AI Engine grid */
.chip-grid { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.chip {
  padding: 8px 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-dim);
  transition: all 0.15s;
}
.chip:hover { background: rgba(123, 92, 255, 0.12); color: var(--text); border-color: rgba(123, 92, 255, 0.4); }

/* Split section */
.split { display: grid; grid-template-columns: 1.05fr 1fr; gap: 40px; align-items: center; }
@media (max-width: 900px) { .split { grid-template-columns: 1fr; } }
.split .visual { padding: 20px; min-height: 320px; }

/* Numbers strip */
.numbers { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; padding: 32px; }
@media (max-width: 720px) { .numbers { grid-template-columns: repeat(2, 1fr); } }
.numbers .n { font-size: 28px; font-weight: 700; }
.numbers .l { color: var(--text-mute); font-size: 12.5px; text-transform: uppercase; letter-spacing: 0.12em; margin-top: 4px; }

/* Pricing */
.pricing-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
@media (max-width: 900px) { .pricing-grid { grid-template-columns: 1fr; } }
.price-card { padding: 30px; position: relative; }
.price-card.featured {
  border-color: rgba(123, 92, 255, 0.4);
  box-shadow: 0 0 0 1px rgba(123, 92, 255, 0.25), 0 20px 60px rgba(123, 92, 255, 0.2);
}
.price-card .plan { font-size: 13px; text-transform: uppercase; letter-spacing: 0.14em; color: var(--text-mute); }
.price-card .amt { font-size: 44px; font-weight: 700; margin: 10px 0 4px; letter-spacing: -0.02em; }
.price-card .amt small { font-size: 15px; color: var(--text-mute); font-weight: 500; }
.price-card ul { list-style: none; padding: 0; margin: 22px 0; }
.price-card li { padding: 8px 0; color: var(--text-dim); font-size: 14.5px; display: flex; align-items: start; gap: 10px; }
.price-card li::before {
  content: ""; width: 18px; height: 18px; border-radius: 6px; flex: 0 0 18px; margin-top: 2px;
  background: linear-gradient(135deg, rgba(34, 211, 238, 0.35), rgba(123, 92, 255, 0.25));
  border: 1px solid rgba(34, 211, 238, 0.3);
}
.badge-top {
  position: absolute; top: -12px; left: 24px;
  padding: 4px 12px; border-radius: 999px; font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase;
  background: linear-gradient(120deg, #7b5cff, #ec4899); color: #ffffff; font-weight: 700;
}

/* FAQ */
.faq-list { display: grid; gap: 12px; }
.faq-item { padding: 4px 20px; border-radius: 14px; border: 1px solid var(--border); background: rgba(255, 255, 255, 0.02); }
.faq-item summary {
  padding: 18px 0; cursor: pointer; list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  font-weight: 600; color: var(--text);
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; font-size: 20px; color: var(--text-mute); transition: transform 0.2s; }
.faq-item[open] summary::after { content: "−"; }
.faq-item .a { padding: 0 0 18px; color: var(--text-dim); font-size: 14.5px; }

/* CTA */
.final-cta { padding: 100px 0 120px; text-align: center; position: relative; }
.final-cta .cta-card {
  padding: 60px 40px;
  position: relative;
  overflow: hidden;
}
.final-cta .cta-card::before {
  content: ""; position: absolute; inset: -60px;
  background: radial-gradient(50% 60% at 50% 40%, rgba(123, 92, 255, 0.35), transparent 60%),
    radial-gradient(40% 50% at 80% 80%, rgba(34, 211, 238, 0.25), transparent 60%);
  z-index: -1;
  animation: pulseBg 8s ease-in-out infinite alternate;
}
@keyframes pulseBg { to { opacity: 0.5; } }

/* Footer */
footer.site {
  padding: 60px 0 40px;
  border-top: 1px solid var(--border);
  color: var(--text-mute);
  font-size: 13.5px;
}
footer.site .cols { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 40px; margin-bottom: 40px; }
@media (max-width: 780px) { footer.site .cols { grid-template-columns: 1fr 1fr; } }
footer.site h5 { font-size: 12px; color: var(--text); letter-spacing: 0.14em; text-transform: uppercase; margin: 0 0 14px; }
footer.site a { display: block; padding: 6px 0; color: var(--text-mute); text-decoration: none; }
footer.site a:hover { color: var(--text); }
footer.site .base { display: flex; justify-content: space-between; align-items: center; border-top: 1px solid var(--border); padding-top: 24px; }

/* Auth pages */
.auth-wrap {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
}
@media (max-width: 900px) { .auth-wrap { grid-template-columns: 1fr; } }
.auth-hero {
  position: relative;
  padding: 60px 60px;
  display: flex; flex-direction: column; justify-content: space-between;
  overflow: hidden;
}
.auth-hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(60% 60% at 30% 20%, rgba(123, 92, 255, 0.35), transparent 65%),
    radial-gradient(60% 60% at 80% 80%, rgba(34, 211, 238, 0.25), transparent 60%),
    linear-gradient(180deg, #060915 0%, #080b1c 100%);
}
.auth-hero .quote { max-width: 460px; }
.auth-hero .quote h2 { margin-bottom: 14px; }
.auth-hero .marks { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 40px; }
.auth-hero .mark { padding: 14px; }
.auth-hero .mark .k { font-size: 20px; font-weight: 700; }
.auth-hero .mark .l { font-size: 12px; color: var(--text-mute); }
@media (max-width: 900px) { .auth-hero { padding: 48px 28px; min-height: 40vh; } }

.auth-form-side {
  padding: 60px 40px;
  display: flex; align-items: center; justify-content: center;
}
.auth-card { width: 100%; max-width: 460px; }
.auth-card h1 { font-size: 32px; margin-bottom: 8px; }
.auth-card .sub { color: var(--text-dim); margin-bottom: 28px; }
.auth-card .switch { margin-top: 22px; text-align: center; color: var(--text-mute); font-size: 14px; }
.auth-card .switch a { color: var(--accent); text-decoration: none; }

.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; color: var(--text-dim); margin-bottom: 6px; }
.input, select.input, textarea.input {
  width: 100%; padding: 12px 14px; border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  color: var(--text); font-size: 14px; font-family: inherit;
  transition: border-color 0.15s, background 0.15s;
}
.input:focus, select.input:focus, textarea.input:focus {
  outline: none; border-color: rgba(123, 92, 255, 0.6); background: rgba(123, 92, 255, 0.08);
  box-shadow: 0 0 0 4px rgba(123, 92, 255, 0.12);
}
.input.error { border-color: rgba(255, 92, 138, 0.55); }
select.input { appearance: none; -webkit-appearance: none; background-image: linear-gradient(45deg, transparent 50%, #b8bce0 50%), linear-gradient(135deg, #b8bce0 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; padding-right: 34px; }
select.input option, select option { background: #12102b !important; color: #f2f4ff !important; }
select.input optgroup { background: #12102b; color: #b8bce0; }
.field .err { color: #fda4af; font-size: 12.5px; margin-top: 6px; min-height: 16px; }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 500px) { .row-2 { grid-template-columns: 1fr; } }
.check-row { display: flex; align-items: start; gap: 10px; margin: 8px 0 20px; font-size: 13.5px; color: var(--text-dim); }
.check-row input { margin-top: 3px; }
.check-row a { color: var(--accent); text-decoration: none; }

.pw-strength { height: 4px; border-radius: 3px; background: rgba(255, 255, 255, 0.07); overflow: hidden; margin-top: 8px; }
.pw-strength > div { height: 100%; width: 0; transition: width 0.2s, background 0.2s; }

/* Dashboard shell */
.dash {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
}
.sidebar {
  border-right: 1px solid var(--border);
  background: rgba(8, 11, 24, 0.7);
  backdrop-filter: blur(20px);
  padding: 22px 14px;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.sidebar .brand { padding: 0 8px 22px; border-bottom: 1px solid var(--border); }
.sidebar nav { display: flex; flex-direction: column; gap: 2px; margin-top: 18px; }
.sidebar nav a {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: 10px;
  color: var(--text-dim); text-decoration: none; font-size: 14px;
  transition: background 0.15s, color 0.15s;
}
.sidebar nav a:hover { background: rgba(255, 255, 255, 0.05); color: var(--text); }
.sidebar nav a.active { background: linear-gradient(90deg, rgba(123, 92, 255, 0.18), rgba(123, 92, 255, 0.02)); color: var(--text); border-left: 2px solid var(--accent); padding-left: 10px; }
.sidebar nav a .ico { width: 18px; text-align: center; opacity: 0.85; }
.sidebar .group { padding: 14px 12px 6px; font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-mute); }

.main {
  min-width: 0;
  display: flex; flex-direction: column;
}
.topbar {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 26px;
  border-bottom: 1px solid var(--border);
  background: rgba(6, 9, 20, 0.6);
  backdrop-filter: blur(14px);
  position: sticky; top: 0; z-index: 20;
}
.topbar .search {
  flex: 1; max-width: 520px;
  display: flex; align-items: center; gap: 8px;
  padding: 8px 14px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
}
.topbar .search input { background: transparent; border: none; outline: none; color: var(--text); flex: 1; font-family: inherit; }
.topbar .spacer { flex: 1; }
.topbar .avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: linear-gradient(135deg, #7b5cff, #ec4899);
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px; color: #ffffff;
  cursor: pointer;
}
.page { padding: 26px; flex: 1; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head h1 { font-size: 26px; }
.page-head .actions { display: flex; gap: 10px; flex-wrap: wrap; }

.backdrop-mobile { display: none; }
.topbar .menu-btn { display: none; }
@media (max-width: 900px) {
  .dash { grid-template-columns: 1fr; }
  .sidebar { position: fixed; z-index: 60; width: 260px; left: -280px; transition: left 0.25s; box-shadow: 20px 0 60px rgba(0,0,0,.5); }
  .sidebar.open { left: 0; }
  .backdrop-mobile { position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 55; }
  .backdrop-mobile.on { display: block; }
  .topbar .menu-btn { display: inline-flex; }
}

/* KPI cards */
.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
@media (max-width: 900px) { .kpi-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .kpi-grid { grid-template-columns: 1fr; } }
.kpi { padding: 18px; }
.kpi .lbl { font-size: 12px; color: var(--text-mute); text-transform: uppercase; letter-spacing: 0.12em; }
.kpi .val { font-size: 26px; font-weight: 700; margin: 6px 0 4px; letter-spacing: -0.02em; }
.kpi .delta { font-size: 12.5px; }

/* Cards row */
.card { padding: 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.card-head h3 { font-size: 16px; }
.card-head .sub { font-size: 12px; color: var(--text-mute); }

.list { display: flex; flex-direction: column; }
.list .row { padding: 10px 0; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 12px; }
.list .row:last-child { border-bottom: none; }
.list .row .a { flex: 1; min-width: 0; }
.list .row .name { font-weight: 600; font-size: 14px; }
.list .row .meta { font-size: 12px; color: var(--text-mute); }

/* Table */
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { padding: 12px 10px; text-align: left; border-bottom: 1px solid var(--border); }
.table th { font-size: 12px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--text-mute); font-weight: 600; }
.table tbody tr { transition: background 0.15s; }
.table tbody tr:hover { background: rgba(255, 255, 255, 0.03); }
.table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.table th.num { text-align: right; }

/* Modal */
.modal-wrap { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; padding: 20px; opacity: 0; pointer-events: none; transition: opacity 0.2s; }
.modal-wrap.in { opacity: 1; pointer-events: auto; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.55); backdrop-filter: blur(6px); }
.modal-card { position: relative; width: 100%; max-width: 520px; padding: 26px; transform: translateY(10px); transition: transform 0.2s; }
.modal-wrap.in .modal-card { transform: translateY(0); }
.modal-card.wide { max-width: 820px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }

/* Toast */
#toast-host { position: fixed; top: 20px; right: 20px; z-index: 200; display: flex; flex-direction: column; gap: 10px; pointer-events: none; }
.toast {
  padding: 12px 16px; border-radius: 12px;
  background: var(--panel-strong);
  border: 1px solid var(--border-strong);
  backdrop-filter: blur(14px);
  color: var(--text);
  font-size: 14px;
  transform: translateX(20px); opacity: 0;
  transition: transform 0.25s, opacity 0.25s;
  box-shadow: var(--shadow-md);
  pointer-events: auto;
  min-width: 220px;
}
.toast.in { opacity: 1; transform: translateX(0); }
.toast-success { border-color: rgba(102, 209, 158, 0.4); }
.toast-error { border-color: rgba(255, 92, 138, 0.4); }
.toast-info { border-color: rgba(123, 92, 255, 0.4); }

/* Skeleton */
.skel { background: linear-gradient(90deg, rgba(255,255,255,0.04), rgba(255,255,255,0.09), rgba(255,255,255,0.04)); background-size: 200% 100%; animation: shimmer 1.4s infinite linear; border-radius: 8px; }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* Empty state */
.empty { padding: 40px 24px; text-align: center; }
.empty .ill {
  width: 88px; height: 88px; margin: 0 auto 16px;
  border-radius: 22px;
  background: linear-gradient(135deg, rgba(123, 92, 255, 0.2), rgba(34, 211, 238, 0.15));
  border: 1px solid var(--border-strong);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 34px;
}
.empty h4 { margin-bottom: 6px; }
.empty p { max-width: 400px; margin: 0 auto 18px; }

/* Chat */
.chat-wrap { display: grid; grid-template-columns: 280px 1fr; gap: 18px; min-height: 70vh; }
@media (max-width: 900px) { .chat-wrap { grid-template-columns: 1fr; } }
.chat-side { padding: 14px; display: flex; flex-direction: column; gap: 10px; height: 76vh; }
.chat-side .search-mini { position: relative; }
.chat-side .conv-list { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; }
.conv-item { padding: 10px 12px; border-radius: 10px; cursor: pointer; display: flex; align-items: center; gap: 10px; font-size: 13.5px; color: var(--text-dim); }
.conv-item:hover { background: rgba(255, 255, 255, 0.05); color: var(--text); }
.conv-item.active { background: rgba(123, 92, 255, 0.14); color: var(--text); }
.conv-item .t { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conv-item .pin { opacity: 0.6; font-size: 11px; }
.conv-item button { opacity: 0; }
.conv-item:hover button { opacity: 1; }

.chat-main { display: flex; flex-direction: column; height: 76vh; }
.chat-log { flex: 1; overflow-y: auto; padding: 20px 24px; display: flex; flex-direction: column; gap: 16px; }
.msg { display: flex; gap: 12px; max-width: 100%; }
.msg .av { width: 30px; height: 30px; border-radius: 50%; flex: 0 0 30px; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; }
.msg.user .av { background: linear-gradient(135deg, #7b5cff, #ec4899); color: #ffffff; }
.msg.ai .av { background: linear-gradient(135deg, #22d3ee, #7b5cff); color: #ffffff; }
.msg .bubble { padding: 12px 16px; border-radius: 14px; max-width: min(760px, 85%); font-size: 14.5px; line-height: 1.65; }
.msg.user .bubble { background: rgba(123, 92, 255, 0.16); border: 1px solid rgba(123, 92, 255, 0.3); }
.msg.ai .bubble { background: rgba(255, 255, 255, 0.03); border: 1px solid var(--border); }
.msg .bubble p { color: var(--text); margin: 0 0 8px; }
.msg .bubble p:last-child { margin: 0; }
.msg .bubble h1, .msg .bubble h2, .msg .bubble h3, .msg .bubble h4 { margin: 12px 0 6px; }
.msg .bubble ul, .msg .bubble ol { margin: 6px 0 8px; padding-left: 20px; }
.msg .bubble code { background: rgba(255, 255, 255, 0.06); padding: 2px 6px; border-radius: 5px; font-family: var(--font-mono); font-size: 13px; }
.msg .bubble pre { background: rgba(0, 0, 0, 0.35); padding: 12px; border-radius: 10px; overflow-x: auto; border: 1px solid var(--border); }
.msg .bubble pre code { background: transparent; padding: 0; }
.msg .bubble .md-table-wrap { overflow-x: auto; margin: 8px 0; }
.msg .bubble .md-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.msg .bubble .md-table th, .msg .bubble .md-table td { border: 1px solid var(--border); padding: 8px 10px; }
.msg .bubble .md-table th { background: rgba(255,255,255,.03); text-align: left; }
.msg-tools { display: flex; gap: 6px; margin-top: 8px; }
.msg-tools button { font-size: 11px; padding: 3px 8px; border-radius: 6px; background: transparent; border: 1px solid var(--border); color: var(--text-mute); cursor: pointer; }
.msg-tools button:hover { color: var(--text); border-color: var(--border-strong); }

.chat-input {
  padding: 12px; border-top: 1px solid var(--border);
  display: flex; gap: 10px; align-items: flex-end;
}
.chat-input textarea {
  flex: 1; resize: none; min-height: 44px; max-height: 200px;
  padding: 12px 14px; border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  color: var(--text); font-family: inherit; font-size: 14px;
}
.chat-input textarea:focus { outline: none; border-color: rgba(123, 92, 255, 0.5); }
.suggested { display: flex; flex-wrap: wrap; gap: 8px; padding: 10px 18px; border-top: 1px solid var(--border); }
.suggested .chip { cursor: pointer; }

/* Portfolio chart wrappers */
.chart-box { position: relative; height: 260px; }
.chart-box.tall { height: 340px; }
.chart-box.small { height: 180px; }
.legend-list { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.legend-list .li { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-dim); }
.legend-list .li .sw { width: 10px; height: 10px; border-radius: 3px; }

/* Ring metric */
.ring { position: relative; width: 130px; height: 130px; }
.ring svg { transform: rotate(-90deg); }
.ring .val { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; flex-direction: column; }
.ring .val .k { font-size: 24px; font-weight: 700; }
.ring .val .l { font-size: 11px; color: var(--text-mute); text-transform: uppercase; letter-spacing: 0.14em; }

/* Heatmap */
.heat { display: grid; gap: 4px; }
.heat .h { border-radius: 4px; height: 22px; }

/* Utility */
.flex { display: flex; }
.between { justify-content: space-between; }
.center { align-items: center; }
.gap-8 { gap: 8px; } .gap-12 { gap: 12px; } .gap-16 { gap: 16px; }
.mt-6 { margin-top: 6px; } .mt-12 { margin-top: 12px; } .mt-20 { margin-top: 20px; } .mt-30 { margin-top: 30px; }
.tag { display: inline-flex; padding: 3px 8px; border-radius: 6px; background: rgba(255,255,255,.05); color: var(--text-dim); font-size: 11.5px; }
.divider { height: 1px; background: var(--border); margin: 16px 0; }

/* Reveal animation — always visible; only subtle motion when observed */
.reveal { opacity: 1; transform: none; transition: opacity 0.7s ease, transform 0.7s ease; }
.js .reveal { opacity: 0; transform: translateY(24px); }
.js .reveal.in { opacity: 1; transform: translateY(0); }

/* Fallback for gradient text if background-clip:text unsupported */
@supports not ((-webkit-background-clip: text) or (background-clip: text)) {
  .gradient-text { color: #e8ecf5 !important; background: none !important; }
}

/* Ticker marquee */
.ticker-marquee { overflow: hidden; padding: 12px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.ticker-track { display: inline-flex; gap: 44px; animation: slide 40s linear infinite; white-space: nowrap; }
@keyframes slide { to { transform: translateX(-50%); } }
.ticker-item { display: inline-flex; align-items: center; gap: 8px; color: var(--text-dim); font-size: 13px; }
.ticker-item .sym { font-family: var(--font-mono); color: var(--text); font-weight: 600; }

/* Section timeline */
.timeline { position: relative; padding-left: 30px; }
.timeline::before { content: ""; position: absolute; left: 8px; top: 6px; bottom: 6px; width: 2px; background: linear-gradient(180deg, #7b5cff, #ec4899); }
.tl-item { position: relative; padding: 12px 0 22px; }
.tl-item::before { content: ""; position: absolute; left: -30px; top: 18px; width: 12px; height: 12px; border-radius: 50%; background: #060314; border: 2px solid #7b5cff; box-shadow: 0 0 0 4px rgba(123,92,255,.2); }
.tl-item h4 { margin-bottom: 4px; }

/* Scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.08); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.16); }

/* Notification dropdown */
.dropdown { position: relative; }
.dropdown-menu {
  position: absolute; right: 0; top: 44px;
  min-width: 320px; max-width: 380px;
  padding: 8px; z-index: 40;
  transform: translateY(-6px); opacity: 0; pointer-events: none;
  transition: opacity 0.15s, transform 0.15s;
  background: #0f0b26;
  border: 1px solid var(--border-strong);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  box-shadow: 0 24px 60px rgba(6, 3, 20, 0.75), 0 0 0 1px rgba(148, 163, 255, 0.06);
}
.dropdown.open .dropdown-menu { opacity: 1; transform: translateY(0); pointer-events: auto; }
.dropdown-menu .item { padding: 10px 12px; border-radius: 10px; cursor: pointer; display: flex; gap: 10px; align-items: flex-start; }
.dropdown-menu .item:hover { background: rgba(255, 255, 255, 0.05); }
.dropdown-menu .item .t { font-weight: 600; font-size: 13.5px; }
.dropdown-menu .item .b { font-size: 12.5px; color: var(--text-mute); }
.badge-count {
  position: absolute; top: -4px; right: -4px;
  min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px;
  background: #ec4899; color: #ffffff; font-size: 10.5px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
}

/* Text small */
small.hint { color: var(--text-mute); font-size: 12px; }
.link { color: var(--accent); text-decoration: none; }
.link:hover { text-decoration: underline; }
