:root {
  --bg: #f5f5f7;
  --surface: #ffffff;
  --ink: #1d1d1f;
  --muted: #6e6e73;
  --faint: #86868b;
  --line: #e5e5e7;
  --soft: #f0f0f2;
  --blue: #06c;
  --green: #197044;
  --orange: #9b5d00;
  --red: #b42318;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--bg);
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; background: var(--bg); }
button, input { font: inherit; }
button { cursor: pointer; }
.topbar { height: 64px; padding: 0 5vw; display: flex; align-items: center; gap: 28px; background: rgba(255,255,255,.86); border-bottom: 1px solid rgba(0,0,0,.08); position: sticky; top: 0; z-index: 10; backdrop-filter: blur(18px); }
.wordmark { color: var(--ink); font-size: 19px; font-weight: 700; text-decoration: none; letter-spacing: -.04em; }
.wordmark span { color: var(--blue); }
.topnav { display: flex; gap: 18px; flex: 1; }
.nav-link { border: 0; padding: 8px 0; color: var(--muted); background: transparent; font-size: 14px; }
.nav-link.is-active, .nav-link:hover { color: var(--ink); }
.nav-link.is-active { font-weight: 600; }
.top-actions { display: flex; align-items: center; gap: 15px; }
.live-pill { display: inline-flex; gap: 6px; align-items: center; color: var(--muted); font-size: 12px; }
.live-pill i { display: block; width: 7px; height: 7px; border-radius: 50%; background: var(--green); }
.icon-button, .close-button { border: 0; background: transparent; color: var(--muted); }
.shell { max-width: 1280px; margin: 0 auto; padding: 72px 5vw 100px; }
.view { display: none; }
.view.is-visible { display: block; }
.hero-row, .page-heading { display: flex; justify-content: space-between; align-items: end; gap: 36px; margin-bottom: 50px; }
.hero-row h1, .page-heading h1 { font-size: clamp(40px, 6vw, 76px); line-height: 1.05; letter-spacing: -.065em; margin: 8px 0 20px; font-weight: 700; }
.hero-row h1 span { color: var(--faint); }
.page-heading h1 { font-size: clamp(38px, 5vw, 64px); }
.eyebrow { color: var(--faint); font-size: 11px; font-weight: 700; letter-spacing: .13em; margin: 0 0 10px; }
.lede { max-width: 590px; color: var(--muted); font-size: 17px; line-height: 1.55; margin: 0; }
.hero-note { max-width: 230px; padding: 18px; border-left: 2px solid var(--ink); color: var(--muted); font-size: 13px; line-height: 1.5; }
.hero-note strong, .hero-note span { display: block; }
.hero-note strong { color: var(--ink); margin-bottom: 4px; }
.metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 22px; }
.metric-card { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 22px; min-height: 126px; }
.metric-card .metric-label { color: var(--muted); font-size: 13px; }
.metric-card .metric-value { display: block; margin-top: 16px; font-size: 30px; letter-spacing: -.04em; font-weight: 650; }
.metric-card .metric-detail { display: block; margin-top: 4px; font-size: 12px; color: var(--faint); }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 26px; margin-bottom: 16px; }
.panel-heading { display: flex; align-items: end; justify-content: space-between; gap: 18px; margin-bottom: 18px; }
.panel-heading.compact { align-items: center; }
.panel h2 { margin: 0; font-size: 22px; letter-spacing: -.04em; }
.heading-actions { display: flex; gap: 8px; }
.button { border-radius: 999px; padding: 10px 16px; font-size: 13px; border: 1px solid var(--line); transition: transform .16s ease, background .16s ease; }
.button:hover { transform: translateY(-1px); }
.button-dark { color: #fff; border-color: var(--ink); background: var(--ink); }
.button-light { color: var(--ink); background: var(--surface); }
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; min-width: 650px; }
.data-table th, .data-table td { padding: 15px 8px; text-align: left; border-bottom: 1px solid var(--line); font-size: 13px; white-space: nowrap; }
.data-table th { color: var(--faint); font-size: 11px; letter-spacing: .08em; font-weight: 600; }
.data-table tr:last-child td { border-bottom: 0; }
.stock-link { border: 0; background: transparent; text-align: left; padding: 0; color: var(--ink); font-weight: 650; }
.stock-link small { display: block; color: var(--faint); font-weight: 400; margin-top: 3px; }
.score { font-variant-numeric: tabular-nums; font-weight: 650; }
.signal { font-size: 12px; font-weight: 650; }
.signal-buy { color: var(--green); }.signal-watch { color: var(--orange); }.signal-sell { color: var(--red); }.signal-neutral { color: var(--muted); }
.split-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.news-list, .status-list, .orders-list { display: grid; gap: 0; }
.news-item, .status-item, .order-item { padding: 13px 0; border-bottom: 1px solid var(--line); }
.news-item:last-child, .status-item:last-child, .order-item:last-child { border-bottom: 0; }
.news-title { display: block; color: var(--ink); font-size: 14px; line-height: 1.45; }
.news-meta, .status-item, .order-item { color: var(--muted); font-size: 12px; }
.status-item { display: flex; justify-content: space-between; gap: 12px; }
.status-item strong { color: var(--ink); font-weight: 600; }
.empty-state { padding: 32px 12px; color: var(--muted); text-align: center; font-size: 14px; }
.is-hidden { display: none !important; }
.detail-metric .metric-value { margin-top: 9px; }
.chart-box { min-height: 270px; }
.chart-box svg { width: 100%; height: 270px; overflow: visible; }
.chart-line { fill: none; stroke: var(--ink); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.chart-area { fill: url(#areaFill); }
.chart-grid { stroke: var(--line); stroke-width: 1; }
.backtest-result { color: var(--muted); font-size: 14px; line-height: 1.8; }
.backtest-result strong { color: var(--ink); }
.modal { position: fixed; inset: 0; padding: 20px; display: grid; place-items: center; background: rgba(29,29,31,.28); z-index: 20; }
.modal-card { width: min(100%, 430px); background: var(--surface); padding: 28px; border-radius: 22px; box-shadow: 0 20px 60px rgba(0,0,0,.15); }
.close-button { font-size: 26px; line-height: 1; }
.stack-form { display: grid; gap: 9px; }
.stack-form label { color: var(--muted); font-size: 13px; margin-top: 8px; }
.stack-form input { width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 13px 14px; background: var(--surface); color: var(--ink); outline: none; }
.stack-form input:focus { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(0,0,0,.06); }
.form-error { min-height: 18px; color: var(--red); font-size: 12px; margin: 0; }
.auth-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.auth-card { width: min(100%, 390px); background: var(--surface); border: 1px solid var(--line); border-radius: 24px; padding: 40px; box-shadow: 0 20px 70px rgba(0,0,0,.05); }
.brand-mark { display: grid; place-items: center; width: 42px; height: 42px; background: var(--ink); color: #fff; border-radius: 12px; font-weight: 700; letter-spacing: -.08em; margin-bottom: 42px; }
.auth-card h1 { font-size: 38px; letter-spacing: -.06em; margin: 8px 0 12px; }
.legal-note { color: var(--faint); font-size: 11px; line-height: 1.5; margin: 28px 0 0; }
.muted { color: var(--muted); }
@media (max-width: 900px) { .metric-grid { grid-template-columns: repeat(2, 1fr); } .hero-row, .page-heading { display: block; } .hero-note { margin-top: 28px; } .page-heading .button { margin-top: 24px; } }
@media (max-width: 640px) { .topbar { padding: 0 18px; gap: 16px; } .topnav { gap: 12px; } .top-actions .live-pill { display: none; } .shell { padding: 48px 18px 72px; } .hero-row h1 { font-size: 48px; } .metric-grid, .split-grid { grid-template-columns: 1fr; } .panel { padding: 20px; border-radius: 16px; } .heading-actions { flex-wrap: wrap; } .auth-card { padding: 28px; } }
