/* Visual language follows CypherOS (injective-zeto frontend): black canvas,
   stacked #121212 / #202020 panels on 1.5px hairlines, violet gradient as the
   only accent, a high-contrast serif for hero numbers and pill buttons. */
:root {
  --bg: #000;
  --panel: #121212;
  --panel-alt: #202020;
  --field: #0e0e0e;
  --line: #282828;
  --line-strong: #303030;
  --text: #fff;
  --muted: #b2b2b2;
  --muted-low: #737373;
  --accent: #7567ff;
  --grad-start: #4d3dff;
  --grad-end: #6936ec;
  --grad-border: #5359f9;
  --gradient: linear-gradient(105deg, #4d3dff 0%, #6936ec 80%);
  --success: #62ca9f;
  --warning: #e7b34c;
  --danger: #e0736a;
  --body-font: "TT Commons", "Avenir Next", Avenir, Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --display-font: "ABC Marist", "Iowan Old Style", "Bodoni 72", Georgia, serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, monospace;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 400 13px/1.45 var(--body-font);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
h2 { margin: 0 0 4px; font-size: 16px; font-weight: 600; letter-spacing: -0.01em; }
p { margin: 0; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }
[hidden] { display: none !important; }

/* ---------------------------------------------------------------- buttons */
button {
  font: inherit; color: var(--text); cursor: pointer;
  min-height: 34px; padding: 0 16px; border-radius: 100px;
  border: 1.5px solid rgba(255, 255, 255, .06); background: rgba(255, 255, 255, .04);
  box-shadow: 0 1px 1px rgba(0, 0, 0, .2);
  transition: filter .15s ease, transform .15s ease, border-color .15s ease, background .15s ease;
  white-space: nowrap;
}
button:hover:not(:disabled) { filter: brightness(1.12); border-color: var(--line-strong); }
button:disabled { opacity: .42; cursor: not-allowed; }
button.primary { background: var(--gradient); border-color: var(--grad-border); color: #fff; font-weight: 500; }
button.primary:hover:not(:disabled) { transform: translateY(-1px); }
button.ghost { background: transparent; }
button.sm { min-height: 28px; padding: 0 12px; font-size: 12px; border-radius: 8px; }
input, select {
  font: 500 13px/1 var(--body-font); color: var(--text); width: 100%;
  min-height: 40px; padding: 0 14px; border-radius: 8px;
  border: 1.5px solid var(--line); background: var(--field);
  font-variant-numeric: tabular-nums;
}
input:focus { outline: none; border-color: var(--grad-border); box-shadow: 0 0 0 3px rgba(77, 61, 255, .18); }

/* --------------------------------------------------------------- top bar */
.topbar {
  position: sticky; top: 0; z-index: 30; height: 56px; flex: none;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 0 24px; background: rgba(0, 0, 0, .78); backdrop-filter: blur(14px);
  border-bottom: 1px solid #111;
}
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none !important; }
.brand-logo { display: block; width: 32px; height: 32px; border-radius: 50%; box-shadow: 0 1px 2px rgba(0, 0, 0, .3); }
.brand-name { font-size: 16px; font-weight: 600; letter-spacing: -0.01em; }
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.badge {
  display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 11px;
  border: 1.5px solid var(--line); border-radius: 8px; background: var(--panel);
  font-size: 11px; box-shadow: 0 1px 1px rgba(0, 0, 0, .2); white-space: nowrap;
}
.network-badge { color: var(--success); }
.network-badge i { width: 5px; height: 5px; border-radius: 50%; background: var(--success); box-shadow: 0 0 8px var(--success); }

.wallet { display: flex; align-items: center; gap: 8px; }
.wallet .bal { font-size: 11px; color: var(--muted); text-align: right; line-height: 1.3; }
.wallet .bal b { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.wallet-menu { position: relative; }
.wallet-menu .menu {
  position: absolute; right: 0; top: calc(100% + 10px); min-width: 220px; padding: 6px;
  display: grid; gap: 2px; border: 1.5px solid var(--line-strong); border-radius: 14px;
  background: var(--panel); box-shadow: 0 18px 48px rgba(0, 0, 0, .7);
}
.wallet-menu .menu button {
  justify-content: flex-start; text-align: left; border-radius: 8px; border-color: transparent;
  background: transparent; box-shadow: none; min-height: 40px;
}
.wallet-menu .menu button:hover { background: rgba(255, 255, 255, .05); border-color: var(--line); }
/* account dropdown: opens on hover, keyboard focus or a click */
.account .menu { display: none; min-width: 280px; }
.account:hover .menu, .account:focus-within .menu, .account.open .menu { display: grid; }
.account .menu::before { content: ""; position: absolute; left: 0; right: 0; top: -12px; height: 12px; }
.account .acct { display: grid; gap: 4px; padding: 8px 10px 10px; }
.account .acct .k { color: var(--muted); font-size: 11px; }
.account .acct .addr { font-size: 11px; word-break: break-all; color: var(--text); }
.account .acct-bal { display: grid; gap: 4px; margin: 0 4px 6px; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 10px; background: var(--field); font-size: 12px; color: var(--muted); }
.account .acct-bal b { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.wallet-menu .menu .menu-link { display: flex; align-items: center; min-height: 40px; padding: 0 16px; border-radius: 8px; color: var(--text); text-decoration: none; }
.wallet-menu .menu .menu-link:hover { background: rgba(255, 255, 255, .05); }
.wallet-menu .menu button.danger { color: var(--danger); }

/* ----------------------------------------------------------------- layout */
.layout {
  display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 16px;
  max-width: 1680px; margin: 0 auto; padding: 16px 20px 24px;
}
.col-main, .col-side { display: grid; gap: 16px; align-content: start; min-width: 0; }
.col-side { position: sticky; top: 72px; }

/* A stack is CypherOS's card: panels joined by 1.5px seams, 24px outer radius. */
.stack {
  display: flex; flex-direction: column; gap: 1.5px; overflow: hidden;
  border-radius: 24px; background: var(--bg); box-shadow: 0 2px 1px rgba(0, 0, 0, .2); min-width: 0;
}
.panel { padding: 18px 22px; border: 1.5px solid var(--line); background: var(--panel); min-width: 0; }
.panel.alt { background: var(--panel-alt); border-color: var(--line-strong); }
.panel.flush { padding: 4px 8px 8px; }
.stack > .panel:first-child { border-radius: 24px 24px 0 0; }
.stack > .panel:last-child { border-radius: 0 0 24px 24px; }
.stack > .panel:only-child { border-radius: 24px; }
.panel.head { padding-top: 14px; padding-bottom: 14px; display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

/* -------------------------------------------------------------------- hero */
.index-panel {
  display: grid; grid-template-columns: minmax(220px, 260px) minmax(260px, 330px) minmax(0, 1fr);
  gap: 24px; align-items: center;
}
.hero-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.kicker { color: var(--muted); font-size: 12px; letter-spacing: .02em; }
.index-kicker { display: inline-flex; align-items: center; gap: 8px; color: var(--text); font-weight: 600; font-size: 13px; }
.asset-icon { display: block; width: 22px; height: 22px; border-radius: 6px; }
.asset-icon.round { border-radius: 50%; object-fit: cover; }

/* market switcher: the index title opens a list of every underlying */
.market-switch { position: relative; }
.market-switch .index-kicker { min-height: 32px; padding: 0 10px 0 6px; border: 1.5px solid var(--line); border-radius: 100px; background: var(--field); box-shadow: none; cursor: pointer; }
.market-switch .index-kicker:hover { border-color: var(--line-strong); }
.market-switch .caret { color: var(--muted); font-size: 10px; }
.market-switch .kbd { margin-left: 2px; }
.kbd {
  display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border: 1px solid var(--line-strong); border-radius: 5px;
  color: var(--accent); font: 600 11px/1 var(--mono); background: transparent;
}
@media (hover: none) { .market-switch .kbd { display: none; } }

/* market selector popover, after TrueCurrent's: search, category pills, sortable table */
.market-menu {
  position: fixed; z-index: 30; display: none; flex-direction: column;
  width: min(800px, calc(100vw - 32px)); overflow: hidden;
  border: 1.5px solid var(--line-strong); border-radius: 14px; background: var(--panel); box-shadow: 0 18px 48px rgba(0, 0, 0, .7);
  transform-origin: top left;
}
.market-menu.open { display: flex; animation: mk-in .1s ease-out; }
@keyframes mk-in { from { opacity: 0; transform: scale(.97); } to { opacity: 1; transform: none; } }

/* market table: shared by the selector and the landing page */
.mk { flex-direction: column; min-height: 0; }
.mk-head { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; padding: 4px 12px 0; border-bottom: 1px solid var(--line); }
.mk-search { display: flex; flex: 1 1 260px; align-items: center; gap: 10px; min-height: 52px; color: var(--muted-low); }
.mk-search input { flex: 1; min-width: 0; padding: 0; border: 0; outline: 0; background: transparent; box-shadow: none; color: var(--text); font: inherit; font-size: 14px; }
.mk-search input::placeholder { color: var(--muted-low); }
.mk-search input::-webkit-search-cancel-button { display: none; }
.mk-pills { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 0; }
.mk-pills button { min-height: 0; padding: 4px 9px; border: 0; border-radius: 6px; background: var(--panel-alt); box-shadow: none; color: var(--text); font-size: 12px; }
.mk-pills button:hover { background: var(--line-strong); }
.mk-pills button.on { color: var(--accent); background: rgba(117, 103, 255, .14); }
.mk-scroll { flex: 1; min-height: 0; overflow: auto; scrollbar-width: none; }
.mk-scroll::-webkit-scrollbar { display: none; }
.mk-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.mk-table thead th { position: sticky; top: 0; z-index: 1; padding: 8px 10px; background: var(--panel); text-align: left; white-space: nowrap; }
.mk-table th.r, .mk-table td.r { text-align: right; }
.mk-table th button { display: inline-flex; align-items: center; gap: 4px; min-height: 0; padding: 0; border: 0; background: none; box-shadow: none; color: var(--muted-low); font-size: 12px; font-weight: 400; }
.mk-table th button:hover, .mk-table th button.on { color: var(--muted); }
.mk-table th button i { font-style: normal; opacity: .45; }
.mk-table th button.on i { opacity: 1; }
.mk-table tbody tr { cursor: pointer; }
.mk-table tbody tr:nth-child(odd) { background: rgba(0, 0, 0, .28); }
.mk-table tbody tr:hover, .mk-table tbody tr.active { background: var(--panel-alt); }
.mk-table tbody tr.current b { color: var(--accent); }
.mk-table td { padding: 7px 10px; text-align: left; white-space: nowrap; }
.mk-table .num { font-variant-numeric: tabular-nums; }
.mk-table .up { color: var(--success); }
.mk-table .down { color: var(--danger); }
.mk-dim { color: var(--muted-low); }
/* subscript zero counts in tiny prices (0.0₅4912), as on TrueCurrent */
sub { font-size: .72em; line-height: 0; vertical-align: -.3em; }
.mk-fav { width: 28px; padding-right: 0 !important; }
.mk-fav button { min-height: 0; padding: 0; border: 0; background: none; box-shadow: none; color: var(--muted-low); font-size: 14px; line-height: 1; }
.mk-fav button.on { color: var(--warning); }
.mk-mkt { display: inline-flex; align-items: center; gap: 10px; }
.mk-mkt img, .mk-letter { flex: none; width: 20px; height: 20px; border-radius: 50%; object-fit: cover; background: var(--panel-alt); }
.mk-letter { display: inline-grid; place-items: center; color: var(--muted); font-size: 11px; font-weight: 600; }
.mk-mkt > span { display: grid; line-height: 1.2; }
.mk-mkt b { font-weight: 600; }
.mk-mkt small { max-width: 220px; overflow: hidden; text-overflow: ellipsis; color: var(--muted-low); font-size: 11px; }
.mk-empty td { padding: 40px 10px; color: var(--muted-low); text-align: center; cursor: default; }
@media (max-width: 640px) {
  .mk-pills { display: none; }
  .mk-wide { display: none; }
  .mk-mkt small { max-width: 120px; }
}
.wallet-menu .menu button img { margin-right: 8px; border-radius: 4px; }
.wallet-menu .menu-note { padding: 8px 10px; }
.hero-number {
  margin: 10px 0 0; font-family: var(--display-font); font-size: 44px; line-height: 1; font-weight: 400;
  letter-spacing: -0.025em; font-variant-numeric: lining-nums tabular-nums;
}
.hero-number small { font-family: var(--body-font); font-size: 14px; font-weight: 600; color: var(--muted); margin-left: 8px; letter-spacing: 0; }
.hero-caption { display: flex; gap: 12px; flex-wrap: wrap; align-items: baseline; margin-top: 8px; color: var(--muted); font-size: 12px; }
#heroChange.up { color: var(--success); }
#heroChange.down { color: var(--danger); }
.skeleton {
  display: inline-block; width: 4.2em; height: .72em; border-radius: 9px; vertical-align: -.02em;
  background: linear-gradient(100deg, rgba(255,255,255,.07) 15%, rgba(255,255,255,.18) 45%, rgba(255,255,255,.07) 75%);
  background-size: 220% 100%; animation: shimmer 1.5s ease-in-out infinite;
}
@keyframes shimmer { to { background-position-x: -220%; } }
@media (prefers-reduced-motion: reduce) { .skeleton { animation: none; } }

.notice { display: inline-flex; align-items: center; gap: 8px; color: var(--warning); }
.notice::before { content: ""; flex: none; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.notice.ok { color: var(--success); }

.seg { display: inline-flex; padding: 3px; gap: 2px; border: 1.5px solid var(--line); border-radius: 10px; background: var(--field); }
.seg button { min-height: 26px; padding: 0 10px; border: 0; border-radius: 7px; background: transparent; box-shadow: none; color: var(--muted-low); font-size: 11px; }
.seg button.on { background: var(--panel-alt); color: var(--text); }

.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.stat { min-width: 0; padding: 9px 12px; border: 1.5px solid var(--line-strong); border-radius: 14px; background: var(--panel); }
.stat .k { color: var(--muted); font-size: 11px; }
.stat .v { margin-top: 3px; font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat .v .muted { font-weight: 400; }
.chart-box { position: relative; height: 140px; min-width: 0; }

/* -------------------------------------------------------------- god mode */
.chain-card .panel.head { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px 16px; }
.chain-card .tabs { grid-column: 1 / -1; }
.chain-title { display: flex; align-items: baseline; gap: 14px; min-width: 0; flex-wrap: wrap; }
.chain-title h2 { margin: 0; }
.chain-tools { display: flex; gap: 10px; align-items: center; justify-content: flex-end; flex-wrap: wrap; }
.god-bar { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.god-tag {
  display: inline-flex; align-items: center; height: 24px; padding: 0 9px; border-radius: 8px;
  background: var(--warning); color: #000; font-size: 11px; font-weight: 600; letter-spacing: .02em;
}
.god-panel { padding-top: 12px !important; padding-bottom: 12px !important; border-color: rgba(231, 179, 76, .45) !important; background: linear-gradient(180deg, rgba(231, 179, 76, .07), rgba(231, 179, 76, .02)), var(--panel) !important; }
.god-panel h4 { display: flex; align-items: center; gap: 8px; margin: 0 0 6px; font-size: 13px; font-weight: 600; }
.god-panel p { color: var(--muted); font-size: 12px; margin-bottom: 10px; }
.god-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 8px; }
.god-row button { min-height: 40px; border-radius: 8px; background: var(--warning); border-color: rgba(255, 255, 255, .3); color: #000; font-weight: 600; }

/* ------------------------------------------------------------------ tabs */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; }
#expiryTabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
#expiryTabs::-webkit-scrollbar { display: none; }
#expiryTabs button { flex: none; }
.tab-split { flex: none; width: 1px; margin: 6px 4px; background: var(--line-strong); }
.tabs button { min-height: 32px; padding: 0 12px; font-size: 12px; border-radius: 8px; color: var(--muted); }
.tabs button.on { color: #fff; border-color: rgba(114, 82, 255, .55); background: linear-gradient(110deg, rgba(77, 61, 255, .32), rgba(105, 54, 236, .12)); }
.tabs button .dte { margin-left: 6px; color: var(--muted-low); }
.tabs button.on .dte { color: rgba(255, 255, 255, .6); }

/* ---------------------------------------------------------------- tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: separate; border-spacing: 0; }
th, td { padding: 8px 12px; text-align: right; white-space: nowrap; }
th { color: var(--muted); font-size: 11px; font-weight: 500; }
td { font-variant-numeric: tabular-nums; border-top: 1px dashed var(--line-strong); font-size: 13px; }
table thead { position: sticky; top: 0; z-index: 1; background: var(--panel-alt); }
table.chain thead tr:first-child th { padding-top: 10px; }
.muted-low { color: var(--muted-low); font-weight: 400; letter-spacing: 0; }
table.chain th.side { text-align: center; font-size: 12px; font-weight: 600; letter-spacing: .04em; }
table.chain th.calls { color: var(--success); }
table.chain th.puts { color: var(--danger); }
table.chain th.strike-h, table.chain td.strike { text-align: center; }
table.chain td.strike { color: #fff; font-weight: 600; background: rgba(255, 255, 255, .03); }
table.chain td.cell { cursor: pointer; transition: background .12s ease; }
table.chain td.cell:hover { background: rgba(255, 255, 255, .035); }
table.chain td.sel { background: linear-gradient(110deg, rgba(77, 61, 255, .22), rgba(105, 54, 236, .1)) !important; }
table.chain td.ask { color: var(--accent); font-weight: 600; }
table.chain td.ask .muted { color: var(--muted-low); font-weight: 400; }
table.chain td.empty { color: var(--muted-low); cursor: default; }
table.chain td.bid { color: var(--success); font-weight: 600; }
table.chain td.bid .muted { color: var(--muted-low); font-weight: 400; }
table.grid td:first-child, table.grid th:first-child { text-align: left; }
table.grid td.actions { display: flex; gap: 6px; justify-content: flex-end; }
table.grid a { color: var(--text); }
.empty-row td { text-align: center !important; color: var(--muted); padding: 22px; }

/* ------------------------------------------------------------------ dock */
.dock-head { gap: 12px; }
.dock-tabs button { min-height: 28px; padding: 0 12px; font-size: 12px; }
.dock-pane.pad { padding: 12px; }

/* ----------------------------------------------------------------- chips */
.pill {
  display: inline-flex; align-items: center; min-height: 24px; padding: 0 9px; border-radius: 8px;
  border: 1.5px solid var(--line-strong); background: rgba(255, 255, 255, .04);
  color: var(--muted); font-size: 11px; white-space: nowrap;
}
.pill-call { background: var(--success); border-color: rgba(255, 255, 255, .32); color: #000; }
.pill-put { background: var(--danger); border-color: rgba(255, 255, 255, .32); color: #000; }
.pill-struct { background: var(--accent); border-color: rgba(255, 255, 255, .32); color: #fff; }

/* structure builder: presets, strike pickers, the legs it trades */
.chain-title { align-items: center; }
#structPanel { padding: 16px; }
.struct { display: grid; gap: 14px; max-width: 760px; }
.struct-presets { flex-wrap: wrap; }
.struct-presets button { min-height: 30px; padding: 0 12px; font-size: 12px; }
.struct-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.struct-fields .field { margin: 0; }
.struct-fields .field span { color: var(--muted); font-size: 12px; }
.struct-legs { max-width: 480px; }
.struct-legs td:first-child, .struct-legs th:first-child { text-align: left; width: 90px; }
.struct-legs td, .struct-legs th { text-align: left; }
.struct-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.struct-foot b { font-size: 18px; font-variant-numeric: tabular-nums; }
.struct-foot .primary { margin-left: auto; }
.pill-ok { background: var(--grad-start); border-color: var(--grad-border); color: #fff; }
.pill-warn { background: var(--warning); border-color: rgba(255, 255, 255, .32); color: #000; }

/* ----------------------------------------------------------------- ticket */
.ticket .panel:first-child { padding: 18px 22px 16px; }
.ticket .placeholder { padding: 48px 20px; color: var(--muted); text-align: center; }
.ticket .symbol { font-size: 13px; font-weight: 600; letter-spacing: .01em; word-break: break-all; }
.ticket .chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.ticket .big { margin: 12px 0 2px; font-family: var(--display-font); font-size: 36px; line-height: 1; letter-spacing: -0.03em; font-variant-numeric: lining-nums tabular-nums; }
.ticket .big small { margin-left: 6px; font-family: var(--body-font); font-size: 13px; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.ticket .facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px 14px; margin-top: 12px; }
.ticket .facts .wide { grid-column: span 2; }
.ticket .facts div { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.ticket .facts .k { color: var(--muted); font-size: 11px; }
.ticket .facts .v { font-size: 13px; font-weight: 500; font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; }
.ticket .mode { display: grid; grid-template-columns: 1fr 1fr; gap: 3px; padding: 3px; margin-bottom: 12px; border: 1.5px solid var(--line); border-radius: 100px; background: var(--field); }
.ticket .mode button { min-height: 34px; border: 0; box-shadow: none; background: transparent; color: var(--muted); }
.ticket .mode button.on { background: var(--gradient); color: #fff; }
.field { display: grid; gap: 6px; margin-bottom: 10px; }
.field label { display: flex; justify-content: space-between; color: var(--muted); font-size: 12px; }
.check { display: flex; align-items: center; gap: 9px; margin-bottom: 14px; color: var(--muted); font-size: 12px; }
.check input { width: 16px; min-height: 16px; height: 16px; accent-color: var(--grad-start); }
.summary { display: grid; gap: 5px; margin-bottom: 10px; padding: 10px 14px; border: 1.5px solid var(--line); border-radius: 14px; background: var(--field); font-size: 12px; }
.summary div { display: flex; justify-content: space-between; gap: 10px; }
.summary span:first-child { color: var(--muted); }
.summary span:last-child { font-weight: 500; font-variant-numeric: tabular-nums; }
.summary .pos { color: var(--success); }
.summary .neg, #positions .neg { color: var(--danger); }
.payoff-box { position: relative; height: 116px; margin: 2px 0 12px; }

/* synthetic order book: indicative RFQ levels, asks above the mid, bids below */
.book { display: grid; gap: 1px; margin-bottom: 12px; padding: 6px; border: 1.5px solid var(--line); border-radius: 14px; background: var(--field); font-size: 12px; font-variant-numeric: tabular-nums; }
.book.empty { padding: 14px; color: var(--muted); text-align: center; }
.book-head, .book-row { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; padding: 3px 8px; }
.book-head { color: var(--muted-low); font-size: 11px; }
.book-head span:not(:first-child), .book-row span:not(:first-child) { text-align: right; }
.book-row {
  position: relative; min-height: 0; border: 0; border-radius: 6px; background: transparent; box-shadow: none; color: var(--text); font: inherit; cursor: pointer;
}
.book-row::before { content: ""; position: absolute; inset: 0 0 0 auto; width: var(--depth); border-radius: 6px; opacity: .14; }
.book-row.ask span:first-child { color: var(--danger); font-weight: 600; }
.book-row.bid span:first-child { color: var(--success); font-weight: 600; }
.book-row.ask::before { background: var(--danger); }
.book-row.bid::before { background: var(--success); }
.book-row:hover { background: rgba(255, 255, 255, .04); }
.book-row span { position: relative; }
.book-mid { display: flex; justify-content: space-between; gap: 8px; margin: 3px 0; padding: 5px 8px; border-top: 1px dashed var(--line-strong); border-bottom: 1px dashed var(--line-strong); font-weight: 600; }
.book-mid .muted { font-weight: 400; font-size: 11px; }
.book-none { padding: 4px 8px; font-size: 11px; }
.ticket .cta { width: 100%; min-height: 42px; font-size: 14px; }
.ticket .cta-note { margin: 8px 0 0; font-size: 12px; line-height: 1.4; }
.settled-box { margin-bottom: 14px; padding: 14px 16px; border: 1px solid var(--grad-border); border-radius: 14px; background: rgba(77, 61, 255, .1); color: #d9d6ff; }

/* --------------------------------------------------------- side content */
.how { list-style: none; margin: 0 0 14px; padding: 0; display: grid; }
.how li { display: flex; gap: 12px; padding: 8px 0; border-top: 1px dashed var(--line-strong); color: #d4d4d4; }
.how li:first-child { border-top: 0; padding-top: 0; }
.how .n { display: grid; flex: none; place-items: center; width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--line-strong); font-size: 11px; color: var(--muted); }
.how li:first-child .n { background: var(--gradient); border-color: var(--grad-border); color: #fff; }
.feed { list-style: none; margin: 0; padding: 0; display: grid; }
.feed li { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; border-top: 1px dashed var(--line-strong); font-size: 12px; }
.feed li:first-child { border-top: 0; padding-top: 0; }
.feed .what { min-width: 0; overflow: hidden; text-overflow: ellipsis; }

.foot { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 16px; max-width: 1680px; margin: 0 auto; padding: 0 20px 28px; color: var(--muted-low); font-size: 11px; text-align: center; }
.foot a { color: var(--muted); }

/* ---------------------------------------------------------------- landing */
.landing {
  position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 32px 24px; overflow: auto;
  background:
    radial-gradient(900px 560px at 50% 38%, rgba(77, 61, 255, .22), transparent 70%),
    radial-gradient(700px 480px at 70% 80%, rgba(105, 54, 236, .12), transparent 70%),
    var(--bg);
}
body.on-landing { overflow: hidden; }
.landing-inner { display: grid; justify-items: center; gap: 14px; width: 100%; max-width: 1180px; text-align: center; animation: landing-in .6s cubic-bezier(.22, 1, .36, 1) both; }
@keyframes landing-in { from { opacity: 0; transform: translateY(14px); } }
@media (prefers-reduced-motion: reduce) { .landing-inner { animation: none; } }
.landing-logo { width: 56px; height: 56px; border-radius: 50%; box-shadow: 0 12px 48px rgba(77, 61, 255, .45); }
.landing h1 { margin: 6px 0 0; font-family: var(--display-font); font-size: clamp(44px, 6vw, 76px); font-weight: 400; line-height: 1; letter-spacing: -0.03em; }
.landing-sub { max-width: 620px; color: var(--muted); font-size: 16px; line-height: 1.45; }
.landing-points { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.landing-points span { padding: 6px 12px; border: 1.5px solid var(--line); border-radius: 100px; background: var(--panel); color: var(--muted); font-size: 12px; }
.landing-markets {
  display: flex; width: 100%; max-width: 860px; height: min(560px, 62vh); margin-top: 14px; overflow: hidden; text-align: left;
  border: 1.5px solid var(--line); border-radius: 18px; background: var(--panel);
}
/* short screens: tighten the hero so the market table still fits */
@media (min-width: 981px) and (max-height: 760px) {
  .landing-logo { width: 44px; height: 44px; }
  .landing h1 { font-size: 56px; }
  .landing-inner { gap: 10px; }
}
.landing-cta {
  display: inline-flex; align-items: center; justify-content: center; min-height: 44px; margin-top: 4px; padding: 0 30px;
  border-radius: 100px; border: 1.5px solid var(--grad-border); background: var(--gradient); color: #fff !important;
  font-size: 15px; font-weight: 500; text-decoration: none !important; box-shadow: 0 10px 36px rgba(77, 61, 255, .4);
  transition: transform .15s ease, filter .15s ease;
}
.landing-cta:hover { transform: translateY(-1px); filter: brightness(1.1); }
.landing-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 12px; }
.landing-docs {
  display: inline-flex; align-items: center; min-height: 44px; margin-top: 4px; padding: 0 24px; border-radius: 100px;
  border: 1.5px solid var(--line-strong); color: var(--muted) !important; font-size: 15px; text-decoration: none !important;
}
.landing-docs:hover { color: var(--text) !important; border-color: var(--muted-low); }
.top-link { color: var(--muted); font-size: 13px; text-decoration: none; padding: 6px 4px; }
.top-link:hover { color: var(--text); }

/* ------------------------------------------------------ toasts + dialog */
.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 50; display: grid; gap: 8px; max-width: min(380px, calc(100vw - 40px)); }
.toast { padding: 12px 14px; border: 1.5px solid var(--line-strong); border-radius: 14px; background: var(--panel); box-shadow: 0 18px 48px rgba(0, 0, 0, .7); font-size: 12px; word-break: break-word; }
.toast::before { content: ""; display: inline-block; width: 6px; height: 6px; margin-right: 8px; border-radius: 50%; background: var(--accent); vertical-align: 1px; }
.toast.ok::before { background: var(--success); }
.toast.err::before { background: var(--danger); }
dialog { width: min(420px, calc(100vw - 32px)); padding: 24px; border: 1.5px solid var(--line-strong); border-radius: 24px; background: var(--panel); color: var(--text); }
dialog::backdrop { background: rgba(0, 0, 0, .65); backdrop-filter: blur(4px); }
dialog h3 { margin: 0 0 16px; font-size: 16px; font-weight: 600; }
dialog .row { display: flex; gap: 8px; justify-content: flex-end; margin-top: 8px; }
dialog .confirm h3 { margin-top: 12px; }
dialog .confirm .god-tag + h3 { margin-top: 14px; }
dialog .confirm .summary { margin-bottom: 14px; }
dialog .confirm p { margin-bottom: 18px; font-size: 12px; line-height: 1.5; }
dialog button.warn { background: var(--warning); border-color: rgba(255, 255, 255, .3); color: #000; font-weight: 600; }

/* ------------------------------------------------------------ responsive */
/* Wide, tall-enough screens get a fixed app shell: nothing scrolls but the
   chain, the dock and (if it must) the ticket column. */
@media (min-width: 1121px) and (min-height: 640px) {
  html, body { height: 100%; }
  body { display: flex; flex-direction: column; height: 100vh; min-height: 0; overflow: hidden; }
  .layout { flex: 1; min-height: 0; width: 100%; padding: 14px 20px 0; gap: 14px; grid-template-rows: minmax(0, 1fr); }
  .col-main { grid-template-rows: auto minmax(0, 1fr) minmax(130px, 22%); gap: 14px; min-height: 0; align-content: stretch; }
  .col-side { display: block; position: static; min-height: 0; overflow-y: auto; border-radius: 24px; scrollbar-width: thin; }
  .chain-card, .dock { min-height: 0; }
  .scroll-panel { flex: 1; min-height: 0; display: flex; flex-direction: column; }
  .scroll-panel > .table-wrap, .scroll-panel > .dock-pane { flex: 1; min-height: 0; overflow: auto; scrollbar-width: thin; }
  .foot { flex: none; width: 100%; padding: 8px 20px 10px; }
}
@media (min-width: 1121px) and (min-height: 640px) and (max-height: 900px) {
  .index-panel { padding-top: 12px; padding-bottom: 12px; }
  .hero-number { font-size: 34px; margin-top: 6px; }
  .chart-box { height: 104px; }
  .stat { padding: 6px 10px; }
  .panel.head { padding-top: 10px; padding-bottom: 10px; }
  .ticket .facts { gap: 5px 16px; }
  .payoff-box { height: 92px; margin-bottom: 10px; }
  .ticket .big { font-size: 30px; margin-top: 8px; }
  .ticket .panel:first-child { padding-top: 14px; padding-bottom: 12px; }
  .ticket .chips { margin-top: 6px; }
  .summary { gap: 3px; padding: 8px 12px; }
  input, select { min-height: 36px; }
  .ticket .mode button { min-height: 30px; }
  th, td { padding-top: 6px; padding-bottom: 6px; }
}
@media (max-width: 1120px) {
  .layout { grid-template-columns: 1fr; }
  .col-side { position: static; }
  .index-panel { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .index-panel .chart-box { grid-column: 1 / -1; }
}
@media (max-width: 800px) {
  .topbar { height: 56px; padding: 0 16px; }
  .network-badge { display: none; }
  .layout { padding: 16px 16px 24px; gap: 16px; }
  .panel { padding: 18px; }
  .index-panel { grid-template-columns: minmax(0, 1fr); }
  .hero-number { font-size: 40px; }
  .wallet .bal { display: none; }
}
@media (max-width: 420px) {
  .brand-name { font-size: 14px; }
  .hero-number { font-size: 36px; }
  .ticket .big { font-size: 32px; }
}
