@property --order-w {
  syntax: "<length>";
  inherits: true;
  initial-value: 330px;
}

:root {
  --page: #010612;
  --surface: #0b101b;
  --elev: #151a25;
  --line: #151a25;
  --line-2: #1f2938;
  --brand: #4c9af8;
  --brand-fg: #010612;
  --brand-soft: #172a54;
  --brand-40: #4c9af866;
  --tick: rgba(255, 255, 255, 0.25);
  --text: #ffffff;
  --text-2: #f3f4f7;
  --muted: #a0aec0;
  --muted-2: #6c829d;
  --muted-more: #55677c;
  --green: #56c75d;
  --green-bg: #0b280e;
  --red: #ff6467;
  --nav-h: 56px;
  --ticker-h: 60px;
  --order-w: 330px;
  --bottom-h: 357px;
  --gutter: 4px;
  --font: Inter, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; color-scheme: dark; background: var(--page); }
body {
  font-family: var(--font);
  background: var(--page);
  color: var(--text);
  overflow: hidden;
  font-size: 12px;
  font-weight: 400;
}
button, input { font-family: inherit; font-weight: 400; color: inherit; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; }

.app {
  height: 100%;
  display: grid;
  grid-template-rows: var(--nav-h) minmax(0, 1fr);
  gap: var(--gutter);
  background: var(--page);
}

/* NAV — 56px, panel bg, items 32×, 13px */
.nav {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--nav-h);
  padding: 0 12px;
  background: var(--surface);
  border: 0;
  border-bottom: 0;
}
.nav-left, .nav-right { display: flex; align-items: center; }
.nav-left { gap: 0; }
.nav-link + .nav-link { margin-left: 4px; }
.nav-right { gap: 8px; }
.logo-slot {
  display: flex;
  align-items: center;
  width: 26px;
  height: 19px;
  margin-right: 16px;
  overflow: hidden;
  flex-shrink: 0;
  color: #fff;
  text-decoration: none;
}
.logo-slot img,
.logo-slot svg {
  display: block;
  width: 26px;
  height: 19px;
  flex-shrink: 0;
}
.logo-word {
  display: inline-flex;
  align-items: center;
  gap: 0.35em;
  margin-left: 8px;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 500;
  line-height: 19px;
  letter-spacing: -0.02em;
  color: #fff;
}
.logo-word b {
  color: var(--brand);
  font-weight: 500;
}
@media (min-width: 1300px) {
  .logo-slot {
    width: auto;
    max-width: none;
  }
}
a.logo-slot:hover {
  background: transparent;
}
.nav-link {
  display: inline-flex;
  align-items: center;
  height: 32px;
  padding: 6px 10px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  line-height: 19.5px;
  border-radius: 6px;
  white-space: nowrap;
}
.nav-link.active {
  color: #f3f4f7;
  background: var(--brand-soft);
  font-weight: 400;
}
.nav-link:hover {
  color: var(--muted);
  background: var(--elev);
  font-weight: 400;
}
.nav-link.active:hover {
  color: #f3f4f7;
  background: var(--brand-soft);
}
.nav-link .caret { margin-left: 6px; font-size: 9px; opacity: 0.8; }
.btn-connect {
  height: 32px;
  min-width: 116px;
  padding: 8px;
  border-radius: 6px;
  border: 1px solid transparent;
  background: var(--brand);
  color: var(--brand-fg);
  font-size: 12px;
  line-height: 18px;
  white-space: nowrap;
}
.btn-connect:hover { filter: brightness(1.06); }
.wallet-chip {
  display: none;
  align-items: center;
  gap: 8px;
  height: 32px;
  padding: 0 6px 0 10px;
  border: 0;
  border-radius: 6px;
  background: var(--elev);
  color: var(--text-2);
  font-size: 12px;
  line-height: 18px;
  white-space: nowrap;
}
.wallet-chip:not([hidden]) { display: inline-flex; }
.wallet-av {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #8b5a2b;
  flex-shrink: 0;
}
.signin-modal {
  width: min(440px, calc(100vw - 24px));
  border: 1px solid var(--elev);
  border-radius: 16px;
  background: var(--page);
  overflow: hidden;
}
.signin-inner {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 20px;
}
.signin-title {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  line-height: 24px;
  color: #fff;
}
.signin-sub {
  margin: -8px 0 0;
  font-size: 12px;
  line-height: 16px;
  color: var(--muted);
}
.signin-lead {
  margin: 0;
  font-size: 12px;
  line-height: 16px;
  color: var(--muted);
}
.signin-lead a,
.signin-check-t a { color: var(--brand); }
.signin-check {
  height: auto;
  min-height: 24px;
  align-items: flex-start;
  gap: 10px;
  padding: 0;
  text-align: left;
  font-size: 12px;
  line-height: 16px;
  color: var(--muted);
}
.signin-check .box {
  margin-top: 1px;
  flex-shrink: 0;
}
.signin-check-t {
  flex: 1;
  min-width: 0;
}
.signin-modal .cta.wide {
  margin-top: 4px;
}
.signin-modal .cta.wide:not(.dim) {
  background: var(--brand);
  color: var(--brand-fg);
  pointer-events: auto;
}
.icon-btn {
  width: 32px;
  height: 32px;
  padding: 8px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  display: grid;
  place-items: center;
}
.icon-btn:hover { background: var(--elev); }
.nav-burger {
  display: none;
  width: 32px;
  height: 32px;
  min-width: 32px;
  padding: 8px;
  border: 1px solid var(--line-2);
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  place-items: center;
}
.nav-burger:hover { background: var(--elev); }
.nav-drawer {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 46;
  flex-direction: column;
  background: #010612;
  overflow: hidden;
}
.nav-drawer.show { display: flex; }
body.menu-open { overflow: hidden !important; }
.nav-drawer-head {
  position: relative;
  flex-shrink: 0;
  min-height: 64px;
  padding: 12px 80px 0 12px;
}
.nav-drawer-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  padding: 8px;
  border: 1px solid #1f2938;
  border-radius: 6px;
  background: transparent;
  color: #fff;
  display: grid;
  place-items: center;
}
.nav-drawer-close:hover { background: var(--elev); }
.nav-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 0 16px 16px;
  -webkit-overflow-scrolling: touch;
}
.nav-drawer-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.nav-drawer-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 56px;
  height: 56px;
  padding: 16px;
  border: 1px solid #151a25;
  border-radius: 6px;
  background: transparent;
  color: var(--muted-more);
  font-size: 16px;
  line-height: 24px;
  font-weight: 400;
  text-align: left;
}
.nav-drawer-item span { flex: 1; }
.nav-drawer-item svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}
.nav-drawer-item.active {
  background: rgba(76, 154, 248, 0.08);
  color: #fff;
}
.nav-drawer-more,
.nav-drawer-lang {
  display: flex;
  flex-direction: column;
  border: 1px solid #151a25;
  border-radius: 6px;
  color: var(--muted-more);
  overflow: hidden;
}
.nav-drawer-more.open,
.nav-drawer-lang.open { background: #0b101b; }
.nav-drawer-more-btn,
.nav-drawer-lang-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 56px;
  height: 56px;
  padding: 16px;
  border: 0;
  background: transparent;
  color: inherit;
  font-size: 16px;
  line-height: 24px;
  text-align: left;
}
.nav-drawer-more-btn > div,
.nav-drawer-lang-btn > div {
  display: flex;
  flex: 1;
  align-items: center;
  gap: 8px;
}
.nav-drawer-more-btn svg,
.nav-drawer-lang-btn svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}
.nav-drawer-caret { transition: transform 0.2s ease; }
.nav-drawer-more.open .nav-drawer-caret,
.nav-drawer-lang.open .nav-drawer-caret { transform: rotate(180deg); }
.nav-drawer-sub { display: none; flex-direction: column; }
.nav-drawer-more.open .nav-drawer-sub,
.nav-drawer-lang.open .nav-drawer-sub { display: flex; }
.nav-drawer-sub a,
.nav-drawer-sub button {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 56px;
  height: 56px;
  padding: 16px;
  border: 0;
  border-top: 1px solid #151a25;
  border-radius: 0;
  background: transparent;
  color: var(--muted-more);
  font-size: 16px;
  line-height: 24px;
  text-align: left;
}
.nav-drawer-sub a span,
.nav-drawer-sub button span { flex: 1; }
.nav-drawer-sub a svg { width: 12px; height: 12px; flex-shrink: 0; }
.nav-drawer-sub button.active { color: #fff; }
.nav-drawer-foot { margin-top: 16px; }

/* TICKER — 60px surface on page */
.ticker {
  display: flex;
  align-items: center;
  height: var(--ticker-h);
  padding: 10px;
  gap: 0;
  background: var(--surface);
  border: 0;
  box-shadow: none;
  overflow-x: auto;
  min-width: 0;
  container-type: inline-size;
  container-name: ticker;
  scrollbar-width: none;
}
.ticker::-webkit-scrollbar { display: none; }
.market-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  width: 93px;
  padding: 8px;
  border: 0;
  background: transparent;
  color: var(--text-2);
  font-size: 14px;
  line-height: 21px;
  border-radius: 6px;
  flex-shrink: 0;
  box-shadow: none;
  outline: none;
}
.market-btn:hover {
  background: var(--elev);
  color: var(--text-2);
  font-weight: 400;
}
.mkt-caret { color: var(--muted-2); flex-shrink: 0; }
.coin {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: block;
  flex-shrink: 0;
  object-fit: cover;
}
.ticker-stats {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-left: 12px;
  padding-left: 12px;
  height: 34px;
}
.stat { display: flex; flex-direction: column; justify-content: center; min-width: 0; }
.stat-label, .stat-value {
  font-size: 12px;
  line-height: 16px;
  white-space: nowrap;
}
.stat-label { color: var(--muted); }
.stat-value { color: var(--text); font-variant-numeric: tabular-nums; }
.up { color: var(--green); }
.down { color: var(--red); }
.funding-btn { background: transparent; border: 0; text-align: left; padding: 0; }
.fund-val { display: flex; gap: 4px; }

/* WORKSPACE — page shows through 4px gutters */
.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--order-w);
  gap: var(--gutter);
  min-height: 0;
  min-width: 0;
  background: var(--page);
  transition: grid-template-columns 0.22s ease, gap 0.22s ease;
}
.col-left {
  display: grid;
  grid-template-rows: var(--ticker-h) minmax(0, 1fr);
  gap: var(--gutter);
  min-width: 0;
  min-height: 0;
  background: var(--page);
}
.well {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  background: var(--surface);
  border: 0;
  box-shadow: none;
  padding: 10px;
  overflow: hidden;
}
.chart-wrap {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  background: #0b101b;
  border: 0 none transparent;
  outline: none;
  border-radius: 0;
  box-shadow: none;
  display: flex;
  flex-direction: column;
}
.chart-tb {
  position: absolute;
  top: 2px;
  left: 8px;
  right: 6px;
  z-index: 8;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 18px;
  background: transparent;
  outline: 0;
  pointer-events: none;
}
.chart-tb-l, .chart-tb-r {
  display: flex;
  align-items: center;
  gap: 8px;
  pointer-events: auto;
  background: transparent;
}
.chart-tb-r {
  gap: 10px;
  margin-left: auto;
}
.chart-tb button,
.chart-tb .tb-ico,
.chart-tb .tb-fx,
.chart-tb .tb-plus {
  height: auto;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted-2);
  font-size: 12px;
  line-height: 16px;
  font-weight: 400;
  border-radius: 0;
  display: inline-flex;
  align-items: center;
}
.chart-tb-r .tb-ico {
  color: #a0aec0;
  width: 16px;
  height: 16px;
  justify-content: center;
  opacity: 0.92;
}
.chart-tb-r .tb-ico svg {
  display: block;
}
.chart-tb button.on { color: #d1d5db; }
.chart-tb button:hover,
.chart-tb .tb-ico:hover { color: var(--muted); background: transparent; }
.tb-sep {
  width: 1px;
  height: 12px;
  background: #1f2938;
  display: inline-block;
}
.tb-plus { font-size: 14px; padding: 0 2px; }
.tb-fx { gap: 4px; }
.tv-pop {
  position: absolute;
  display: none;
  z-index: 22;
  background: #0b101b;
  border: 1px solid #151a25;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0,0,0,0.45);
}
.tv-pop.show { display: flex; flex-direction: column; }
.tv-pop button {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 32px;
  padding: 8px 12px;
  border: 0;
  background: transparent;
  color: #fff;
  font-size: 13px;
  line-height: 16px;
  text-align: left;
  font-weight: 400;
}
.tv-pop button:hover { background: #151a25; }
.tv-pop button.on { color: var(--brand); }
.tv-pop-h {
  padding: 8px 12px 4px;
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--muted-2);
}
.tv-pop-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
}
.tv-pop-x {
  width: 24px !important;
  min-height: 24px !important;
  padding: 0 !important;
  justify-content: center;
  font-size: 18px;
  color: var(--muted) !important;
}
.tv-pop-note {
  margin: 0 12px 8px;
  font-size: 12px;
  color: var(--muted);
  line-height: 16px;
}
.tv-pop-row {
  display: flex;
  gap: 8px;
  padding: 0 12px 10px;
}
.tv-pop-row input,
.tv-pop-search {
  flex: 1;
  height: 32px;
  padding: 8px 10px;
  border: 1px solid #1f2938;
  border-radius: 6px;
  background: #151a25;
  color: #fff;
  font-size: 12px;
  outline: 0;
}
.tv-pop-search {
  margin: 0 12px 8px;
  width: calc(100% - 24px);
  flex: none;
}
.tv-pop-go {
  width: auto !important;
  min-width: 56px;
  justify-content: center;
  background: #172a54 !important;
  color: var(--brand) !important;
  border-radius: 6px;
}
.tv-pop-list {
  overflow: auto;
  max-height: 360px;
  padding-bottom: 8px;
}
.tv-pop-interval { top: 22px; left: 70px; width: 140px; }
.tv-pop-style { top: 22px; left: 108px; width: 205px; max-height: min(500px, 70vh); overflow: auto; }
.tv-pop-compare { top: 22px; left: 148px; width: 280px; }
.tv-pop-indicators { top: 22px; left: 8px; width: 380px; max-height: 460px; }
.tv-pop-settings { top: 22px; right: 40px; left: auto; width: 280px; }
.tv-pop-snapshot { top: 22px; right: 6px; left: auto; width: 180px; }
.tv-set-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 40px;
  padding: 0 12px;
  font-size: 12px;
  color: var(--muted);
}
.tv-set-row b { color: #fff; font-weight: 400; }
.tv-set-seg { display: flex; border: 1px solid #1f2938; border-radius: 6px; overflow: hidden; }
.tv-set-seg button {
  width: auto;
  min-height: 28px;
  padding: 4px 8px;
  font-size: 12px;
}
.tv-set-seg button.on { background: #1f2938; color: #fff; }
.chart-wrap:fullscreen,
.chart-wrap:-webkit-full-screen {
  background: #0b101b;
  padding: 12px;
  width: 100%;
  height: 100%;
}
.chart-legend {
  position: absolute;
  top: 28px;
  left: 10px;
  z-index: 7;
  display: flex;
  flex-direction: column;
  gap: 1px;
  pointer-events: none;
  font-size: 11px;
  line-height: 14px;
  font-variant-numeric: tabular-nums;
  font-weight: 400;
}
.chart-legend .cl-sym { color: var(--muted-2); font-size: 11px; }
.chart-legend .cl-ohlc {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  color: var(--green);
  font-size: 11px;
}
.chart-legend .cl-ohlc > span {
  display: inline-flex;
  align-items: baseline;
  white-space: nowrap;
}
.chart-legend .cl-ohlc i { font-style: normal; color: var(--green); margin-right: 3px; }
.chart-legend .cl-ohlc b { font-weight: 400; color: var(--green); }
.chart-legend .cl-ohlc.down,
.chart-legend .cl-ohlc.down i,
.chart-legend .cl-ohlc.down b { color: var(--red); }
.chart-foot {
  height: 22px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 8px 0 10px;
  background: var(--surface);
  color: var(--muted-2);
  font-size: 11px;
  line-height: 14px;
  position: relative;
  z-index: 8;
}
.chart-foot-r {
  display: flex;
  align-items: center;
  gap: 10px;
}
.chart-foot-r button {
  border: 0;
  background: transparent;
  color: var(--muted-2);
  font-size: 11px;
  padding: 0;
  font-weight: 400;
}
.chart-foot-r button.on { color: var(--muted); }
.chart-split {
  height: var(--gutter);
  background: var(--page);
  flex-shrink: 0;
}
.chart-stage {
  position: relative;
  flex: 1;
  min-height: 0;
  width: 100%;
  overflow: hidden;
  background: #0b101b;
  box-shadow: inset 0 0 0 1px #0b101b;
}
.chart-stage .tv-embed,
.chart-stage #tv-chart {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  flex: none;
}
.tv-embed, #tv-chart {
  position: relative;
  flex: 1;
  width: 100%;
  min-height: 0;
  border: 0 none transparent;
  outline: none;
  background: #0b101b;
  overflow: hidden;
  color-scheme: dark;
  box-shadow: none;
}
.chart-loader {
  position: absolute;
  inset: 0;
  z-index: 9;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0b101b;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.chart-loader.is-off {
  opacity: 0;
  visibility: hidden;
}
.chart-loader-logo {
  width: 72px;
  height: 72px;
}
.chart-loader-logo img {
  width: 72px;
  height: auto;
  display: block;
  animation: omni-logo-pulse 1.05s ease-in-out infinite;
}
.chart-loader-logo svg {
  width: 72px;
  height: 72px;
  display: block;
}
@keyframes omni-logo-pulse {
  0%, 100% { opacity: 0.35; transform: scale(0.96); }
  50% { opacity: 1; transform: scale(1); }
}
#tv-chart iframe,
#tv-chart > div,
.tradingview-widget-container,
.tradingview-widget-container__widget,
.tradingview-widget-container iframe {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  border: 0 !important;
  outline: none !important;
  border-radius: 0 !important;
  background: #0b101b !important;
  box-shadow: none !important;
  margin: 0 !important;
  padding: 0 !important;
  color-scheme: dark !important;
  clip-path: none !important;
}
#tv-chart iframe {
  top: -3px !important;
  left: -3px !important;
  right: auto !important;
  bottom: auto !important;
  width: calc(100% + 6px) !important;
  height: calc(100% + 6px) !important;
  border: 0 !important;
}
.tradingview-widget-copyright,
#tv-chart .tv-embed-widget-wrapper__body {
  display: none !important;
}

.bottom {
  display: flex;
  flex-direction: column;
  height: var(--bottom-h, 357px);
  flex-shrink: 0;
  min-height: 0;
  background: var(--surface);
}
.tabs {
  display: flex;
  align-items: center;
  height: 48px;
  gap: 4px;
  padding: 8px 0;
}
.tabs button {
  height: 32px;
  padding: 6px 10px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  line-height: 19.5px;
  border-radius: 6px;
  white-space: nowrap;
}
.tabs button.active { color: var(--text-2); background: var(--elev); }
.tabs button:hover { color: var(--text-2); background: var(--elev); }
.bottom-body {
  flex: 1;
  display: grid;
  place-items: center;
  text-align: center;
}
.bottom-body p {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 13px;
  line-height: 20px;
}

table { width: 100%; border-collapse: collapse; font-size: 12px; }
th, td { padding: 8px 10px; text-align: left; white-space: nowrap; }
th { color: var(--muted); font-weight: 400; border-bottom: 1px solid var(--elev); }
td { border-bottom: 1px solid var(--elev); font-variant-numeric: tabular-nums; }

/* ORDER — 330px surface, inner 310 */
.order {
  min-height: 0;
  min-width: 0;
  overflow: auto;
  padding: 10px;
  background: var(--surface);
  border: 0;
  box-shadow: none;
  transition: opacity 0.18s ease, padding 0.18s ease;
}
.order-top {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  width: 310px;
  margin-left: auto;
}
.chip {
  height: 32px;
  padding: 8px;
  border-radius: 6px;
  border: 1px solid var(--line-2);
  background: transparent;
  color: var(--text);
  font-size: 12px;
  line-height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0;
}
.chip:hover { background: var(--elev); }
.order-types {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  width: 310px;
  margin: 8px 0 0 auto;
  height: 32px;
}
.order-types > button,
.order-types > .pop-anchor > [data-pro] {
  height: 32px;
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  line-height: 19.5px;
  padding: 6px 10px;
  border-radius: 6px;
}
.order-types > button:hover,
.order-types > .pop-anchor > [data-pro]:hover { color: var(--text-2); background: var(--elev); }
.order-types > button.active,
.order-types > .pop-anchor > [data-pro].active { color: var(--text-2); background: var(--elev); }
.order-types > .pop-anchor {
  position: relative;
  height: 32px;
}

.side-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  width: 310px;
  height: 40px;
  margin: 8px 0 0 auto;
  background: var(--elev);
  border-radius: 6px;
  overflow: visible;
  gap: 0;
}
.side {
  border: 1px solid transparent;
  background: transparent;
  height: 40px;
  padding: 2px 8px 4px;
  text-align: center;
  color: var(--muted);
  border-radius: 6px;
  font-size: 12px;
}
.side .k, .side .v { font-size: 12px; line-height: 18px; }
.side.buy.active {
  background: var(--green-bg);
  color: var(--green);
  border-color: rgba(255, 255, 255, 0.08);
}
.side.buy.active .k, .side.buy.active .v { color: var(--green); }
.side.sell.active {
  background: #460809;
  color: var(--red);
  border-color: rgba(255, 255, 255, 0.08);
}

.kv {
  width: 310px;
  margin: 8px 0 0 auto;
}
.row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 24px;
  font-size: 12px;
  line-height: 16px;
}
.row span:first-child { color: var(--muted); }
.row b { font-weight: 400; color: var(--text); font-variant-numeric: tabular-nums; }
.slip { color: var(--brand) !important; background: none; border: 0; padding: 0; font-size: 12px; }

.size-block { width: 310px; margin: 8px 0 0 auto; }
.size-row {
  display: flex;
  align-items: center;
  height: 32px;
  padding: 0 8px;
  background: var(--elev);
  border: 1px solid #1f2938;
  border-radius: 6px;
  gap: 8px;
}
.size-row:focus-within {
  border-color: #4c9af8;
}
.size-row .lbl { color: var(--muted-2); font-size: 12px; flex-shrink: 0; }
.size-row input {
  flex: 1;
  min-width: 0;
  height: 18px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text-2);
  font-size: 12px;
  line-height: 18px;
  text-align: right;
  caret-color: var(--brand);
}
.size-row .unit {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  color: rgba(255, 255, 255, 0.8);
  font-size: 12px;
  line-height: 18px;
  background: none;
  border: 0;
  padding: 0;
  flex-shrink: 0;
}
.size-row .unit:hover { color: var(--text-2); }
.size-row .unit-swap { display: block; flex-shrink: 0; }

.slider-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
  height: 32px;
}
.slider {
  position: relative;
  flex: 1;
  height: 8px;
}
.slider-row.is-locked .slider { opacity: 0.5; }
.slider-row.is-locked input[type=range] { cursor: default; }
.slider input[type=range] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 8px;
  margin: 0;
  cursor: pointer;
  z-index: 2;
  background: transparent;
  -webkit-appearance: none;
  appearance: none;
}
.slider input[type=range]::-webkit-slider-runnable-track {
  background: transparent;
  height: 8px;
  border: 0;
}
.slider input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 12px;
  height: 12px;
  margin-top: -2px;
  border-radius: 50%;
  background: var(--brand);
  border: 0;
  box-shadow: none;
}
.slider input[type=range]::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--brand);
  border: 0;
}
.slider input[type=range]::-moz-range-track {
  background: transparent;
  height: 8px;
  border: 0;
}
.track {
  position: absolute;
  left: 0; right: 0; top: 3px;
  height: 2px;
  background: var(--line);
  border-radius: 2px;
}
.track .fill {
  height: 100%;
  width: 0;
  background: var(--brand);
  border-radius: 2px;
}
.dots { position: absolute; inset: 0; pointer-events: none; }
.dots i {
  position: absolute;
  top: 1px;
  width: 6px;
  height: 6px;
  margin-left: -3px;
  border-radius: 50%;
  background: var(--tick);
}
.pct-box {
  width: 64px;
  height: 32px;
  background: var(--elev);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted-2);
  font-size: 12px;
}

.checks { width: 310px; margin: 8px 0 0 auto; }
.check {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 24px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 12px;
  line-height: 16px;
}
.check .box {
  width: 14px;
  height: 14px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: transparent;
}
.check.on .box { background: var(--brand); border-color: var(--brand); }

.cta {
  display: block;
  width: 310px;
  height: 32px;
  margin: 8px 0 0 auto;
  border-radius: 6px;
  border: 1px solid transparent;
  background: var(--brand);
  color: var(--brand-fg);
  font-size: 12px;
  line-height: 18px;
}
.cta.buy { background: #38af40; }
.cta.sell { background: #fb2c36; color: var(--brand-fg); }

.kv.gap { margin-top: 17px; }

.page { height: 100%; display: grid; grid-template-rows: var(--nav-h) minmax(0,1fr); }
.markets-main { padding: 18px 22px; overflow: auto; background: var(--page); }
.markets-main h1 { font-size: 22px; font-weight: 700; margin: 0 0 14px; }
.filters { display: flex; gap: 6px; margin-bottom: 14px; flex-wrap: wrap; }
.filters button {
  height: 30px; padding: 0 10px; border-radius: 999px;
  border: 1px solid var(--line); background: transparent; color: var(--muted);
}
.filters button.active { background: #172a54; border-color: #1c5bd9; color: var(--text); }

.overlay {
  position: fixed; inset: 0; background: #000000cc;
  display: none; place-items: center; z-index: 40;
}
.overlay.show { display: grid; }
.overlay.markets-overlay {
  background: transparent;
  place-items: start start;
  padding: 112px 0 0 10px;
}
.market-picker {
  width: min(900px, calc(100vw - 20px));
  height: min(700px, calc(100vh - 128px));
  background: var(--page);
  border: 1px solid var(--elev);
  border-radius: 16px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow: hidden;
}
.mp-search {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 32px;
  padding: 8px;
  border-radius: 6px;
  background: var(--elev);
  border: 1px solid var(--line-2);
  color: var(--muted-2);
  flex-shrink: 0;
}
.mp-search:focus-within { border-color: var(--brand-40); }
.mp-search input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text-2);
  font-size: 12px;
  line-height: 18px;
}
.mp-search input::placeholder { color: var(--muted-2); }
.mp-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  flex-wrap: wrap;
}
.mp-tabs button {
  height: 32px;
  padding: 6px 10px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  line-height: 19.5px;
  border-radius: 6px;
  white-space: nowrap;
}
.mp-tabs button.active { color: var(--text-2); }
.mp-tabs button:hover { background: var(--elev); color: var(--text-2); }
.mp-head {
  display: grid;
  grid-template-columns: 176px 136px 136px 136px 136px 136px;
  gap: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 300;
  line-height: 18px;
  flex-shrink: 0;
  padding: 4px 0;
}
.mp-head span { padding: 0 8px; }
.mp-head span:first-child { text-align: left; }
.mp-head span:not(:first-child) { text-align: right; }
.mp-list {
  flex: 1;
  min-height: 0;
  overflow: auto;
}
.mp-row {
  display: grid;
  grid-template-columns: 176px 136px 136px 136px 136px 136px;
  width: 100%;
  height: 32px;
  align-items: center;
  border: 0;
  background: transparent;
  padding: 0;
  border-radius: 0;
  text-align: left;
  font-size: 12px;
  line-height: 16px;
  color: var(--text);
}
.mp-row:hover, .mp-row.hi { background: var(--elev); }
.mp-row span { padding: 0 8px; font-variant-numeric: tabular-nums; }
.mp-row span:not(:first-child) { text-align: right; }
.mp-asset {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.mp-star { color: var(--muted-2); flex-shrink: 0; }
.mp-asset .coin { width: 20px; height: 20px; }
.mp-sym { color: var(--text); font-size: 12px; }
.mp-lev {
  height: 16px;
  padding: 0 4px;
  border-radius: 3px;
  background: var(--elev);
  color: var(--muted);
  font-size: 10px;
  line-height: 16px;
  flex-shrink: 0;
}
.mp-tradfi {
  height: 16px;
  padding: 0 4px;
  border-radius: 3px;
  background: var(--green-bg);
  color: var(--green);
  font-size: 10px;
  line-height: 16px;
  flex-shrink: 0;
}
.mp-foot {
  display: flex;
  align-items: center;
  gap: 40px;
  padding-top: 16px;
  flex-shrink: 0;
  color: var(--muted);
  font-size: 12px;
}
.mp-foot b { color: var(--text-2); font-weight: 400; margin-right: 6px; }
.mp-viewall {
  margin-left: auto;
  height: 32px;
  min-width: 126px;
  padding: 8px;
  border-radius: 6px;
  background: var(--brand);
  color: var(--brand-fg);
  font-size: 12px;
  line-height: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.mp-viewall-m { display: none; }
@media (max-width: 767px) {
  .overlay.markets-overlay {
    background: rgba(0, 0, 0, 0.85);
    place-items: end center;
    padding: 0;
  }
  .market-picker {
    width: 100%;
    height: 560px;
    border-radius: 16px 16px 0 0;
    border: 1px solid #151a25;
    background: #010612;
    padding: 16px;
  }
  .mp-tabs,
  .mp-subs {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .mp-tabs::-webkit-scrollbar,
  .mp-subs::-webkit-scrollbar { display: none; }
  .mp-head,
  .mp-row {
    grid-template-columns: 1fr 1fr;
    width: 100%;
  }
  .mp-head span:nth-child(n+3),
  .mp-row > span:nth-child(n+3) { display: none; }
  .mp-foot { display: none; }
  .mp-viewall-m {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 40px;
    margin-top: 16px;
    padding: 8px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: var(--brand);
    color: var(--brand-fg);
    font-size: 14px;
    line-height: 21px;
    flex-shrink: 0;
  }
}
.modal {
  width: min(520px, calc(100vw - 24px));
  background: var(--page);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}
.modal.narrow { width: min(360px, calc(100vw - 24px)); }
.modal-h {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; border-bottom: 1px solid var(--elev); font-size: 14px;
}
.search {
  margin: 12px 16px 8px; display: flex; align-items: center; gap: 8px;
  background: var(--elev); border-radius: 8px; padding: 0 10px; height: 38px; color: var(--muted);
}
.search input { flex: 1; border: 0; background: transparent; outline: 0; color: var(--text); }
.market-list { max-height: 420px; overflow: auto; padding: 0 8px 12px; }
.market-row {
  width: 100%; display: grid; grid-template-columns: 1fr auto auto; gap: 12px;
  align-items: center; background: transparent; border: 0; padding: 10px 8px;
  border-radius: 8px; text-align: left;
}
.market-row:hover { background: var(--elev); }
.m-name { color: var(--muted); font-size: 12px; }
.wallet-list { padding: 8px 12px 16px; display: flex; flex-direction: column; gap: 8px; }
.wallet {
  display: flex; align-items: center; justify-content: space-between;
  height: 48px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--surface); font-size: 13px;
}
.wallet:hover { border-color: var(--brand); }
.lev-body { padding: 16px; }
.lev-val { font-size: 28px; text-align: center; margin-bottom: 12px; }
.toast {
  position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--surface); border: 1px solid var(--line); color: var(--text);
  padding: 10px 14px; border-radius: 8px; opacity: 0; pointer-events: none;
  transition: 0.2s ease; z-index: 50; font-size: 12px;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.dropdown {
  position: absolute; top: 48px; left: 430px;
  background: var(--page); border: 1px solid var(--line); border-radius: 10px;
  min-width: 200px; padding: 6px; display: none; z-index: 30;
}
.dropdown.show { display: block; }
.dropdown a {
  display: block; padding: 12px 8px; border-radius: 6px; font-size: 12px;
}
.dropdown a:hover { background: var(--elev); }

.pop {
  position: absolute;
  display: none;
  z-index: 35;
  background: var(--page);
  border: 1px solid var(--elev);
  border-radius: 8px;
  padding: 8px;
  gap: 2px;
  overflow: hidden;
}
.pop.show { display: flex; flex-direction: column; }
.pop button {
  display: flex;
  align-items: center;
  width: 100%;
  height: 42px;
  padding: 12px 8px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #fff;
  font-size: 12px;
  line-height: 18px;
  text-align: left;
  gap: 8px;
}
.pop button:hover { background: var(--elev); }
.pop button.active { color: var(--brand); }
.pop-pro {
  top: calc(100% + 4px);
  right: 0;
  min-width: 102px;
}
.pop-lang {
  top: 40px;
  right: 0;
  width: 200px;
}
.pop-anchor { position: relative; }

.settings-pop {
  position: fixed;
  top: 52px;
  right: 12px;
  width: 256px;
  max-height: calc(100dvh - 64px);
  overflow: auto;
  z-index: 50;
  background: var(--page);
  border: 1px solid var(--elev);
  border-radius: 8px;
  padding: 8px 16px;
  display: none;
  flex-direction: column;
  gap: 2px;
}
.settings-pop.show { display: flex; }
.settings-h,
.set-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  height: 40px;
  min-height: 40px;
  font-size: 12px;
  line-height: 16px;
  font-weight: 400;
  color: var(--muted);
}
.set-row .sub { color: var(--muted); font-weight: 400; }
.set-status {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 20px;
  padding: 3px 6px;
  border-radius: 4px;
  background: rgba(86, 199, 93, 0.118);
  color: #94e199;
  font-size: 10px;
  line-height: 14px;
}
.set-status i {
  width: 8px; height: 8px; border-radius: 50%; background: var(--green); display: block;
}
.theme-seg {
  display: flex;
  align-items: center;
  height: 32px;
  border: 1px solid var(--line-2);
  border-radius: 6px;
  overflow: hidden;
  background: transparent;
  flex-shrink: 0;
}
.theme-seg button {
  height: 32px;
  padding: 8px;
  border: 0;
  background: transparent;
  color: #fff;
  font-size: 12px;
  font-weight: 300;
  line-height: 18px;
}
.theme-seg button.on { background: #1f2938; }
.toggle {
  width: 32px;
  height: 20px;
  padding: 0;
  border: 0;
  border-radius: 24px;
  background: #1f2938;
  position: relative;
  flex-shrink: 0;
}
.toggle i {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  pointer-events: none;
}
.toggle.on { background: var(--green); }
.toggle.on i { left: 14px; }

.size-row .mid {
  color: var(--brand);
  font-size: 12px;
  background: none;
  border: 0;
  padding: 0;
  flex-shrink: 0;
}
.size-block[hidden] { display: none; }
.size-block[data-limit-row] { margin-bottom: 16px; }

.sheet {
  width: min(500px, calc(100vw - 24px));
  background: var(--surface);
  border: 1px solid var(--elev);
  border-radius: 16px;
  padding: 16px;
  display: flex;
  flex-direction: column;
}
.sheet-h {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0;
  padding-bottom: 16px;
  font-size: 16px;
  font-weight: 600;
  line-height: 24px;
  color: #fff;
}
.sheet-lead, .sheet-note {
  margin: 0 0 16px;
  font-size: 12px;
  line-height: 16px;
  color: var(--muted);
  font-weight: 400;
}
.sheet-note a { color: var(--brand); }
.lev-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 16px;
}
.lev-row input[type=range] { flex: 1; }
.lev-box {
  height: 40px;
  min-width: 80px;
  padding: 10px 12px;
  border-radius: 6px;
  background: var(--elev);
  border: 1px solid var(--line-2);
  color: var(--text-2);
  font-size: 13px;
  line-height: 19.5px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}
.lev-box .lev-x { color: var(--muted-2); }
.mode-seg {
  display: flex;
  align-items: center;
  height: 40px;
  margin: 0 0 16px;
  border: 1px solid var(--line-2);
  border-radius: 6px;
  overflow: hidden;
  background: transparent;
}
.mode-seg button {
  flex: 1;
  height: 40px;
  padding: 10px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #fff;
  font-size: 14px;
  font-weight: 300;
  line-height: 21px;
}
.mode-seg button + button { border-left: 1px solid var(--elev); }
.mode-seg button.on { background: #1f2938; }
.notice {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 0 0 16px;
  padding: 12px 16px;
  border-radius: 6px;
  background: #172a54;
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--brand);
  font-size: 13px;
  line-height: 19.5px;
}
.notice .i {
  width: 16px; height: 16px; border-radius: 50%;
  border: 1px solid var(--brand);
  display: grid; place-items: center;
  font-size: 10px; flex-shrink: 0;
}
.cta.wide {
  width: 100%;
  height: 40px;
  margin: 0;
  font-size: 14px;
  line-height: 21px;
  padding: 8px;
  border: 1px solid rgba(255,255,255,0.08);
}
.cta.dim {
  background: #172a54;
  color: #1d4ab0;
  pointer-events: none;
}

.float-trade {
  display: none;
  position: fixed;
  left: 0;
  right: 0;
  bottom: calc(40px + env(safe-area-inset-bottom, 0px));
  z-index: 38;
  justify-content: center;
  pointer-events: none;
}
.float-trade-inner {
  pointer-events: auto;
  display: flex;
  flex: 1;
  min-width: 300px;
  max-width: 400px;
  gap: 12px;
  padding: 12px;
  margin: 0 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.02);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.float-mkt {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  width: 93px;
  flex-shrink: 0;
  padding: 8px;
  border: 0;
  background: transparent;
  color: var(--text-2);
  font-size: 14px;
  line-height: 21px;
  border-radius: 6px;
}
.float-mkt:hover { background: var(--elev); }
.float-buy,
.float-sell {
  flex: 1;
  height: 40px;
  min-width: 0;
  padding: 8px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 14px;
  line-height: 24px;
  font-weight: 400;
  color: var(--brand-fg);
}
.float-buy { background: #38af40; }
.float-sell { background: #fb2c36; }

@media (max-width: 1023px) {
  :root { --order-w: 0px; --bottom-h: auto; }
  html:has(.app),
  html:has(.app) body {
    height: auto;
    min-height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  .app {
    height: auto;
    min-height: 100dvh;
    overflow: visible;
    grid-template-rows: var(--nav-h) auto;
  }
  .workspace {
    gap: 0;
    height: auto;
    min-height: 0;
    overflow: visible;
    grid-template-columns: minmax(0, 1fr);
  }
  .col-left {
    grid-template-rows: auto auto;
    height: auto;
    min-height: 0;
    overflow: visible;
  }
  .well {
    height: auto;
    min-height: 0;
    overflow: visible;
  }
  .chart-wrap {
    flex: none;
    height: 500px;
    min-height: 500px;
    touch-action: none;
  }
  .chart-stage,
  #tv-chart {
    min-height: 0;
    touch-action: none;
  }
  #tv-chart iframe {
    pointer-events: auto;
    touch-action: none;
  }
  .bottom {
    flex: none;
    height: auto;
    min-height: 280px;
    padding-bottom: calc(132px + env(safe-area-inset-bottom, 0px));
  }
  .order {
    display: none;
  }
  .float-trade { display: flex; }
  input:not([type="range"]):not([type="checkbox"]):not([type="radio"]),
  textarea,
  select {
    font-size: 16px;
  }
  .mp-search { height: 40px; }
  .mp-search input { font-size: 16px; line-height: 20px; }
  .toast { bottom: calc(116px + env(safe-area-inset-bottom, 0px)); }
  .tabs { overflow-x: auto; scrollbar-width: none; padding-left: 8px; }
  .tabs::-webkit-scrollbar { display: none; }
  .bottom-body {
    padding-bottom: 24px;
    align-content: start;
    padding-top: 8px;
  }
}

@media (max-width: 767px) {
  :root {
    --ticker-h: 72px;
    --bottom-h: auto;
  }
  .nav-left .nav-link { display: none; }
  .nav-desk-ico { display: none; }
  .nav-burger { display: grid; }
  .ticker { padding: 16px; }
  .well { padding: 0; }
  .chart-tb button.tb-plus { display: none; }
  .bottom-body .btn-connect { display: none; }
  .dropdown { left: 12px; }
}

html.ts-locked body > :not(.ts-gate) { visibility: hidden; }
.ts-gate {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  background: var(--page);
}
.ts-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 32px 28px;
  width: min(360px, calc(100vw - 32px));
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 8px;
  text-align: center;
}
.ts-card p {
  margin: 0;
  font-size: 14px;
  line-height: 20px;
  color: var(--text-2);
}
.ts-err { color: var(--red) !important; font-size: 12px !important; }
.ts-widget { min-height: 65px; }
