:root {
  color-scheme: dark;
  --bg: #050711;
  --bg-soft: #0a0f1e;
  --ink: #eef4ff;
  --muted: #8a97ad;
  --faint: #5b677d;
  --line: rgba(174, 197, 255, 0.13);
  --line-strong: rgba(174, 197, 255, 0.24);
  --glass: rgba(13, 20, 39, 0.62);
  --glass-strong: rgba(16, 25, 48, 0.82);
  --teal: #38e4c4;
  --teal-soft: rgba(56, 228, 196, 0.13);
  --pink: #ff4f91;
  --pink-soft: rgba(255, 79, 145, 0.13);
  --amber: #ffc464;
  --violet: #a897ff;
  --danger: #ff6b78;
  --radius: 24px;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.38);
  --blur: blur(22px) saturate(125%);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --font: "SF Pro Display", "PingFang SC", "Microsoft YaHei", "Noto Sans SC", system-ui, -apple-system, sans-serif;
  --mono: "SFMono-Regular", "Cascadia Code", "Roboto Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
button, input { font: inherit; }
button { cursor: pointer; }
a { color: inherit; }

.ambient {
  position: fixed;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.75;
  pointer-events: none;
  z-index: -1;
}
.ambient-a {
  width: 42vw; height: 42vw; max-width: 520px; max-height: 520px;
  top: -12vh; right: -10vw;
  background: radial-gradient(circle, rgba(56, 228, 196, 0.22), transparent 68%);
}
.ambient-b {
  width: 50vw; height: 50vw; max-width: 620px; max-height: 620px;
  bottom: 10vh; left: -18vw;
  background: radial-gradient(circle, rgba(126, 95, 255, 0.18), transparent 70%);
}

.app-shell {
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: 18px 16px calc(98px + var(--safe-bottom));
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 2px 18px;
}
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand-mark {
  position: relative;
  width: 42px; height: 42px;
  border-radius: 14px;
  background: linear-gradient(145deg, rgba(56, 228, 196, 0.16), rgba(126, 95, 255, 0.12));
  border: 1px solid rgba(151, 213, 255, 0.2);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.14), 0 10px 26px rgba(0,0,0,0.28);
  display: grid;
  place-content: center;
  gap: 4px;
  overflow: hidden;
  flex: 0 0 auto;
}
.brand-mark span {
  display: block;
  height: 4px;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--teal), rgba(168, 151, 255, 0.85));
  box-shadow: 0 0 12px rgba(56, 228, 196, 0.35);
}
.brand-mark span:nth-child(1) { width: 22px; }
.brand-mark span:nth-child(2) { width: 16px; }
.brand-mark span:nth-child(3) { width: 10px; }
.brand-mark.large { width: 54px; height: 54px; margin: 0 auto 14px; }
.eyebrow {
  margin: 0 0 3px;
  font-size: 9px;
  letter-spacing: 0.22em;
  color: var(--muted);
  font-weight: 650;
}
h1 { margin: 0; font-size: 22px; line-height: 1.1; letter-spacing: -0.03em; }
h2 { margin: 0; font-size: 18px; line-height: 1.2; letter-spacing: -0.02em; }
h3 { margin: 0; font-size: 15px; line-height: 1.35; }
p { margin: 0; }

.top-actions { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.icon-btn, .ghost-btn {
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.04);
  color: var(--ink);
  border-radius: 14px;
  min-height: 40px;
  transition: transform .18s ease, border-color .18s ease, background .18s ease;
}
.icon-btn { width: 42px; display: grid; place-items: center; }
.icon-btn svg { width: 19px; height: 19px; stroke: currentColor; stroke-width: 1.7; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.ghost-btn { padding: 0 14px; font-size: 13px; color: var(--muted); }
.icon-btn:active, .ghost-btn:active, .primary-btn:active { transform: scale(0.96); }

.glass, .glass-thin {
  border: 1px solid var(--line);
  background: var(--glass);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  box-shadow: var(--shadow);
  border-radius: var(--radius);
}
.glass-thin {
  border-radius: 16px;
  background: rgba(10, 15, 30, 0.5);
  box-shadow: none;
}

.connection-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  margin-bottom: 12px;
}
.conn-state { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); min-width: 0; }
.conn-state #connText { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--faint);
  box-shadow: 0 0 0 4px rgba(255,255,255,0.04);
  flex: 0 0 auto;
}
.dot.is-live { background: var(--teal); box-shadow: 0 0 0 4px rgba(56, 228, 196, 0.13), 0 0 16px rgba(56, 228, 196, 0.7); }
.dot.is-warn { background: var(--amber); box-shadow: 0 0 0 4px rgba(255, 196, 100, 0.13); }
.dot.is-off { background: var(--pink); box-shadow: 0 0 0 4px rgba(255, 79, 145, 0.13); }
.conn-meta { display: flex; align-items: center; gap: 9px; flex: 0 0 auto; }
.market-badge {
  font-size: 10px; letter-spacing: .08em; color: var(--muted);
  border: 1px solid var(--line); border-radius: 99px; padding: 4px 8px;
  background: rgba(255,255,255,0.03);
}
.market-badge.is-open { color: var(--teal); border-color: rgba(56,228,196,0.28); background: var(--teal-soft); }
.stamp { font-family: var(--mono); font-size: 10px; color: var(--faint); }

.risk-card { padding: 18px 18px 15px; margin-bottom: 18px; position: relative; overflow: hidden; }
.risk-card::after {
  content: "";
  position: absolute; inset: 0 auto 0 0; width: 3px;
  background: linear-gradient(180deg, var(--teal), rgba(56,228,196,0.1));
}
.risk-card.warn::after { background: linear-gradient(180deg, var(--amber), rgba(255,196,100,0.1)); }
.risk-card.halt::after { background: linear-gradient(180deg, var(--danger), rgba(255,107,120,0.1)); }
.risk-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.micro-label { font-size: 9px; letter-spacing: .18em; color: var(--faint); font-weight: 650; margin: 0 0 5px; }
.equity-line { display: flex; align-items: baseline; gap: 3px; }
.currency { font-size: 13px; color: var(--muted); }
.equity-line strong { font-family: var(--mono); font-size: 29px; letter-spacing: -0.04em; line-height: 1; font-variant-numeric: tabular-nums; }
.risk-sub { color: var(--muted); font-size: 11px; margin-top: 8px; }
.risk-badge {
  flex: 0 0 auto;
  font-family: var(--mono); font-size: 10px; letter-spacing: .1em;
  padding: 6px 9px; border-radius: 9px; border: 1px solid var(--line);
  color: var(--muted);
}
.risk-badge.normal { color: var(--teal); border-color: rgba(56,228,196,0.22); background: var(--teal-soft); }
.risk-badge.warn { color: var(--amber); border-color: rgba(255,196,100,0.24); background: rgba(255,196,100,0.1); }
.risk-badge.halt { color: var(--danger); border-color: rgba(255,107,120,0.3); background: rgba(255,107,120,0.1); }
.risk-metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 18px; }
.risk-metrics div { min-width: 0; }
.risk-metrics span { display: block; font-size: 10px; color: var(--muted); margin-bottom: 5px; }
.risk-metrics strong { font-family: var(--mono); font-size: 13px; font-weight: 550; font-variant-numeric: tabular-nums; white-space: nowrap; }
.risk-bar { height: 3px; background: rgba(255,255,255,0.05); border-radius: 99px; overflow: hidden; margin: 16px 0 10px; }
.risk-bar span { display: block; height: 100%; width: 6%; background: linear-gradient(90deg, var(--teal), var(--amber)); border-radius: inherit; transition: width .4s ease; }
.risk-foot { display: flex; justify-content: space-between; gap: 10px; color: var(--faint); font-size: 9px; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }

.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; padding: 20px 2px 11px; }
.section-head.compact { padding-top: 18px; }
.source-tag, .tiny-label {
  color: var(--muted); font-size: 9px; border: 1px solid var(--line);
  border-radius: 99px; padding: 5px 8px; background: rgba(255,255,255,0.03);
  white-space: nowrap;
}
.source-tag.warn { color: var(--amber); border-color: rgba(255,196,100,0.22); }
.tiny-label { border: 0; padding: 0 2px; }

.quote-grid { display: grid; grid-template-columns: 1fr; gap: 11px; }
.quote-card {
  position: relative;
  overflow: hidden;
  padding: 16px 16px 14px;
  border-radius: 24px;
  border: 1px solid var(--line);
  background: linear-gradient(145deg, rgba(17, 27, 51, 0.78), rgba(8, 13, 28, 0.64));
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  box-shadow: var(--shadow);
  transition: border-color .2s ease, transform .2s ease;
}
.quote-card:active { transform: scale(0.985); }
.quote-card::before {
  content: "";
  position: absolute; width: 100px; height: 100px; right: -34px; top: -38px;
  border-radius: 50%; filter: blur(26px);
  background: var(--accent, var(--teal)); opacity: .2;
}
.quote-card::after {
  content: "";
  position: absolute; left: 16px; right: 16px; top: 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent, var(--teal)), transparent);
  opacity: .42; pointer-events: none;
}
.quote-card[data-symbol="TA"] { --accent: var(--teal); }
.quote-card[data-symbol="MA"] { --accent: var(--amber); }
.quote-card[data-symbol="V"] { --accent: var(--violet); }
.quote-top { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.quote-id { display: flex; align-items: center; gap: 10px; min-width: 0; }
.symbol-pill {
  flex: 0 0 auto;
  font-family: var(--mono); font-weight: 700; font-size: 16px;
  color: var(--accent, var(--teal));
  background: color-mix(in srgb, var(--accent, var(--teal)) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent, var(--teal)) 28%, transparent);
  border-radius: 10px; padding: 6px 9px; line-height: 1;
}
.quote-name { color: var(--muted); font-size: 11px; min-width: 0; line-height: 1.4; }
.quote-name strong { color: var(--ink); font-weight: 600; display: block; font-size: 13px; white-space: nowrap; }
.quote-contract { color: var(--faint); font-family: var(--mono); font-size: 9px; margin-top: 2px; white-space: nowrap; }
.quote-price { text-align: right; flex: 0 0 auto; min-width: 0; }
.quote-price strong { font-family: var(--mono); font-size: clamp(24px, 6.5vw, 28px); letter-spacing: -0.04em; line-height: 1; font-variant-numeric: tabular-nums; }
.quote-price span {
  font-family: var(--mono); font-size: 10px; display: inline-flex; margin-top: 6px;
  padding: 3px 7px; border-radius: 999px; background: rgba(255,255,255,0.035);
  border: 1px solid rgba(255,255,255,0.055); line-height: 1.2;
}
.up { color: var(--teal); }
.down { color: var(--pink); }
.flat { color: var(--muted); }
.spark-wrap { position: relative; height: 46px; margin: 10px -2px 7px; }
.spark-wrap canvas { width: 100%; height: 46px; display: block; }
.quote-bottom { position: relative; display: grid; gap: 8px; border-top: 1px solid rgba(255,255,255,0.055); padding-top: 9px; }
.quote-book { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; min-width: 0; }
.quote-book span { color: var(--faint); font-size: 9px; white-space: nowrap; }
.quote-book strong { font-family: var(--mono); font-size: 11px; font-weight: 500; font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--ink); }
.quote-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; min-width: 0; }
.quote-stats div { display: flex; align-items: baseline; justify-content: space-between; gap: 5px; min-width: 0; }
.quote-stats span { color: var(--faint); font-size: 9px; white-space: nowrap; }
.quote-stats strong { font-family: var(--mono); font-size: 10.5px; font-weight: 500; font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--muted); }
.quote-card.is-gap { opacity: .74; }
.gap-label {
  display: inline-flex; align-items: center; margin-top: 8px; padding: 3px 8px;
  border-radius: 999px; color: var(--amber); font-size: 9px; line-height: 1.3;
  background: rgba(255, 196, 100, 0.08); border: 1px solid rgba(255, 196, 100, 0.18);
}
@media (hover: hover) {
  .quote-card:hover { border-color: var(--line-strong); transform: translateY(-1px); }
}

.stack { display: grid; gap: 9px; }
.empty-state {
  border: 1px dashed var(--line-strong);
  border-radius: 18px;
  padding: 20px 16px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
  background: rgba(255,255,255,0.015);
}
.position-card, .order-card, .trade-card, .strategy-card, .history-card, .boundary-card {
  padding: 15px;
}
.position-card { display: grid; gap: 11px; }
.position-main { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.position-title { display: flex; align-items: center; gap: 8px; min-width: 0; }
.side-chip {
  font-size: 9px; letter-spacing: .06em; border-radius: 7px; padding: 4px 7px;
  font-family: var(--mono);
}
.side-chip.long { color: var(--teal); background: var(--teal-soft); border: 1px solid rgba(56,228,196,0.2); }
.side-chip.short { color: var(--pink); background: var(--pink-soft); border: 1px solid rgba(255,79,145,0.2); }
.position-contract { font-family: var(--mono); font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
.position-qty { text-align: right; }
.position-qty strong { font-family: var(--mono); font-size: 20px; }
.position-qty span { display: block; color: var(--faint); font-size: 9px; margin-top: 2px; }
.position-metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; }
.position-metrics div { min-width: 0; }
.position-metrics span { display: block; color: var(--faint); font-size: 9px; margin-bottom: 3px; }
.position-metrics strong { font-family: var(--mono); font-size: 11px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.position-actions { display: flex; justify-content: flex-end; }
.close-btn, .cancel-btn {
  border: 1px solid rgba(255, 79, 145, 0.28);
  background: rgba(255, 79, 145, 0.08);
  color: #ff9bbb;
  border-radius: 10px;
  padding: 7px 12px;
  font-size: 11px;
}
.cancel-btn { border-color: rgba(255,196,100,0.26); color: var(--amber); background: rgba(255,196,100,0.06); }
.close-btn:disabled, .cancel-btn:disabled { opacity: .4; cursor: not-allowed; }

.order-card, .trade-card { display: grid; gap: 8px; }
.row-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.row-title { display: flex; align-items: center; gap: 8px; min-width: 0; }
.row-title strong { font-family: var(--mono); font-size: 12px; }
.row-title span { font-size: 9px; color: var(--faint); }
.status-chip { font-size: 9px; font-family: var(--mono); border-radius: 99px; padding: 4px 7px; border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.status-chip.alive { color: var(--amber); border-color: rgba(255,196,100,0.26); }
.status-chip.finished { color: var(--teal); border-color: rgba(56,228,196,0.22); }
.status-chip.error { color: var(--danger); border-color: rgba(255,107,120,0.26); }
.row-meta { display: flex; flex-wrap: wrap; gap: 8px 14px; color: var(--faint); font-size: 9px; }
.row-meta b { color: var(--muted); font-weight: 500; }
.row-msg { color: var(--muted); font-size: 10px; line-height: 1.5; }
.row-actions { display: flex; justify-content: flex-end; }

.strategy-card { display: grid; gap: 10px; }
.strategy-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.strategy-head strong { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.strategy-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; }
.strategy-kpis div { min-width: 0; }
.strategy-kpis span { display: block; font-size: 9px; color: var(--faint); margin-bottom: 3px; }
.strategy-kpis strong { font-family: var(--mono); font-size: 13px; font-weight: 550; white-space: nowrap; }
.strategy-note { color: var(--faint); font-size: 9px; line-height: 1.55; }

.history-card { display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.history-left { min-width: 0; }
.history-left strong { display: block; font-family: var(--mono); font-size: 12px; margin-bottom: 3px; }
.history-left span { color: var(--faint); font-size: 9px; }
.history-right { text-align: right; flex: 0 0 auto; }
.history-right strong { display: block; font-family: var(--mono); font-size: 12px; }
.history-right span { font-size: 9px; color: var(--faint); }
.history-card .badge-citable { display: inline-block; margin-top: 5px; color: var(--faint); font-size: 8px; border: 1px solid var(--line); border-radius: 99px; padding: 2px 5px; }

.review-metrics { padding: 16px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.review-metrics div { min-width: 0; }
.review-metrics span { display: block; color: var(--faint); font-size: 9px; margin-bottom: 4px; }
.review-metrics strong { font-family: var(--mono); font-size: 15px; font-weight: 550; white-space: nowrap; }

.boundary-card { color: var(--muted); font-size: 11px; line-height: 1.7; }
.boundary-card h3 { color: var(--ink); margin-bottom: 6px; }
.boundary-card p + p { margin-top: 8px; }

.ticket-card { padding: 16px; display: grid; gap: 15px; }
.field-block { min-width: 0; }
.field-label { display: block; font-size: 10px; color: var(--muted); margin-bottom: 7px; letter-spacing: .05em; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.segmented { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; padding: 4px; border: 1px solid var(--line); border-radius: 14px; background: rgba(3, 8, 20, 0.55); }
.segmented button {
  border: 0; border-radius: 10px; min-height: 39px; padding: 6px 4px;
  background: transparent; color: var(--muted); font-size: 12px; transition: background .18s ease, color .18s ease;
}
.segmented button small { display: block; font-size: 8px; color: var(--faint); margin-top: 2px; }
.segmented button.is-active { background: rgba(255,255,255,0.07); color: var(--ink); box-shadow: inset 0 1px 0 rgba(255,255,255,0.09); }
.segmented button.is-active small { color: var(--muted); }
.segmented button.is-buy.is-active { color: var(--teal); background: var(--teal-soft); }
.segmented button.is-sell.is-active { color: var(--pink); background: var(--pink-soft); }
.stepper { display: grid; grid-template-columns: 40px 1fr 40px; align-items: center; border: 1px solid var(--line); border-radius: 14px; background: rgba(3,8,20,0.55); min-height: 47px; }
.stepper button { border: 0; background: transparent; color: var(--muted); font-size: 20px; height: 100%; }
.stepper output { text-align: center; font-family: var(--mono); font-size: 18px; }
.price-input, .token-input {
  width: 100%; border: 1px solid var(--line); background: rgba(3,8,20,0.55); color: var(--ink);
  border-radius: 13px; min-height: 46px; padding: 0 13px; outline: none;
  font-family: var(--mono); font-size: 15px;
}
.price-input:focus, .token-input:focus { border-color: rgba(56,228,196,0.42); box-shadow: 0 0 0 3px rgba(56,228,196,0.08); }
.ticket-preview {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 13px 0;
}
.ticket-preview div { min-width: 0; }
.ticket-preview span { display: block; color: var(--faint); font-size: 9px; margin-bottom: 4px; }
.ticket-preview strong { font-family: var(--mono); font-size: 11px; font-weight: 550; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ticket-note, .legal-note { color: var(--faint); font-size: 10px; line-height: 1.65; }
.primary-btn {
  border: 1px solid rgba(56,228,196,0.28);
  background: linear-gradient(135deg, rgba(56,228,196,0.22), rgba(126,95,255,0.18));
  color: var(--ink); border-radius: 14px; min-height: 50px;
  font-size: 14px; font-weight: 600; letter-spacing: .02em;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.14), 0 8px 24px rgba(0,0,0,0.22);
  transition: transform .18s ease, filter .18s ease;
}
.primary-btn:hover { filter: brightness(1.1); }
.primary-btn:disabled { opacity: .45; cursor: not-allowed; }

.bottom-nav {
  position: fixed; left: 50%; bottom: calc(12px + var(--safe-bottom)); transform: translateX(-50%);
  width: min(calc(100% - 24px), 700px);
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 3px;
  padding: 7px; border-radius: 22px;
  background: rgba(9, 14, 29, 0.82);
  z-index: 4;
}
.nav-item {
  border: 0; background: transparent; color: var(--faint);
  border-radius: 16px; min-height: 51px; display: grid; place-items: center; gap: 3px;
  font-size: 10px; transition: color .18s ease, background .18s ease;
}
.nav-item svg { width: 20px; height: 20px; stroke: currentColor; stroke-width: 1.7; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.nav-item.is-active { color: var(--teal); background: rgba(56,228,196,0.08); }

.tab-panel { display: none; }
.tab-panel.is-active { display: block; animation: panelIn .25s ease both; }
@keyframes panelIn { from { opacity: .7; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.toast {
  position: fixed; left: 50%; bottom: calc(86px + var(--safe-bottom)); transform: translate(-50%, 10px);
  max-width: min(90vw, 420px); padding: 10px 14px; border-radius: 12px;
  background: rgba(8, 14, 30, 0.95); border: 1px solid var(--line-strong); color: var(--ink);
  font-size: 12px; line-height: 1.5; opacity: 0; pointer-events: none; z-index: 8;
  transition: opacity .2s ease, transform .2s ease;
  box-shadow: 0 12px 32px rgba(0,0,0,0.42);
}
.toast.is-show { opacity: 1; transform: translate(-50%, 0); }
.toast.is-error { border-color: rgba(255,107,120,0.36); color: #ffb5bd; }

.login-overlay {
  position: fixed; inset: 0; z-index: 12; display: grid; place-items: center; padding: 20px;
  background: radial-gradient(circle at 50% 20%, rgba(56,228,196,0.1), transparent 50%), rgba(3, 6, 16, 0.9);
  -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
}
.login-overlay[hidden] { display: none; }
.login-card { width: min(100%, 360px); padding: 28px 23px 22px; text-align: center; }
.login-card h2 { font-size: 20px; }
.login-card p { color: var(--muted); font-size: 11px; line-height: 1.6; margin: 9px 0 17px; }
.token-input { text-align: center; }
.login-card .primary-btn { width: 100%; margin-top: 12px; }
.login-error { color: #ff9da8; min-height: 16px; margin: 8px 0 0 !important; font-size: 10px !important; }

.confirm-dialog {
  width: min(calc(100% - 32px), 420px); border: 1px solid var(--line-strong); border-radius: 22px;
  background: rgba(10, 16, 32, 0.96); color: var(--ink); padding: 20px; box-shadow: var(--shadow);
}
.confirm-dialog::backdrop { background: rgba(2, 5, 14, 0.72); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.confirm-dialog form { display: grid; gap: 10px; }
.confirm-body { color: var(--muted); font-size: 12px; line-height: 1.7; }
.dialog-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-top: 6px; }
.dialog-actions .ghost-btn, .dialog-actions .primary-btn { min-height: 44px; }

.v2-status-row {
  display: flex; flex-wrap: wrap; gap: 7px;
  margin-top: 11px; color: var(--faint); font-size: 9px;
}
.v2-status-row span {
  border: 1px solid var(--line); border-radius: 99px; padding: 3px 7px;
  background: rgba(255,255,255,0.025);
}
.v2-warning {
  margin-top: 11px; padding: 9px 11px; border-radius: 11px;
  color: #ffb6bd; background: rgba(255,107,120,0.10);
  border: 1px solid rgba(255,107,120,0.22); font-size: 10px; line-height: 1.6;
}
.v2-signal-card, .v2-summary, .stop-card, .review-summary, .legacy-strip, .signal-card {
  padding: 15px; display: grid; gap: 10px;
}
.v2-signal-card .strategy-head { align-items: center; }
.stop-card { border-color: rgba(255,196,100,0.22); }
.stop-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.stop-actions .ghost-btn { min-height: 36px; padding: 0 12px; font-size: 11px; }
.position-card.is-pending { border-color: rgba(255,196,100,0.25); }
.legacy-strip { border-style: dashed; }
.legacy-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.legacy-head span { color: var(--muted); font-size: 10px; }
.legacy-head strong { font-family: var(--mono); font-size: 16px; }
.review-md {
  max-height: 260px; overflow: auto; margin: 0; padding: 10px;
  border-radius: 12px; background: rgba(0,0,0,0.18); border: 1px solid var(--line);
  color: var(--muted); font: 10px/1.65 var(--mono); white-space: pre-wrap;
}
.tiny-btn { min-height: 34px; padding: 0 12px; font-size: 11px; }
.signal-card { border-color: var(--line); }

@media (min-width: 680px) {
  .quote-grid { grid-template-columns: repeat(3, 1fr); }
  .quote-card { padding: 15px 14px 13px; border-radius: 22px; }
  .quote-price strong { font-size: 20px; }
  .quote-price span { margin-top: 5px; }
  .quote-book strong { font-size: 10.5px; }
  .quote-stats strong { font-size: 10px; }
  .position-card { grid-template-columns: 1.25fr 1fr; align-items: center; }
  .position-main { grid-column: 1 / -1; }
  .position-metrics { grid-column: 1; }
  .position-actions { grid-column: 2; align-self: end; }
  .review-metrics { grid-template-columns: repeat(4, 1fr); }
}
@media (min-width: 860px) {
  .app-shell { max-width: 980px; }
  .bottom-nav { width: 700px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
