/* opx trade. Own layout: market tape + command palette instead of a side list,
   a hairline board (cells share 1px rules) instead of floating cards, and a ticket
   where the route is chosen under the amounts. Sharp geometry (2-6px). */
:root {
  /* theme tokens */
  --bg: #06070b; --bg-2: #101114; --cell: #06070b; --cell-2: #0b0c10; --raised: #18181a;
  --dialog: #101114; --scrim: #06070bcc;
  --line: #22242d; --line-strong: #323542; --line-soft: #22242d99;
  --hover: #101114; --fill: #101114; --selected: #526fff17;
  --text: #fcfcfc; --text-strong: #ffffff; --text-2: #c8c9d1; --muted: #a0a2b3; --subtle: #777a8c;
  --blue: #526fff; --blue-edge: #647dfa; --blue-bright: #526fff; --blue-icon: #6d85ff; --blue-text: #8a9cff;
  --blue-tint: #526fff1f; --blue-tint-border: #526fff80; --send-idle: #18181a;
  --green: #2fe3ac; --green-soft: #2fe3ac; --amber: #dcc13c; --down: #ec397a;
  --font: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "Geist", ui-sans-serif, system-ui, sans-serif;
  --r-xs: 2px; --r-sm: 3px; --r: 4px; --r-lg: 4px;
  --shadow-pop: 0 16px 40px #000000b3;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg); color: var(--text); font-family: var(--font); font-size: 14px; line-height: 1.5;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; overflow-x: clip;
  font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1, "cv11" 1;
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
button:disabled { cursor: not-allowed; }
a { color: var(--blue-text); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 1px solid var(--blue-bright); outline-offset: 2px; }
.num { font-variant-numeric: tabular-nums; }
.up { color: var(--green); } .down { color: var(--down); } .muted { color: var(--muted); } .warn { color: var(--amber); }
[hidden] { display: none !important; }
kbd { font-family: var(--font); font-size: 10.5px; line-height: 1; padding: 3px 5px; border-radius: var(--r-xs); border: 1px solid var(--line-strong); color: var(--subtle); background: var(--fill); }

.app { display: flex; flex-direction: column; min-height: 100dvh; }

/* ---- top bar ---- */
.topbar { display: flex; align-items: center; gap: 28px; height: 56px; padding: 0 20px; border-bottom: 1px solid var(--line); background: #06070bf2; backdrop-filter: blur(14px); position: sticky; top: 0; z-index: 30; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text-strong); font-weight: 650; font-size: 16px; letter-spacing: -.02em; }
.brand:hover { text-decoration: none; }
.logoTile { width: 28px; height: 28px; border-radius: var(--r); display: grid; place-items: center; background: var(--blue); }
.logoTile svg { width: 15px; height: 15px; }
.main-nav { display: flex; align-self: stretch; }
.main-nav button { position: relative; padding: 0 14px; color: var(--muted); font-weight: 500; font-size: 14px; }
.main-nav button:hover { color: var(--text); }
.main-nav button.active { color: var(--text-strong); }
.main-nav button.active::after { content: ""; position: absolute; left: 14px; right: 14px; bottom: -1px; height: 2px; background: var(--blue-bright); }
.find { display: flex; align-items: center; gap: 8px; height: 34px; width: 280px; padding: 0 8px 0 11px; border-radius: var(--r); border: 1px solid var(--line); background: var(--fill); color: var(--subtle); font-size: 13px; }
.find span { flex: 1; text-align: left; }
.find:hover { border-color: var(--line-strong); color: var(--muted); }
.header-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.net-pill { display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 11px; border-radius: var(--r); border: 1px solid var(--line); color: var(--text-2); font-size: 12.5px; }
.dot { width: 6px; height: 6px; border-radius: 50%; background: var(--green); display: inline-block; flex: none; }
.wallet-btn { display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 14px; border-radius: var(--r); font-weight: 600; font-size: 13.5px; color: var(--bg); background: var(--blue); border: 1px solid transparent; transition: background .12s; }
.wallet-btn:hover { background: var(--blue-edge); }
.wallet-btn img { width: 16px; height: 16px; border-radius: var(--r-xs); }
.wallet-btn.connected { background: transparent; border-color: var(--line-strong); color: var(--text); padding: 0 11px 0 9px; }
.wallet-btn.connected:hover { background: var(--hover); }
.wallet-btn .wb-addr { font-weight: 500; font-size: 13px; }
.wallet-btn .wb-sol { font-weight: 500; font-size: 12px; color: var(--muted); padding-left: 8px; border-left: 1px solid var(--line-strong); }

/* ---- market tape ---- */
.tape { display: flex; overflow-x: auto; border-bottom: 1px solid var(--line); background: var(--bg-2); scrollbar-width: none; }
.tape::-webkit-scrollbar { display: none; }
.tp { display: flex; align-items: center; gap: 8px; padding: 0 16px; height: 40px; flex: none; border-right: 1px solid var(--line-soft); font-size: 12.5px; color: var(--muted); position: relative; }
.tp:hover { background: var(--hover); color: var(--text); }
.tp img { width: 18px; height: 18px; border-radius: 50%; }
.tp b { color: var(--text); font-weight: 600; }
.tp.sel { background: var(--selected); }
.tp.sel::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 2px; background: var(--blue-bright); }
.tp-star { color: #dcc13c; font-size: 10px; }

/* ---- trade layout ---- */
main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.swap { display: grid; grid-template-columns: minmax(0, 1fr) 372px; gap: 16px; align-items: start; width: 100%; max-width: 1520px; margin: 0 auto; padding: 16px 20px 28px; }

/* hairline board: cells share 1px rules */
.board { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; min-width: 0; }
.cell { background: var(--cell); min-width: 0; }
.hero, .stats, .chart, .details { grid-column: 1 / -1; }

.hero { display: flex; align-items: center; gap: 20px; padding: 16px 18px; }
.mkt-btn { display: flex; align-items: center; gap: 12px; padding: 6px 12px 6px 6px; margin: -6px 0 -6px -6px; border-radius: var(--r); text-align: left; min-width: 0; }
.mkt-btn:hover { background: var(--hover); }
.mkt-btn img { width: 44px; height: 44px; border-radius: 50%; background: #ffffff10; flex: none; }
.mkt-id { display: flex; flex-direction: column; min-width: 0; }
.mkt-line { display: flex; align-items: center; gap: 8px; }
.mkt-line strong { font-size: 20px; font-weight: 650; letter-spacing: -.02em; color: var(--text-strong); display: flex; align-items: center; gap: 8px; }
.mkt-line .chev { color: var(--subtle); }
#instName { color: var(--subtle); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hero-px { display: flex; align-items: baseline; gap: 10px; margin-left: auto; }
.hero-px strong { font-size: 30px; font-weight: 650; letter-spacing: -.03em; color: var(--text-strong); }
.hero-px span { font-size: 14px; font-weight: 500; }
.hero-actions { display: flex; gap: 6px; padding-left: 16px; border-left: 1px solid var(--line-soft); }
.icon-btn { position: relative; width: 32px; height: 32px; border-radius: var(--r); display: grid; place-items: center; color: var(--muted); border: 1px solid var(--line); }
.icon-btn:hover { color: var(--text); background: var(--hover); }
.icon-btn.on { color: #dcc13c; } .icon-btn.on svg { fill: #dcc13c; }
.badge { position: absolute; top: -5px; right: -5px; min-width: 15px; height: 15px; padding: 0 4px; border-radius: var(--r-xs); background: var(--blue); color: #fff; font-style: normal; font-size: 10px; font-weight: 700; display: grid; place-items: center; }

.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; background: var(--line); margin: 0; }
.stats > div { background: var(--cell-2); padding: 10px 18px; min-width: 0; }
.stats dt { color: var(--subtle); font-size: 11.5px; }
.stats dd { margin: 1px 0 0; font-size: 14px; font-weight: 500; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.chart { padding: 12px 14px 6px; position: relative; }
.chart-bar { display: flex; align-items: center; gap: 12px; padding-bottom: 8px; flex-wrap: wrap; }
.ranges { display: inline-flex; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.ranges button { padding: 4px 10px; color: var(--muted); font-size: 12px; font-weight: 500; border-right: 1px solid var(--line-soft); }
.ranges button:last-child { border-right: 0; }
.ranges button:hover { color: var(--text); background: var(--hover); }
.ranges button.sel { background: var(--selected); color: var(--text-strong); }
.ranges svg { display: block; width: 14px; height: 14px; }
.ranges button[data-t] { padding: 4px 8px; }
.chart-src { margin-left: auto; color: var(--subtle); font-size: 11.5px; }
.sample-badge { font-size: 11px; font-weight: 600; padding: 2px 7px; border-radius: var(--r-xs); color: #e8d67a; background: #dcc13c1a; border: 1px solid #dcc13c55; }
#chartBox svg { display: block; width: 100%; height: 330px; }
.chart .grid { stroke: #ffffff0d; }
.chart .axis { fill: var(--subtle); font-family: var(--font); font-size: 10.5px; }
.chart .line { fill: none; stroke: var(--blue-icon); stroke-width: 1.5; }
.chart .last { stroke: #6d85ff88; stroke-dasharray: 3 4; }
.chart .tag { fill: var(--blue); }
.chart .tagtxt { fill: #fff; font-family: var(--font); font-size: 10.5px; font-weight: 600; }
.chart .cross { stroke: #ffffff30; }
.chart .candle-up { fill: #2fe3ac; stroke: #2fe3ac; } .chart .candle-down { fill: #ec397a; stroke: #ec397a; }
.chart .vol { fill: #526fff; opacity: .2; }
.chart-tip { position: absolute; pointer-events: none; padding: 6px 9px; border-radius: var(--r); background: var(--dialog); border: 1px solid var(--line-strong); box-shadow: var(--shadow-pop); font-size: 11.5px; white-space: nowrap; }
.chart-empty { height: 330px; display: grid; place-items: center; color: var(--subtle); font-size: 13px; }

.panel { display: flex; flex-direction: column; }
.panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line-soft); }
.panel-head h2 { margin: 0; font-size: 12px; font-weight: 600; color: var(--text-2); text-transform: uppercase; letter-spacing: .06em; }
.panel-sub { font-size: 11.5px; color: var(--subtle); text-align: right; }
#bxBody { overflow-x: auto; }
.panel table th, .panel table td { padding: 9px 16px; font-size: 12.5px; }
.panel table th { background: transparent; }
.panel .empty { padding: 22px 16px; font-size: 12.5px; }
.bx-save { margin-top: auto; padding: 10px 16px; font-size: 12.5px; color: var(--text-2); border-top: 1px solid var(--line-soft); background: #2fe3ac08; }
.bx-save b { color: var(--green-soft); font-weight: 600; }
.checks { list-style: none; margin: 0; padding: 0; }
.checks li { display: grid; grid-template-columns: 16px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 8px 16px; font-size: 12.5px; border-bottom: 1px solid var(--line-soft); }
.checks li:last-child { border-bottom: 0; }
.checks .ci { width: 16px; height: 16px; border-radius: var(--r-xs); display: grid; place-items: center; font-size: 10px; font-weight: 700; }
.checks .ok .ci { background: #2fe3ac1c; color: var(--green); }
.checks .warn .ci { background: #dcc13c1c; color: var(--amber); }
.checks .bad .ci { background: #ec397a1c; color: var(--down); }
.checks .info .ci { background: #526fff1c; color: var(--blue-icon); }
.checks .cv { color: var(--subtle); font-size: 11.5px; text-align: right; }

.details summary { padding: 12px 16px; cursor: pointer; font-weight: 600; font-size: 12px; color: var(--text-2); text-transform: uppercase; letter-spacing: .06em; list-style: none; display: flex; justify-content: space-between; }
.details summary::after { content: "+"; color: var(--subtle); }
.details[open] summary::after { content: "−"; }
.kv { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; background: var(--line-soft); margin: 0; border-top: 1px solid var(--line-soft); }
.kv > div { display: flex; justify-content: space-between; gap: 12px; padding: 9px 16px; font-size: 12.5px; background: var(--cell); }
.kv dt { color: var(--subtle); }
.kv dd { margin: 0; text-align: right; color: var(--text-2); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---- ticket ---- */
.side { position: sticky; top: 72px; min-width: 0; }
.ticket { border: 1px solid var(--line-strong); border-radius: var(--r-lg); background: var(--cell); overflow: hidden; }
.side-tabs { display: grid; grid-template-columns: 1fr 1fr; border-bottom: 1px solid var(--line); }
.side-tabs button { height: 46px; font-weight: 600; font-size: 14px; color: var(--muted); position: relative; background: var(--bg-2); }
.side-tabs button + button { border-left: 1px solid var(--line); }
.side-tabs button:hover { color: var(--text); }
.side-tabs button.sel { background: var(--cell); color: var(--text-strong); }
.side-tabs button.sel::after { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 2px; }
.side-tabs button.sel[data-side="buy"] { color: var(--green-soft); } .side-tabs button.sel[data-side="buy"]::after { background: var(--green); }
.side-tabs button.sel[data-side="sell"] { color: var(--down); } .side-tabs button.sel[data-side="sell"]::after { background: var(--down); }
.tk-body { display: flex; flex-direction: column; gap: 12px; padding: 14px; }
.leg { border: 1px solid var(--line); border-radius: var(--r); background: var(--bg-2); padding: 11px 13px; display: flex; flex-direction: column; gap: 6px; }
.leg:focus-within { border-color: var(--blue-tint-border); }
.leg-head { display: flex; justify-content: space-between; font-size: 12px; color: var(--subtle); }
.leg-body { display: flex; align-items: center; gap: 10px; }
.leg-body input, .leg-body .out { flex: 1; min-width: 0; background: none; border: 0; outline: none; font-size: 26px; font-weight: 600; letter-spacing: -.02em; color: var(--text-strong); padding: 0; font-family: var(--font); }
.leg-body input::placeholder { color: #ffffff30; }
.leg-body .out { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.leg-body .out.dim { color: #ffffff38; }
.asset-tag { display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 10px 0 6px; border-radius: var(--r); background: var(--fill); border: 1px solid var(--line); font-weight: 600; font-size: 13px; white-space: nowrap; }
.asset-tag img { width: 20px; height: 20px; border-radius: 50%; }
.leg-foot { font-size: 11.5px; color: var(--subtle); display: flex; justify-content: space-between; gap: 8px; }
.leg-foot .shares { color: var(--muted); }
.shortcuts { display: flex; border: 1px solid var(--line); border-radius: var(--r-sm); overflow: hidden; }
.shortcuts button { padding: 2px 8px; font-size: 11px; color: var(--muted); border-right: 1px solid var(--line-soft); }
.shortcuts button:last-child { border-right: 0; }
.shortcuts button:hover:not(:disabled) { color: var(--text); background: var(--hover); }
.shortcuts button:disabled { opacity: .45; }
.flip { align-self: center; margin: -17px 0; z-index: 2; width: 30px; height: 30px; border-radius: var(--r); display: grid; place-items: center; background: var(--raised); border: 1px solid var(--line-strong); color: var(--muted); }
.flip:hover { color: var(--text); }

.routes { border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.routes-head { display: flex; justify-content: space-between; padding: 7px 12px; font-size: 11px; color: var(--subtle); text-transform: uppercase; letter-spacing: .06em; background: var(--bg-2); border-bottom: 1px solid var(--line-soft); }
.routes-head .muted { text-transform: none; letter-spacing: 0; color: var(--subtle); }
.route { display: grid; grid-template-columns: 14px minmax(0, 1fr) auto; gap: 10px; align-items: center; width: 100%; padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line-soft); }
.route:hover { background: var(--hover); }
.route.sel { background: var(--selected); }
.route:disabled { opacity: .45; }
.radio { width: 14px; height: 14px; border-radius: 50%; border: 1px solid var(--line-strong); display: grid; place-items: center; }
.route.sel .radio { border-color: var(--blue-bright); }
.route.sel .radio::after { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--blue-bright); }
.r-name { display: flex; flex-direction: column; min-width: 0; }
.r-name strong { font-size: 13px; font-weight: 600; color: var(--text-strong); display: flex; align-items: center; gap: 6px; }
.r-name span { font-size: 11px; color: var(--subtle); }
.route em { font-style: normal; font-size: 12.5px; font-weight: 500; color: var(--text-2); text-align: right; white-space: nowrap; }
.route em.best { color: var(--green); }
.venues summary { padding: 8px 12px; cursor: pointer; font-size: 12px; font-weight: 500; color: var(--muted); list-style: none; display: flex; justify-content: space-between; align-items: center; }
.venues summary:hover { color: var(--text); }
.venues summary::after { content: "+"; color: var(--subtle); }
.venues[open] summary::after { content: "−"; }
.venues summary span { margin-left: auto; margin-right: 10px; font-size: 11.5px; color: var(--green-soft); }
.vn-body { border-top: 1px solid var(--line-soft); }
.vn-row { display: grid; grid-template-columns: minmax(0, 1fr) auto 78px; gap: 10px; padding: 7px 12px; font-size: 12px; align-items: center; white-space: nowrap; }
.vn-row .vn-out { color: var(--text-2); }
.vn-row .vn-d { text-align: right; }
.vn-row.best { background: #2fe3ac0a; }
.vn-body .empty { padding: 12px; font-size: 12px; }

.qlines { display: flex; flex-direction: column; margin: 0; border-top: 1px dashed var(--line); padding-top: 10px; font-size: 12.5px; gap: 6px; }
.qlines > div { display: flex; justify-content: space-between; gap: 12px; }
.qlines dt { color: var(--subtle); white-space: nowrap; }
.qlines dd { margin: 0; text-align: right; color: var(--text-2); }
.settings { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; color: var(--subtle); }
.settings > div { display: flex; justify-content: space-between; align-items: center; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: var(--r-sm); overflow: hidden; }
.seg button { padding: 2px 8px; font-size: 11.5px; color: var(--muted); border-right: 1px solid var(--line-soft); }
.seg button:last-child { border-right: 0; }
.seg button:hover { color: var(--text); }
.seg button.sel { background: var(--selected); color: var(--text-strong); }
.primary { height: 46px; border-radius: var(--r); font-weight: 600; font-size: 14.5px; color: var(--bg); display: flex; align-items: center; justify-content: center; background: var(--blue); border: 1px solid transparent; transition: background .12s; }
.primary:hover:not(:disabled) { background: var(--blue-edge); }
.primary:disabled { background: var(--send-idle); border-color: var(--line); color: var(--muted); }
.fine { margin: 0; font-size: 11.5px; color: var(--subtle); line-height: 1.5; }
.msg { font-size: 12.5px; padding: 9px 12px; border-radius: var(--r); border: 1px solid var(--line); background: var(--fill); color: var(--text-2); }
.msg.warn { border-color: #dcc13c50; background: #dcc13c0d; color: #e8d67a; }
.msg.bad { border-color: #ec397a50; background: #ec397a0d; color: #f47aa6; }
.msg.ok { border-color: #2fe3ac50; background: #2fe3ac0d; color: var(--green-soft); }
.opx-mark { font-style: normal; font-size: 9.5px; font-weight: 700; letter-spacing: .04em; padding: 1px 4px; border-radius: var(--r-xs); color: #fff; background: var(--blue); }

/* ---- command palette ---- */
.palette { padding: 0; width: min(560px, calc(100vw - 32px)); max-height: min(640px, calc(100dvh - 80px)); margin-top: 72px; overflow: hidden; display: none; flex-direction: column; }
.palette[open] { display: flex; }
.palette .search { display: flex; align-items: center; gap: 10px; height: 52px; padding: 0 16px; border-bottom: 1px solid var(--line); color: var(--subtle); flex: none; }
.palette .search input { flex: 1; min-width: 0; background: none; border: 0; outline: none; font-size: 15px; color: var(--text); }
.palette .search input::placeholder { color: var(--subtle); }
.chips { display: flex; gap: 6px; padding: 10px 16px; border-bottom: 1px solid var(--line-soft); flex: none; }
.chips button { height: 26px; padding: 0 10px; border-radius: var(--r-sm); border: 1px solid var(--line); font-size: 12px; font-weight: 500; color: var(--muted); }
.chips button:hover { color: var(--text); }
.chips button.sel { color: var(--text-strong); border-color: var(--blue-tint-border); background: var(--blue-tint); }
.market-rows { overflow-y: auto; flex: 1; scrollbar-width: thin; scrollbar-color: #ffffff1f transparent; }
.market-row { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto 22px; align-items: center; gap: 12px; width: 100%; padding: 9px 16px; border-bottom: 1px solid var(--line-soft); cursor: pointer; }
.market-row:hover, .market-row:focus-visible { background: var(--hover); outline: none; }
.market-row.selected { background: var(--selected); }
.asset-icon { width: 26px; height: 26px; border-radius: 50%; background: #ffffff10; }
.mr-id { display: flex; flex-direction: column; min-width: 0; }
.mr-id strong { color: var(--text-strong); font-weight: 600; font-size: 13.5px; display: flex; align-items: center; gap: 6px; }
.mr-id span { color: var(--subtle); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mr-px { display: flex; flex-direction: column; align-items: flex-end; font-size: 12.5px; }
.mr-px strong { font-weight: 500; color: var(--text); }
.mr-px span { font-size: 11.5px; }
.market-row .star { width: 22px; height: 22px; display: grid; place-items: center; border-radius: var(--r-sm); color: #ffffff30; }
.market-row .star:hover { color: var(--muted); background: var(--hover); }
.market-row .star.on { color: #dcc13c; } .market-row .star.on svg { fill: #dcc13c; }
.empty { padding: 28px 16px; text-align: center; color: var(--subtle); }

/* ---- pages ---- */
.page { max-width: 1180px; width: 100%; margin: 0 auto; padding: 28px 20px 40px; }
.page h2 { margin: 0 0 4px; font-size: 22px; font-weight: 650; letter-spacing: -.02em; color: var(--text-strong); }
.page > p { margin: 0 0 18px; color: var(--muted); }
.cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; margin: 0 0 16px; }
.card { background: var(--cell); padding: 14px 16px; }
.card dt { color: var(--subtle); font-size: 12px; }
.card dd { margin: 4px 0 0; font-size: 22px; font-weight: 600; letter-spacing: -.02em; }
.tbl-wrap { border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--cell); overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 11px 16px; text-align: right; border-bottom: 1px solid var(--line-soft); white-space: nowrap; }
th { color: var(--subtle); font-weight: 500; font-size: 12px; background: var(--bg-2); }
td:first-child, th:first-child { text-align: left; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr.click { cursor: pointer; }
tbody tr.click:hover { background: var(--hover); }
.tok { display: flex; align-items: center; gap: 10px; }
.tok img { width: 24px; height: 24px; border-radius: 50%; }
.tok b { color: var(--text-strong); font-weight: 600; }
.tok span { color: var(--subtle); }

/* ---- status bar ---- */
.statusbar { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; padding: 7px 20px; border-top: 1px solid var(--line); font-size: 12px; color: var(--subtle); background: var(--bg-2); }
.statusbar > div { display: flex; align-items: center; gap: 10px; }
.statusbar button { display: inline-flex; align-items: center; gap: 6px; padding: 2px 8px; border-radius: var(--r-sm); border: 1px solid var(--line); color: var(--muted); font-size: 11.5px; }
.statusbar button:hover { color: var(--text); }
.statusbar strong { color: var(--text-2); font-weight: 600; }
.statusbar a { color: var(--muted); }

/* ---- dialogs, wallets, alerts, toast ---- */
dialog { border: 1px solid var(--line-strong); border-radius: var(--r-lg); background: var(--dialog); color: var(--text); padding: 18px; width: min(440px, calc(100vw - 32px)); box-shadow: var(--shadow-pop); }
dialog::backdrop { background: var(--scrim); backdrop-filter: blur(3px); }
.dlg-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.dlg-head h2 { margin: 0; font-size: 16px; font-weight: 600; }
.dlg-head .icon-btn { border: 0; }
.dlg-sub { margin: 0 0 14px; color: var(--muted); font-size: 13px; }
.wallets { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.wallets button { display: flex; align-items: center; justify-content: space-between; padding: 11px 14px; min-height: 54px; border-bottom: 1px solid var(--line-soft); font-weight: 600; font-size: 14.5px; }
.wallets button:last-child { border-bottom: 0; }
.wallets button:hover { background: var(--selected); }
.wallets button span { display: flex; align-items: center; gap: 12px; }
.wallets button small { color: var(--subtle); font-weight: 500; }
.wallets .msg { border: 0; border-bottom: 1px solid var(--line-soft); border-radius: 0; }
.wl-sep { padding: 8px 14px 6px; font-size: 11px; color: var(--subtle); text-transform: uppercase; letter-spacing: .06em; background: var(--bg-2); border-bottom: 1px solid var(--line-soft); }
.wl-ico { width: 30px; height: 30px; border-radius: var(--r); display: grid; place-items: center; background: #ffffff10; font-weight: 700; font-size: 14px; overflow: hidden; }
.wl-ico img { width: 30px; height: 30px; }
.alert-form { display: flex; flex-direction: column; gap: 10px; margin-bottom: 8px; }
.alert-list { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.alert-list > div { display: flex; justify-content: space-between; align-items: center; padding: 9px 12px; border-radius: var(--r); border: 1px solid var(--line); font-size: 13px; }
.alert-list button { color: var(--muted); font-size: 12px; }
.alert-list button:hover { color: var(--down); }
.disc { margin: 6px 0 12px; padding-left: 18px; display: flex; flex-direction: column; gap: 10px; font-size: 13px; color: var(--text-2); line-height: 1.55; }
.disc b { color: var(--text-strong); }
.toast { position: fixed; right: 20px; bottom: 44px; z-index: 50; display: flex; flex-direction: column; gap: 8px; max-width: min(380px, calc(100vw - 32px)); }
.toast > div { padding: 11px 14px; border-radius: var(--r); border: 1px solid var(--line-strong); border-left: 2px solid var(--blue-bright); background: var(--dialog); box-shadow: var(--shadow-pop); font-size: 13px; animation: tin .18s ease-out; }
.toast > div.ok { border-left-color: var(--green); } .toast > div.bad { border-left-color: var(--down); }
.toast kbd { margin-right: 4px; }
@keyframes tin { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---- responsive ---- */
@media (max-width: 1180px) {
  .swap { grid-template-columns: minmax(0, 1fr); }
  .side { position: static; max-width: 560px; width: 100%; margin: 0 auto; order: -1; }
  .find { width: auto; } .find span { display: none; }
}
@media (max-width: 760px) {
  .topbar { gap: 10px; padding: 0 12px; height: auto; min-height: 56px; flex-wrap: wrap; }
  .main-nav { order: 3; width: 100%; overflow-x: auto; border-top: 1px solid var(--line-soft); }
  .main-nav button { height: 42px; }
  .net-pill { display: none; }
  .swap { padding: 12px 12px 24px; gap: 12px; }
  .board { grid-template-columns: minmax(0, 1fr); }
  .hero { flex-wrap: wrap; gap: 12px; padding: 14px; }
  .hero-px { margin-left: 0; order: 3; width: 100%; }
  .hero-actions { margin-left: auto; border-left: 0; padding-left: 0; }
  .hero-px strong { font-size: 26px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #chartBox svg, .chart-empty { height: 240px; }
  .kv { grid-template-columns: minmax(0, 1fr); }
  .cards { grid-template-columns: minmax(0, 1fr); }
  .page { padding: 20px 12px 32px; }
  .statusbar { padding: 7px 12px; }
  .palette { margin-top: 16px; }
}

/* ---- sector heatmap (palette + Markets page) ---- */
.palette { width: min(900px, calc(100vw - 32px)); max-height: min(720px, calc(100dvh - 80px)); }
.heat { padding: 4px 16px 16px; }
.heat-group { margin-top: 12px; }
.heat-head { display: flex; justify-content: space-between; align-items: baseline; padding: 0 2px 6px; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--subtle); }
.heat-head span:last-child { text-transform: none; letter-spacing: 0; font-weight: 500; }
.heat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.heat .market-row.tile { display: flex; flex-direction: column; align-items: stretch; gap: 2px; padding: 9px 10px 8px; min-height: 76px; border: 0; background: linear-gradient(var(--tint), var(--tint)), var(--cell); position: relative; cursor: pointer; transition: filter .12s; }
.heat .market-row.tile:hover, .heat .market-row.tile:focus-visible { filter: brightness(1.35); outline: none; }
.heat .market-row.tile.selected { box-shadow: inset 0 0 0 1px var(--blue-bright); }
.heat .tile.is-opx::after { content: "Riflex"; position: absolute; right: 0; bottom: 0; padding: 1px 5px; font-size: 8.5px; font-weight: 700; letter-spacing: .05em; color: #fff; background: var(--blue); border-top-left-radius: var(--r-xs); }
.t-top { display: flex; align-items: center; gap: 6px; min-width: 0; }
.t-top img { width: 18px; height: 18px; border-radius: 50%; flex: none; }
.t-top b { font-size: 13px; font-weight: 650; color: var(--text-strong); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.t-top .star { margin-left: auto; width: 18px; height: 18px; display: grid; place-items: center; border-radius: var(--r-xs); color: #ffffff2e; }
.t-top .star svg { width: 11px; height: 11px; }
.t-top .star:hover { color: var(--muted); }
.t-top .star.on { color: #dcc13c; } .t-top .star.on svg { fill: #dcc13c; }
.t-px { font-size: 13px; font-weight: 500; color: var(--text); margin-top: auto; }
.t-ch { font-size: 11.5px; font-weight: 500; }
.heat .t-ch.up { color: #7ef0cd; } .heat .t-ch.down { color: #f58bb1; }
.heat-page { padding: 0; margin-bottom: 18px; }
.heat-page .heat-group:first-child { margin-top: 0; }
@media (max-width: 760px) { .heat-grid { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); } .heat { padding: 4px 10px 12px; } }

/* ---- best price (simple) ---- */
.bx-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px 6px; flex-wrap: wrap; }
.bx-head { margin: 0; font-size: 13px; color: var(--text-2); }
.bx-head b { color: var(--text-strong); font-weight: 600; }
.bx-row { display: grid; grid-template-columns: 96px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 9px 16px; font-size: 12.5px; }
.bx-row + .bx-row { border-top: 1px solid var(--line-soft); }
.bx-name { color: var(--text-2); font-weight: 500; white-space: nowrap; }
.bx-name em { font-style: normal; font-size: 10.5px; color: var(--subtle); }
.bx-row.best .bx-name { color: var(--text-strong); }
.bx-row.best .bx-name::before { content: "✓ "; color: var(--green); }
.bx-bar { height: 6px; background: var(--fill); border-radius: var(--r-xs); overflow: hidden; }
.bx-bar i { display: block; height: 100%; border-radius: var(--r-xs); }
.bx-bar i.over { background: #dcc13cb3; } .bx-bar i.under { background: #2fe3acb3; }
.bx-row.best .bx-bar i.over { background: #6d85ff; }
.bx-val { white-space: nowrap; color: var(--text-2); font-weight: 500; }
.bx-foot { margin: 0; padding: 8px 16px 12px; font-size: 11.5px; color: var(--subtle); margin-top: auto; }

/* ---- safety (simple) ---- */
.checks li.verdict { grid-template-columns: 20px minmax(0, 1fr); padding: 12px 16px; font-size: 14px; font-weight: 600; color: var(--text-strong); }
.checks li.verdict .ci { width: 20px; height: 20px; font-size: 12px; border-radius: var(--r); }
.checks li.ticks { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 16px; }
.checks li.ticks span { font-size: 11.5px; font-weight: 500; padding: 3px 8px; border-radius: var(--r-sm); border: 1px solid var(--line); }
.checks li.ticks span.ok { color: var(--green-soft); background: #2fe3ac0a; }
.checks li.ticks span.bad { color: var(--down); background: #ec397a0f; border-color: #ec397a40; }
.checks li.note { grid-template-columns: 16px minmax(0, 1fr); align-items: start; color: var(--text-2); line-height: 1.45; }
.checks li.note .ci { margin-top: 1px; }
.wl-ico { background: transparent; } .wl-ico img { border-radius: var(--r); }

/* ---- brand ---- */
.brand { gap: 10px; }
.brand-mark { width: 22px; height: 22px; color: var(--text-strong); flex: none; }
.brand-name { font-family: "Barlow Condensed", "Geist", sans-serif; font-weight: 600; font-size: 22px; letter-spacing: .06em; line-height: 1; color: var(--text-strong); transform: translateY(1px); }

/* ---- tape: arrows + drag ---- */
.tape-wrap { position: relative; border-bottom: 1px solid var(--line); background: var(--bg-2); }
.tape-wrap .tape { border-bottom: 0; cursor: grab; user-select: none; -webkit-user-select: none; scroll-behavior: auto; }
.tape.dragging { cursor: grabbing; }
.tape.dragging .tp { pointer-events: none; }
.tp img { -webkit-user-drag: none; pointer-events: none; }
.tape-arrow { position: absolute; top: 0; bottom: 0; z-index: 2; width: 56px; display: flex; align-items: center; color: var(--text); transition: opacity .15s; }
.tape-arrow svg { width: 28px; height: 28px; padding: 6px; border-radius: var(--r); background: var(--raised); border: 1px solid var(--line-strong); box-sizing: border-box; }
.tape-arrow:hover svg { background: var(--blue); border-color: var(--blue); color: var(--bg); }
.tape-arrow.left { left: 0; justify-content: flex-start; padding-left: 8px; background: linear-gradient(90deg, var(--bg-2) 55%, transparent); }
.tape-arrow.right { right: 0; justify-content: flex-end; padding-right: 8px; background: linear-gradient(270deg, var(--bg-2) 55%, transparent); }
.tape-arrow.off { opacity: 0; pointer-events: none; }

/* ---- footer (plain text, no boxed buttons) ---- */
.statusbar { align-items: center; padding: 8px 20px; gap: 8px 28px; }
.statusbar .sb-left { display: flex; align-items: center; gap: 10px; }
.statusbar .sb-snap { border: 0; padding: 0; gap: 6px; color: var(--subtle); font-size: 12px; }
.statusbar .sb-snap:hover { color: var(--text); }
.statusbar .sb-session { display: flex; flex-direction: column; align-items: flex-end; margin-left: auto; line-height: 1.35; text-align: right; }
.statusbar .sb-line { display: flex; gap: 8px; align-items: baseline; }
.statusbar .sb-line strong { color: var(--text-2); font-weight: 600; }
.statusbar .sb-src { font-size: 11px; color: #5d6070; }
.statusbar .sb-links { display: flex; gap: 14px; padding-left: 18px; border-left: 1px solid var(--line); }
.statusbar .sb-links button, .statusbar .sb-links a { border: 0; padding: 0; font-size: 12px; color: var(--subtle); }
.statusbar .sb-links button:hover, .statusbar .sb-links a:hover { color: var(--text); text-decoration: none; }
@media (max-width: 760px) { .statusbar .sb-session { align-items: flex-start; margin-left: 0; text-align: left; } .statusbar .sb-links { border-left: 0; padding-left: 0; } }

/* ---- safety + best price: one type size, one blue icon language ---- */
.sf-ic { width: 18px; height: 18px; flex: none; display: inline-grid; place-items: center; border-radius: var(--r-sm); background: var(--blue-tint); color: var(--blue-icon); }
.sf-ic svg { width: 12px; height: 12px; display: block; }
#checks { font-size: 13px; }
#checks li { display: flex; align-items: flex-start; gap: 10px; padding: 10px 16px; font-size: 13px; line-height: 1.45; color: var(--text-2); border-bottom: 1px solid var(--line-soft); grid-template-columns: none; }
#checks li:last-child { border-bottom: 0; }
#checks li.sf-verdict { align-items: center; color: var(--text-strong); font-weight: 600; }
#checks li.sf-checks { flex-wrap: wrap; gap: 8px 16px; align-items: center; }
#checks li.sf-checks > span { display: inline-flex; align-items: center; gap: 8px; color: var(--text-2); }
#checks .bad .sf-ic, #checks li.sf-checks > span.bad .sf-ic { background: #ec397a1f; color: var(--down); }
#checks li.sf-note .sf-ic { margin-top: 0; }
#bxBody { font-size: 13px; }
.bx-top { padding: 12px 16px 0; justify-content: flex-start; }
.bx-head { display: flex; align-items: flex-start; gap: 10px; margin: 0; padding: 10px 16px; font-size: 13px; color: var(--text-strong); font-weight: 600; line-height: 1.45; border-bottom: 1px solid var(--line-soft); }
.bx-head b { font-weight: 600; }
.bx-row { grid-template-columns: 110px minmax(0, 1fr) auto; padding: 10px 16px; font-size: 13px; border-top: 0; border-bottom: 1px solid var(--line-soft); }
.bx-row + .bx-row { border-top: 0; }
.bx-name { color: var(--text-2); font-weight: 400; }
.bx-name em { font-size: 11px; color: var(--subtle); }
.bx-row.best .bx-name { color: var(--text-strong); font-weight: 600; }
.bx-row.best .bx-name::before { content: none; }
.bx-bar { height: 4px; background: var(--line); }
.bx-bar i { background: #3a3d4b !important; }
.bx-row.best .bx-bar i { background: var(--blue) !important; }
.bx-val { color: var(--text-2); font-weight: 400; }
.bx-row.best .bx-val { color: var(--text-strong); font-weight: 600; }
.bx-foot { display: flex; align-items: flex-start; gap: 10px; padding: 10px 16px 12px; font-size: 13px; color: var(--subtle); line-height: 1.45; }

/* ---- brand in title case; nav and footer aligned with the trade board below ---- */
.brand-name { letter-spacing: .02em; font-size: 23px; }
.opx-mark { letter-spacing: .02em; }
.topbar, .statusbar { padding-left: max(20px, calc((100% - 1520px) / 2 + 20px)); padding-right: max(20px, calc((100% - 1520px) / 2 + 20px)); }
.page { max-width: 1520px; }
@media (max-width: 760px) { .topbar, .statusbar { padding-left: 12px; padding-right: 12px; } }
.brand-name { font-weight: 300; letter-spacing: .03em; font-size: 24px; }
.brand-name { font-weight: 200; letter-spacing: .04em; font-size: 26px; }

/* ---- explorer + social logos (Solscan in links, X and Solscan in the footer) ---- */
.sc-ic { width: 14px; height: 14px; border-radius: 50%; vertical-align: -2px; margin-right: 6px; }
.wl-sc { width: 22px; height: 22px; border-radius: 50%; }
.kv dd a, .toast a, #actBody a { display: inline-flex; align-items: center; }
.statusbar .soc { display: flex; gap: 6px; padding-left: 14px; border-left: 1px solid var(--line); }
.statusbar .soc a { width: 26px; height: 26px; display: grid; place-items: center; border-radius: var(--r); border: 1px solid var(--line); color: var(--text-2); }
.statusbar .soc a:hover { background: var(--raised); border-color: var(--line-strong); color: var(--text-strong); text-decoration: none; }
.statusbar .soc svg { width: 12px; height: 12px; }
.statusbar .soc img { width: 14px; height: 14px; border-radius: 50%; }

/* ---- footer: one row, taller ---- */
.statusbar { min-height: 52px; padding-top: 12px; padding-bottom: 12px; font-size: 13px; flex-wrap: nowrap; align-items: center; gap: 24px; }
.statusbar .sb-left { gap: 12px; white-space: nowrap; }
.statusbar .sb-snap { font-size: 13px; }
.statusbar .sb-session { flex-direction: row; align-items: center; gap: 10px; margin-left: auto; white-space: nowrap; }
.statusbar .sb-line { gap: 10px; }
.statusbar .sb-line strong { font-size: 13px; }
.statusbar .sb-src { font-size: 12px; padding-left: 10px; border-left: 1px solid var(--line); color: #5d6070; }
.statusbar .sb-links { gap: 18px; padding-left: 20px; }
.statusbar .sb-links button, .statusbar .sb-links a { font-size: 13px; color: var(--muted); }
.statusbar .soc { gap: 8px; padding-left: 18px; }
.statusbar .soc a { width: 30px; height: 30px; }
.statusbar .soc svg { width: 13px; height: 13px; }
.statusbar .soc img { width: 16px; height: 16px; }
.dot { width: 7px; height: 7px; }
@media (max-width: 1180px) { .statusbar { flex-wrap: wrap; } .statusbar .sb-src { display: none; } }
@media (max-width: 760px) { .statusbar .sb-session { margin-left: 0; white-space: normal; } }
