:root {
  --bg: #050810;
  --bg-soft: #080d16;
  --card: #0c1320;
  --card-2: #111a2a;
  --card-3: #162135;
  --line: #1b2739;
  --line-soft: #131d2c;
  --text: #e8effa;
  --muted: #8797ae;
  --muted-2: #5f6e85;
  --accent: #38e0c8;
  --accent-2: #5b8cff;
  --accent-soft: rgba(56, 224, 200, 0.12);
  --green: #34d399;
  --green-soft: rgba(52, 211, 153, 0.12);
  --red: #fb7185;
  --red-soft: rgba(251, 113, 133, 0.12);
  --amber: #fbbf24;
  --amber-soft: rgba(251, 191, 36, 0.12);
  --violet: #a78bfa;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 26px 70px rgba(0, 0, 0, 0.5);
  --font: "Segoe UI", ui-sans-serif, system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --mono: "Cascadia Code", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, h4, p { margin: 0; }
h1, h2, h3 { letter-spacing: -0.025em; line-height: 1.15; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
img, svg { display: block; max-width: 100%; }
ul, ol, dl, dd { margin: 0; padding: 0; }
li { list-style: none; }
::selection { background: rgba(56, 224, 200, 0.28); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: #223048; border-radius: 99px; border: 2px solid var(--bg); }

.hidden { display: none !important; }
.pos { color: var(--green) !important; }
.neg { color: var(--red) !important; }
.mono { font-family: var(--mono); }
.eyebrow {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 750;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
}
.micro-disclaimer { color: var(--muted-2); font-size: 12px; line-height: 1.6; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 11px;
  font-size: 14px;
  font-weight: 650;
  transition: transform 0.15s, background 0.15s, border-color 0.15s, opacity 0.15s;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn-primary {
  background: linear-gradient(135deg, #38e0c8, #2aa8a0);
  color: #03120f;
  box-shadow: 0 12px 32px rgba(56, 224, 200, 0.22);
}
.btn-primary:hover { background: linear-gradient(135deg, #4cecd5, #31bdb2); }
.btn-blue {
  background: linear-gradient(135deg, #5b8cff, #4066e0);
  color: #fff;
  box-shadow: 0 12px 32px rgba(91, 140, 255, 0.24);
}
.btn-ghost {
  background: rgba(255, 255, 255, 0.03);
  border-color: var(--line);
  color: var(--text);
}
.btn-ghost:hover { border-color: #2c3d55; background: rgba(255, 255, 255, 0.055); }
.btn-danger { background: var(--red); color: #2a0710; }
.btn-danger:hover { background: #ff8a9b; }
.btn-danger-ghost { background: var(--red-soft); border-color: rgba(251, 113, 133, 0.32); color: #ffa5b1; }
.btn-sm { min-height: 34px; padding: 0 12px; font-size: 12.5px; border-radius: 9px; }
.btn-lg { min-height: 50px; padding: 0 24px; font-size: 15px; border-radius: 13px; }
.btn-block { width: 100%; }
.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: transparent;
  color: var(--muted);
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.icon-btn:hover { color: var(--text); border-color: #2c3d55; background: rgba(255, 255, 255, 0.04); }
.icon-btn svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

/* Tags */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.025);
  font-size: 10.5px;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}
.tag.live { border-color: rgba(56, 224, 200, 0.32); background: var(--accent-soft); color: var(--accent); }
.tag.paper { border-color: rgba(167, 139, 250, 0.32); background: rgba(167, 139, 250, 0.1); color: var(--violet); }
.tag.green { border-color: rgba(52, 211, 153, 0.32); background: var(--green-soft); color: var(--green); }
.tag.red { border-color: rgba(251, 113, 133, 0.32); background: var(--red-soft); color: var(--red); }
.tag.warn { border-color: rgba(251, 191, 36, 0.32); background: var(--amber-soft); color: var(--amber); }
.mini-tag {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line-soft);
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted-2);
  white-space: nowrap;
}
.dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; flex: none; }
.dot.green { background: var(--green); box-shadow: 0 0 10px rgba(52, 211, 153, 0.7); }
.dot.red { background: var(--red); }
.dot.accent { background: var(--accent); box-shadow: 0 0 10px rgba(56, 224, 200, 0.6); }
.dot.amber { background: var(--amber); }
.dot.violet { background: var(--violet); }
.mini-tag.red { color: var(--red); border-color: rgba(251, 113, 133, 0.3); background: var(--red-soft); }
.mini-tag.amber { color: var(--amber); border-color: rgba(251, 191, 36, 0.3); background: var(--amber-soft); }

/* Brand */
.brand { display: inline-flex; align-items: center; gap: 11px; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: linear-gradient(135deg, rgba(56, 224, 200, 0.2), rgba(91, 140, 255, 0.15));
  border: 1px solid rgba(56, 224, 200, 0.38);
  color: var(--accent);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: -0.03em;
}
.brand-word { font-size: 19px; font-weight: 760; letter-spacing: -0.045em; }
.brand-word em { font-style: normal; color: var(--accent); }

/* Forms */
.field { display: flex; flex-direction: column; gap: 7px; }
.field > span { font-size: 12px; font-weight: 650; color: var(--muted); }
.field > small { font-size: 11.5px; color: var(--muted-2); line-height: 1.5; }
.field input, .field select {
  width: 100%;
  height: 44px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg-soft);
  color: var(--text);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
.field select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) 19px, calc(100% - 13px) 19px;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 34px;
}
.field input::placeholder { color: #45546a; }
.field input:focus, .field select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(56, 224, 200, 0.14);
  background: #0a111b;
}
.field input:disabled { opacity: 0.55; }
.form-error { min-height: 18px; color: var(--red); font-size: 12.5px; }
.form-ok { color: var(--green); }
.stack { display: flex; flex-direction: column; gap: 16px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.button-row { display: flex; flex-wrap: wrap; gap: 10px; }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line-soft); }
.switch-row:last-child { border-bottom: 0; }
.switch-row strong { display: block; font-size: 13.5px; font-weight: 650; }
.switch-row small { display: block; margin-top: 2px; color: var(--muted-2); font-size: 11.5px; line-height: 1.5; }
.switch { position: relative; width: 46px; height: 26px; flex: none; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.switch span {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: #1a2537;
  border: 1px solid var(--line);
  transition: background 0.18s, border-color 0.18s;
}
.switch span::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #7d8ca3;
  transition: transform 0.18s, background 0.18s;
}
.switch input:checked + span { background: rgba(56, 224, 200, 0.22); border-color: rgba(56, 224, 200, 0.5); }
.switch input:checked + span::after { transform: translateX(20px); background: var(--accent); }
.switch input:disabled + span { opacity: 0.5; }

/* ===== Landing ===== */
.landing-body, .auth-body {
  background:
    radial-gradient(ellipse 65% 50% at 15% -10%, rgba(56, 224, 200, 0.14), transparent 60%),
    radial-gradient(ellipse 55% 45% at 92% 5%, rgba(91, 140, 255, 0.13), transparent 62%),
    var(--bg);
}
.landing-nav {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 30px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px 28px;
  backdrop-filter: blur(14px);
}
.landing-links { display: flex; gap: 26px; margin-left: auto; }
.landing-links a { color: var(--muted); font-size: 13.5px; font-weight: 600; }
.landing-links a:hover { color: var(--text); }
.landing-actions { display: flex; gap: 10px; margin-left: 10px; }
.hero {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 54px;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
  padding: 66px 28px 54px;
}
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.025);
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 600;
}
.hero-badge i { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px var(--accent); }
.hero h1 {
  margin: 22px 0 20px;
  font-size: clamp(42px, 6vw, 74px);
  font-weight: 790;
  letter-spacing: -0.058em;
  line-height: 1;
}
.hero h1 span {
  background: linear-gradient(100deg, #7af7e6 5%, #38e0c8 40%, #5b8cff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero-sub { max-width: 560px; color: var(--muted); font-size: 16.5px; line-height: 1.65; }
.hero-sub strong { color: var(--text); font-weight: 650; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin: 28px 0 32px; }
.hero-facts { display: flex; gap: 34px; padding: 20px 0 22px; border-top: 1px solid var(--line-soft); }
.hero-facts div { display: flex; flex-direction: column; gap: 3px; }
.hero-facts strong { font-size: 23px; font-weight: 760; letter-spacing: -0.04em; }
.hero-facts span { color: var(--muted-2); font-size: 11.5px; }
.hero-visual { position: relative; min-width: 0; }
.market-card {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(17, 26, 42, 0.96), rgba(9, 14, 22, 0.98));
  box-shadow: var(--shadow);
  overflow: hidden;
}
.loop-diagram { padding: 24px 22px 6px; }
.loop-diagram svg { width: 100%; height: 210px; }
.loop-node { fill: #0f1929; stroke: #2a3b55; stroke-width: 1.4; }
.loop-node.hit { stroke: var(--accent); }
.loop-label { fill: #cddbef; font-family: var(--font); font-size: 11px; font-weight: 650; }
.loop-sub { fill: var(--muted-2); font-family: var(--mono); font-size: 9px; }
.loop-arrow { stroke: var(--accent); stroke-width: 1.6; fill: none; opacity: 0.75; }
.loop-mid { fill: var(--accent); font-family: var(--mono); font-size: 12px; font-weight: 700; }
.market-card-head { display: flex; align-items: flex-start; justify-content: space-between; padding: 20px 22px 0; }
.market-card-head .ticker { display: block; color: var(--muted-2); font-size: 10.5px; font-weight: 750; letter-spacing: 0.12em; }
.market-card-head strong { display: block; margin-top: 4px; font-family: var(--mono); font-size: 24px; font-weight: 650; letter-spacing: -0.03em; }
.trade-strip { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line-soft); margin-top: 6px; }
.trade-strip div { padding: 13px 14px; border-right: 1px solid var(--line-soft); }
.trade-strip div:last-child { border-right: 0; }
.trade-strip span { display: block; color: var(--muted-2); font-size: 10px; text-transform: uppercase; letter-spacing: 0.07em; }
.trade-strip strong { display: block; margin-top: 4px; font-size: 12.5px; font-weight: 650; }
.float-card {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 15px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(12, 19, 32, 0.94);
  backdrop-filter: blur(12px);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4);
}
.float-card strong { display: block; font-size: 12px; font-weight: 650; }
.float-card small { display: block; color: var(--muted-2); font-size: 10px; margin-top: 1px; }
.float-top { top: -18px; right: -14px; }
.float-bottom { bottom: -16px; left: -14px; }
.logos-strip {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 18px;
  padding: 22px 28px;
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
  color: var(--muted-2);
  font-size: 12px;
}
.logos-strip strong { color: #93a1b7; font-weight: 650; font-size: 12.5px; }
.logos-strip i { width: 3px; height: 3px; border-radius: 50%; background: #33415a; }
.section { max-width: 1200px; margin: 0 auto; padding: 84px 28px; }
.section-head { max-width: 640px; margin-bottom: 38px; }
.section-head h2 { margin: 12px 0 12px; font-size: clamp(29px, 4vw, 44px); font-weight: 760; }
.section-head p { color: var(--muted); font-size: 15.5px; }
.feature-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.feature {
  padding: 24px 20px 22px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(17, 26, 42, 0.72), rgba(9, 14, 22, 0.55));
  transition: border-color 0.2s, transform 0.2s;
}
.feature:hover { border-color: #2c3d55; transform: translateY(-3px); }
.feature-num { display: block; color: var(--accent); font-family: var(--mono); font-size: 11px; font-weight: 700; letter-spacing: 0.1em; }
.feature h3 { margin: 40px 0 10px; font-size: 17px; font-weight: 700; }
.feature p { color: var(--muted); font-size: 13px; line-height: 1.65; }
.split-section { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 60px; align-items: center; border-top: 1px solid var(--line-soft); }
.split-copy h2 { margin: 12px 0 16px; font-size: clamp(29px, 4vw, 44px); font-weight: 760; }
.split-copy > p { color: var(--muted); font-size: 15.5px; line-height: 1.7; }
.check-list { display: flex; flex-direction: column; gap: 11px; margin: 24px 0 28px; }
.check-list li { position: relative; padding-left: 26px; color: #b9c4d4; font-size: 13.5px; }
.check-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 6px;
  width: 14px;
  height: 8px;
  border-left: 2px solid var(--accent);
  border-bottom: 2px solid var(--accent);
  transform: rotate(-45deg);
}
.split-panel {
  padding: 8px 26px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(17, 26, 42, 0.9), rgba(9, 14, 22, 0.8));
  box-shadow: var(--shadow);
}
.panel-row { display: flex; align-items: center; justify-content: space-between; padding: 15px 0; border-bottom: 1px solid var(--line-soft); font-size: 13.5px; }
.panel-row span { color: var(--muted); }
.panel-row strong { font-family: var(--mono); font-size: 12.5px; font-weight: 650; }
.panel-note { padding: 16px 0 18px; color: var(--muted-2); font-size: 11.5px; line-height: 1.6; }
.risk-section { padding-top: 0; }
.risk-card {
  padding: 44px 44px 40px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background:
    radial-gradient(ellipse 50% 100% at 100% 0%, rgba(56, 224, 200, 0.1), transparent 70%),
    linear-gradient(180deg, #0f1929, #080d16);
  overflow: hidden;
}
.risk-card h2 { margin: 12px 0 14px; font-size: clamp(26px, 3.4vw, 38px); font-weight: 760; }
.risk-card p { max-width: 800px; color: var(--muted); font-size: 14px; line-height: 1.75; }
.risk-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.landing-footer {
  display: flex;
  align-items: center;
  gap: 22px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 30px 28px 42px;
  border-top: 1px solid var(--line-soft);
  color: var(--muted-2);
  font-size: 12px;
}
.landing-footer p { margin-left: auto; }
.landing-footer > a { color: var(--muted); }
.landing-footer > a:hover { color: var(--text); }

/* ===== Auth ===== */
.auth-body { display: flex; align-items: center; justify-content: center; padding: 40px 20px; }
.auth-wrap { width: 100%; max-width: 432px; }
.auth-brand { margin-bottom: 24px; }
.auth-card {
  padding: 34px 32px 30px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(17, 26, 42, 0.96), rgba(8, 13, 22, 0.98));
  box-shadow: var(--shadow);
}
.auth-card h1 { margin: 9px 0 8px; font-size: 30px; font-weight: 770; letter-spacing: -0.04em; }
.auth-sub { margin-bottom: 26px; color: var(--muted); font-size: 13.5px; }
.auth-card form { display: flex; flex-direction: column; gap: 15px; }
.auth-switch { margin-top: 22px; text-align: center; color: var(--muted); font-size: 13px; }
.auth-switch a { color: var(--accent); font-weight: 650; }
.auth-switch a:hover { text-decoration: underline; }
.auth-legal { margin-top: 22px; text-align: center; color: var(--muted-2); font-size: 11px; line-height: 1.6; }

/* ===== App shell ===== */
.app-body { background: var(--bg); }
.app-shell { display: flex; min-height: 100vh; }
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 60;
  display: flex;
  flex-direction: column;
  width: 238px;
  padding: 22px 16px;
  border-right: 1px solid var(--line-soft);
  background: #060a12;
}
.sidebar .brand { padding: 0 8px 22px; }
.nav { display: flex; flex-direction: column; gap: 4px; }
.nav-link {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 11px;
  border-radius: 10px;
  color: var(--muted);
  font-size: 13.5px;
  font-weight: 600;
  transition: color 0.15s, background 0.15s;
}
.nav-link svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; opacity: 0.85; }
.nav-link:hover { color: var(--text); background: rgba(255, 255, 255, 0.035); }
.nav-link.active { color: #b9f7ee; background: rgba(56, 224, 200, 0.1); box-shadow: inset 0 0 0 1px rgba(56, 224, 200, 0.16); }
.nav-link.active svg { opacity: 1; }
.nav-sep { margin: 14px 11px 8px; font-size: 9.5px; font-weight: 750; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted-2); }
.sidebar-bottom { display: flex; align-items: center; gap: 8px; margin-top: auto; padding-top: 18px; border-top: 1px solid var(--line-soft); }
.user-chip { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; }
.avatar {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: none;
  border-radius: 9px;
  background: linear-gradient(135deg, rgba(56, 224, 200, 0.28), rgba(91, 140, 255, 0.16));
  border: 1px solid rgba(56, 224, 200, 0.3);
  color: #b9f7ee;
  font-size: 13px;
  font-weight: 700;
}
.user-meta { min-width: 0; }
.user-meta strong { display: block; font-size: 12.5px; font-weight: 650; overflow: hidden; text-overflow: ellipsis; }
.user-meta small { display: block; color: var(--muted-2); font-size: 10px; text-transform: uppercase; letter-spacing: 0.06em; }
.sidebar .icon-btn { width: 34px; height: 34px; flex: none; }
.app-main { flex: 1; min-width: 0; margin-left: 238px; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 30px;
  border-bottom: 1px solid var(--line-soft);
  background: rgba(5, 8, 16, 0.86);
  backdrop-filter: blur(12px);
}
.topbar-title { min-width: 0; }
.topbar-title h1 { margin-top: 3px; font-size: 21px; font-weight: 750; letter-spacing: -0.035em; }
.topbar-right { display: flex; align-items: center; gap: 9px; margin-left: auto; flex-wrap: wrap; justify-content: flex-end; }
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
  font-size: 11.5px;
  font-weight: 650;
  color: var(--muted);
  white-space: nowrap;
}
.status-pill i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted-2); }
.status-pill.on i { box-shadow: 0 0 9px currentColor; }
.status-pill.paper { color: var(--violet); border-color: rgba(167, 139, 250, 0.28); }
.status-pill.paper i { background: var(--violet); }
.status-pill.testnet { color: var(--amber, #fbbf24); border-color: rgba(251, 191, 36, 0.3); }
.status-pill.testnet i { background: var(--amber, #fbbf24); }
.status-pill.live { color: var(--red); border-color: rgba(251, 113, 133, 0.3); }
.status-pill.live i { background: var(--red); }
.session-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted-2);
  white-space: nowrap;
}
.session-pill.paper { color: var(--violet); border-color: rgba(167, 139, 250, 0.24); }
.session-pill.error { color: var(--red); border-color: rgba(251, 113, 133, 0.3); }
.mobile-menu { display: none; }
.content { padding: 26px 30px 60px; max-width: 1480px; }

/* Cards and layout */
.card {
  padding: 20px 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(17, 26, 42, 0.55), rgba(9, 14, 22, 0.4));
}
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 16px; }
.card-head h2 { margin-top: 4px; font-size: 17px; font-weight: 720; letter-spacing: -0.03em; }
.card-link { display: inline-block; color: var(--accent); font-size: 12.5px; font-weight: 650; }
.card-link:hover { text-decoration: underline; }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.stat-card {
  padding: 17px 19px 15px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: linear-gradient(165deg, rgba(19, 29, 46, 0.7), rgba(9, 14, 22, 0.55));
}
.stat-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; font-size: 11.5px; color: var(--muted); font-weight: 600; }
.stat-value { display: block; font-size: 25px; font-weight: 750; letter-spacing: -0.045em; font-variant-numeric: tabular-nums; }
.stat-value-row { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.stat-pct { font-size: 12px; font-weight: 650; }
.stat-foot { display: block; margin-top: 4px; font-size: 11px; color: var(--muted-2); }
.progress { height: 5px; margin-top: 10px; border-radius: 99px; background: #16202f; overflow: hidden; }
.progress > span { display: block; height: 100%; width: 0%; border-radius: 99px; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width 0.4s; }
.dash-grid { display: grid; grid-template-columns: 1.55fr 0.95fr; gap: 16px; margin-bottom: 16px; }
.dash-grid-2 { display: grid; grid-template-columns: 1.2fr 1fr; gap: 16px; }
.live-grid { display: grid; grid-template-columns: 1.5fr 0.95fr; gap: 16px; margin-bottom: 16px; }
.live-bottom { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.chart-box { position: relative; padding: 4px 0 0; }
.chart-box canvas { width: 100%; display: block; }
.chart-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  text-align: center;
  color: var(--muted-2);
  font-size: 12.5px;
  pointer-events: none;
}
.legend { display: flex; gap: 18px; margin-top: 10px; color: var(--muted-2); font-size: 11px; }
.legend span { display: inline-flex; align-items: center; gap: 7px; }
.dl.kv, dl.kv { display: flex; flex-direction: column; gap: 0; }
dl.kv > div { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line-soft); font-size: 12.5px; }
dl.kv > div:last-child { border-bottom: 0; }
dl.kv dt { color: var(--muted); }
dl.kv dd { font-weight: 650; font-family: var(--mono); font-size: 12px; margin: 0; text-align: right; }
.bot-actions { display: flex; flex-direction: column; gap: 9px; margin-top: 16px; }
.table-wrap { overflow-x: auto; margin: 0 -4px; }
.data-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.data-table th {
  padding: 8px 10px;
  text-align: left;
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted-2);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.data-table td { padding: 10px; border-bottom: 1px solid var(--line-soft); white-space: nowrap; }
.data-table tbody tr:hover { background: rgba(255, 255, 255, 0.02); }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table .num { font-family: var(--mono); font-size: 11.5px; font-variant-numeric: tabular-nums; }
.empty-cell, .empty-state { padding: 26px 12px; text-align: center; color: var(--muted-2); font-size: 12.5px; }
.side-badge {
  display: inline-flex;
  padding: 2px 7px;
  border-radius: 6px;
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.06em;
}
.side-badge.buy, .side-badge.long { background: var(--green-soft); color: var(--green); }
.side-badge.sell, .side-badge.short { background: var(--red-soft); color: var(--red); }
.type-badge {
  display: inline-flex;
  padding: 2px 7px;
  border-radius: 6px;
  font-size: 9.5px;
  font-weight: 750;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.type-badge.triangle { background: rgba(56, 224, 200, 0.12); color: var(--accent); }
.type-badge.carry { background: rgba(91, 140, 255, 0.14); color: #8fb0ff; }

/* Opportunity cards */
.opp-list { display: flex; flex-direction: column; gap: 10px; }
.opp {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 16px;
  padding: 14px 16px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.012);
}
.opp-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; font-weight: 650; }
.opp-sub { color: var(--muted-2); font-size: 11.5px; margin-top: 3px; }
.opp-edge { text-align: right; }
.opp-edge strong { display: block; font-family: var(--mono); font-size: 16px; font-weight: 700; }
.opp-edge small { display: block; font-size: 10px; color: var(--muted-2); margin-top: 2px; }
.opp-legs { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px; }
.leg-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--line-soft);
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--muted);
}
.opp-empty { padding: 22px 12px; text-align: center; color: var(--muted-2); font-size: 12.5px; line-height: 1.6; }
.threshold-note { margin-top: 12px; color: var(--muted-2); font-size: 11px; line-height: 1.6; }

/* Live */
.live-toolbar {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  padding: 14px 18px;
  margin-bottom: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(17, 26, 42, 0.45);
}
.live-symbol { display: flex; align-items: center; gap: 9px; }
.live-symbol strong { font-family: var(--mono); font-size: 16px; letter-spacing: -0.02em; }
.live-price { margin-left: auto; text-align: right; }
.live-price span { display: block; font-family: var(--mono); font-size: 21px; font-weight: 650; letter-spacing: -0.03em; }
.live-price small { display: block; font-size: 11px; color: var(--muted-2); }
.live-connection { display: flex; align-items: center; gap: 8px; font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.conn-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted-2); }
.conn-dot.on { background: var(--green); box-shadow: 0 0 10px var(--green); }
.conn-dot.off { background: var(--red); }
.conn-dot.warn { background: var(--amber); box-shadow: 0 0 10px rgba(251, 191, 36, 0.6); }
.metric-list { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.metric-list > div { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 9px 0; border-bottom: 1px solid var(--line-soft); font-size: 12px; }
.metric-list span { color: var(--muted); }
.metric-list strong { font-family: var(--mono); font-size: 11.5px; font-weight: 650; }
.market-rows { display: flex; flex-direction: column; }
.market-row {
  display: grid;
  grid-template-columns: 1.1fr 1fr 1fr 1fr;
  gap: 8px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--line-soft);
  font-size: 12px;
}
.market-row:last-child { border-bottom: 0; }
.market-row .sym { font-family: var(--mono); font-weight: 650; font-size: 11.5px; }
.market-row .val { font-family: var(--mono); font-size: 11px; color: var(--muted); text-align: right; }
.market-row .basis { font-family: var(--mono); font-size: 11.5px; text-align: right; font-weight: 650; }
.market-head { color: var(--muted-2); font-size: 9.5px; text-transform: uppercase; letter-spacing: 0.07em; }

/* Position */
.position-price strong { display: block; font-family: var(--mono); font-size: 26px; font-weight: 700; letter-spacing: -0.035em; }
.position-price small { display: block; color: var(--muted-2); font-size: 11.5px; margin-top: 2px; }
.position-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; margin-top: 14px; }
.position-grid div { padding: 9px 0; border-bottom: 1px solid var(--line-soft); }
.position-grid span { display: block; color: var(--muted-2); font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.05em; }
.position-grid strong { display: block; margin-top: 3px; font-family: var(--mono); font-size: 13px; font-weight: 650; }
.position-meta { margin: 12px 0; color: var(--muted-2); font-size: 11.5px; line-height: 1.6; }
.event-feed { display: flex; flex-direction: column; max-height: 430px; overflow-y: auto; }
.event-item { display: flex; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line-soft); font-size: 12px; line-height: 1.5; }
.event-item:last-child { border-bottom: 0; }
.event-item time { flex: none; width: 44px; color: var(--muted-2); font-family: var(--mono); font-size: 10px; padding-top: 2px; }
.event-item .msg { color: #b7c3d4; }
.event-item.error .msg { color: #ffb3bd; }
.event-item.success .msg { color: #a9f0cf; }
.event-item.warning .msg { color: #f5d98c; }
.event-empty { padding: 22px 0; text-align: center; color: var(--muted-2); font-size: 12px; }
.analysis-decision { margin: -4px 0 14px; padding: 11px 13px; border: 1px solid var(--line-soft); border-radius: 10px; background: rgba(56, 224, 200, 0.045); color: #c9d6e7; font-size: 12.5px; line-height: 1.55; }
.steps { display: flex; flex-direction: column; gap: 8px; margin-top: 9px; }
.steps li { position: relative; padding-left: 20px; color: var(--muted); font-size: 11.5px; line-height: 1.5; }
.steps li::before { content: "→"; position: absolute; left: 0; color: var(--accent); }

/* Settings */
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.mode-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 16px; }
.mode-tab {
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.015);
  text-align: left;
  transition: border-color 0.15s, background 0.15s;
}
.mode-tab strong { display: flex; align-items: center; gap: 7px; font-size: 13.5px; font-weight: 700; }
.mode-tab small { display: block; margin-top: 3px; color: var(--muted-2); font-size: 11px; line-height: 1.45; }
.mode-tab.active { border-color: rgba(56, 224, 200, 0.4); background: rgba(56, 224, 200, 0.075); }
.mode-tab.active.paper { border-color: rgba(167, 139, 250, 0.42); background: rgba(167, 139, 250, 0.08); }
.mode-tab.active.testnet { border-color: rgba(251, 191, 36, 0.42); background: rgba(251, 191, 36, 0.08); }
.keybox { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border: 1px solid var(--line-soft); border-radius: 11px; background: rgba(255, 255, 255, 0.02); margin-bottom: 14px; }
.keybox .hint { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.danger-zone { border-color: rgba(251, 113, 133, 0.22); }
.divider { height: 1px; margin: 16px 0; background: var(--line-soft); }
.notice { padding: 11px 13px; border: 1px solid var(--line); border-radius: 10px; background: rgba(91, 140, 255, 0.06); color: #b9c9e6; font-size: 11.5px; line-height: 1.6; }
.notice.warn { border-color: rgba(251, 191, 36, 0.26); background: var(--amber-soft); color: #f6dda0; }

/* Toasts */
.toast-stack { position: fixed; right: 20px; bottom: 20px; z-index: 200; display: flex; flex-direction: column; gap: 9px; max-width: 360px; }
.toast {
  padding: 12px 15px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #101a2a;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
  font-size: 12.5px;
  line-height: 1.5;
  color: #d7e2f1;
}
.toast.success { border-color: rgba(52, 211, 153, 0.35); }
.toast.error { border-color: rgba(251, 113, 133, 0.4); }

/* Responsive */
@media (max-width: 1180px) {
  .feature-grid { grid-template-columns: repeat(2, 1fr); }
  .dash-grid, .live-grid { grid-template-columns: 1fr; }
  .dash-grid-2, .live-bottom { grid-template-columns: 1fr; }
}
@media (max-width: 1024px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .settings-grid { grid-template-columns: 1fr; }
  .hero { grid-template-columns: 1fr; gap: 44px; }
  .split-section { grid-template-columns: 1fr; gap: 34px; }
  .float-top { right: 10px; }
  .float-bottom { left: 10px; }
}
@media (max-width: 860px) {
  .sidebar { transform: translateX(-100%); transition: transform 0.22s ease; box-shadow: 0 0 60px rgba(0,0,0,0.6); }
  .sidebar.open { transform: translateX(0); }
  .app-main { margin-left: 0; }
  .mobile-menu { display: inline-grid; }
  .topbar { padding: 13px 16px; }
  .content { padding: 18px 16px 50px; }
  .landing-links { display: none; }
  .hero { padding-top: 40px; }
  .section { padding: 56px 20px; }
  .landing-nav { padding: 16px 20px; }
  .risk-card { padding: 30px 22px; }
  .landing-footer { flex-wrap: wrap; padding: 24px 20px 36px; }
  .landing-footer p { margin-left: 0; width: 100%; }
}
@media (max-width: 560px) {
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat-value { font-size: 21px; }
  .form-grid { grid-template-columns: 1fr; }
  .trade-strip { grid-template-columns: 1fr 1fr; }
  .trade-strip div:nth-child(2) { border-right: 0; }
  .trade-strip div { border-bottom: 1px solid var(--line-soft); }
  .metric-list { grid-template-columns: 1fr; }
  .market-row { grid-template-columns: 1fr 1fr 1fr; }
  .market-row .col-funding { display: none; }
  .hero h1 { font-size: 40px; }
  .auth-card { padding: 26px 20px 24px; }
  .topbar-right .session-pill { display: none; }
  .toast-stack { left: 14px; right: 14px; bottom: 14px; max-width: none; }
}
