:root {
  color-scheme: dark;
  --bg: #090909;
  --panel: #101010;
  --panel-2: #141414;
  --line: #292929;
  --line-soft: #1d1d1d;
  --text: #f2f2f2;
  --muted: #8a8a8a;
  --muted-2: #606060;
  --green: #00c087;
  --green-bright: #f2f2f2;
  --green-soft: rgba(255, 255, 255, .07);
  --red: #f6465d;
  --amber: #f7b955;
  --sidebar: 84px;
  --radius: 6px;
  --font: Inter, "SF Pro Display", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { background: var(--bg); scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font); letter-spacing: 0; }
button, input, select { font: inherit; }
button { color: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid var(--green-bright); outline-offset: 2px; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.svg-defs { position: fixed; width: 0; height: 0; overflow: hidden; }

.app-shell { min-height: 100vh; }
.global-header { position: sticky; top: 0; z-index: 60; height: 64px; padding: 0 clamp(22px, 3vw, 48px); border-bottom: 1px solid var(--line-soft); background: rgba(9,9,9,.96); backdrop-filter: blur(16px); display: flex; align-items: center; gap: 34px; }
.top-brand { flex: 0 0 auto; display: flex; align-items: center; gap: 11px; color: var(--text); text-decoration: none; }
.brand-logo { flex: 0 0 auto; width: 44px; height: 40px; display: block; object-fit: contain; }
.brand-symbol { position: relative; width: 30px; height: 30px; border: 1px solid #686868; border-radius: 50%; display: block; overflow: hidden; }
.brand-symbol::before, .brand-symbol::after { content: ""; position: absolute; left: 50%; top: 50%; background: #4b4b4b; transform: translate(-50%, -50%); }
.brand-symbol::before { width: 1px; height: 22px; }
.brand-symbol::after { width: 22px; height: 1px; }
.brand-symbol i:nth-child(1) { position: absolute; z-index: 1; left: 50%; top: 50%; width: 7px; height: 7px; border: 1px solid var(--text); background: #090909; transform: translate(-50%, -50%) rotate(45deg); }
.brand-symbol i:nth-child(2), .brand-symbol i:nth-child(3) { display: none; }
.brand-lockup { display: grid; gap: 2px; line-height: 1; }
.brand-lockup b { font-size: 12px; letter-spacing: 1.4px; }
.brand-lockup small { color: #6f6f6f; font-size: 7px; font-weight: 650; letter-spacing: 2.5px; }
.global-nav { align-self: stretch; display: flex; align-items: stretch; gap: 24px; }
.global-nav button { position: relative; padding: 1px 0 0; border: 0; background: transparent; color: #929292; font-size: 12px; cursor: pointer; }
.global-nav button:hover { color: var(--text); }
.global-nav button.active { color: var(--text); }
.global-nav button.active::after { content: ""; position: absolute; right: 0; bottom: -1px; left: 0; height: 2px; background: var(--text); }
.global-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.header-search, .header-create { height: 36px; padding: 0 11px; border: 1px solid var(--line); border-radius: 4px; background: transparent; display: inline-flex; align-items: center; gap: 8px; color: #aaa; font-size: 11px; cursor: pointer; }
.header-search { min-width: 132px; }
.header-search span { margin-right: auto; }
.header-search svg, .header-create svg { width: 16px; height: 16px; }
.header-create { color: #d1d1d1; }
.header-search:hover, .header-create:hover { border-color: #4a4a4a; background: #151515; color: var(--text); }
.global-actions .avatar { width: 32px; height: 32px; margin-left: 3px; }
.sidebar { display: none; }
.brand { width: 100%; height: 82px; display: flex; align-items: center; justify-content: center; gap: 9px; color: var(--text); text-decoration: none; border-bottom: 1px solid var(--line-soft); font-size: 13px; font-weight: 800; letter-spacing: 1.2px; }
.sidebar-brand-logo { width: 44px; height: 40px; }
.brand > span:last-child { display: none; }
.brand-mark { width: 30px; height: 30px; display: grid; place-items: center; border: 2px solid var(--text); font-size: 15px; font-weight: 800; line-height: 1; }
.side-nav { width: 100%; padding: 20px 12px; display: flex; flex-direction: column; gap: 8px; }
.nav-item { position: relative; width: 100%; min-height: 52px; padding: 0; display: grid; place-items: center; border: 0; border-radius: var(--radius); background: transparent; color: var(--muted); cursor: pointer; transition: .2s ease; }
.nav-item span { display: none; }
.nav-item:hover { background: #171717; color: var(--text); }
.nav-item.active { color: var(--text); background: #1b1b1b; }
.nav-item.active::before { content: ""; position: absolute; left: -12px; width: 2px; height: 24px; background: var(--text); }
.side-bottom { margin-top: auto; padding: 18px 0 22px; display: grid; gap: 16px; place-items: center; }
.icon-button { position: relative; width: 38px; height: 38px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; background: #121212; cursor: pointer; }
.icon-button:hover { border-color: #444; background: #181818; }
.notification-dot { position: absolute; right: 7px; top: 7px; width: 5px; height: 5px; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 2px #121212; }
.avatar { width: 36px; height: 36px; padding: 0; border: 1px solid #343434; border-radius: 50%; background: #141414; color: #d9d9d9; display: grid; place-items: center; cursor: pointer; transition: .18s ease; }
.avatar svg { width: 17px; height: 17px; stroke-width: 1.7; }
.avatar:hover { border-color: #6a6a6a; background: #1b1b1b; color: #fff; }

.main-content { width: min(1560px, 100%); margin: 0 auto; padding: 30px clamp(22px, 3.2vw, 52px) 34px; }
.topbar { min-height: 66px; display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; }
.eyebrow { color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: 1.3px; }
.live-dot { display: inline-block; width: 6px; height: 6px; margin-right: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px rgba(52, 211, 153, .1); }
h1 { margin: 7px 0 0; font-size: clamp(25px, 2.2vw, 34px); line-height: 1.15; letter-spacing: 0; }
.top-actions { display: flex; align-items: center; gap: 10px; }
.search-button, .primary-button { height: 42px; border-radius: var(--radius); display: inline-flex; align-items: center; justify-content: center; gap: 9px; cursor: pointer; }
.search-button { min-width: 185px; padding: 0 10px 0 14px; border: 1px solid var(--line); background: var(--panel); color: var(--muted); }
.search-button span { margin-right: auto; }
kbd { padding: 3px 6px; border: 1px solid #303030; border-radius: 4px; color: #777; background: #181818; font: 10px var(--font); }
.primary-button { padding: 0 17px; border: 0; background: var(--text); color: #080808; font-size: 13px; font-weight: 750; }
.primary-button:hover { background: #dcdcdc; }
.api-status { height: 42px; padding: 0 12px; border: 1px solid var(--line); border-radius: var(--radius); display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 11px; }
.api-status span { width: 6px; height: 6px; border-radius: 50%; background: var(--amber); }
.api-status.connected span { background: var(--green); }
.api-status.fallback span { background: var(--amber); }
.api-status b { font-weight: 500; }
.mobile-tabs { display: none; }

.ticker-strip { margin: 28px 0 16px; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); overflow: hidden; }
.ticker-card { min-width: 0; padding: 15px 18px; border: 0; border-right: 1px solid var(--line); background: transparent; color: var(--text); text-align: left; cursor: pointer; transition: background .2s; }
.ticker-card:last-child { border-right: 0; }
.ticker-card:hover, .ticker-card.active { background: #171717; box-shadow: inset 0 -1px var(--text); }
.ticker-symbol { display: flex; align-items: center; gap: 9px; margin-bottom: 8px; }
.coin-icon { flex: 0 0 auto; width: 28px; height: 28px; border: 1px solid rgba(255,255,255,.08); border-radius: 50%; display: inline-grid; place-items: center; background: #111; overflow: hidden; }
.coin-icon img { width: 100%; height: 100%; display: block; object-fit: contain; }
.coin-icon.sol { background: #050505; }
.coin-icon.sol img { width: 84%; height: 84%; }
.ticker-symbol b { font-size: 13px; }
.ticker-symbol small { color: var(--muted-2); font-size: 10px; }
.ticker-values { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.ticker-values strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; font-size: 15px; font-variant-numeric: tabular-nums; }
.ticker-values span { font-size: 11px; }

.panel { border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); overflow: hidden; }
.overview-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(310px, .78fr); gap: 16px; }
.portfolio-panel { min-height: 416px; padding: 22px 22px 14px; }
.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.panel-heading.compact { align-items: center; }
.panel-label, .subtle { color: var(--muted); font-size: 11px; }
.balance-line { margin-top: 5px; display: flex; align-items: baseline; gap: 8px; }
.balance-line strong { font-size: clamp(27px, 2.2vw, 38px); font-weight: 650; font-variant-numeric: tabular-nums; }
.balance-line > span { color: var(--muted); font-size: 11px; }
.visibility-button { width: 30px; height: 30px; margin-left: 3px; border: 0; background: transparent; color: var(--muted); cursor: pointer; }
.daily-pnl { display: grid; grid-template-columns: auto auto; justify-items: end; column-gap: 10px; }
.daily-pnl span { grid-column: 1 / -1; margin-bottom: 5px; color: var(--muted); font-size: 11px; }
.daily-pnl strong { font-size: 17px; }
.daily-pnl small { align-self: center; padding: 3px 6px; border-radius: 3px; background: rgba(52, 211, 153, .09); font-size: 10px; }
.positive { color: var(--green) !important; }
.negative { color: var(--red) !important; }
.asset-metrics { margin: 22px 0 18px; padding: 14px 0; display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); }
.asset-metrics > div { padding-left: 16px; border-left: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; }
.asset-metrics > div:first-child { padding-left: 0; border-left: 0; }
.asset-metrics span { color: var(--muted); font-size: 10px; }
.asset-metrics b { font-size: 13px; font-variant-numeric: tabular-nums; }
.asset-metrics small { color: var(--muted); font-size: 9px; font-weight: 500; }
.chart-header { display: flex; justify-content: space-between; align-items: center; }
.panel-title { font-size: 14px; font-weight: 700; }
.segmented { display: flex; padding: 2px; border: 1px solid var(--line); border-radius: 4px; background: #0d0d0d; }
.segmented button { min-width: 39px; height: 25px; padding: 0 7px; border: 0; border-radius: 3px; background: transparent; color: var(--muted); font-size: 10px; cursor: pointer; }
.segmented button.active { background: #282828; color: var(--text); }
.canvas-wrap { position: relative; width: 100%; }
.equity-canvas-wrap { height: 168px; margin-top: 9px; }
canvas { display: block; width: 100%; height: 100%; }
.chart-tooltip { position: absolute; z-index: 3; display: none; pointer-events: none; padding: 7px 9px; border: 1px solid #363636; border-radius: 4px; background: rgba(16,16,16,.95); box-shadow: 0 8px 22px rgba(0,0,0,.3); font-size: 10px; line-height: 1.55; transform: translate(-50%, -115%); white-space: nowrap; }

.strategy-panel { padding: 22px; display: flex; flex-direction: column; }
.strategy-name { margin-top: 8px; display: flex; align-items: center; gap: 9px; }
.strategy-name .coin-icon { width: 27px; height: 27px; }
.strategy-name strong { font-size: 14px; }
.switch { cursor: pointer; }
.switch input { position: absolute; opacity: 0; }
.switch span { width: 39px; height: 22px; padding: 2px; border-radius: 20px; background: #333; display: block; transition: .2s; }
.switch span::after { content: ""; width: 18px; height: 18px; border-radius: 50%; background: #8a8a8a; display: block; transition: .2s; }
.switch input:checked + span { background: var(--green); }
.switch input:checked + span::after { transform: translateX(17px); background: #fff; }
.strategy-meta { margin: 15px 0 18px; display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 10px; }
.strategy-meta i { width: 2px; height: 2px; border-radius: 50%; background: #555; }
.strategy-return span { display: block; color: var(--muted); font-size: 10px; }
.strategy-return strong { display: inline-block; margin-top: 5px; color: var(--green); font-size: 25px; font-weight: 650; }
.strategy-return small { margin-left: 7px; color: var(--muted); font-size: 10px; }
.mini-equity { height: 85px; margin: 10px -4px 8px; }
.strategy-stats { padding: 13px 0; display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); }
.strategy-stats div { padding-left: 12px; border-left: 1px solid var(--line); }
.strategy-stats div:first-child { padding-left: 0; border-left: 0; }
.strategy-stats span { display: block; margin-bottom: 5px; color: var(--muted); font-size: 9px; }
.strategy-stats b { font-size: 12px; }
.text-button { border: 0; background: transparent; color: var(--muted); font-size: 11px; cursor: pointer; }
.text-button:hover { color: var(--text); }
.text-button span { color: var(--text); }
.text-button.full { width: 100%; margin-top: auto; padding: 15px 0 0; text-align: center; }

.trading-grid { margin-top: 16px; display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(310px, .78fr); gap: 16px; }
.market-panel { min-height: 420px; padding: 21px 22px 14px; }
.panel-title { display: flex; align-items: center; gap: 9px; }
.market-tag, .count-badge { padding: 3px 6px; border-radius: 3px; background: #252525; color: var(--muted); font-size: 9px; font-weight: 500; }
.market-price-row { margin-top: 6px; display: flex; align-items: baseline; gap: 9px; }
.market-price-row strong { font-size: 25px; font-weight: 600; font-variant-numeric: tabular-nums; }
.market-price-row span { font-size: 11px; }
.ohlc-row { margin-top: 16px; display: flex; gap: 18px; color: var(--muted); font-size: 9px; }
.ohlc-row b { margin-left: 3px; color: #aaa; font-weight: 500; }
.market-canvas-wrap { height: 296px; margin-top: 7px; }
.chart-loading { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 8px; color: var(--muted); background: rgba(17,17,17,.65); font-size: 11px; }
.chart-loading span { width: 12px; height: 12px; border: 2px solid #444; border-top-color: var(--green-bright); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.chart-loading.hidden { display: none; }

.signal-panel { padding: 22px; }
.signal-state { display: inline-flex; align-items: center; gap: 6px; padding: 5px 8px; border: 1px solid rgba(0,192,135,.22); border-radius: 3px; background: transparent; color: var(--green); font-size: 10px; }
.signal-state i { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.score-gauge { margin: 28px 0 27px; padding: 18px 0; border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); display: flex; align-items: center; gap: 19px; }
.signal-score { flex: 0 0 96px; min-height: 68px; padding-right: 18px; border-right: 1px solid var(--line); display: flex; align-items: baseline; align-content: center; flex-wrap: wrap; }
.signal-score strong { font-size: 30px; line-height: 1; font-weight: 600; }
.signal-score > span { margin-left: 4px; color: var(--muted); font-size: 10px; }
.signal-score small { flex: 0 0 100%; margin-top: 9px; color: var(--muted); font-size: 9px; }
.score-copy strong { font-size: 13px; }
.score-copy p { max-width: 210px; margin: 7px 0 0; color: var(--muted); font-size: 10px; line-height: 1.65; }
.factor-list { display: grid; gap: 15px; }
.factor-list > div { display: grid; grid-template-columns: 62px 1fr 28px; align-items: center; gap: 10px; font-size: 10px; }
.factor-list span { color: var(--muted); }
.factor-list i { height: 3px; background: #292929; overflow: hidden; }
.factor-list i b { display: block; height: 100%; background: var(--text); }
.factor-list i.risk b { background: var(--amber); }
.factor-list strong { text-align: right; font-size: 10px; }
.signal-footer { margin-top: 27px; padding-top: 14px; border-top: 1px solid var(--line-soft); display: flex; justify-content: space-between; color: var(--muted); font-size: 9px; }
.signal-footer b { color: #aaa; font-weight: 500; font-variant-numeric: tabular-nums; }

.positions-panel { margin-top: 16px; }
.positions-heading { padding: 20px 22px 16px; }
.position-table { width: 100%; overflow: hidden; }
.position-row { min-height: 68px; padding: 0 22px; border-top: 1px solid var(--line-soft); display: grid; grid-template-columns: 1.25fr .82fr .8fr .8fr 1fr 1fr 30px; align-items: center; gap: 14px; font-size: 11px; font-variant-numeric: tabular-nums; }
.position-row.table-head { min-height: 35px; background: #0e0e0e; color: var(--muted-2); font-size: 9px; }
.position-row > b { font-size: 11px; font-weight: 550; }
.position-symbol { display: grid; grid-template-columns: 30px 1fr; column-gap: 9px; align-items: center; }
.position-symbol .coin-icon { grid-row: 1 / 3; width: 29px; height: 29px; }
.position-symbol b { font-size: 11px; }
.position-symbol small, .pnl small { color: var(--muted); font-size: 9px; }
.direction { display: inline-grid; place-items: center; width: 20px; height: 20px; margin-right: 6px; border-radius: 3px; font-size: 9px; }
.direction.long { background: rgba(52,211,153,.09); color: var(--green); }
.direction.short { background: rgba(255,92,112,.09); color: var(--red); }
.pnl { display: flex; flex-direction: column; gap: 3px; }
.pnl b { font-size: 11px; }
.pnl small { color: currentColor; }
.row-menu { width: 30px; height: 30px; border: 0; border-radius: 4px; background: transparent; color: var(--muted); cursor: pointer; }
.row-menu:hover { background: #222; color: var(--text); }
.page-footer { padding: 24px 2px 0; display: flex; justify-content: space-between; color: #4e4e4e; font-size: 8px; letter-spacing: .7px; }
.mobile-nav { display: none; }

.welcome-backdrop { position: fixed; inset: 0; z-index: 120; padding: 20px; display: grid; place-items: center; background: rgba(0,0,0,.76); backdrop-filter: blur(8px); opacity: 0; visibility: hidden; transition: opacity .22s ease, visibility .22s ease; }
.welcome-backdrop.open { opacity: 1; visibility: visible; }
.welcome-offer { position: relative; width: min(500px, 100%); padding: 29px 30px 24px; border: 1px solid #3a3a3a; border-radius: 6px; background: #101010; box-shadow: 0 28px 80px rgba(0,0,0,.62); transform: translateY(10px); transition: transform .22s ease; }
.welcome-backdrop.open .welcome-offer { transform: translateY(0); }
.offer-close { position: absolute; top: 18px; right: 18px; width: 34px; height: 34px; padding: 0; border: 1px solid #303030; border-radius: 50%; background: transparent; color: #8b8b8b; display: grid; place-items: center; cursor: pointer; }
.offer-close:hover { border-color: #555; color: var(--text); }
.offer-close svg { width: 17px; height: 17px; }
.offer-brand { display: flex; align-items: center; gap: 8px; color: #8b8b8b; font-size: 8px; font-weight: 700; letter-spacing: 1.7px; }
.offer-brand > span { width: 14px; height: 14px; border: 1px solid #686868; border-radius: 50%; position: relative; }
.offer-brand > span::before, .offer-brand > span::after { content: ""; position: absolute; left: 50%; top: 50%; background: #777; transform: translate(-50%, -50%); }
.offer-brand > span::before { width: 1px; height: 9px; }
.offer-brand > span::after { width: 9px; height: 1px; }
.offer-kicker { margin-top: 27px; color: #6f6f6f; font-size: 9px; font-weight: 650; letter-spacing: 1.4px; }
.welcome-offer h2 { margin: 7px 48px 0 0; font-size: 23px; line-height: 1.35; font-weight: 650; }
.offer-intro { margin: 12px 0 0; color: #969696; font-size: 11px; line-height: 1.75; }
.offer-amount { margin: 23px 0 21px; padding: 18px 0; border-top: 1px solid #292929; border-bottom: 1px solid #292929; display: flex; align-items: center; gap: 15px; }
.offer-amount > strong { font-size: 54px; line-height: .95; font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: 0; }
.offer-amount > span { display: grid; gap: 7px; }
.offer-amount b { font-size: 14px; letter-spacing: .5px; }
.offer-amount small { color: var(--green); font-size: 10px; }
.offer-steps { display: grid; grid-template-columns: repeat(3, 1fr); }
.offer-steps > div { min-width: 0; padding: 0 12px; border-left: 1px solid #292929; display: flex; gap: 9px; }
.offer-steps > div:first-child { padding-left: 0; border-left: 0; }
.offer-steps > div:last-child { padding-right: 0; }
.offer-steps i { color: #676767; font: 9px var(--font); }
.offer-steps span { min-width: 0; display: grid; gap: 5px; }
.offer-steps b { font-size: 10px; white-space: nowrap; }
.offer-steps small { color: #6e6e6e; font-size: 8px; line-height: 1.45; }
.offer-primary { width: 100%; height: 45px; margin-top: 25px; border: 0; border-radius: 4px; background: #f0f0f0; color: #0a0a0a; font-size: 12px; font-weight: 750; cursor: pointer; }
.offer-primary:hover { background: #fff; }
.offer-primary span { margin-left: 5px; }
.offer-secondary { width: 100%; height: 36px; border: 0; background: transparent; color: #777; font-size: 10px; cursor: pointer; }
.offer-secondary:hover { color: #bbb; }
.offer-terms { margin: 0; color: #555; font-size: 8px; line-height: 1.55; text-align: center; }

.modal-backdrop, .command-backdrop { position: fixed; inset: 0; z-index: 100; padding: 20px; display: grid; place-items: center; background: rgba(0,0,0,.72); backdrop-filter: blur(8px); opacity: 0; visibility: hidden; transition: .2s; }
.modal-backdrop.open, .command-backdrop.open { opacity: 1; visibility: visible; }
.modal { width: min(480px, 100%); padding: 24px; border: 1px solid #313131; border-radius: 8px; background: #111; box-shadow: 0 24px 80px rgba(0,0,0,.6); transform: translateY(12px); transition: .2s; }
.open .modal { transform: none; }
.modal-header { display: flex; justify-content: space-between; align-items: flex-start; }
.modal h2 { margin: 6px 0 0; font-size: 21px; }
.modal form { margin-top: 24px; display: grid; gap: 18px; }
.modal label { display: grid; gap: 8px; color: var(--muted); font-size: 11px; }
.template-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.template-grid input { position: absolute; opacity: 0; }
.template-grid > span { min-height: 90px; padding: 13px; border: 1px solid var(--line); border-radius: 5px; display: grid; grid-template-columns: 26px 1fr; column-gap: 8px; align-content: center; cursor: pointer; }
.template-grid > span svg { grid-row: 1 / 3; color: var(--green-bright); }
.template-grid > span b { color: var(--text); font-size: 12px; }
.template-grid > span small { margin-top: 4px; color: var(--muted); font-size: 9px; }
.template-grid input:checked + span { border-color: var(--green-bright); background: var(--green-soft); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.modal select, .modal input { width: 100%; height: 42px; padding: 0 12px; border: 1px solid var(--line); border-radius: 4px; background: #0a0a0a; color: var(--text); }
.input-suffix { position: relative; display: block; }
.input-suffix b { position: absolute; right: 12px; top: 13px; color: var(--muted); font-size: 10px; }
.risk-note { padding: 13px; border: 1px solid #27311a; border-radius: 5px; background: rgba(184,245,44,.04); display: flex; align-items: center; gap: 12px; }
.risk-note svg { color: var(--green); }
.risk-note span { display: grid; gap: 3px; }
.risk-note b { font-size: 10px; }
.risk-note small { color: var(--muted); font-size: 9px; }
.modal-submit { width: 100%; height: 45px; }

.command-backdrop { align-items: start; padding-top: 12vh; }
.command-box { width: min(570px, 100%); border: 1px solid #343434; border-radius: 7px; background: #121212; box-shadow: 0 24px 80px rgba(0,0,0,.55); overflow: hidden; }
.command-input { height: 59px; padding: 0 16px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 12px; }
.command-input input { flex: 1; height: 100%; border: 0; outline: 0; background: transparent; color: var(--text); }
.command-results { padding: 8px; }
.command-result { width: 100%; height: 54px; padding: 0 10px; border: 0; border-radius: 4px; background: transparent; display: flex; align-items: center; gap: 10px; text-align: left; cursor: pointer; }
.command-result:hover { background: #1d1d1d; }
.command-result b { font-size: 12px; }
.command-result small { margin-left: auto; color: var(--muted); }
.toast { position: fixed; left: 50%; bottom: 26px; z-index: 150; min-height: 44px; padding: 0 16px; border: 1px solid #345019; border-radius: 5px; background: #15200b; color: #d9f99d; display: flex; align-items: center; gap: 9px; font-size: 11px; transform: translate(-50%, 20px); opacity: 0; visibility: hidden; transition: .25s; }
.toast.show { transform: translate(-50%, 0); opacity: 1; visibility: visible; }

@media (max-width: 1100px) {
  .api-status { display: none; }
  .global-header { gap: 22px; }
  .global-nav { gap: 16px; }
  .global-nav button { font-size: 11px; }
  .overview-grid, .trading-grid { grid-template-columns: minmax(0, 1.45fr) minmax(290px, .8fr); }
  .position-row { grid-template-columns: 1.25fr .8fr .8fr 1fr 1fr 30px; }
  .position-row > :nth-child(4) { display: none; }
  .table-head > :nth-child(4) { display: none; }
}

@media (max-width: 820px) {
  :root { --sidebar: 0px; }
  .sidebar { display: none; }
  .global-header { display: none; }
  .brand-symbol { width: 27px; height: 27px; }
  .brand-symbol::before { height: 19px; }
  .brand-symbol::after { width: 19px; }
  .brand-lockup b { font-size: 11px; letter-spacing: 1.1px; }
  .brand-lockup small { font-size: 6px; }
  .brand-logo { width: 40px; height: 36px; }
  .global-nav { display: none; }
  .global-actions { gap: 8px; }
  .header-search { width: 34px; min-width: 34px; height: 34px; padding: 0; justify-content: center; border-color: transparent; }
  .header-search span, .header-search kbd { display: none; }
  .header-create { display: none; }
  .global-actions .avatar { width: 30px; height: 30px; margin-left: 0; }
  .main-content { margin: 0; padding: 76px 15px 88px; }
  .topbar { min-height: 66px; align-items: center; }
  .topbar .top-actions { display: none; }
  .mobile-tabs { position: fixed; inset: 0 0 auto; z-index: 65; height: 56px; margin: 0; padding: 0 12px 0 15px; border-bottom: 1px solid var(--line-soft); background: rgba(9,9,9,.98); backdrop-filter: blur(16px); display: flex; align-items: stretch; gap: 10px; }
  .mobile-tabs::-webkit-scrollbar { display: none; }
  .mobile-tab-links { min-width: 0; flex: 1; display: flex; align-items: stretch; justify-content: space-between; gap: 13px; overflow-x: auto; scrollbar-width: none; }
  .mobile-tab-links::-webkit-scrollbar { display: none; }
  .mobile-tab-links button { position: relative; flex: 0 0 auto; padding: 0; border: 0; background: transparent; color: #777; font-size: 13px; }
  .mobile-tab-links button.active { color: var(--text); }
  .mobile-tab-links button.active::after { content: ""; position: absolute; right: 0; bottom: -1px; left: 0; height: 2px; background: var(--text); }
  .mobile-tab-tools { flex: 0 0 auto; padding-left: 9px; border-left: 1px solid #252525; display: flex; align-items: center; gap: 4px; }
  .mobile-tab-tools > button { width: 31px; height: 31px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: #a0a0a0; display: grid; place-items: center; }
  .mobile-tab-tools > button:hover { background: #171717; color: var(--text); }
  .mobile-tab-tools svg { width: 17px; height: 17px; }
  .mobile-tab-tools .avatar { border: 1px solid #303030; }
  .top-actions .search-button { width: 42px; min-width: 42px; padding: 0; }
  .search-button span, .search-button kbd, .primary-button span { display: none; }
  .top-actions .primary-button { width: 42px; padding: 0; }
  .ticker-strip { display: flex; margin: 14px -15px 14px; border-width: 1px 0; border-radius: 0; overflow-x: auto; scrollbar-width: none; scroll-snap-type: x mandatory; }
  .ticker-strip::-webkit-scrollbar { display: none; }
  .ticker-card { flex: 0 0 168px; scroll-snap-align: start; }
  .overview-grid, .trading-grid { grid-template-columns: 1fr; }
  .strategy-panel { min-height: 393px; }
  .market-panel { min-height: 400px; }
  .signal-panel { min-height: 355px; }
  .position-table { overflow-x: auto; }
  .position-row { min-width: 800px; grid-template-columns: 1.25fr .82fr .8fr .8fr 1fr 1fr 30px; }
  .position-row > :nth-child(4), .table-head > :nth-child(4) { display: initial; }
  .mobile-nav { position: fixed; inset: auto 0 0; z-index: 50; height: calc(62px + env(safe-area-inset-bottom)); padding: 3px 8px env(safe-area-inset-bottom); border-top: 1px solid var(--line); background: rgba(10,10,10,.98); backdrop-filter: blur(16px); display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); align-items: stretch; }
  .mobile-nav button { width: 100%; height: 58px; padding: 6px 0 5px; border: 0; background: transparent; color: #727272; display: grid; grid-template-rows: 23px 15px; align-content: center; justify-items: center; gap: 3px; font-size: 10px; line-height: 15px; }
  .mobile-nav button.active { color: var(--text); }
  .mobile-nav svg { width: 19px; height: 19px; align-self: center; }
  .mobile-nav .mobile-create { width: 100%; height: 58px; place-self: auto; border-radius: 0; background: transparent; color: #727272; box-shadow: none; }
  .mobile-nav .mobile-create svg { width: 19px; height: 19px; }
  .toast { bottom: 76px; }
}

@media (max-width: 520px) {
  .topbar h1 { font-size: 27px; }
  .eyebrow { font-size: 11px; }
  .top-actions { gap: 7px; }
  .portfolio-panel, .strategy-panel, .market-panel, .signal-panel { padding: 17px 15px 12px; }
  .portfolio-panel { min-height: 394px; }
  .balance-line strong { font-size: 30px; }
  .panel-label, .subtle { font-size: 12px; }
  .panel-title { font-size: 15px; }
  .ticker-symbol b { font-size: 14px; }
  .ticker-symbol small { font-size: 11px; }
  .ticker-values strong { font-size: 17px; }
  .ticker-values span { font-size: 12px; }
  .daily-pnl { display: block; text-align: right; }
  .daily-pnl strong { display: block; margin-top: 4px; font-size: 14px; }
  .daily-pnl small { display: inline-block; margin-top: 4px; }
  .asset-metrics { margin-top: 18px; }
  .asset-metrics > div { padding-left: 9px; }
  .asset-metrics span { font-size: 11px; }
  .asset-metrics b { font-size: 12px; }
  .equity-canvas-wrap { height: 150px; }
  .strategy-name strong { font-size: 15px; }
  .strategy-meta { font-size: 11px; }
  .strategy-return span { font-size: 11px; }
  .strategy-stats { margin-top: 2px; }
  .strategy-stats span { font-size: 10px; }
  .strategy-stats b { font-size: 13px; }
  .market-heading { align-items: flex-start !important; }
  .market-heading .segmented { margin-top: 2px; }
  .segmented button { min-width: 31px; padding: 0 5px; }
  .market-price-row strong { font-size: 21px; }
  .ohlc-row { gap: 10px; overflow-x: auto; white-space: nowrap; }
  .market-canvas-wrap { height: 270px; }
  .score-gauge { gap: 14px; }
  .signal-score { flex-basis: 88px; padding-right: 14px; }
  .score-copy p { line-height: 1.55; }
  .positions-heading { padding: 17px 15px 14px; }
  .page-footer { display: none; }
  .welcome-backdrop { padding: 12px; }
  .welcome-offer { padding: 24px 19px 19px; }
  .offer-close { top: 15px; right: 15px; }
  .offer-brand { font-size: 9px; }
  .offer-kicker { margin-top: 23px; font-size: 10px; }
  .welcome-offer h2 { margin-right: 38px; font-size: 22px; }
  .offer-intro { font-size: 12px; line-height: 1.7; }
  .offer-amount { margin: 19px 0; padding: 16px 0; }
  .offer-amount > strong { font-size: 48px; }
  .offer-steps { grid-template-columns: 1fr; gap: 0; }
  .offer-steps > div { min-height: 60px; padding: 8px 0; border-left: 0; border-top: 1px solid #242424; align-items: center; }
  .offer-steps > div:first-child { border-top: 0; }
  .offer-steps span { width: 100%; grid-template-columns: minmax(0, 1fr); align-items: center; gap: 4px; }
  .offer-steps i { font-size: 10px; }
  .offer-steps b { font-size: 12px; }
  .offer-steps small { min-width: 0; font-size: 10px; overflow-wrap: anywhere; }
  .offer-steps span small { margin-top: 0; }
  .offer-primary { margin-top: 18px; font-size: 13px; }
  .offer-secondary { font-size: 11px; }
  .offer-terms { font-size: 9px; }
  .modal-backdrop { padding: 10px; align-items: end; }
  .modal { padding: 20px 16px calc(20px + env(safe-area-inset-bottom)); border-radius: 8px 8px 0 0; }
  .template-grid > span { min-height: 82px; padding: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
