:root {
  --bg: #080b10;
  --bg-raised: #0d1219;
  --panel: #111821;
  --panel-2: #151e29;
  --panel-3: #1a2532;
  --line: rgba(174, 201, 224, 0.13);
  --line-strong: rgba(174, 201, 224, 0.24);
  --text: #edf4f8;
  --text-soft: #b7c6d0;
  --muted: #8193a2;
  --muted-2: #5f7281;
  --lime: #c8ff63;
  --lime-soft: rgba(200, 255, 99, 0.12);
  --cyan: #79e8ff;
  --cyan-soft: rgba(121, 232, 255, 0.11);
  --violet: #aa94ff;
  --violet-soft: rgba(170, 148, 255, 0.12);
  --amber: #ffd479;
  --amber-soft: rgba(255, 212, 121, 0.12);
  --red: #ff7180;
  --red-soft: rgba(255, 113, 128, 0.12);
  --shadow: 0 22px 70px rgba(0, 0, 0, 0.32);
  --shadow-small: 0 10px 28px rgba(0, 0, 0, 0.22);
  --radius: 18px;
  --radius-small: 12px;
  --nav-width: 88px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  min-height: 100vh;
  color: var(--text);
  background:
    linear-gradient(rgba(255,255,255,0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.018) 1px, transparent 1px),
    radial-gradient(900px 520px at 78% -16%, rgba(121,232,255,0.09), transparent 62%),
    radial-gradient(720px 460px at 5% 100%, rgba(200,255,99,0.065), transparent 64%),
    var(--bg);
  background-size: 48px 48px, 48px 48px, auto, auto, auto;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-feature-settings: "tnum" 1, "cv11" 1;
  letter-spacing: -0.01em;
  padding-bottom: 28px;
}
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  background: radial-gradient(ellipse at center, transparent 35%, rgba(0,0,0,0.26) 100%);
}
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: var(--cyan); text-decoration: none; }
a:hover { color: var(--lime); }
button { cursor: pointer; }

/* Ambient lighting */
.ambient { position: fixed; border-radius: 50%; pointer-events: none; filter: blur(80px); opacity: 0.13; z-index: -1; }
.ambient-one { width: 280px; height: 280px; background: var(--cyan); right: 4%; top: 16%; }
.ambient-two { width: 240px; height: 240px; background: var(--lime); left: 10%; bottom: 8%; }

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  height: 72px;
  border-bottom: 1px solid var(--line);
  background: rgba(8, 11, 16, 0.82);
  backdrop-filter: blur(22px) saturate(140%);
}
.header-inner {
  height: 100%;
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
}
.brand { display: inline-flex; align-items: center; gap: 11px; color: var(--text); min-width: 190px; }
.brand:hover { color: var(--text); }
.brand-mark {
  width: 34px; height: 34px; border: 1px solid rgba(200,255,99,0.5); border-radius: 10px;
  display: flex; align-items: flex-end; justify-content: center; gap: 3px; padding: 8px 7px;
  background: linear-gradient(145deg, rgba(200,255,99,0.18), rgba(121,232,255,0.08));
  box-shadow: inset 0 0 18px rgba(200,255,99,0.06), 0 0 26px rgba(200,255,99,0.08);
}
.brand-mark span { display: block; width: 4px; border-radius: 3px; background: var(--lime); }
.brand-mark span:nth-child(1) { height: 8px; opacity: 0.65; }
.brand-mark span:nth-child(2) { height: 14px; opacity: 0.82; }
.brand-mark span:nth-child(3) { height: 19px; }
.brand-copy { display: flex; flex-direction: column; line-height: 0.92; letter-spacing: 0.08em; }
.brand-copy strong { font-size: 13px; font-weight: 900; }
.brand-copy em { font-size: 11px; font-style: normal; font-weight: 800; color: var(--lime); }
.header-center { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; }
.exchange-status { display: inline-flex; align-items: center; gap: 7px; color: var(--lime); font-weight: 800; }
.exchange-status i { display: block; width: 7px; height: 7px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 12px var(--lime); animation: statusPulse 2.4s ease-in-out infinite; }
.header-divider { width: 1px; height: 17px; background: var(--line-strong); }
.header-context { color: var(--muted-2); }
.user-chip { display: flex; align-items: center; gap: 10px; min-width: 190px; justify-content: flex-end; font-size: 12px; color: var(--text-soft); }
.user-avatar { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 9px; color: var(--bg); background: var(--lime); font-size: 11px; font-weight: 950; }
.user-meta { display: flex; flex-direction: column; gap: 2px; text-align: right; }
.user-meta strong { font-size: 12px; color: var(--text); }
.user-meta span { font-size: 9px; color: var(--muted); letter-spacing: 0.12em; text-transform: uppercase; }
.logout-btn { border: 0; background: transparent; color: var(--muted); font-size: 11px; padding: 4px 0; }
.logout-btn:hover { color: var(--red); }

/* Main shell */
.container { width: min(100% - 48px, 1180px); margin: 0 auto; padding: 34px 0 90px; }
.page-shell { animation: pageIn 0.3s ease both; }
.no-anim { animation: none !important; }
@keyframes pageIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin: 2px 0 26px; }
.page-heading-main { max-width: 700px; }
.eyebrow { margin-bottom: 9px; color: var(--lime); font-size: 10px; font-weight: 900; letter-spacing: 0.18em; text-transform: uppercase; }
.page-heading h1 { font-size: clamp(32px, 5vw, 56px); line-height: 0.98; letter-spacing: -0.065em; font-weight: 900; }
.page-heading h1 span { color: var(--cyan); }
.page-heading p { max-width: 600px; margin-top: 12px; color: var(--muted); font-size: 14px; line-height: 1.6; }
.heading-aside { text-align: right; color: var(--muted); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; }
.heading-aside strong { display: block; color: var(--text); font-size: 18px; letter-spacing: -0.02em; margin-bottom: 4px; }

/* Desktop navigation rail; mobile becomes bottom navigation */
nav.bottom {
  position: fixed;
  left: 18px;
  top: 92px;
  bottom: 18px;
  z-index: 35;
  width: var(--nav-width);
  padding: 12px 9px;
  border: 1px solid var(--line);
  border-radius: 22px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  background: rgba(13,18,25,0.82);
  box-shadow: var(--shadow-small);
  backdrop-filter: blur(20px);
}
.nav-brand { width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; color: var(--lime); background: var(--lime-soft); border: 1px solid rgba(200,255,99,0.24); font-size: 12px; font-weight: 950; letter-spacing: 0.08em; }
.nav-items { display: flex; flex-direction: column; align-items: center; gap: 7px; width: 100%; }
nav.bottom button { width: 100%; min-height: 61px; padding: 8px 4px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; border: 1px solid transparent; border-radius: 14px; color: var(--muted-2); background: transparent; font-size: 9px; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; transition: color .18s, background .18s, border-color .18s, transform .18s; }
nav.bottom button .icon { font-size: 19px; line-height: 1; filter: saturate(0.55); transition: filter .18s, transform .18s; }
nav.bottom button:hover { color: var(--text); background: rgba(255,255,255,0.045); border-color: var(--line); }
nav.bottom button:hover .icon { filter: saturate(1); transform: translateY(-2px); }
nav.bottom button.active { color: var(--bg); background: var(--lime); border-color: var(--lime); box-shadow: 0 8px 22px rgba(200,255,99,0.15); }
nav.bottom button.active .icon { filter: saturate(1); }
.nav-spacer { flex: 1; }
.nav-caption { color: var(--muted-2); font-size: 8px; writing-mode: vertical-rl; transform: rotate(180deg); letter-spacing: 0.16em; text-transform: uppercase; }

/* Panels and cards */
.card, .panel { position: relative; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(145deg, rgba(21,30,41,0.96), rgba(13,18,25,0.96)); box-shadow: var(--shadow-small); }
.card { padding: 22px; margin-bottom: 16px; }
.panel { padding: 22px; }
.card::before, .panel::before { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(120deg, rgba(255,255,255,0.035), transparent 24%, transparent 76%, rgba(121,232,255,0.025)); }
.card > *, .panel > * { position: relative; z-index: 1; }
.card h2, .panel h2 { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; color: var(--text-soft); font-size: 11px; font-weight: 900; letter-spacing: 0.15em; text-transform: uppercase; }
.card h2 .h2-icon, .panel h2 .h2-icon { color: var(--lime); font-size: 15px; filter: none; }
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding-bottom: 17px; margin-bottom: 5px; border-bottom: 1px solid var(--line); }
.panel-head h2 { margin-bottom: 0; }
.panel-head p { color: var(--muted); font-size: 12px; line-height: 1.45; text-align: right; }
.panel-kicker { color: var(--muted-2); font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; }

/* Market overview */
.market-meta { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; }
.season-chip, .live-chip, .token-chip { display: inline-flex; align-items: center; gap: 7px; min-height: 30px; padding: 7px 11px; border-radius: 999px; border: 1px solid var(--line-strong); color: var(--text-soft); background: rgba(255,255,255,0.035); font-size: 10px; font-weight: 800; letter-spacing: 0.09em; text-transform: uppercase; }
.live-chip { color: var(--lime); border-color: rgba(200,255,99,0.28); background: var(--lime-soft); }
.live-chip i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; box-shadow: 0 0 9px currentColor; }
.market-kpis { display: grid; grid-template-columns: 1.35fr 1fr 1fr 1fr; gap: 12px; margin-bottom: 16px; }
.metric-card { min-height: 126px; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(145deg, rgba(26,37,50,0.98), rgba(15,21,29,0.98)); box-shadow: var(--shadow-small); }
.metric-card.primary { border-color: rgba(200,255,99,0.24); background: radial-gradient(260px 110px at 90% 0%, rgba(200,255,99,0.11), transparent 70%), linear-gradient(145deg, rgba(31,47,40,0.98), rgba(15,21,29,0.98)); }
.metric-label { display: flex; justify-content: space-between; gap: 10px; color: var(--muted); font-size: 10px; font-weight: 850; letter-spacing: 0.13em; text-transform: uppercase; }
.metric-value { margin-top: 13px; color: var(--text); font-size: clamp(24px, 3vw, 35px); font-weight: 900; line-height: 1; letter-spacing: -0.06em; font-variant-numeric: tabular-nums; }
.metric-sub { margin-top: 8px; color: var(--muted); font-size: 11px; }
.metric-value.pos, .metric-sub.pos { color: var(--lime); }
.metric-value.neg, .metric-sub.neg { color: var(--red); }
.countdown { color: var(--amber); font-size: clamp(23px, 3vw, 32px); font-weight: 900; letter-spacing: -0.055em; font-variant-numeric: tabular-nums; }
.market-regime { display: inline-flex; align-items: center; gap: 9px; padding: 8px 12px; margin: 0 0 16px; border-radius: 999px; border: 1px solid var(--line-strong); color: var(--text-soft); background: rgba(255,255,255,0.035); font-size: 11px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; }
.regime-icon { font-size: 15px; }
.regime-bull { color: var(--lime); border-color: rgba(200,255,99,0.28); background: var(--lime-soft); }
.regime-bear { color: var(--red); border-color: rgba(255,113,128,0.28); background: var(--red-soft); }
.regime-chop { color: var(--amber); border-color: rgba(255,212,121,0.28); background: var(--amber-soft); }
.market-layout { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(290px, 0.75fr); gap: 16px; align-items: start; }
.market-sidebar { display: grid; gap: 16px; }

/* Ticker board */
.ticker-head { display: grid; grid-template-columns: 72px minmax(100px, 1fr) 70px 92px 86px; gap: 10px; align-items: center; padding: 0 12px 9px; color: var(--muted-2); font-size: 9px; font-weight: 900; letter-spacing: 0.13em; text-transform: uppercase; }
.ticker-head span:nth-last-child(-n+2) { text-align: right; }
.ticker-row { display: flex; align-items: center; gap: 10px; min-height: 58px; padding: 10px 12px; border: 1px solid transparent; border-radius: 13px; transition: background .18s, border-color .18s, transform .18s; }
.ticker-row:hover { border-color: var(--line-strong); background: rgba(255,255,255,0.045); transform: translateX(2px); }
.ticker-row:active { transform: scale(0.995); }
.ticker-sym { min-width: 52px; color: var(--text); font-size: 14px; font-weight: 950; letter-spacing: 0.02em; }
.ticker-name { min-width: 0; flex: 1; overflow: hidden; color: var(--muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.ticker-spark { width: 64px; height: 26px; flex: 0 0 64px; opacity: 0.92; }
.ticker-price { min-width: 82px; color: var(--text); font-size: 13px; font-weight: 850; text-align: right; font-variant-numeric: tabular-nums; }
.ticker-chg { min-width: 76px; color: var(--text-soft); font-size: 11px; font-weight: 850; text-align: right; font-variant-numeric: tabular-nums; }
.chg-pill { display: inline-flex; justify-content: center; min-width: 70px; padding: 5px 8px; border-radius: 8px; font-size: 10px; font-weight: 900; letter-spacing: 0.01em; font-variant-numeric: tabular-nums; }
.chg-pill.pos { color: var(--lime); background: var(--lime-soft); }
.chg-pill.neg { color: var(--red); background: var(--red-soft); }

/* News */
.news-item { padding: 14px 12px; border-bottom: 1px solid var(--line); border-radius: 11px; cursor: pointer; transition: background .16s, transform .16s; }
.news-item:last-child { border-bottom: 0; }
.news-item:hover { background: rgba(255,255,255,0.04); }
.news-item:active { transform: scale(0.995); }
.news-time { color: var(--muted-2); font-size: 10px; font-weight: 800; letter-spacing: 0.07em; text-transform: uppercase; }
.news-head { margin: 6px 0 4px; color: var(--text); font-size: 13px; font-weight: 750; line-height: 1.38; }
.news-effects { color: var(--muted); font-size: 11px; line-height: 1.45; }
.news-body { display: none; margin-top: 10px; color: var(--text-soft); font-size: 12px; line-height: 1.65; }
.news-item.open .news-body { display: block; }
.news-cat { display: inline-block; margin-left: 7px; padding: 3px 6px; border-radius: 5px; font-size: 8px; font-weight: 950; letter-spacing: 0.08em; text-transform: uppercase; vertical-align: 1px; }
.news-cat.global { color: var(--violet); background: var(--violet-soft); }
.news-cat.unexpected { color: var(--red); background: var(--red-soft); }
.news-cat.uncertain { color: var(--amber); background: var(--amber-soft); }
.news-cat.predictable { color: var(--cyan); background: var(--cyan-soft); }
.news-more { display: inline-flex; align-items: center; gap: 6px; margin-top: 12px; color: var(--cyan); font-size: 11px; font-weight: 850; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 42px; padding: 11px 17px; border: 1px solid transparent; border-radius: 11px; color: var(--bg); background: var(--lime); box-shadow: 0 8px 18px rgba(200,255,99,0.13); font-size: 12px; font-weight: 950; letter-spacing: 0.04em; text-transform: uppercase; transition: transform .15s, filter .15s, box-shadow .15s; }
.btn:hover { filter: brightness(1.08); box-shadow: 0 10px 24px rgba(200,255,99,0.19); }
.btn:active { transform: translateY(1px); }
.btn.green { color: var(--bg); background: var(--lime); }
.btn.red { color: #fff; background: var(--red); box-shadow: 0 8px 18px rgba(255,113,128,0.14); }
.btn.red:hover { box-shadow: 0 10px 24px rgba(255,113,128,0.2); }
.btn.ghost { color: var(--text-soft); background: rgba(255,255,255,0.035); border-color: var(--line-strong); box-shadow: none; }
.btn.ghost:hover { color: var(--text); background: rgba(255,255,255,0.07); }
.btn.small { min-height: 32px; padding: 7px 11px; border-radius: 9px; font-size: 10px; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* Forms */
input, select { width: 100%; min-height: 44px; border: 1px solid var(--line-strong); border-radius: 11px; outline: 0; color: var(--text); background: rgba(5,8,12,0.6); padding: 11px 13px; font-size: 13px; transition: border-color .16s, box-shadow .16s, background .16s; }
input::placeholder { color: var(--muted-2); }
input:focus, select:focus { border-color: var(--lime); background: rgba(5,8,12,0.8); box-shadow: 0 0 0 3px var(--lime-soft); }
label { display: block; margin-bottom: 7px; color: var(--muted); font-size: 10px; font-weight: 900; letter-spacing: 0.12em; text-transform: uppercase; }
.form-row { margin-bottom: 15px; }

/* Tabs */
.tabs { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 17px; padding: 4px; border: 1px solid var(--line); border-radius: 13px; background: rgba(0,0,0,0.15); width: fit-content; }
.tab { padding: 8px 14px; border: 1px solid transparent; border-radius: 9px; color: var(--muted); background: transparent; cursor: pointer; font-size: 10px; font-weight: 900; letter-spacing: 0.08em; text-transform: uppercase; transition: all .16s; }
.tab:hover { color: var(--text); background: rgba(255,255,255,0.04); }
.tab.active { color: var(--bg); background: var(--lime); }

/* Company screen */
.back-link { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 19px; color: var(--muted); font-size: 11px; font-weight: 850; letter-spacing: 0.1em; text-transform: uppercase; }
.back-link:hover { color: var(--lime); }
.company-shell { animation: pageIn .3s ease both; }
.company-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 19px; }
.company-symbol { display: flex; align-items: center; gap: 13px; }
.company-badge { width: 48px; height: 48px; display: grid; place-items: center; border: 1px solid rgba(121,232,255,0.28); border-radius: 14px; color: var(--cyan); background: var(--cyan-soft); font-size: 13px; font-weight: 950; }
.company-symbol h1 { font-size: 30px; line-height: 1; letter-spacing: -0.05em; }
.company-symbol p { margin-top: 5px; color: var(--muted); font-size: 12px; }
.price-block { text-align: right; }
.price-block .big-value { font-size: 36px; }
.price-block .big-sub { margin-top: 6px; font-size: 11px; font-weight: 850; }
.company-chart-panel { margin-bottom: 16px; }
.chart-toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; color: var(--muted); font-size: 10px; letter-spacing: .1em; text-transform: uppercase; }
.chart-box { position: relative; width: 100%; height: 235px; }
canvas { display: block; width: 100%; height: 100%; }
.fund-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 17px; }
.fund-cell { min-height: 66px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 11px; background: rgba(255,255,255,0.025); }
.fund-cell .fc-label { color: var(--muted-2); font-size: 9px; font-weight: 900; letter-spacing: .11em; text-transform: uppercase; }
.fund-cell .fc-value { margin-top: 7px; color: var(--text); font-size: 14px; font-weight: 900; font-variant-numeric: tabular-nums; }
.company-description { max-width: 760px; margin-top: 15px; color: var(--muted); font-size: 12px; line-height: 1.65; }
.company-actions { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 20px; }
.position-card { margin-top: 17px; padding: 15px; border: 1px solid var(--line); border-radius: 13px; background: rgba(0,0,0,0.14); }

/* Portfolio */
.portfolio-hero { display: grid; grid-template-columns: 1.25fr 1fr 1fr; gap: 12px; margin-bottom: 16px; }
.portfolio-value-card { padding: 23px; border: 1px solid rgba(200,255,99,0.23); border-radius: var(--radius); background: radial-gradient(300px 130px at 100% 0%, rgba(200,255,99,0.12), transparent 72%), linear-gradient(145deg, rgba(31,47,40,0.95), rgba(15,21,29,0.98)); box-shadow: var(--shadow-small); }
.portfolio-value-card .metric-value { font-size: clamp(31px, 4vw, 46px); }
.portfolio-layout { display: grid; grid-template-columns: 1.3fr 0.7fr; gap: 16px; margin-bottom: 16px; }
.allocation-empty { color: var(--muted); font-size: 12px; line-height: 1.6; }
.alloc-bar { display: flex; height: 12px; overflow: hidden; margin: 19px 0 14px; border-radius: 999px; background: rgba(255,255,255,0.06); }
.alloc-seg { min-width: 2px; height: 100%; }
.alloc-legend { display: flex; flex-wrap: wrap; gap: 9px 13px; color: var(--muted); font-size: 10px; }
.alloc-dot { display: inline-block; width: 7px; height: 7px; margin-right: 4px; border-radius: 50%; }
.positions-list { display: grid; gap: 4px; }
.position-header { display: grid; grid-template-columns: 72px 1fr 115px 110px; gap: 10px; padding: 0 12px 9px; color: var(--muted-2); font-size: 9px; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; }
.position-header span:nth-last-child(-n+2) { text-align: right; }


/* Trade history */
.trade-history-panel { margin-top: 16px; }
.trade-summary { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; color: var(--muted); font-size: 10px; font-weight: 800; }
.trade-summary span { padding: 6px 8px; border: 1px solid var(--line); border-radius: 999px; }
.trade-history-head, .trade-row { display: grid; grid-template-columns: 72px 1fr 125px 125px; gap: 12px; align-items: center; }
.trade-history-head { padding: 0 12px 9px; color: var(--muted-2); font-size: 9px; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; }
.trade-history-head span:nth-last-child(-n+2) { text-align: right; }
.trade-history { display: grid; gap: 3px; }
.trade-row { min-height: 55px; padding: 9px 12px; border-top: 1px solid var(--line); border-radius: 10px; }
.trade-row:hover { background: rgba(255,255,255,0.035); }
.trade-side { width: max-content; padding: 5px 7px; border-radius: 5px; font-size: 9px; font-weight: 950; letter-spacing: .08em; }
.trade-buy { color: var(--lime); background: var(--lime-soft); }
.trade-sell { color: var(--red); background: var(--red-soft); }
.trade-symbol, .trade-execution { display: flex; flex-direction: column; gap: 3px; }
.trade-symbol strong { color: var(--text); font-size: 12px; }
.trade-symbol small, .trade-shares small, .trade-execution small { color: var(--muted-2); font-size: 10px; }
.trade-shares, .trade-execution { color: var(--text-soft); font-size: 12px; font-weight: 800; font-variant-numeric: tabular-nums; }
.trade-shares, .trade-execution { text-align: right; }
.trade-execution small { color: var(--muted); }

/* Leaderboard */
.leaderboard-hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 20px; }
.leaderboard-hero h1 { font-size: 35px; line-height: 1; letter-spacing: -.055em; }
.leaderboard-hero p { margin-top: 8px; color: var(--muted); font-size: 12px; }
.lb-row { display: flex; align-items: center; min-height: 58px; padding: 10px 12px; border-bottom: 1px solid var(--line); border-radius: 12px; }
.lb-row:last-child { border-bottom: 0; }
.lb-row:hover { background: rgba(255,255,255,0.035); }
.lb-rank { width: 46px; color: var(--muted-2); font-size: 15px; font-weight: 950; }
.lb-rank.top1 { color: var(--amber); }
.lb-rank.top2 { color: #c8d2da; }
.lb-rank.top3 { color: #d49b68; }
.lb-name { flex: 1; color: var(--text); font-size: 13px; font-weight: 750; }
.lb-val { margin-right: 14px; color: var(--text-soft); font-size: 12px; font-weight: 850; font-variant-numeric: tabular-nums; }
.lb-you { display: inline-block; margin-left: 7px; padding: 3px 6px; border-radius: 5px; color: var(--bg); background: var(--lime); font-size: 8px; font-weight: 950; letter-spacing: .08em; }

/* More, groups, research, stats, admin */
.more-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.more-card { min-height: 125px; padding: 18px; border: 1px solid var(--line); border-radius: 15px; background: rgba(255,255,255,0.025); cursor: pointer; transition: transform .18s, border-color .18s, background .18s; }
.more-card:hover { transform: translateY(-3px); border-color: var(--line-strong); background: rgba(255,255,255,0.055); }
.more-icon { font-size: 24px; }
.more-card h3 { margin-top: 15px; color: var(--text); font-size: 14px; }
.more-card p { margin-top: 5px; color: var(--muted); font-size: 11px; line-height: 1.45; }
.group-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.group-card { min-height: 190px; }
.group-title { color: var(--text); font-size: 17px; font-weight: 850; }
.group-meta { margin-top: 6px; color: var(--muted); font-size: 11px; }
.invite-code { display: inline-flex; margin-top: 19px; padding: 9px 12px; border: 1px dashed rgba(121,232,255,0.35); border-radius: 9px; color: var(--cyan); background: var(--cyan-soft); font-size: 17px; font-weight: 950; letter-spacing: .14em; }
.group-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.split-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.token-chip { color: var(--amber); border-color: rgba(255,212,121,.28); background: var(--amber-soft); }
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.stat-tile { padding: 16px; border: 1px solid var(--line); border-radius: 13px; background: rgba(255,255,255,.025); }
.stat-tile .st-label { color: var(--muted-2); font-size: 9px; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; }
.stat-tile .st-value { margin-top: 9px; color: var(--text); font-size: 23px; font-weight: 900; font-variant-numeric: tabular-nums; }
.achievement-row { display: flex; align-items: center; gap: 12px; padding: 13px 10px; border-bottom: 1px solid var(--line); }
.achievement-row:last-child { border-bottom: 0; }
.achievement-icon { width: 35px; text-align: center; font-size: 22px; }
.achievement-copy { flex: 1; color: var(--muted); font-size: 11px; line-height: 1.45; }
.achievement-copy b { color: var(--text); font-size: 12px; }
.achievement-status { color: var(--lime); font-size: 12px; font-weight: 950; }
.admin-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }

/* Empty state */
.empty-state { padding: 48px 25px; text-align: center; border: 1px dashed var(--line-strong); border-radius: var(--radius); background: rgba(255,255,255,0.018); }
.empty-icon { font-size: 34px; }
.empty-state h2 { justify-content: center; margin-top: 13px; color: var(--text); font-size: 20px; letter-spacing: -.03em; text-transform: none; }
.empty-state p { max-width: 420px; margin: 8px auto 18px; color: var(--muted); font-size: 12px; line-height: 1.6; }

/* Auth */
.auth-layout { min-height: calc(100vh - 150px); display: grid; grid-template-columns: 1.05fr .8fr; align-items: center; gap: 70px; max-width: 1050px; margin: 0 auto; }
.auth-showcase { padding: 25px 0; }
.auth-wordmark { margin-top: 18px; color: var(--text); font-size: clamp(48px, 8vw, 92px); line-height: .82; font-weight: 950; letter-spacing: -.09em; }
.auth-wordmark span { color: var(--lime); }
.auth-lede { max-width: 510px; margin-top: 28px; color: var(--text-soft); font-size: 16px; line-height: 1.6; }
.auth-signal-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; max-width: 500px; margin-top: 35px; }
.auth-signal { padding: 13px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.025); }
.auth-signal strong { display: block; color: var(--lime); font-size: 15px; }
.auth-signal span { display: block; margin-top: 5px; color: var(--muted); font-size: 9px; letter-spacing: .08em; text-transform: uppercase; }
.auth-card { padding: 28px; }
.auth-card h1 { font-size: 25px; letter-spacing: -.05em; }
.auth-card .auth-subtitle { margin-top: 8px; margin-bottom: 24px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.auth-card .btn { width: 100%; }
.auth-note { margin-top: 15px; color: var(--muted-2); font-size: 10px; line-height: 1.5; text-align: center; }

/* Modal */
.modal-backdrop { position: fixed; inset: 0; z-index: 80; display: flex; align-items: center; justify-content: center; padding: 18px; background: rgba(2,4,7,.78); backdrop-filter: blur(10px); animation: fadeIn .18s ease; }
.modal { width: min(100%, 460px); max-height: 88vh; overflow: auto; padding: 25px; border: 1px solid var(--line-strong); border-radius: 20px; background: linear-gradient(145deg, var(--panel-3), var(--panel)); box-shadow: 0 35px 100px rgba(0,0,0,.62); animation: modalIn .24s cubic-bezier(.2,.9,.3,1.15); }
.modal h3 { margin-bottom: 19px; font-size: 20px; letter-spacing: -.04em; }
.live-dot { display: inline-block; width: 6px; height: 6px; margin-left: 4px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 10px var(--lime); animation: statusPulse 2s ease-in-out infinite; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes modalIn { from { opacity: 0; transform: translateY(12px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes statusPulse { 0%,100% { opacity: 1; } 50% { opacity: .35; } }

/* Toasts */
#toasts { position: fixed; top: 84px; right: 22px; z-index: 100; display: flex; flex-direction: column; gap: 9px; width: min(340px, calc(100vw - 32px)); }
.toast { padding: 13px 15px; border: 1px solid var(--line-strong); border-left: 3px solid var(--cyan); border-radius: 12px; color: var(--text); background: rgba(21,30,41,.96); box-shadow: var(--shadow-small); font-size: 12px; line-height: 1.4; animation: toastIn .28s cubic-bezier(.2,.9,.3,1.1); }
.toast.green { border-left-color: var(--lime); }
.toast.red { border-left-color: var(--red); }
@keyframes toastIn { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }

/* Utilities */
.muted { color: var(--muted); }
.small { font-size: 11px; }
.mt8 { margin-top: 8px; } .mt16 { margin-top: 16px; }
.mb8 { margin-bottom: 8px; }
.flex { display: flex; align-items: center; gap: 10px; }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.pos { color: var(--lime); }
.neg { color: var(--red); }
.hidden { display: none !important; }
.you-row { background: var(--lime-soft); }
.you-tag { padding: 3px 6px; border-radius: 5px; color: var(--bg); background: var(--lime); font-size: 8px; font-weight: 950; letter-spacing: .08em; text-transform: uppercase; }

/* Responsive */
@media (min-width: 921px) {
  .container { width: min(calc(100% - 170px), 1180px); margin-left: 132px; margin-right: 38px; }
  .header-inner { padding-left: 132px; }
}
@media (max-width: 920px) {
  .header-center { display: none; }
  .market-layout, .portfolio-layout, .split-grid { grid-template-columns: 1fr; }
  .market-kpis { grid-template-columns: repeat(2, 1fr); }
  .auth-layout { grid-template-columns: 1fr; gap: 25px; max-width: 620px; }
  .auth-showcase { text-align: center; }
  .auth-lede, .auth-signal-grid { margin-left: auto; margin-right: auto; }
  .auth-signal-grid { text-align: left; }
}
@media (max-width: 680px) {
  body { padding-bottom: 82px; }
  .site-header { height: 62px; }
  .header-inner { padding: 0 15px; }
  .brand { min-width: auto; }
  .brand-copy { display: none; }
  .user-chip { min-width: auto; }
  .user-meta { display: none; }
  .container { width: calc(100% - 28px); padding-top: 24px; }
  nav.bottom { left: 10px; right: 10px; top: auto; bottom: 10px; width: auto; height: 66px; padding: 6px; border-radius: 18px; flex-direction: row; gap: 0; }
  .nav-brand, .nav-spacer, .nav-caption { display: none; }
  .nav-items { flex-direction: row; justify-content: space-around; gap: 3px; }
  nav.bottom button { min-height: 52px; border-radius: 12px; font-size: 8px; }
  nav.bottom button .icon { font-size: 17px; }
  .page-heading { align-items: flex-start; flex-direction: column; gap: 14px; margin-bottom: 20px; }
  .heading-aside { text-align: left; }
  .market-meta { justify-content: flex-start; }
  .market-kpis { grid-template-columns: 1fr 1fr; gap: 8px; }
  .metric-card { min-height: 110px; padding: 14px; }
  .metric-card.primary { grid-column: 1 / -1; }
  .metric-value { font-size: 25px; }
  .market-layout { gap: 12px; }
  .panel, .card { padding: 16px; border-radius: 15px; }
  .ticker-head { display: none; }
  .ticker-row { min-height: 54px; padding: 9px 6px; gap: 7px; }
  .ticker-name { display: none; }
  .ticker-spark { margin-left: auto; }
  .ticker-price { min-width: 70px; font-size: 12px; }
  .chg-pill { min-width: 63px; padding-left: 5px; padding-right: 5px; font-size: 9px; }
  .panel-head { padding-bottom: 13px; }
  .panel-head p { display: none; }
  .company-top { flex-direction: column; gap: 17px; }
  .price-block { width: 100%; text-align: left; }
  .fund-grid { grid-template-columns: repeat(2, 1fr); }
  .portfolio-hero { grid-template-columns: 1fr 1fr; gap: 8px; }
  .portfolio-value-card { grid-column: 1 / -1; padding: 19px; }
  .position-header { display: none; }
  .trade-history-head { display: none; }
  .trade-history .trade-row { grid-template-columns: 55px 1fr auto; gap: 8px; padding-left: 6px; padding-right: 6px; }
  .trade-execution { grid-column: 3; grid-row: 1; }
  .trade-shares { grid-column: 2; grid-row: 2; text-align: left; font-size: 10px; }
  .trade-symbol small { font-size: 9px; }
  .trade-summary { justify-content: flex-start; margin-top: 8px; }
  .position-row .ticker-name { display: block; }
  .more-grid, .group-grid, .stat-grid { grid-template-columns: 1fr; }
  .leaderboard-hero { align-items: flex-start; flex-direction: column; gap: 12px; }
  .auth-layout { min-height: auto; }
  .auth-showcase { padding-top: 10px; }
  .auth-wordmark { font-size: 55px; }
  .auth-signal-grid { gap: 6px; }
  .auth-signal { padding: 10px 8px; }
  .auth-signal strong { font-size: 13px; }
  .auth-signal span { font-size: 8px; }
  .auth-card { padding: 20px; }
  #toasts { top: 72px; right: 14px; }
}
@media (max-width: 390px) {
  .market-kpis, .portfolio-hero { grid-template-columns: 1fr; }
  .metric-card.primary, .portfolio-value-card { grid-column: auto; }
  .ticker-spark { display: none; }
  .company-actions .btn { flex: 1; }
}

/* Final polish for the redesigned component states */
.big-value { color: var(--text); font-size: 32px; font-weight: 950; line-height: 1; letter-spacing: -.06em; font-variant-numeric: tabular-nums; }
.big-sub { color: var(--muted); font-size: 12px; line-height: 1.35; }
.ticker-name { display: flex; flex-direction: column; gap: 3px; }
.ticker-name small { color: var(--muted-2); font-size: 9px; font-weight: 750; letter-spacing: .06em; text-transform: uppercase; }
.market-regime-row { display: flex; align-items: center; justify-content: space-between; gap: 15px; flex-wrap: wrap; margin-bottom: 16px; }
.market-regime-row .market-regime { margin-bottom: 0; }
.market-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.panel-note { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; line-height: 1.6; }
.empty-mini { padding: 18px 4px; color: var(--muted); font-size: 11px; line-height: 1.55; }
.allocation-empty { min-height: 105px; display: grid; place-items: center; text-align: center; }
.position-row .ticker-name small { display: inline; margin-left: 4px; color: var(--muted-2); font-size: 9px; }
.position-row .chg-pill small { margin-left: 3px; color: inherit; font-size: 9px; opacity: .8; }
@media (max-width: 680px) {
  .market-regime-row { align-items: flex-start; flex-direction: column; gap: 9px; }
  .market-meta { justify-content: flex-start; }
  .big-value { font-size: 29px; }
}
