:root {
  --bg: #0a0c12;
  --surface: #11141c;
  --surface-2: #171b25;
  --surface-3: #1e2330;
  --line: #252b39;
  --line-2: #333b4d;
  --text: #e8ecf3;
  --muted: #8b95a8;
  --accent: #4de3c1;
  --accent-2: #8ff0dc;
  --accent-ink: #04221b;
  --ok: #2bd98b;
  --err: #ff5c7a;
  --warn: #f5b83d;
  --long: #2bd98b;
  --short: #ff5c7a;
  --radius: 14px;
  --radius-sm: 9px;
  --mono: ui-monospace, "SFMono-Regular", "JetBrains Mono", Menlo, Consolas, monospace;
  --sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.55 var(--sans); min-height: 100vh; display: flex; flex-direction: column; }
main { flex: 1; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent-2); }
img { max-width: 100%; display: block; }
h1, h2, h3 { margin: 0; line-height: 1.15; letter-spacing: -0.02em; }
h1 { font-size: clamp(28px, 4.4vw, 44px); font-weight: 750; }
h2 { font-size: 22px; font-weight: 700; }
h3 { font-size: 16px; font-weight: 650; }
p { margin: 0 0 12px; }
code, pre, .mono { font-family: var(--mono); font-size: 0.93em; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; border-radius: 6px; }

.wrap { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 20px 64px; }
.wrap-narrow { max-width: 820px; }
.muted { color: var(--muted); }
.accent { color: var(--accent); }
.up { color: var(--long); }
.down { color: var(--short); }
.min0 { min-width: 0; }
.row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.row.nowrap { flex-wrap: nowrap; }
.k { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.big { font-size: 22px; font-weight: 700; }
.eyebrow { font-size: 12px; font-weight: 650; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent); margin-bottom: 12px; }
.lede { font-size: 17px; color: #c3cad6; max-width: 62ch; }
.hint { font-size: 13px; color: var(--muted); margin-top: 8px; }
.hint.err, .err { color: var(--err); }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.opt { font-size: 12px; font-weight: 500; color: var(--muted); margin-left: 6px; text-transform: none; letter-spacing: 0; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 16px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--surface-2); color: var(--text); font-weight: 600; cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s, transform .05s; }
.btn:hover { background: var(--surface-3); border-color: #48525f; color: var(--text); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent-2); border-color: var(--accent-2); color: var(--accent-ink); }
.btn-ghost { background: transparent; }
.btn-sm { padding: 6px 11px; font-size: 13px; border-radius: 8px; }
.btn-lg { padding: 13px 22px; font-size: 16px; }
.btn-block { width: 100%; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; align-items: center; }
.btn-row.end { justify-content: flex-end; }
.addr-row .btn-row, .wallet-addr .btn-row, .config-row .btn-row { margin-top: 0; }

.nav { position: sticky; top: 0; z-index: 30; background: rgba(10, 12, 18, .86); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.nav-inner { max-width: 1180px; margin: 0 auto; padding: 12px 20px; display: flex; align-items: center; gap: 22px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; }
.brand:hover { color: var(--text); }
.brand-mark { width: 26px; height: 26px; border-radius: 8px; background: linear-gradient(135deg, var(--accent), #3b82f6); position: relative; flex: none; }
.brand-mark::before { content: ""; position: absolute; left: 8px; top: 6px; width: 3px; height: 14px; border-radius: 2px; background: var(--accent-ink); }
.brand-mark::after { content: ""; position: absolute; left: 15px; top: 10px; width: 3px; height: 10px; border-radius: 2px; background: var(--accent-ink); }
.brand-name { font-size: 17px; font-weight: 600; letter-spacing: -0.02em; }
.brand-name b { color: var(--accent); font-weight: 800; }
.nav-links { display: flex; gap: 4px; flex: 1; overflow-x: auto; scrollbar-width: none; }
.nav-links a { padding: 7px 12px; border-radius: 8px; color: var(--muted); font-weight: 600; font-size: 14px; white-space: nowrap; }
.nav-links a:hover, .nav-links a.on { color: var(--text); background: var(--surface-2); }
.nav-right { display: flex; align-items: center; gap: 10px; }
.ca { display: inline-flex; align-items: center; gap: 8px; padding: 5px 10px; border: 1px solid var(--line-2); border-radius: 999px; font-size: 12px; white-space: nowrap; }
.ca b { color: var(--accent); }
.ca-soon { color: var(--muted); font-style: italic; }
.ca-none .ca-v { color: var(--warn); font-weight: 700; letter-spacing: 0.04em; }
.ca-copy { background: none; border: 0; color: var(--muted); cursor: pointer; padding: 0; font-size: 12px; }
.ca-copy:hover { color: var(--text); }
.banner { background: #2a1f08; color: var(--warn); border-bottom: 1px solid #4a3710; padding: 9px 20px; text-align: center; font-size: 13px; }

.wallet-wrap { position: relative; display: inline-block; }
.wallet-btn { gap: 8px; }
.wallet-icon { width: 18px; height: 18px; border-radius: 5px; }
.wallet-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--ok); }
.wallet-menu { position: absolute; right: 0; top: calc(100% + 8px); width: 300px; background: var(--surface-2); border: 1px solid var(--line-2); border-radius: var(--radius); padding: 14px; display: grid; gap: 8px; box-shadow: 0 18px 50px rgba(0, 0, 0, .5); }
.wallet-addr { word-break: break-all; font-size: 12px; }
.wallet-picker { position: fixed; inset: 0; z-index: 60; background: rgba(4, 5, 7, .72); display: grid; place-items: center; padding: 20px; }
.wp-box { width: 100%; max-width: 400px; background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--radius); padding: 20px; }
.wp-list { display: grid; gap: 8px; margin: 14px 0; }
.wp-item { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface-2); cursor: pointer; width: 100%; text-align: left; }
.wp-item:hover { border-color: var(--accent); color: var(--text); }
.wp-icon { width: 30px; height: 30px; border-radius: 8px; background: var(--surface-3); flex: none; }
.wp-name { font-weight: 650; }

.hero { display: grid; grid-template-columns: 1.4fr 1fr; gap: 32px; align-items: center; padding: 56px 0 36px; }
.hero h1 { font-size: clamp(32px, 5.2vw, 56px); margin-bottom: 18px; }
.hero-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; min-width: 0; }
.stat-k { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.stat-v { font-size: 24px; font-weight: 750; margin-top: 4px; letter-spacing: -0.02em; overflow-wrap: anywhere; }
.stat-sub { font-size: 12px; color: var(--muted); margin-top: 2px; min-height: 1em; }
.stats-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 18px 0; }

.ticker { overflow: hidden; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 10px 0; margin-bottom: 8px; -webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent); mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent); }
.ticker-track { display: flex; gap: 26px; width: max-content; animation: ticker 80s linear infinite; }
.ticker:hover .ticker-track { animation-play-state: paused; }
.ticker-item { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; }
.ticker-item img { width: 20px; height: 20px; border-radius: 50%; background: #fff; }
.ticker-item span { color: var(--muted); }
.ticker-item em { font-style: normal; font-size: 12px; }
@keyframes ticker { to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .ticker-track { animation: none; flex-wrap: wrap; width: auto; } html { scroll-behavior: auto; } }

.section { margin-top: 44px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.page-head { padding: 44px 0 20px; }
.page-head h1 { margin-bottom: 12px; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.tab { padding: 7px 13px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); font-size: 13px; font-weight: 600; }
.tab.on, .tab:hover { color: var(--text); border-color: var(--line-2); background: var(--surface-2); }
.pager { display: flex; gap: 6px; justify-content: center; margin-top: 20px; flex-wrap: wrap; }
.pager a { min-width: 34px; text-align: center; padding: 6px 10px; border-radius: 8px; border: 1px solid var(--line); color: var(--muted); }
.pager a.on { color: var(--accent-ink); background: var(--accent); border-color: var(--accent); }

input[type=text], input[type=search], input[type=password], input[type=number], select, textarea { width: 100%; background: var(--bg); border: 1px solid var(--line-2); border-radius: var(--radius-sm); padding: 10px 12px; color: var(--text); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(77, 227, 193, .18); }
textarea { resize: vertical; }
.filters input[type=search] { width: 240px; }
.filters select { width: auto; }
.field { margin-bottom: 16px; }
.field label, .field .label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
label.inline { display: inline-flex; align-items: center; gap: 6px; font-weight: 500; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.span-2 { grid-column: span 2; }
.prefixed { display: flex; border: 1px solid var(--line-2); border-radius: var(--radius-sm); overflow: hidden; background: var(--bg); }
.prefixed span { padding: 10px 0 10px 12px; color: var(--muted); white-space: nowrap; }
.prefixed input { border: 0; padding-left: 2px; box-shadow: none !important; }
.prefixed:focus-within { border-color: var(--accent); }
.drop-row { display: flex; gap: 12px; align-items: stretch; }
.drop { flex: 1; display: flex; align-items: center; justify-content: center; text-align: center; padding: 18px; border: 1px dashed var(--line-2); border-radius: var(--radius-sm); color: var(--muted); cursor: pointer; }
.drop:hover { border-color: var(--accent); color: var(--text); }
.drop input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.drop-prev { width: 84px; height: 84px; flex: none; border-radius: var(--radius-sm); background: var(--surface-3) center/cover no-repeat; display: grid; place-items: center; color: var(--muted); font-size: 12px; }
details.more { border-top: 1px solid var(--line); padding-top: 14px; }
details.more summary { cursor: pointer; font-weight: 600; margin-bottom: 12px; }
.chip { padding: 5px 12px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface-2); cursor: pointer; font-size: 13px; }
.chip:hover { border-color: var(--accent); }
.chip.on { border-color: var(--accent); color: var(--accent); }
.chip:disabled { opacity: .35; cursor: not-allowed; }
.quick { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.amount-row { display: flex; align-items: center; border: 1px solid var(--line-2); border-radius: var(--radius-sm); background: var(--bg); }
.amount-row:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(77, 227, 193, .18); }
.amount-row input { border: 0; background: none; font-size: 20px; padding: 12px; box-shadow: none !important; min-width: 0; }
.amount-unit { padding: 0 14px; color: var(--muted); font-weight: 650; white-space: nowrap; }
.estimate { margin-top: 10px; padding: 10px 12px; border-radius: var(--radius-sm); background: rgba(77, 227, 193, .08); border: 1px solid rgba(77, 227, 193, .28); font-size: 14px; }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin-bottom: 16px; }
.panel-title { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin-bottom: 14px; display: flex; align-items: center; gap: 10px; }
.panel-no { width: 22px; height: 22px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: inline-grid; place-items: center; font-size: 12px; }
.note { padding: 12px 14px; border-radius: var(--radius-sm); border: 1px solid var(--line-2); background: var(--surface-2); margin-bottom: 14px; font-size: 14px; }
.note-err { border-color: #5a2432; background: #241216; color: #ffb4c2; }
.note-warn { border-color: #4a3710; background: #221a08; color: #f8d58a; }
.note-ok { border-color: #1b4a36; background: #0d2019; color: #a6f0cd; }
.pill { display: inline-block; padding: 2px 9px; border-radius: 999px; border: 1px solid var(--line-2); font-size: 12px; font-weight: 600; color: var(--muted); }
.pill-ok { color: var(--ok); border-color: #1b4a36; background: #0d2019; }
.pill-warn { color: var(--warn); border-color: #4a3710; background: #221a08; }
.pill-err { color: var(--err); border-color: #5a2432; background: #241216; }
.empty { text-align: center; padding: 48px 20px; border: 1px dashed var(--line-2); border-radius: var(--radius); margin-bottom: 16px; }
.empty h3 { margin-bottom: 8px; font-size: 18px; }
.logbox { background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px; margin: 12px 0 0; max-height: 220px; overflow: auto; white-space: pre-wrap; word-break: break-word; font-size: 12.5px; color: #c3cad6; }
.facts { display: grid; grid-template-columns: 150px 1fr; gap: 10px 16px; margin: 0; }
.facts dt { color: var(--muted); font-size: 13px; }
.facts dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; }

.tgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 14px; }
.tcard { display: block; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; transition: border-color .15s, transform .15s; }
.tcard:hover { border-color: var(--accent); transform: translateY(-2px); color: var(--text); }
.tcard-top { display: flex; align-items: center; gap: 12px; }
.tcard-logo { width: 46px; height: 46px; border-radius: 12px; object-fit: cover; flex: none; background: var(--surface-3); }
.tcard-logo-blank { display: grid; place-items: center; font-weight: 800; color: var(--accent); }
.tcard-name { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tcard-sym { color: var(--muted); font-size: 13px; }
.tcard-top .stock-badge, .tcard-top > .btn { margin-left: auto; flex: none; }
.tcard-bet { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 12px; }
.tcard-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 14px 0 12px; }
.tcard-stats .k { display: block; font-size: 11px; }
.tcard-stats .v { font-weight: 700; }
.tcard-bar, .progress { height: 7px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.tcard-bar span, .progress span { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--accent), #3b82f6); transition: width .4s; }
.tcard-bar.done span, .progress.done span { background: var(--ok); }
.tcard-foot { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-top: 8px; }
.stock-badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px 3px 4px; border-radius: 999px; background: var(--surface-3); border: 1px solid var(--line-2); font-size: 12px; font-weight: 650; white-space: nowrap; }
.stock-badge img { width: 18px; height: 18px; border-radius: 50%; }
.mine { margin-bottom: 14px; }

.bet-badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; border: 1px solid var(--line-2); background: var(--surface-3); white-space: nowrap; }
.bet-badge b { color: var(--text); }
.bet-long { border-color: rgba(43, 217, 139, .45); color: var(--long); }
.bet-short { border-color: rgba(255, 92, 122, .45); color: var(--short); }
.bet-side-long { color: var(--long); }
.bet-side-short { color: var(--short); }
.bet-status { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); border: 1px solid var(--line); white-space: nowrap; }
.bet-status-open { color: var(--ok); border-color: #1b4a36; background: #0d2019; }
.bet-status-funded { color: var(--warn); border-color: #4a3710; background: #221a08; }
.bet-status-liquidated, .bet-status-skipped, .bet-status-disabled { color: var(--err); border-color: #5a2432; background: #241216; }
.bet-status-closed { color: var(--text); border-color: var(--line-2); background: var(--surface-3); }
.bet-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; }
.bet-head .bet-status { margin-left: auto; }
.bet-logo { width: 44px; height: 44px; border-radius: 50%; background: #fff; flex: none; }
.bet-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.bet-grid > div { display: grid; gap: 2px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; min-width: 0; }
.bet-grid .v { font-weight: 700; overflow-wrap: anywhere; }
.bet-row { display: grid; grid-template-columns: auto 1fr; gap: 20px; align-items: start; margin-top: 14px; }
.seg-side { margin: 0; }
.seg-side button[aria-checked=true] { background: var(--surface-3); color: var(--text); }
.seg-side [data-bet-side=long][aria-checked=true] { background: rgba(43, 217, 139, .16); color: var(--long); }
.seg-side [data-bet-side=short][aria-checked=true] { background: rgba(255, 92, 122, .16); color: var(--short); }
.bet-row input[type="range"] { -webkit-appearance: none; appearance: none; width: 100%; height: 28px; padding: 0; border: 0; background: none; box-shadow: none; cursor: pointer; }
.bet-row input[type="range"]::-webkit-slider-runnable-track { height: 6px; border-radius: 999px; background: var(--surface-3); border: 1px solid var(--line-2); }
.bet-row input[type="range"]::-moz-range-track { height: 6px; border-radius: 999px; background: var(--surface-3); border: 1px solid var(--line-2); }
.bet-row input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 22px; height: 22px; margin-top: -9px; border-radius: 50%; background: var(--accent); border: 3px solid var(--bg); box-shadow: 0 0 0 1px var(--accent); }
.bet-row input[type="range"]::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: var(--accent); border: 3px solid var(--bg); box-shadow: 0 0 0 1px var(--accent); }
.desk-actions { display: grid; gap: 10px; margin-top: 10px; }
.desk-actions .desk-action { padding: 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-2); }
.desk-actions input[type=number] { max-width: 160px; }
.desk-actions .grid-2 .field { margin-bottom: 8px; }

.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.step { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.step-no { font-family: var(--mono); color: var(--accent); font-weight: 700; margin-bottom: 10px; }
.step h3 { margin-bottom: 8px; }
.step p { color: #b6becb; font-size: 14px; margin: 0; }
.feed { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.feed li { display: grid; grid-template-columns: 10px 1fr auto; gap: 10px; align-items: baseline; font-size: 14px; }
.feed-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); transform: translateY(-1px); }
.feed-launched { background: var(--accent); }
.feed-migrated { background: var(--ok); }
.feed-migrationfeecollected, .feed-deskfunded { background: var(--accent-2); }
.feed-feescollected { background: #6aa8ff; }
.feed-positionopened { background: #3b82f6; }
.feed-positionclosed { background: var(--warn); }
.feed-positionliquidated { background: var(--err); }
.feed-profitswept { background: var(--ok); }
.feed-text { min-width: 0; overflow-wrap: anywhere; }
.feed-time { color: var(--muted); font-size: 12px; white-space: nowrap; }

#market-search, #pair-search { margin-bottom: 12px; }
.stock-opt[hidden], .market-opt[hidden] { display: none; }
.stock-opt-blank { width: 28px; height: 28px; border-radius: 50%; grid-row: span 3; background: var(--surface-3); display: grid; place-items: center; font-weight: 800; color: var(--accent); font-size: 13px; }
.stat-plus { font-size: 14px; font-weight: 600; color: var(--muted); }
select { cursor: pointer; }
.stock-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(136px, 1fr)); gap: 8px; max-height: 420px; overflow: auto; padding: 2px 4px 2px 2px; }
.pair-grid { max-height: none; }
.market-grid { grid-template-columns: repeat(auto-fill, minmax(156px, 1fr)); max-height: 360px; }
.stock-opt, .market-opt { display: grid; grid-template-columns: 28px 1fr; grid-template-rows: auto auto auto; column-gap: 10px; align-items: center; text-align: left; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface-2); cursor: pointer; }
.stock-opt:hover, .market-opt:hover { border-color: var(--line-2); }
.stock-opt.on, .market-opt.on { border-color: var(--accent); background: rgba(77, 227, 193, .09); box-shadow: 0 0 0 1px var(--accent) inset; }
.stock-opt img, .market-opt img { width: 28px; height: 28px; border-radius: 50%; grid-row: span 3; background: #fff; }
.stock-opt-s { font-weight: 700; font-size: 14px; }
.stock-opt-n { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stock-opt-p { font-size: 12px; color: #c3cad6; }
.stock-opt-p em { font-style: normal; margin-left: 4px; }

.token-head { display: flex; align-items: center; gap: 18px; padding: 34px 0 6px; flex-wrap: wrap; }
.token-logo { width: 72px; height: 72px; border-radius: 18px; object-fit: cover; flex: none; background: var(--surface-3); font-size: 24px; }
.token-head h1 { font-size: clamp(24px, 3.6vw, 34px); }
.token-sub { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 10px; font-size: 14px; color: var(--muted); }
.token-ca { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.progress-panel .progress { height: 10px; margin: 12px 0; }
.progress-head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.deck { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 16px; align-items: start; }
.deck-side { position: sticky; top: 76px; }
.chart { border-radius: var(--radius-sm); overflow: hidden; border: 1px solid var(--line); background: var(--bg); }
.chart iframe { width: 100%; height: 440px; border: 0; display: block; }
.addr-list, .config-list, .wallet-list { display: grid; gap: 10px; }
.addr-row { display: grid; grid-template-columns: 170px minmax(0, 1fr) auto auto; gap: 10px; align-items: center; font-size: 14px; }
.addr-k { color: var(--muted); font-size: 13px; }
.addr-row code { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.config-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding-bottom: 10px; border-bottom: 1px solid var(--line); font-size: 14px; }
.config-row:last-child { border-bottom: 0; padding-bottom: 0; }
.wallet-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: 16px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.wallet-role { font-weight: 700; margin-bottom: 4px; }
.wallet-row .wallet-addr { display: grid; gap: 8px; justify-items: end; text-align: right; font-size: 13px; }

.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; padding: 4px; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; margin-bottom: 14px; }
.seg button { padding: 9px 10px; border-radius: 9px; border: 0; background: none; color: var(--muted); font-weight: 650; cursor: pointer; }
.seg button[aria-selected=true] { background: var(--surface-3); color: var(--text); }
.seg [data-side=buy][aria-selected=true] { background: rgba(43, 217, 139, .16); color: var(--ok); }
.seg [data-side=sell][aria-selected=true] { background: rgba(255, 92, 122, .16); color: var(--err); }
.seg-sm { margin: 0; padding: 3px; border-radius: 10px; }
.seg-sm button { padding: 5px 12px; font-size: 13px; border-radius: 7px; }
.swap-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.swap-k { font-size: 13px; color: var(--muted); }
.swap-field { margin-bottom: 14px; }
.swap-label { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); margin-bottom: 6px; gap: 10px; }
.swap-out { font-size: 22px; font-weight: 700; overflow-wrap: anywhere; }

.foot { border-top: 1px solid var(--line); background: var(--surface); margin-top: 24px; }
.foot-inner { max-width: 1180px; margin: 0 auto; padding: 28px 20px; display: grid; grid-template-columns: 1.4fr 1fr 1.2fr; gap: 28px; }
.foot-note { font-size: 13px; color: var(--muted); margin: 10px 0 0; }
.foot-links { display: grid; gap: 8px; align-content: start; font-size: 14px; }

@media (max-width: 980px) {
  .hero { grid-template-columns: 1fr; padding-top: 36px; }
  .deck { grid-template-columns: 1fr; }
  .deck-side { position: static; order: -1; }
  .steps { grid-template-columns: 1fr 1fr; }
  .stats-row { grid-template-columns: 1fr 1fr; }
  .split { grid-template-columns: 1fr; }
  .foot-inner { grid-template-columns: 1fr; }
  .nav-right .ca { display: none; }
  .bet-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .wrap { padding: 0 14px 48px; }
  .nav-inner { padding: 10px 14px; gap: 10px; flex-wrap: wrap; }
  .nav-links { order: 3; flex-basis: 100%; }
  .nav-right { margin-left: auto; }
  .brand-name { font-size: 15px; }
  .steps, .grid-2 { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .facts { grid-template-columns: 1fr; gap: 2px 0; }
  .facts dd { margin-bottom: 10px; }
  .addr-row { grid-template-columns: 1fr auto auto; }
  .addr-row .addr-k { grid-column: 1 / -1; }
  .wallet-row { grid-template-columns: 1fr; }
  .wallet-row .wallet-addr { justify-items: start; text-align: left; }
  .wallet-row code { word-break: break-all; }
  .token-ca { margin-left: 0; }
  .filters input[type=search] { width: 100%; }
  .chart iframe { height: 340px; }
  .wallet-menu { width: min(300px, calc(100vw - 28px)); }
  .panel { padding: 16px; }
  .stat { padding: 14px; }
  .stat-v { font-size: 19px; }
  .bet-row { grid-template-columns: 1fr; }
}

.chart-tools { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.chart-tools .panel-title { margin-bottom: 0; }
.chips { display: flex; gap: 4px; flex-wrap: wrap; }
.chips .chip { padding: 4px 9px; font-size: 12px; }
.chart-canvas { position: relative; height: 440px; }
.chart-canvas .tv-lightweight-charts { border-radius: var(--radius-sm); }
.chart-empty { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); font-size: 14px; text-align: center; padding: 20px; }
.chart-foot { margin-top: 12px; }
.facts-tight { grid-template-columns: 130px 1fr; gap: 6px 14px; margin-bottom: 14px; }
#curve-canvas { width: 100%; height: auto; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--bg); margin-bottom: 14px; display: block; }
.mt-14 { margin-top: 14px; }
.bet-row.mt-0 { margin-top: 0; }
.demo-steps { list-style: none; margin: 0 0 20px; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.demo-steps li { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--surface); color: var(--muted); font-weight: 600; font-size: 14px; }
.demo-steps li b { width: 24px; height: 24px; border-radius: 50%; display: inline-grid; place-items: center; background: var(--surface-3); color: var(--text); font-size: 12px; flex: none; }
.demo-steps li.on { border-color: var(--accent); color: var(--text); }
.demo-steps li.on b { background: var(--accent); color: var(--accent-ink); }
.demo-steps li.done { color: var(--text); }
.demo-steps li.done b { background: var(--ok); color: var(--accent-ink); }
.feed-buy { background: var(--ok); }
.feed-sell { background: var(--err); }
.token-head .token-logo.tcard-logo-blank { display: grid; place-items: center; font-weight: 800; color: var(--accent); }
@media (max-width: 980px) { .demo-steps { grid-template-columns: 1fr 1fr; } }
@media (max-width: 640px) { .chart-canvas { height: 340px; } .demo-steps { grid-template-columns: 1fr; } .facts-tight { grid-template-columns: 1fr; } }

.wrap-wide { max-width: 1480px; }
.kc-root { display: flex; flex-direction: column; min-height: 460px; position: relative; }
.kc-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; padding: 6px 0 8px; }
.kc-group { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.kc-btn { padding: 4px 9px; border-radius: 7px; border: 1px solid transparent; background: transparent; color: var(--muted); font-size: 12px; font-weight: 600; cursor: pointer; }
.kc-btn:hover { color: var(--text); background: var(--surface-2); }
.kc-btn.on { color: var(--accent); background: rgba(77, 227, 193, .1); border-color: rgba(77, 227, 193, .3); }
.kc-dd { position: relative; }
.kc-menu { position: absolute; top: calc(100% + 4px); left: 0; z-index: 20; display: none; min-width: 170px; background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 10px; padding: 6px; box-shadow: 0 14px 40px rgba(0, 0, 0, .5); }
.kc-dd.open .kc-menu { display: grid; }
.kc-item { text-align: left; padding: 7px 10px; border-radius: 7px; border: 0; background: none; color: var(--text); font-size: 13px; cursor: pointer; }
.kc-item:hover { background: var(--surface-3); }
.kc-item.on { color: var(--accent); }
.kc-canvas { flex: 1; min-height: 400px; border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; background: var(--bg); }
.kc-note { position: absolute; left: 50%; top: 55%; transform: translate(-50%, -50%); color: var(--muted); font-size: 13px; pointer-events: none; }
.chart-canvas .kc-root { height: 100%; }
#t-kchart { min-height: 520px; height: 60vh; }
#t-kchart .kc-canvas { min-height: 440px; }
.t-top { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding: 18px 0 12px; }
.t-market { position: relative; }
.t-market-btn { display: inline-flex; align-items: center; gap: 10px; padding: 8px 14px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--surface); color: var(--text); cursor: pointer; }
.t-logo { width: 28px; height: 28px; border-radius: 50%; background: #fff; }
.t-sym { font-weight: 800; font-size: 18px; }
.t-perp { color: var(--muted); font-weight: 600; font-size: 13px; }
.t-name { color: var(--muted); font-size: 13px; }
.t-caret { color: var(--muted); }
.t-market-list { position: absolute; top: calc(100% + 6px); left: 0; z-index: 40; width: min(560px, 92vw); background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--radius); padding: 10px; box-shadow: 0 18px 50px rgba(0, 0, 0, .55); }
.t-market-list input[type=search] { margin-bottom: 8px; }
.t-market-scroll { max-height: 60vh; overflow: auto; }
.t-group { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); padding: 8px 8px 4px; }
.t-row { display: grid; grid-template-columns: 24px 1fr 1.4fr auto auto; gap: 10px; align-items: center; padding: 7px 8px; border-radius: 8px; font-size: 13px; }
.t-row:hover, .t-row.on { background: var(--surface-2); color: var(--text); }
.t-row img, .t-blank { width: 22px; height: 22px; border-radius: 50%; background: var(--surface-3); }
.t-row-sym { font-weight: 700; }
.t-row-sym small { color: var(--muted); font-weight: 500; margin-left: 4px; }
.t-row-name { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.t-row-px, .t-row-chg { text-align: right; min-width: 60px; }
.t-stats { display: flex; gap: 18px; flex-wrap: wrap; align-items: center; }
.t-stats > div { display: grid; gap: 1px; }
.t-stats .k { font-size: 10.5px; }
.t-stats .v { font-weight: 650; font-size: 14px; }
.t-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px 340px; gap: 12px; align-items: stretch; }
.t-grid .panel { margin-bottom: 0; padding: 14px; }
.t-chart { min-width: 0; }
.ob-head { display: grid; grid-template-columns: 1fr 1fr 1fr; font-size: 11px; color: var(--muted); padding: 6px 6px 4px; }
.ob-head span:nth-child(2), .ob-head span:nth-child(3) { text-align: right; }
.ob-row { position: relative; display: grid; grid-template-columns: 1fr 1fr 1fr; font-size: 12px; padding: 2px 6px; cursor: pointer; }
.ob-row span:nth-child(3), .ob-row span:nth-child(4) { text-align: right; }
.ob-row .ob-fill { position: absolute; right: 0; top: 0; bottom: 0; opacity: .12; }
.ob-row.ask .ob-fill { background: var(--err); }
.ob-row.bid .ob-fill { background: var(--ok); }
.ob-row.ask span:nth-child(2) { color: var(--err); }
.ob-row.bid span:nth-child(2) { color: var(--ok); }
.ob-mid { padding: 6px; text-align: center; font-weight: 700; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin: 4px 0; }
.ob-rows { max-height: 480px; overflow: auto; }
.t-form .seg { margin-bottom: 10px; }
.t-opts { display: flex; gap: 14px; flex-wrap: wrap; margin: 6px 0 10px; font-size: 13px; }
.t-summary { margin-bottom: 12px; }
.t-summary dd .mini { width: 64px; display: inline-block; padding: 4px 8px; }
.btn-sell.btn-primary { background: var(--short); border-color: var(--short); color: #fff; }
.link { background: none; border: 0; color: var(--accent); cursor: pointer; padding: 0; font-size: 13px; }
.t-acct { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.t-acct-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 10px 0; }
.t-acct-grid .k { display: block; font-size: 10.5px; }
.t-acct-grid .v { font-weight: 650; }
.t-acct-io { display: grid; gap: 8px; margin: 10px 0; }
.t-acct-io .amount-row input { font-size: 14px; padding: 8px 10px; }
.t-acct-io .btn { margin: 4px; }
.t-bottom { margin-top: 12px; }
.t-tabs { margin-bottom: 12px; }
.t-ws .v { font-size: 12px; }
.split-bar { display: flex; height: 34px; border-radius: 10px; overflow: hidden; margin: 6px 0 14px; font-size: 12px; font-weight: 700; color: var(--accent-ink); }
.sb { display: flex; align-items: center; justify-content: center; white-space: nowrap; overflow: hidden; }
.sb-creator { background: #6aa8ff; }
.sb-treasury { background: var(--accent); }
.sb-perp { background: #f5b83d; }
.sb-burn { background: var(--short); color: #fff; }
.preset-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 12px; }
.preset { display: grid; gap: 4px; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-2); font-size: 14px; text-align: left; color: var(--text); }
.preset-pick .preset { cursor: pointer; }
.preset-pick .preset.on { border-color: var(--accent); background: rgba(77, 227, 193, .09); }
.list { margin: 0; padding-left: 18px; display: grid; gap: 8px; }
.engine-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.engine-grid > div { display: grid; gap: 2px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; min-width: 0; }
.engine-grid .v { font-weight: 700; overflow-wrap: anywhere; }
.bet-status-idle { color: var(--warn); border-color: #4a3710; background: #221a08; }
.bet-status-cooldown { color: var(--err); border-color: #5a2432; background: #241216; }
.bet-status-paused, .bet-status-retired { color: var(--muted); border-color: var(--line-2); background: var(--surface-3); }
.feed-feesrouted { background: #6aa8ff; }
.feed-positiontoppedup, .feed-collateraladded { background: #3b82f6; }
.feed-profitlocked, .feed-treasurypaid, .feed-builderfeesswept { background: var(--ok); }
.feed-buyback { background: var(--short); }
.feed-creatorpaid { background: var(--accent-2); }
@media (max-width: 1180px) { .t-grid { grid-template-columns: minmax(0, 1fr) 300px; } .t-form { grid-column: 1 / -1; } }
@media (max-width: 860px) { .t-grid { grid-template-columns: 1fr; } .t-book { order: 3; } .engine-grid, .preset-grid { grid-template-columns: 1fr 1fr; } #t-kchart { height: 50vh; min-height: 380px; } .t-acct-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 640px) { .engine-grid, .preset-grid { grid-template-columns: 1fr; } .t-row { grid-template-columns: 22px 1fr auto; } .t-row-name, .t-row-chg { display: none; } }

.kc-root { display: block; height: 100%; min-height: 0; }
.kc-canvas { flex: none; height: 440px; min-height: 0; }
#t-kchart { height: 62vh; min-height: 540px; max-height: 820px; }
.chart-canvas { height: 520px; }
.t-chart.panel { display: flex; flex-direction: column; min-height: 0; }
.t-paper-note { margin-top: 14px; }
.is-paper .t-form .btn-primary { background: var(--warn); border-color: var(--warn); color: #1a1200; }
.is-paper .t-form .btn-primary.btn-sell { background: var(--short); border-color: var(--short); color: #fff; }
.t-flow { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 13px; }
.t-flow .k { margin-bottom: 8px; }
.t-flow .list { font-size: 13px; color: #c3cad6; padding-left: 16px; }
.t-row-lp .t-row-sym { color: var(--accent); }
.t-row-empty { cursor: default; }
.t-tpsl .quick { margin-top: 6px; }
@media (max-width: 860px) { #t-kchart { height: 52vh; min-height: 420px; } .chart-canvas { height: 400px; } }

.pl-chart { height: 460px; margin: 10px 0 6px; }
@media (max-width: 640px) { .pl-chart { height: 380px; } }

.ag-modes label.chip { display: inline-flex; align-items: center; gap: 8px; }
.ag-modes input { margin: 0; }
.ag-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.ag-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; min-width: 0; }
.ag-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; margin-bottom: 14px; }
.ag-facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px 14px; margin-bottom: 12px; }
.ag-facts > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ag-facts .k { font-size: 11px; }
.ag-facts b { font-size: 15px; overflow-wrap: anywhere; }
.ag-facts .muted { font-size: 12px; }
.ag-pos { padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--bg); font-size: 14px; margin-bottom: 12px; }
.ag-levels { font-size: 12px; margin-top: 4px; }
.ag-note { font-size: 13px; color: var(--warn); margin-bottom: 12px; }
.ag-actions { margin-bottom: 10px; }
.ag-details summary { cursor: pointer; font-size: 13px; color: var(--muted); }
.ag-details .table { margin-top: 10px; font-size: 13px; }
.ag-mode-paper { color: var(--accent); border-color: #1b4a40; background: #0c201c; }
.ag-mode-live { color: var(--warn); border-color: #4a3710; background: #221a08; }
.ag-status-running { color: var(--ok); border-color: #1b4a36; background: #0d2019; }
.ag-status-paused { color: var(--warn); border-color: #4a3710; background: #221a08; }
.ag-status-error, .ag-status-stopped { color: var(--err); border-color: #5a2432; background: #241216; }
@media (max-width: 900px) { .ag-grid { grid-template-columns: 1fr; } .ag-facts { grid-template-columns: 1fr 1fr; } }
