:root {
  color-scheme: dark;
  --bg: #0d1014;
  --panel: #12161b;
  --panel-2: #171c22;
  --line: #252c35;
  --line-soft: #1c2229;
  --text: #e8edf2;
  --muted: #8d98a5;
  --green: #21b68a;
  --green-soft: rgba(33, 182, 138, .13);
  --red: #ed6268;
  --red-soft: rgba(237, 98, 104, .13);
  --accent: #6f8ff7;
  --yellow: #e5b95c;
  font-family: Arial, Helvetica, sans-serif;
  background: var(--bg);
  color: var(--text);
}

/* Home and protocol activation preview */
.home-page {
  min-height: calc(100vh - 58px);
  color: var(--text);
  background:
    radial-gradient(circle at 78% 13%, rgba(92, 126, 226, .12), transparent 31%),
    linear-gradient(180deg, #0e1217 0, #0d1014 72%);
}
.home-hero,
.home-section,
.home-cta {
  width: min(1220px, calc(100% - 40px));
  margin-inline: auto;
}
.home-hero {
  min-height: 650px;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(410px, .75fr);
  align-items: center;
  gap: clamp(54px, 8vw, 110px);
  padding: 72px 0 80px;
}
.home-eyebrow,
.home-network-line,
.home-network-line span,
.home-market-card header,
.home-pair-icons { display: flex; align-items: center; }
.home-eyebrow {
  gap: 9px;
  color: #b8c7f3;
  font-size: 14px;
  font-weight: 750;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.home-eyebrow i,
.home-network-line i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 5px rgba(33, 182, 138, .1);
}
.home-hero h1 {
  max-width: 690px;
  margin: 21px 0 22px;
  font-size: clamp(56px, 6.2vw, 86px);
  line-height: .98;
  letter-spacing: -.062em;
}
.home-hero-copy > p {
  max-width: 650px;
  margin: 0;
  color: #aeb7c2;
  font-size: 19px;
  line-height: 1.65;
}
.home-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 34px; }
.home-primary,
.home-secondary,
.home-cta a {
  min-height: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 11px 22px;
  border-radius: 9px;
  font-size: 16px;
  font-weight: 750;
  transition: transform .16s ease, border-color .16s ease, background .16s ease;
}
.home-primary,
.home-cta a { color: #fff; border: 1px solid #6d87dc; background: #536fc9; }
.home-secondary { color: #e2e8f0; border: 1px solid #3a444f; background: #161b21; }
.home-primary:hover,
.home-secondary:hover,
.home-cta a:hover { transform: translateY(-2px); }
.home-primary:hover,
.home-cta a:hover { background: #607dd6; }
.home-secondary:hover { border-color: #667481; background: #1b222a; }
.home-network-line {
  gap: 28px;
  margin-top: 31px;
  color: var(--muted);
  font-size: 14px;
}
.home-network-line span:first-child { gap: 10px; color: #d7dde4; }
.home-market-card {
  padding: 24px;
  border: 1px solid #2a333e;
  border-radius: 20px;
  background: rgba(18, 23, 29, .95);
  box-shadow: 0 32px 70px rgba(0, 0, 0, .28);
}
.home-market-card header { gap: 12px; padding-bottom: 22px; border-bottom: 1px solid var(--line); }
.home-pair-icons { position: relative; width: 66px; height: 42px; }
.home-pair-icons img { position: absolute; width: 40px; height: 40px; object-fit: contain; border: 2px solid #12171d; border-radius: 50%; }
.home-pair-icons img:first-child { left: 0; z-index: 2; }
.home-pair-icons img:last-child { right: 0; }
.home-market-card header > span:nth-child(2) { display: grid; }
.home-market-card header strong { font-size: 18px; }
.home-market-card header small { color: var(--muted); font-size: 13px; }
.home-market-card header > b {
  margin-left: auto;
  padding: 6px 9px;
  color: #a9efd5;
  background: var(--green-soft);
  border-radius: 999px;
  font-size: 12px;
}
.home-price { display: grid; padding: 29px 0 24px; }
.home-price span,
.home-price small { color: var(--muted); font-size: 13px; }
.home-price strong { margin: 4px 0 1px; font-size: 42px; letter-spacing: -.035em; font-variant-numeric: tabular-nums; }
.home-market-access { padding: 30px 0 26px; }
.home-market-access > span { color: #9fb1e7; font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.home-market-access > strong { display: block; margin: 7px 0 10px; font-size: 28px; line-height: 1.22; letter-spacing: -.025em; }
.home-market-access > p { margin: 0; color: var(--muted); font-size: 15px; line-height: 1.65; }
.home-market-card dl { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 0; }
.home-market-card dl div { padding: 13px 10px; background: #171c22; border-radius: 8px; }
.home-market-card dd { overflow: hidden; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.home-market-card button {
  width: 100%;
  min-height: 48px;
  margin-top: 20px;
  color: #e8edf2;
  border: 1px solid #3f4d61;
  border-radius: 8px;
  background: #202a38;
  font-weight: 750;
}
.home-market-card button:hover { border-color: #6b83c9; background: #26344a; }
.home-section { padding: 88px 0; border-top: 1px solid var(--line-soft); }
.home-section > header > span,
.home-assets article span,
.home-cta span {
  color: #9fb1e7;
  font-size: 13px;
  font-weight: 750;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.home-section > header h2 { margin: 5px 0 35px; font-size: clamp(34px, 4vw, 48px); letter-spacing: -.035em; }
.home-steps > div { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.home-steps article { min-height: 240px; padding: 27px; border: 1px solid var(--line); border-radius: 14px; background: #12161b; }
.home-steps article b { color: #6f8ff7; font-size: 15px; }
.home-steps article h3 { margin: 39px 0 11px; font-size: 24px; }
.home-steps article p,
.home-assets article p { margin: 0; color: var(--muted); font-size: 16px; line-height: 1.65; }
.home-assets { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.home-assets article { display: grid; grid-template-columns: 72px 1fr; gap: 22px; padding: 30px; border: 1px solid var(--line); border-radius: 14px; background: #12161b; }
.home-assets article img { width: 62px; height: 62px; object-fit: contain; }
.home-assets article h2 { margin: 6px 0 12px; font-size: 25px; }
.home-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  margin-top: 20px;
  margin-bottom: 80px;
  padding: 36px 40px;
  border: 1px solid #35425a;
  border-radius: 16px;
  background: #151c27;
}
.home-cta h2 { margin: 5px 0 0; font-size: 32px; }

.activation-counter {
  position: relative;
  display: grid;
  grid-template-columns: minmax(300px, 1.2fr) minmax(440px, 1fr);
  align-items: center;
  gap: 26px;
  margin: 16px 0 12px;
  padding: 24px 28px 30px;
  overflow: hidden;
  border: 1px solid #3c4b66;
  border-radius: 14px;
  background: linear-gradient(110deg, #182131, #121820 70%);
}
.activation-lead { display: grid; }
.activation-label { color: #9eb3ef; font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.activation-lead strong { margin: 5px 0 2px; font-size: clamp(24px, 2.3vw, 35px); letter-spacing: -.025em; }
.activation-lead small { color: #a3adba; font-size: 14px; }
.activation-counter dl { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 0; }
.activation-counter dl div { padding-left: 17px; border-left: 1px solid #344156; }
.activation-counter dt { margin: 0 0 4px; font-size: 12px; }
.activation-counter dd { font-size: clamp(23px, 2vw, 31px); font-variant-numeric: tabular-nums; }
.activation-counter .activation-remaining dd { color: #a9bbf2; }
.activation-progress { position: absolute; inset: auto 0 0; height: 5px; background: #202b3a; }
.activation-progress i { display: block; width: 0; height: 100%; background: linear-gradient(90deg, #516ec9, #7998f2); transition: width .45s ease; }
.activation-counter.active { border-color: rgba(33, 182, 138, .48); background: linear-gradient(110deg, rgba(26, 62, 54, .64), #121a1b 70%); }
.activation-counter.active .activation-label,
.activation-counter.active .activation-remaining dd { color: #a9efd5; }
.activation-counter.active .activation-progress i { background: var(--green); }

.trade-workspace { position: relative; }
.trade-lock {
  position: fixed;
  inset: 76px 0 0;
  z-index: 18;
  display: grid;
  place-items: center;
  padding: 24px;
  overflow: hidden;
  background: rgba(9, 12, 16, .4);
  -webkit-backdrop-filter: blur(17px) saturate(.6);
  backdrop-filter: blur(17px) saturate(.6);
}
.trade-lock::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 42%, rgba(81, 111, 201, .13), transparent 38%);
  pointer-events: none;
}
.trade-lock-card {
  position: relative;
  width: min(590px, 100%);
  display: grid;
  justify-items: center;
  padding: 42px 48px 38px;
  color: #f4f6f8;
  text-align: center;
  border: 1px solid rgba(124, 148, 217, .42);
  border-radius: 22px;
  background: rgba(15, 20, 27, .94);
  box-shadow: 0 35px 100px rgba(0, 0, 0, .48);
}
.trade-lock-card > img { width: 68px; height: 68px; margin-bottom: 17px; object-fit: contain; }
.trade-lock-card > span {
  color: #9fb4ef;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .09em;
  text-transform: uppercase;
}
.trade-lock-card > strong {
  margin-top: 17px;
  font-size: clamp(78px, 10vw, 132px);
  line-height: .88;
  letter-spacing: -.07em;
  font-variant-numeric: tabular-nums;
}
.trade-lock-card h1 { margin: 12px 0 13px; font-size: 30px; letter-spacing: -.025em; }
.trade-lock-card p { margin: 0; color: #a8b2bf; font-size: 15px; }
.trade-lock-height {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 29px;
}
.trade-lock-height span { display: grid; gap: 3px; padding: 13px; color: var(--muted); background: #171d24; border-radius: 9px; font-size: 12px; }
.trade-lock-height b { color: #e9edf3; font-size: 18px; font-variant-numeric: tabular-nums; }
.trade-lock-progress { width: 100%; height: 6px; margin-top: 18px; overflow: hidden; border-radius: 99px; background: #242e3d; }
.trade-lock-progress i { display: block; width: 0; height: 100%; background: linear-gradient(90deg, #4f6dc8, #84a2fb); transition: width .45s ease; }
.kaddex-active .trade-lock { display: none; }
.kaddex-height-pending #trade > :not(.trade-lock) { pointer-events: none; }
.preactivation-status { display: inline-flex; align-items: center; gap: 9px; color: #b9c5d4; font-size: 13px; font-weight: 700; }
.preactivation-status i { width: 8px; height: 8px; border-radius: 50%; background: #e5b95c; box-shadow: 0 0 0 5px rgba(229,185,92,.1); }
.activation-gate-page { position: relative; min-height: calc(100vh - 76px); display: grid; place-items: center; overflow: hidden; padding: 30px; }
.activation-gate-card { z-index: 2; }

@media (max-width: 960px) {
  .home-hero { grid-template-columns: 1fr; padding-top: 60px; }
  .home-market-card { width: min(100%, 580px); }
  .activation-counter { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  .home-hero,
  .home-section,
  .home-cta { width: min(100% - 28px, 1220px); }
  .home-hero { min-height: 0; gap: 45px; padding: 50px 0 60px; }
  .home-hero h1 { font-size: 48px; }
  .home-hero-copy > p { font-size: 17px; }
  .home-actions > * { width: 100%; }
  .home-market-card { padding: 18px; }
  .home-price strong { font-size: 34px; }
  .home-market-card dl,
  .home-steps > div,
  .home-assets { grid-template-columns: 1fr; }
  .home-section { padding: 60px 0; }
  .home-cta { align-items: flex-start; flex-direction: column; padding: 28px; }
  .home-cta a { width: 100%; }
  .activation-counter { padding: 22px 18px 28px; }
  .activation-counter dl { grid-template-columns: 1fr 1fr; }
  .activation-counter dl div { padding: 10px 0; border-left: 0; border-top: 1px solid #344156; }
  .activation-counter dl div:last-child { grid-column: 1 / -1; }
  .trade-lock { inset: 66px 0 0; padding: 14px; }
  .trade-lock-card { padding: 33px 22px 29px; }
  .trade-lock-card > strong { font-size: 80px; }
  .trade-lock-card h1 { font-size: 25px; }
  .activation-gate-page { min-height: calc(100vh - 66px); padding: 14px; }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; background: var(--bg); font-size: 16px; line-height: 1.5; }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }

.security-pause {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 12px 0;
  padding: 12px 16px;
  color: #e8edf2;
  background: #171a1f;
  border: 1px solid #6a5730;
  border-left: 4px solid var(--yellow);
  border-radius: 4px;
}
.security-pause strong { white-space: nowrap; }
.security-pause span { color: #b9c1ca; }
.security-pause.live {
  border-color: rgba(33, 182, 138, .44);
  border-left-color: var(--green);
  background: rgba(33, 182, 138, .07);
}

.topbar {
  height: 58px;
  display: flex;
  align-items: center;
  gap: 34px;
  padding: 0 18px;
  background: #101318;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 20;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; white-space: nowrap; }
.brand small { color: var(--muted); font-weight: 600; margin-left: 4px; }
.brand-mark, .coin-icon {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  color: #0d1014;
  background: #d9e0e7;
  font-weight: 900;
}
.brand-logo { width: 36px; height: 36px; object-fit: contain; }
nav { display: flex; align-self: stretch; gap: 26px; }
nav a { display: grid; place-items: center; color: var(--muted); font-size: 15px; border-bottom: 2px solid transparent; }
nav a:hover, nav a.active { color: var(--text); border-color: var(--accent); }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.landing-trade-button { color: #fff; background: #526fcb; border: 1px solid #6f8de6; border-radius: 8px; padding: 9px 14px; font-size: 14px; font-weight: 800; }
.landing-trade-button:hover { background: #6280db; }
.home-market-link { display: block; width: 100%; margin-top: 16px; padding: 12px; color: #fff; background: #3f5baa; border: 1px solid #5873c6; border-radius: 8px; font-weight: 750; text-align: center; }
.home-market-link:hover { background: #4a68bc; }
.standalone-route { min-height: calc(100vh - 58px); }
.wallet-progress {
  min-width: 116px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 6px 10px;
  color: #b6bec8;
  background: #15191e;
  border: 1px solid #303740;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 600;
}
.wallet-progress-mark { display: flex; gap: 3px; }
.wallet-progress-mark i {
  width: 8px;
  height: 12px;
  background: transparent;
  border: 1px solid #65707c;
  border-radius: 2px;
}
.wallet-progress[data-connected="1"] .wallet-progress-mark i:first-child,
.wallet-progress[data-connected="2"] .wallet-progress-mark i {
  background: #6f8ff7;
  border-color: #6f8ff7;
}
.wallet-progress[data-connected="2"] { color: var(--text); border-color: #46536a; }
.wallet-button, .primary-button {
  border: 1px solid #526bb9;
  color: #fff;
  background: #415ba9;
  border-radius: 5px;
  padding: 8px 13px;
  font-weight: 650;
}
.wallet-button:hover, .primary-button:hover { background: #4a66ba; }

.exchange { max-width: 1580px; margin: 0 auto; padding: 0 12px 24px; }
.connection-guide {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(260px, 360px) minmax(260px, 360px);
  gap: 10px;
  padding: 14px 8px;
  border-bottom: 1px solid var(--line);
}
.connection-intro { display: flex; flex-direction: column; justify-content: center; }
.connection-intro strong { font-size: 16px; }
.connection-intro span { color: var(--muted); font-size: 13px; margin-top: 3px; }
.connection-step {
  display: grid;
  grid-template-columns: 34px 1fr auto;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 10px 12px;
  color: var(--text);
  text-align: left;
  border: 1px solid #313a46;
  border-radius: 7px;
  background: #12171d;
  transition: border-color .16s ease, background .16s ease, transform .16s ease;
}
.connection-step:hover { border-color: #60728b; background: #171d24; transform: translateY(-1px); }
.connection-step.connected { border-color: rgba(33,182,138,.55); }
.connection-status { cursor: default; }
.connection-status:hover { border-color: rgba(33,182,138,.55); background: #12171d; transform: none; }
.step-number { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: #253044; color: #b9c9ff; font-weight: 800; }
.connection-step.connected .step-number { background: var(--green-soft); color: var(--green); }
.connection-step b, .connection-step small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.connection-step b { font-size: 14px; }
.connection-step small { color: var(--muted); font-size: 12px; margin-top: 2px; }
.connection-step i { color: #aebeff; font-size: 12px; font-style: normal; }
.connection-step.connected i { color: var(--green); }
.market-strip {
  min-height: 86px;
  display: flex;
  align-items: center;
  gap: 28px;
  border-bottom: 1px solid var(--line);
  padding: 12px 8px;
  font-variant-numeric: tabular-nums;
}
.pair-identity { min-width: 180px; display: flex; align-items: center; gap: 11px; }
.coin-icon { width: 42px; height: 42px; padding: 2px; object-fit: contain; background: transparent; border-radius: 8px; }
.pair-icons { position: relative; display: block; width: 60px; height: 44px; flex: 0 0 60px; }
.pair-icons .coin-icon { position: absolute; top: 1px; width: 40px; height: 40px; border: 2px solid var(--panel); border-radius: 50%; }
.pair-icons .coin-icon:first-child { left: 0; z-index: 2; }
.pair-icons .coin-icon:last-child { right: 0; z-index: 1; }
.pair-identity strong, .pair-identity small { display: block; }
.pair-identity strong { font-size: 17px; }
.pair-identity small { color: var(--muted); margin-top: 3px; }
.last-price { min-width: 128px; }
.last-price strong, .last-price small { display: block; }
.last-price strong { color: var(--green); font-size: 21px; }
.last-price small { color: var(--muted); margin-top: 2px; font-size: 12px; }
.market-strip dl { display: flex; gap: clamp(20px, 4vw, 58px); margin: 0; }
.market-strip dl div { min-width: 78px; }
dt { color: var(--muted); font-size: 13px; margin-bottom: 5px; }
dd { margin: 0; font-size: 15px; font-weight: 600; }

.terminal-grid {
  display: grid;
  grid-template-columns: minmax(500px, 1fr) 330px 315px;
  grid-template-rows: 520px 360px;
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  margin-top: 10px;
}
.panel { min-width: 0; background: var(--panel); }
.panel-header { height: 48px; padding: 0 14px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.panel-header strong { font-size: 15px; }
.panel-header > span { color: var(--muted); font-size: 13px; }
.chart-panel { grid-column: 1; grid-row: 1; }
.orderbook-panel { grid-column: 2; grid-row: 1; }
.order-entry-panel { grid-column: 3; grid-row: 1; }
.recent-trades-panel { grid-column: 3; grid-row: 2; }
.orders-panel { grid-column: 1 / span 2; grid-row: 2; }
.chart-header > div:first-child { display: flex; gap: 14px; align-items: center; }
#ohlc-line { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.chart-actions { display: flex; align-items: center; gap: 10px; }
.intervals { display: flex; gap: 3px; }
.intervals button, .chart-zoom button, .percent-row button, .order-tabs button, .text-button {
  color: var(--muted);
  border: 0;
  background: transparent;
  padding: 5px 7px;
  border-radius: 4px;
  font-size: 13px;
}
.intervals button:hover, .intervals button.active, .chart-zoom button:hover, .order-tabs button:hover, .order-tabs button.active { color: var(--text); background: var(--panel-2); }
.chart-zoom { display: flex; gap: 2px; padding-left: 8px; border-left: 1px solid var(--line); }
.chart-zoom button { min-width: 28px; cursor: pointer; }
.chart-zoom #chart-reset { min-width: auto; }
.chart-wrap { position: relative; height: calc(100% - 48px); min-height: 280px; }
#market-chart { width: 100%; height: 100%; display: block; cursor: crosshair; touch-action: none; user-select: none; }
#market-chart.dragging { cursor: grabbing; }
.chart-empty { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); font-size: 13px; }
.chart-tooltip {
  position: absolute;
  z-index: 4;
  width: 180px;
  pointer-events: none;
  border: 1px solid #475362;
  border-radius: 6px;
  background: rgba(16,20,25,.96);
  padding: 9px 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,.35);
  font-size: 12px;
}
.chart-tooltip b { display: block; margin-bottom: 5px; font-size: 12px; }
.chart-tooltip span { display: flex; justify-content: space-between; color: var(--muted); }
.chart-tooltip i { color: var(--text); font-style: normal; font-family: inherit; font-variant-numeric: tabular-nums; }

.book-columns, .trade-columns { display: grid; grid-template-columns: 1.1fr 1fr 1fr; padding: 8px 12px; color: var(--muted); font-size: 12px; text-align: right; }
.book-columns span:first-child, .trade-columns span:first-child { text-align: left; }
.book { height: 196px; overflow: hidden; display: flex; flex-direction: column; justify-content: flex-end; }
.book.bids { justify-content: flex-start; }
.book-row { position: relative; display: grid; grid-template-columns: 1.1fr 1fr 1fr; padding: 5px 12px; font-family: inherit; font-size: 13px; font-variant-numeric: tabular-nums; text-align: right; cursor: pointer; transition: background .14s ease, transform .14s ease; }
.book-row:hover { background: rgba(255,255,255,.045); transform: translateX(-2px); }
.book-row span:first-child { text-align: left; position: relative; z-index: 1; }
.book-row span:not(:first-child) { position: relative; z-index: 1; }
.book-row::after { content: ""; position: absolute; right: 0; top: 0; bottom: 0; width: var(--depth); }
.asks .book-row:first-child { margin-top: auto; }
.asks .book-row span:first-child { color: var(--red); }
.asks .book-row::after { background: var(--red-soft); }
.bids .book-row span:first-child { color: var(--green); }
.bids .book-row::after { background: var(--green-soft); }
.book-empty { color: var(--muted); font-size: 12px; text-align: center; padding: 30px 10px; }
.mid-price { height: 45px; border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); padding: 7px 12px; display: flex; justify-content: space-between; align-items: center; }
.mid-price strong { font-size: 17px; color: var(--green); font-variant-numeric: tabular-nums; }
.mid-price span { color: var(--muted); font-size: 10px; }

.trade-tabs { height: 49px; display: grid; grid-template-columns: 1fr 1fr; border-bottom: 1px solid var(--line); }
.trade-tabs button { border: 0; background: transparent; color: var(--muted); font-weight: 650; border-bottom: 2px solid transparent; }
.trade-tabs button.active[data-side="buy"] { color: var(--green); border-color: var(--green); }
.trade-tabs button.active[data-side="sell"] { color: var(--red); border-color: var(--red); }
.wallet-hint { margin: 14px 14px 0; padding: 10px; border: 1px solid #2d3540; background: #151a20; color: var(--muted); font-size: 13px; line-height: 1.45; }
#order-form { padding: 7px 14px; }
#order-form label { display: block; margin-top: 12px; color: var(--muted); font-size: 13px; }
.input-shell { display: flex; align-items: center; margin-top: 6px; border: 1px solid #303844; background: #0f1317; border-radius: 4px; }
.input-shell:focus-within { border-color: #586c91; }
.input-shell input { width: 100%; min-width: 0; border: 0; outline: 0; color: var(--text); background: transparent; padding: 10px; text-align: right; font-variant-numeric: tabular-nums; }
.input-shell b { min-width: 58px; padding-right: 9px; color: #bdc5ce; font-size: 11px; text-align: right; }
.input-shell.readonly { opacity: .8; }
.percent-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; margin-top: 9px; }
.percent-row button { border: 1px solid #2b333d; background: #151a20; }
.percent-row button:hover { color: var(--text); border-color: #4b5868; }
.place-order { width: 100%; margin-top: 17px; border: 0; border-radius: 4px; padding: 11px; color: #fff; font-weight: 700; }
.place-order.buy { background: #168e6c; }
.place-order.buy:hover { background: #1aa27b; }
.place-order.sell { background: #c84d54; }
.place-order.sell:hover { background: #db555d; }
.settlement-note { color: var(--muted); font-size: 12px; line-height: 1.45; padding: 0 14px; }

.trade-list { height: 280px; overflow: auto; scrollbar-width: thin; }
.trade-row { display: grid; grid-template-columns: 1.1fr 1fr 1fr; padding: 6px 12px; font-family: inherit; font-size: 13px; font-variant-numeric: tabular-nums; text-align: right; cursor: pointer; transition: background .14s ease, padding-left .14s ease; }
.trade-row:hover { background: rgba(255,255,255,.045); padding-left: 15px; }
.trade-row span:first-child { text-align: left; }
.trade-row.buy span:first-child { color: var(--green); }
.trade-row.sell span:first-child { color: var(--red); }
.orders-panel { overflow: hidden; }
.orders-header { padding-left: 8px; }
.order-tabs { display: flex; gap: 6px; }
.orders-table-wrap { overflow: auto; height: calc(100% - 48px); }
table { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
tbody tr:not(.empty-row):hover { background: rgba(255,255,255,.035); }
th, td { text-align: right; padding: 10px 12px; border-bottom: 1px solid var(--line-soft); white-space: nowrap; }
th:first-child, td:first-child { text-align: left; }
th { color: var(--muted); font-weight: 500; background: var(--panel); position: sticky; top: 0; }
.empty-row td { color: var(--muted); text-align: center; padding: 70px 20px; }
.side-buy { color: var(--green); }.side-sell { color: var(--red); }

.modal { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 20px; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.7); }
.modal-card { position: relative; width: min(440px, 100%); max-height: calc(100vh - 40px); overflow: auto; background: #171b21; border: 1px solid #303844; border-radius: 8px; padding: 24px; box-shadow: 0 18px 50px rgba(0,0,0,.45); }
.modal-card h2 { margin: 0 0 8px; font-size: 23px; }
.modal-card > p { color: var(--muted); font-size: 14px; line-height: 1.6; margin: 0 0 18px; }
.modal-close { position: absolute; right: 13px; top: 11px; border: 0; background: transparent; color: var(--muted); font-size: 25px; }
.wallet-list { display: grid; gap: 8px; }
.wallet-section-title { margin: 18px 0 8px; color: var(--muted); font-size: 12px; font-weight: 650; letter-spacing: .04em; text-transform: uppercase; }
#wallet-modal .modal-card { width: min(600px, 100%); }
.wallet-option { display: flex; align-items: center; gap: 12px; width: 100%; padding: 11px; border: 1px solid #303844; background: #11151a; color: var(--text); border-radius: 5px; text-align: left; }
.wallet-option:hover { border-color: #596777; background: #151a20; }
.wallet-option img, .wallet-fallback-icon { width: 30px; height: 30px; border-radius: 7px; }
.wallet-fallback-icon { display: grid; place-items: center; background: #2b3440; font-weight: 800; }
.wallet-option span { display: block; }
.wallet-option small { display: block; color: var(--muted); margin-top: 2px; }
.wallet-scanning { color: var(--muted); text-align: center; padding: 25px; }
.wallet-help { border-top: 1px solid var(--line); margin-top: 18px; padding-top: 14px; color: var(--muted); font-size: 11px; }
.wallet-help > div { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 9px; }
.wallet-help a:hover { color: var(--text); }
.wallet-help .wallet-catalog { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.wallet-catalog a { display: grid; grid-template-columns: 38px 1fr; grid-template-rows: auto auto; column-gap: 10px; padding: 11px; border: 1px solid #303844; border-radius: 6px; background: #11151a; transition: border-color .15s ease, transform .15s ease; }
.wallet-catalog a:hover { border-color: #596777; transform: translateY(-1px); }
.wallet-catalog b { align-self: end; color: var(--text); font-size: 14px; }
.wallet-catalog small { color: var(--muted); font-size: 11px; }
.wallet-brand-icon { grid-row: 1 / span 2; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 9px; color: #fff; font-size: 18px; font-style: normal; font-weight: 850; }
.metamask-icon { background: #e2761b; }
.rabby-icon { background: #7b61ff; }
.coinbase-icon { background: #1652f0; }
.trust-icon { background: #3375bb; }
.qt-card { width: min(560px, 100%); }
.step-label { color: var(--accent); text-transform: uppercase; letter-spacing: .08em; font-size: 10px; }
.qt-fields { display: grid; gap: 12px; }
.qt-fields label { color: var(--muted); font-size: 11px; }
.qt-fields input { width: 100%; margin-top: 6px; padding: 10px; color: var(--text); background: #0f1317; border: 1px solid #303844; border-radius: 4px; outline: 0; }
.primary-button { width: 100%; margin-top: 16px; }
.secondary-button { width: 100%; border: 1px solid #3c4653; border-radius: 5px; padding: 10px 13px; color: var(--text); background: #181e25; font-weight: 650; }
.secondary-button:hover { border-color: #627184; background: #1d242d; }
.welcome-card { width: min(620px, 100%); padding: 30px; }
.welcome-logo { display: block; width: 64px; height: 64px; object-fit: contain; margin-bottom: 12px; }
.welcome-steps { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 18px 0; }
.welcome-steps > div { padding: 13px; border: 1px solid #303844; border-radius: 6px; background: #11151a; }
.welcome-steps b, .welcome-steps span { display: block; }
.welcome-steps b { font-size: 14px; }
.welcome-steps span { color: var(--muted); font-size: 13px; margin-top: 5px; line-height: 1.5; }
.welcome-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.welcome-actions .primary-button { margin: 0; }
.welcome-actions .text-button { grid-column: 1 / -1; padding: 9px; }
.modal-doc-link { display: block; margin-top: 14px; color: #aebeff; font-size: 13px; text-align: center; }
.modal-doc-link:hover { color: #d3dcff; }
.setup-list { margin: 0 0 14px; padding-left: 24px; color: #cdd5de; font-size: 14px; }
.setup-list li { margin: 8px 0; padding-left: 4px; }
.qt-process { display: grid; gap: 8px; margin: 17px 0; }
.qt-process > div { display: grid; grid-template-columns: 32px 1fr; gap: 10px; align-items: start; padding: 11px; border: 1px solid #303844; border-radius: 6px; background: #11151a; }
.qt-process > div > b { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: #263248; color: #b7c7ff; }
.qt-process strong, .qt-process small { display: block; }
.qt-process strong { font-size: 14px; }
.qt-process small { margin-top: 2px; color: var(--muted); font-size: 12px; line-height: 1.45; }
.pairing-status { margin: 12px 0 0; padding: 11px 12px; border: 1px solid #364153; border-radius: 5px; background: #11161d; color: #c7d0db; font-size: 13px; line-height: 1.5; word-break: break-word; }
.qt-card > p code { color: #cbd6ff; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }
.spa-view { animation: page-in .18s ease-out; }
#spa-page-host { min-height: calc(100vh - 58px); }
.page-loading { min-height: 50vh; display: grid; place-items: center; color: var(--muted); font-size: 15px; }
@keyframes page-in { from { opacity: .25; transform: translateY(3px); } to { opacity: 1; transform: none; } }
.authorization-head { display: flex; align-items: center; justify-content: space-between; margin-top: 18px; }
.order-authorization { display: grid; grid-template-columns: 34px 1fr; align-items: center; gap: 12px; margin-top: 14px; padding: 12px 14px; border: 1px solid #38465e; border-radius: 7px; background: #111821; }
.order-authorization strong, .order-authorization small { display: block; }
.order-authorization small { margin-top: 3px; color: var(--muted); font-size: 12px; }
.order-authorization.success { border-color: rgba(33,182,138,.5); background: rgba(33,182,138,.08); }
.order-authorization.error { border-color: rgba(237,98,104,.56); background: rgba(237,98,104,.08); }
pre { max-height: 220px; overflow: auto; white-space: pre-wrap; word-break: break-all; padding: 11px; border: 1px solid #303844; background: #0f1317; color: #cdd5de; font: 10px ui-monospace, SFMono-Regular, Consolas, monospace; }
.small-note { color: var(--muted); font-size: 10px; }
.toast { position: fixed; right: 18px; bottom: 18px; z-index: 80; max-width: 390px; padding: 11px 14px; border-radius: 5px; background: #202731; border: 1px solid #384351; color: var(--text); box-shadow: 0 8px 30px rgba(0,0,0,.35); font-size: 12px; }
.toast.error { border-color: #793c41; background: #321d20; }

.content-page { width: min(1180px, calc(100% - 32px)); min-height: calc(100vh - 132px); margin: 0 auto; padding: 54px 0 70px; }
.narrow-page { width: min(900px, calc(100% - 32px)); }
.page-hero { margin-bottom: 38px; }
.page-hero h1 { margin: 7px 0 12px; font-size: clamp(32px, 5vw, 50px); line-height: 1.12; letter-spacing: -.025em; }
.page-hero > p, .stats-hero > div > p { max-width: 760px; margin: 0; color: var(--muted); font-size: 18px; line-height: 1.65; }
.eyebrow { color: #9cb1fa; font-size: 13px; font-weight: 750; letter-spacing: .09em; text-transform: uppercase; }
.lab-notice { margin-top: 22px; padding: 15px 17px; border: 1px solid #3d4653; border-left: 3px solid var(--yellow); border-radius: 5px; background: #151a20; color: #cbd3dc; font-size: 14px; }
.error-notice { border-left-color: var(--red); }
.docs-layout { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 48px; align-items: start; }
.docs-nav { position: sticky; top: 82px; display: flex; flex-direction: column; align-self: start; gap: 3px; padding: 8px; border: 1px solid var(--line); border-radius: 7px; background: var(--panel); }
.docs-nav a { padding: 9px 10px; border-radius: 4px; color: var(--muted); font-size: 14px; }
.docs-nav a:hover, .docs-nav a.active { color: var(--text); background: var(--panel-2); }
.docs-content { min-width: 0; }
.docs-content section { padding: 0 0 34px; margin: 0 0 34px; border-bottom: 1px solid var(--line); scroll-margin-top: 90px; }
.docs-content section:last-child { border-bottom: 0; }
.docs-content h2, .stats-section h2 { margin: 0 0 14px; font-size: 25px; }
.docs-content p, .docs-content li { color: #c8d0d9; font-size: 16px; line-height: 1.75; }
.docs-content ol, .docs-content ul { padding-left: 24px; }
.docs-content li { margin: 8px 0; padding-left: 4px; }
.docs-content a, .faq-list a { color: #aebeff; text-decoration: underline; text-decoration-color: rgba(174,190,255,.4); text-underline-offset: 3px; }
.docs-content .note { padding: 13px 15px; border-left: 3px solid var(--accent); background: #141920; color: var(--muted); font-size: 14px; }
.process-flow { display: flex; align-items: stretch; gap: 9px; margin-top: 22px; }
.process-flow div { flex: 1; display: flex; align-items: center; gap: 8px; padding: 13px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); }
.process-flow b { display: grid; place-items: center; flex: 0 0 26px; width: 26px; height: 26px; border-radius: 50%; background: #263248; color: #b7c7ff; }
.process-flow span { font-size: 13px; }
.process-flow i { align-self: center; color: var(--muted); font-style: normal; }
.faq-list { display: grid; gap: 10px; }
.faq-list details { border: 1px solid var(--line); border-radius: 7px; background: var(--panel); overflow: hidden; transition: border-color .15s ease, background .15s ease; }
.faq-list details:hover { border-color: #46515f; }
.faq-list details[open] { border-color: #50617d; background: #141920; }
.faq-list summary { position: relative; padding: 17px 48px 17px 18px; list-style: none; cursor: pointer; font-size: 17px; font-weight: 650; }
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::after { content: "+"; position: absolute; right: 18px; top: 12px; color: var(--muted); font-size: 25px; font-weight: 400; }
.faq-list details[open] summary::after { content: "−"; }
.faq-list p { margin: 0; padding: 0 18px 19px; color: var(--muted); font-size: 15px; line-height: 1.7; }
.stats-hero { display: flex; align-items: end; justify-content: space-between; gap: 24px; }
.stats-hero .secondary-button { width: auto; min-width: 140px; }
.stats-section { margin-top: 32px; }
.stats-section > header { display: flex; align-items: baseline; justify-content: space-between; gap: 15px; margin-bottom: 13px; }
.stats-section > header h2 { margin: 0; }
.stats-section > header span { color: var(--muted); font-size: 13px; }
.stats-card-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stats-card-grid article { min-height: 142px; padding: 18px; border: 1px solid var(--line); border-radius: 7px; background: var(--panel); transition: border-color .15s ease, transform .15s ease; }
.stats-card-grid article:hover { border-color: #526074; transform: translateY(-2px); }
.stats-card-grid span, .stats-card-grid small { display: block; color: var(--muted); }
.stats-card-grid span { font-size: 13px; }
.stats-card-grid strong { display: block; margin: 10px 0 3px; font-size: 27px; font-variant-numeric: tabular-nums; }
.stats-card-grid small { font-size: 12px; }
.network-stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.network-stats-grid article { display: flex; align-items: center; gap: 16px; padding: 20px; border: 1px solid var(--line); border-radius: 7px; background: var(--panel); }
.network-stats-grid img, .chain-symbol { flex: 0 0 54px; width: 54px; height: 54px; object-fit: contain; }
.chain-symbol { display: grid; place-items: center; border-radius: 50%; background: #263248; color: #b7c7ff; font-size: 24px; font-weight: 800; }
.network-stats-grid span, .network-stats-grid small { display: block; color: var(--muted); font-size: 13px; }
.network-stats-grid strong { display: block; margin: 3px 0; font-size: 26px; }
.technical-list { margin-top: 10px; border: 1px solid var(--line); border-radius: 7px; background: var(--panel); }
.technical-list div { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 20px; padding: 13px 16px; border-bottom: 1px solid var(--line-soft); }
.technical-list div:last-child { border-bottom: 0; }
.technical-list dt { margin: 0; }
.technical-list dd { overflow: hidden; color: #cbd3dc; font-family: inherit; font-size: 13px; font-variant-numeric: tabular-nums; text-overflow: ellipsis; white-space: nowrap; }
.page-footer { display: flex; justify-content: space-between; gap: 20px; padding: 22px max(16px, calc((100vw - 1180px) / 2)); border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.page-footer a:hover { color: var(--text); }

@media (max-width: 1180px) {
  .connection-guide { grid-template-columns: 1fr 1fr; }
  .connection-intro { grid-column: 1 / -1; }
  .terminal-grid { grid-template-columns: minmax(480px, 1fr) 310px; grid-template-rows: 500px 430px 340px; }
  .chart-panel { grid-column: 1; grid-row: 1; }
  .orderbook-panel { grid-column: 2; grid-row: 1; }
  .order-entry-panel { grid-column: 1; grid-row: 2; }
  .recent-trades-panel { grid-column: 2; grid-row: 2; }
  .orders-panel { grid-column: 1 / span 2; grid-row: 3; }
}
@media (max-width: 760px) {
  .topbar { gap: 12px; padding: 0 10px; }
  nav { display: none; }
  .wallet-progress { display: none; }
  .brand small { display: none; }
  .market-strip { overflow-x: auto; gap: 20px; }
  .connection-guide { grid-template-columns: 1fr; }
  .connection-intro { grid-column: auto; }
  .market-strip dl { gap: 22px; }
  .terminal-grid { display: flex; flex-direction: column; }
  .chart-panel { height: 400px; }
  .orderbook-panel, .recent-trades-panel { height: 470px; }
  .order-entry-panel { min-height: 490px; }
  .orders-panel { min-height: 300px; }
  #ohlc-line { display: none; }
  .intervals button { padding: 5px; }
  .chart-actions { gap: 4px; }
  .chart-zoom { padding-left: 4px; }
  .chart-zoom #chart-reset { display: none; }
  .welcome-steps, .welcome-actions { grid-template-columns: 1fr; }
  .wallet-help .wallet-catalog { grid-template-columns: 1fr; }
  .welcome-actions .text-button { grid-column: auto; }
  .content-page { width: min(100% - 24px, 1180px); padding-top: 34px; }
  .docs-layout { grid-template-columns: 1fr; gap: 24px; }
  .docs-nav { position: static; flex-direction: row; overflow-x: auto; }
  .docs-nav a { white-space: nowrap; }
  .process-flow { display: grid; grid-template-columns: 1fr; }
  .process-flow i { display: none; }
  .stats-hero { align-items: stretch; flex-direction: column; }
  .stats-card-grid, .network-stats-grid { grid-template-columns: 1fr; }
  .technical-list div { grid-template-columns: 1fr; gap: 4px; }
  .page-footer { flex-direction: column; }
}
/* Trading balances */
.balance-strip {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(260px, 1fr) minmax(220px, .8fr);
  gap: 1px;
  margin: 0 0 12px;
  border: 1px solid var(--line, #2b3139);
  background: var(--line, #2b3139);
}
.balance-asset, .balance-strip > p { margin: 0; padding: 14px 16px; background: var(--panel, #171b21); }
.balance-asset > span { display: block; color: #9ba7b4; font-size: 13px; }
.balance-asset > span.asset-label { display: flex; align-items: center; gap: 8px; color: #dce3ea; font-weight: 700; }
.asset-label img { width: 22px; height: 22px; object-fit: contain; border-radius: 50%; }
.asset-label small { color: #7f8a96; font-size: 12px; font-weight: 500; }
.balance-asset > strong { display: block; margin: 5px 0 2px; font-size: 21px; font-variant-numeric: tabular-nums; }
.balance-asset > small { color: #7f8a96; }
.balance-asset > div { display: flex; gap: 8px; margin-top: 10px; }
.balance-asset button { border: 1px solid #3a4551; border-radius: 5px; padding: 7px 12px; background: #20262d; color: #e9eef4; cursor: pointer; }
.balance-asset button:hover:not(:disabled) { border-color: #8190a0; background: #29313a; }
.balance-asset button:disabled { cursor: not-allowed; opacity: .45; }
.balance-asset .claim-button { border-color: rgba(70,197,150,.65); color: #b9f4dd; background: rgba(37,145,107,.14); animation: claim-ready 1.8s ease-in-out infinite; }
.balance-asset .claim-button:hover { border-color: #62d7ad; background: rgba(37,145,107,.24); }
.order-action { min-width: 74px; border: 1px solid #46515d; border-radius: 5px; padding: 6px 10px; background: transparent; color: #cbd4de; cursor: pointer; }
.order-action:hover:not(:disabled) { border-color: #e06d72; color: #ffb8bb; background: rgba(224,109,114,.08); }
.order-action:disabled { cursor: wait; opacity: .6; }
.balance-strip > p { display: flex; align-items: center; color: #9ba7b4; line-height: 1.55; }
.funding-card { width: min(590px, 100%); padding: 28px; overflow: hidden; }
.funding-head { display: flex; align-items: center; gap: 14px; padding-right: 34px; }
.funding-head h2 { margin: 1px 0 0; font-size: 25px; }
.funding-head small { color: var(--muted); font-size: 12px; }
.funding-asset { position: relative; flex: 0 0 52px; width: 52px; height: 52px; display: grid; place-items: center; border: 1px solid #3b4654; border-radius: 14px; background: #11161c; }
.funding-asset img { width: 34px; height: 34px; object-fit: contain; }
.funding-asset i { position: absolute; right: -5px; bottom: -5px; display: grid; place-items: center; width: 22px; height: 22px; border: 2px solid #171b21; border-radius: 50%; background: #4264c6; color: #fff; font-size: 13px; font-style: normal; font-weight: 800; }
.funding-card > p { margin: 18px 0 0; padding-bottom: 17px; border-bottom: 1px solid var(--line); }
.funding-form { display: grid; gap: 14px; margin: 18px 0; }
.kad-proof-fields { display: grid; gap: 14px; padding-top: 4px; }
.kad-proof-fields .funding-input input { font-size: 15px; }
.funding-field { display: grid; gap: 9px; }
.funding-field > span:first-child { display: flex; justify-content: space-between; gap: 16px; align-items: baseline; }
.funding-field > span b { color: #dce3ea; font-size: 13px; }
.funding-field > span small { color: var(--muted); font-size: 12px; text-align: right; }
.funding-input { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; min-height: 54px; border: 1px solid #3a4551; border-radius: 7px; background: #0e1318; transition: border-color .16s ease, box-shadow .16s ease; }
.funding-input:focus-within { border-color: #6f8ff7; box-shadow: 0 0 0 3px rgba(111,143,247,.12); }
.funding-input input { width: 100%; min-width: 0; border: 0; outline: 0; padding: 12px 15px; background: transparent; color: var(--text); font-size: 20px; font-variant-numeric: tabular-nums; }
.funding-input > b { padding: 0 15px; color: #c9d3df; font-size: 13px; }
.funding-field select { width: 100%; min-height: 54px; border: 1px solid #3a4551; border-radius: 7px; padding: 0 14px; outline: 0; background: #0e1318; color: #e9eef4; }
.funding-field select:focus { border-color: #6f8ff7; box-shadow: 0 0 0 3px rgba(111,143,247,.12); }
.funding-progress { display: grid; grid-template-columns: 34px 1fr; align-items: center; gap: 12px; min-height: 65px; margin: 16px 0 13px; padding: 12px 14px; border: 1px solid #38465e; border-radius: 7px; background: #111821; }
.funding-progress strong, .funding-progress small { display: block; }
.funding-progress strong { font-size: 14px; }
.funding-progress small { margin-top: 2px; color: var(--muted); font-size: 12px; line-height: 1.45; }
.funding-spinner { width: 25px; height: 25px; border: 3px solid #35415a; border-top-color: #85a0ff; border-radius: 50%; animation: funding-spin .8s linear infinite; }
.funding-progress[data-state="success"] { border-color: rgba(33,182,138,.5); background: rgba(33,182,138,.08); }
.funding-progress[data-state="success"] .funding-spinner { border: 0; animation: none; background: var(--green); }
.funding-progress[data-state="success"] .funding-spinner::after { content: "✓"; display: grid; place-items: center; height: 100%; color: #07130f; font-weight: 900; }
.funding-progress[data-state="error"] { border-color: rgba(237,98,104,.56); background: rgba(237,98,104,.08); }
.funding-progress[data-state="error"] .funding-spinner { border: 0; animation: none; background: var(--red); }
.funding-progress[data-state="error"] .funding-spinner::after { content: "!"; display: grid; place-items: center; height: 100%; color: #22080a; font-weight: 900; }
.funding-steps { display: grid; grid-template-columns: repeat(3, 1fr); margin: 14px 0 20px; padding: 0; list-style: none; }
.funding-steps li { position: relative; display: grid; justify-items: center; gap: 5px; color: #6f7985; font-size: 11px; }
.funding-steps li::before { content: ""; position: absolute; top: 12px; right: 50%; width: 100%; height: 1px; background: #343d48; }
.funding-steps li:first-child::before { display: none; }
.funding-steps i { position: relative; z-index: 1; display: grid; place-items: center; width: 25px; height: 25px; border: 1px solid #3a4551; border-radius: 50%; background: #171b21; font-style: normal; font-weight: 700; }
.funding-steps li.current, .funding-steps li.complete { color: #cad6ff; }
.funding-steps li.current i { border-color: #6f8ff7; background: #314b96; color: #fff; box-shadow: 0 0 0 4px rgba(111,143,247,.1); }
.funding-steps li.complete i { border-color: var(--green); background: var(--green); color: #07130f; }
.funding-steps li.complete i::after { content: "✓"; }
.funding-steps li.complete i { font-size: 0; }
.funding-steps li.complete i::after { font-size: 13px; }
.funding-card .modal-actions { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 10px; }
.funding-card .modal-actions .primary-button { margin: 0; min-height: 45px; }
.funding-card .modal-actions .secondary-button { min-height: 45px; }
@keyframes funding-spin { to { transform: rotate(360deg); } }
@keyframes claim-ready { 50% { box-shadow: 0 0 0 4px rgba(70,197,150,.08); } }
@media (max-width: 900px) {
  .balance-strip { grid-template-columns: 1fr 1fr; }
  .balance-strip > p { grid-column: 1 / -1; }
}
@media (max-width: 600px) {
  .balance-strip { grid-template-columns: 1fr; }
  .balance-strip > p { grid-column: auto; }
  .funding-card { padding: 22px 17px; }
  .funding-card .modal-actions { grid-template-columns: 1fr; }
  .funding-field > span:first-child { align-items: flex-start; flex-direction: column; gap: 2px; }
  .funding-field > span small { text-align: left; }
}

/* Simplified trading layout */
:root {
  --bg: #0f1216;
  --panel: #171b20;
  --panel-2: #1d2229;
  --line: #303740;
  --line-soft: #252b32;
  --text: #f0f3f6;
  --muted: #a4adb7;
  --accent: #7893e6;
}

body { font-size: 18px; }

.topbar {
  height: 72px;
  gap: 42px;
  padding: 0 max(24px, calc((100vw - 1320px) / 2));
  background: #121519;
}
.brand { font-size: 19px; }
.brand-logo { width: 42px; height: 42px; }
.topbar nav { gap: 34px; }
.topbar nav a { font-size: 16px; }
.wallet-progress { min-width: 132px; padding: 9px 14px; border-radius: 9px; font-size: 14px; }

.exchange { max-width: 1320px; padding: 26px 24px 72px; }
.simple-intro {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  padding: 28px 30px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
}
.market-kicker { color: #aebeff; font-size: 15px; font-weight: 700; }
.simple-intro h1 { margin: 5px 0; font-size: clamp(30px, 4vw, 42px); line-height: 1.15; letter-spacing: -.025em; }
.simple-intro p { max-width: 720px; margin: 0; color: var(--muted); font-size: 17px; }
.service-status {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 15px;
  border: 1px solid rgba(33,182,138,.45);
  border-radius: 10px;
  color: #b9eddc;
  background: rgba(33,182,138,.08);
  font-size: 15px;
  font-weight: 650;
}
.service-status i { width: 10px; height: 10px; border-radius: 50%; background: var(--green); }

.connection-guide {
  grid-template-columns: minmax(260px, 1fr) minmax(300px, .95fr) minmax(300px, .95fr);
  gap: 16px;
  margin-top: 20px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
}
.connection-intro strong { font-size: 20px; }
.connection-intro span { margin-top: 5px; font-size: 15px; line-height: 1.5; }
.connection-step { min-height: 76px; padding: 14px 16px; border-radius: 11px; background: #13171c; }
.connection-step b { font-size: 16px; }
.connection-step small, .connection-step i { font-size: 14px; }
.step-number { width: 36px; height: 36px; }

.balance-strip {
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 20px 0 0;
  border: 0;
  background: transparent;
}
.balance-asset {
  padding: 22px 24px;
  border: 1px solid var(--line);
  border-radius: 14px;
}
.balance-asset > span.asset-label { font-size: 17px; }
.asset-label img { width: 30px; height: 30px; }
.asset-label small { font-size: 14px; }
.balance-asset > strong { margin: 13px 0 2px; font-size: clamp(28px, 3vw, 36px); line-height: 1.2; }
.balance-asset > small { font-size: 14px; }
.balance-asset > div { gap: 10px; margin-top: 18px; }
.balance-asset button { min-height: 46px; padding: 10px 17px; border-radius: 9px; font-size: 15px; font-weight: 650; }
.balance-strip > p {
  grid-column: 1 / -1;
  min-height: 52px;
  padding: 12px 18px;
  border: 1px solid var(--line);
  border-radius: 11px;
  font-size: 15px;
}

.market-strip {
  min-height: 118px;
  gap: 34px;
  margin-top: 20px;
  padding: 20px 24px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
}
.pair-identity { min-width: 220px; }
.pair-identity strong { font-size: 21px; }
.pair-identity small { font-size: 14px; }
.last-price { min-width: 145px; }
.last-price strong { font-size: 30px; }
.last-price small { font-size: 14px; }
.market-strip dl { flex: 1; display: grid; grid-template-columns: repeat(5, minmax(95px, 1fr)); gap: 18px; }
.market-strip dt { font-size: 14px; }
.market-strip dd { font-size: 17px; }

.simple-section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 30px;
  margin: 38px 0 16px;
}
.simple-section-heading span { color: #aebeff; font-size: 15px; font-weight: 700; }
.simple-section-heading h2 { margin: 3px 0 0; font-size: 30px; }
.simple-section-heading p { max-width: 560px; margin: 0; color: var(--muted); font-size: 16px; text-align: right; }

.terminal-grid {
  grid-template-columns: minmax(0, 1fr) minmax(390px, .72fr);
  grid-template-rows: 620px 440px 390px;
  gap: 18px;
  margin-top: 0;
  border: 0;
  background: transparent;
}
.panel { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.panel-header { height: 64px; padding: 0 20px; }
.panel-header strong { font-size: 19px; }
.panel-header > span { font-size: 14px; }
.order-entry-panel { grid-column: 1; grid-row: 1; }
.orderbook-panel { grid-column: 2; grid-row: 1; }
.chart-panel { grid-column: 1 / -1; grid-row: 2; }
.recent-trades-panel { grid-column: 1; grid-row: 3; }
.orders-panel { grid-column: 2; grid-row: 3; }

.trade-tabs { height: 72px; }
.trade-tabs button { font-size: 19px; }
.wallet-hint { margin: 20px 22px 0; padding: 14px 16px; border-radius: 9px; font-size: 15px; }
#order-form { padding: 6px 22px 20px; }
#order-form label { margin-top: 18px; font-size: 16px; }
.input-shell { min-height: 62px; margin-top: 8px; border-radius: 9px; }
.input-shell input { padding: 15px 16px; font-size: 22px; }
.input-shell b { min-width: 75px; padding-right: 16px; font-size: 14px; }
.percent-row { gap: 9px; margin-top: 13px; }
.percent-row button { min-height: 42px; border-radius: 8px; font-size: 15px; }
.place-order { min-height: 58px; margin-top: 22px; border-radius: 9px; font-size: 18px; }
.settlement-note { padding: 0 22px; font-size: 15px; line-height: 1.55; }

.book-columns, .trade-columns { padding: 12px 18px; font-size: 14px; }
.book { height: 236px; }
.book-row { padding: 8px 18px; font-size: 15px; }
.book-empty { padding: 42px 12px; font-size: 15px; }
.mid-price { height: 62px; padding: 10px 18px; }
.mid-price strong { font-size: 22px; }
.mid-price span { font-size: 13px; }

.chart-header { min-height: 64px; height: auto; }
.chart-header > div:first-child { flex-wrap: wrap; }
#ohlc-line { font-size: 14px; }
.intervals button, .chart-zoom button, .order-tabs button, .text-button { padding: 8px 10px; font-size: 14px; }
.chart-wrap { height: calc(100% - 64px); min-height: 340px; }
.chart-tooltip { width: 210px; padding: 12px 14px; font-size: 14px; }
.chart-tooltip b { font-size: 14px; }

.trade-list { height: 320px; }
.trade-row { padding: 10px 18px; font-size: 15px; }
.trade-row:hover { padding-left: 22px; }
.orders-table-wrap { height: calc(100% - 64px); }
table { font-size: 15px; }
th, td { padding: 13px 15px; }
.empty-row td { padding: 82px 20px; }

.modal-card { width: min(500px, 100%); border-radius: 14px; padding: 28px; }
.modal-card h2 { font-size: 27px; }
.modal-card > p { font-size: 16px; }
.primary-button, .secondary-button { min-height: 50px; border-radius: 9px; font-size: 16px; }
.toast { max-width: 440px; padding: 14px 17px; border-radius: 9px; font-size: 15px; }

@media (max-width: 1040px) {
  .connection-guide { grid-template-columns: 1fr 1fr; }
  .connection-intro { grid-column: 1 / -1; }
  .market-strip { align-items: flex-start; flex-wrap: wrap; }
  .market-strip dl { flex-basis: 100%; }
  .terminal-grid { grid-template-columns: 1fr 1fr; grid-template-rows: 620px 440px 390px; }
}

@media (max-width: 760px) {
  body { font-size: 17px; }
  .topbar { height: 64px; padding: 0 16px; }
  .exchange { padding: 16px 14px 50px; }
  .simple-intro { align-items: flex-start; flex-direction: column; padding: 22px; }
  .simple-intro h1 { font-size: 32px; }
  .service-status { align-self: stretch; justify-content: center; }
  .connection-guide, .balance-strip { grid-template-columns: 1fr; }
  .connection-intro, .balance-strip > p { grid-column: auto; }
  .balance-asset { padding: 20px; }
  .balance-asset > div { display: grid; grid-template-columns: 1fr 1fr; }
  .market-strip { overflow: visible; }
  .market-strip dl { grid-template-columns: 1fr 1fr; }
  .simple-section-heading { align-items: flex-start; flex-direction: column; gap: 7px; margin-top: 30px; }
  .simple-section-heading p { text-align: left; }
  .terminal-grid { display: flex; flex-direction: column; }
  .order-entry-panel { min-height: 610px; order: 1; }
  .orderbook-panel { height: 620px; order: 2; }
  .chart-panel { height: 430px; order: 3; }
  .recent-trades-panel { height: 390px; order: 4; }
  .orders-panel { min-height: 390px; order: 5; }
  .panel-header { height: 60px; padding: 0 16px; }
  .chart-header { padding: 12px 14px; }
  .chart-wrap { height: calc(100% - 76px); }
  #order-form { padding-left: 18px; padding-right: 18px; }
}

@media (max-width: 460px) {
  .brand small { display: none; }
  .simple-intro h1 { font-size: 29px; }
  .balance-asset > strong { font-size: 27px; overflow-wrap: anywhere; }
  .balance-asset > div { grid-template-columns: 1fr; }
  .market-strip dl { grid-template-columns: 1fr 1fr; }
  .market-strip dl div:last-child { grid-column: 1 / -1; }
  .chart-actions { width: 100%; justify-content: space-between; overflow-x: auto; }
  .orders-panel { min-height: 430px; }
}

/* 2026-08-10 exchange workspace refresh */
:root {
  color-scheme: dark;
  --bg: #0b0e11;
  --panel: #13171c;
  --panel-2: #181d23;
  --line: #29313a;
  --line-soft: #20272e;
  --text: #f4f6f8;
  --muted: #9da8b3;
  --accent: #91a9ff;
  --green: #35c995;
  --red: #f07178;
}

body {
  background: #0b0e11;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 17px;
  letter-spacing: -.005em;
}

.topbar {
  height: 76px;
  padding: 0 max(28px, calc((100vw - 1440px) / 2));
  gap: 48px;
  background: #0f1317;
  border-color: #242b32;
}
.brand { gap: 12px; font-size: 20px; letter-spacing: -.02em; }
.brand-logo { width: 44px; height: 44px; }
.brand small { font-size: 13px; letter-spacing: 0; }
.topbar nav { gap: 8px; }
.topbar nav a {
  padding: 10px 13px;
  border-radius: 8px;
  color: #aab4be;
  font-size: 15px;
  font-weight: 650;
}
.topbar nav a:hover { color: #e4e9ef; background: #151a20; border-color: transparent; }
.topbar nav a.active { color: #fff; background: #1a2026; border-color: var(--accent); }
.wallet-progress {
  min-width: 136px;
  padding: 10px 14px;
  border-color: #34404a;
  background: #151a1f;
}

.exchange { max-width: 1440px; padding: 36px 28px 88px; }
.simple-intro {
  padding: 6px 0 28px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
}
.market-kicker { color: #aabcf8; font-size: 14px; letter-spacing: .08em; text-transform: uppercase; }
.simple-intro h1 { margin: 7px 0 8px; font-size: clamp(38px, 5vw, 58px); line-height: 1.04; }
.simple-intro p { max-width: 760px; color: #b0bac4; font-size: 18px; }
.service-status {
  padding: 12px 16px;
  border-radius: 999px;
  border-color: rgba(53, 201, 149, .4);
  background: rgba(53, 201, 149, .08);
}

.connection-guide {
  grid-template-columns: minmax(240px, .75fr) repeat(2, minmax(300px, 1fr));
  gap: 14px;
  margin-top: 24px;
  padding: 0;
  border: 0;
  background: transparent;
}
.connection-intro {
  padding: 20px 4px;
  align-self: center;
}
.connection-intro strong { font-size: 22px; letter-spacing: -.02em; }
.connection-intro span { max-width: 270px; color: #9da8b3; font-size: 15px; }
.connection-step {
  min-height: 88px;
  padding: 18px;
  border-color: #303942;
  border-radius: 14px;
  background: #13181d;
  box-shadow: none;
}
.connection-step:hover { border-color: #526170; background: #171d22; transform: translateY(-2px); }
.connection-step b { font-size: 17px; }
.connection-step small { margin-top: 4px; font-size: 14px; }
.connection-step i { font-size: 14px; font-weight: 700; }
.step-number { width: 40px; height: 40px; border-radius: 10px; }

.balance-strip {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 20px;
}
.balance-asset {
  min-height: 218px;
  padding: 25px 26px;
  border-color: #303942;
  border-radius: 16px;
  background: #13181d;
}
.balance-asset > span.asset-label { gap: 11px; font-size: 18px; }
.asset-label img { width: 34px; height: 34px; }
.balance-asset > strong { margin: 18px 0 4px; font-size: clamp(32px, 3vw, 42px); letter-spacing: -.025em; }
.balance-asset > small { color: #9aa5af; font-size: 15px; }
.balance-asset > div { margin-top: 22px; }
.balance-asset button {
  min-height: 48px;
  padding: 11px 18px;
  border-color: #3a4651;
  border-radius: 10px;
  background: #1a2128;
  font-size: 15px;
}
.balance-asset button:first-child { border-color: #526688; background: #202b3a; }
.balance-asset button:hover:not(:disabled) { border-color: #718295; background: #242d36; transform: translateY(-1px); }
.balance-strip > p {
  min-height: 54px;
  padding: 13px 18px;
  border-color: #303942;
  border-radius: 12px;
  background: #10151a;
}

.market-strip {
  min-height: 126px;
  gap: 38px;
  margin-top: 28px;
  padding: 23px 26px;
  border-color: #303942;
  border-radius: 16px;
  background: #13181d;
}
.pair-icons .coin-icon { width: 38px; height: 38px; }
.pair-identity { min-width: 230px; }
.pair-identity strong { font-size: 23px; }
.last-price strong { font-size: 34px; }
.market-strip dl { gap: 22px; }
.market-strip dt { margin-bottom: 5px; color: #8f9ba6; }
.market-strip dd { font-size: 18px; font-weight: 700; }

.simple-section-heading { margin: 48px 0 18px; }
.simple-section-heading h2 { font-size: 34px; letter-spacing: -.025em; }
.simple-section-heading p { max-width: 590px; font-size: 17px; }

.terminal-grid {
  grid-template-columns: minmax(0, 1.25fr) minmax(420px, .75fr);
  grid-template-rows: 520px 660px 430px;
  gap: 18px;
}
.panel {
  border-color: #303942;
  border-radius: 16px;
  background: #13181d;
  box-shadow: 0 10px 32px rgba(0, 0, 0, .16);
}
.panel-header { height: 68px; padding: 0 22px; }
.panel-header strong { font-size: 19px; }
.chart-panel { grid-column: 1 / -1; grid-row: 1; }
.orderbook-panel { grid-column: 1; grid-row: 2; }
.order-entry-panel { grid-column: 2; grid-row: 2; }
.recent-trades-panel { grid-column: 1; grid-row: 3; }
.orders-panel { grid-column: 2; grid-row: 3; }

.chart-header { min-height: 68px; padding: 11px 22px; }
.chart-wrap { height: calc(100% - 68px); min-height: 420px; background: #101419; }
.intervals,
.chart-zoom { padding: 4px; border-radius: 9px; background: #0e1216; }
.intervals button,
.chart-zoom button { min-height: 34px; border-radius: 7px; }
.intervals button:hover,
.chart-zoom button:hover,
.intervals button.active { color: #fff; background: #252e37; }

.book-columns,
.trade-columns { padding: 13px 22px; color: #8d99a5; font-size: 14px; }
.book { height: 256px; }
.book-row { min-height: 38px; padding: 9px 22px; font-size: 16px; }
.book-row:hover { background: #1c232a; }
.mid-price { height: 68px; padding: 11px 22px; background: #10151a; }
.mid-price strong { font-size: 24px; }

.trade-tabs { height: 74px; padding: 8px; gap: 8px; border-bottom-color: var(--line); }
.trade-tabs button { border-radius: 10px; font-size: 18px; }
.trade-tabs button.active { background: #202832; }
.wallet-hint { margin: 20px 24px 0; padding: 15px 16px; border-radius: 10px; }
#order-form { padding: 4px 24px 22px; }
#order-form label { margin-top: 18px; font-size: 16px; }
.input-shell { min-height: 62px; border-color: #39434d; border-radius: 10px; background: #0f1418; }
.input-shell:focus-within { border-color: #7893e6; box-shadow: 0 0 0 3px rgba(120, 147, 230, .13); }
.input-shell input { font-size: 22px; }
.percent-row button { min-height: 44px; border-radius: 9px; background: #181e24; }
.place-order { min-height: 58px; border-radius: 10px; font-size: 18px; }
.settlement-note { padding: 0 24px; color: #8f9aa5; }

.trade-list { height: 350px; }
.trade-row { min-height: 41px; padding: 10px 22px; font-size: 15px; }
.trade-row:hover { padding-left: 26px; background: #1b2229; }
.orders-table-wrap { height: calc(100% - 68px); }
table { font-size: 15px; }
th { color: #8f9ba6; }
th, td { padding: 14px 16px; }
tbody tr:hover { background: #1a2026; }

.modal-card {
  border-color: #3a444e;
  border-radius: 18px;
  background: #151a20;
  box-shadow: 0 28px 90px rgba(0, 0, 0, .5);
}
.funding-card { width: min(640px, 100%); padding: 32px; }
.funding-form { gap: 18px; }
.funding-field > span b { font-size: 15px; }
.funding-input,
.funding-field select { min-height: 60px; border-radius: 10px; background: #0f1418; }
.funding-input input { font-size: 23px; }
.funding-card .modal-actions { gap: 12px; }
.funding-card .modal-actions .primary-button,
.funding-card .modal-actions .secondary-button { min-height: 52px; }

@media (max-width: 1120px) {
  .connection-guide { grid-template-columns: 1fr 1fr; }
  .connection-intro { grid-column: 1 / -1; padding: 8px 2px; }
  .connection-intro span { max-width: none; }
  .market-strip { align-items: flex-start; flex-wrap: wrap; }
  .market-strip dl { flex-basis: 100%; }
  .terminal-grid { grid-template-columns: 1fr 1fr; grid-template-rows: 500px 650px 430px; }
}

@media (max-width: 820px) {
  .topbar { height: 66px; padding: 0 16px; }
  .topbar nav { display: none; }
  .exchange { padding: 24px 15px 56px; }
  .simple-intro { align-items: flex-start; flex-direction: column; padding-bottom: 24px; }
  .simple-intro h1 { font-size: 36px; }
  .simple-intro p { font-size: 17px; }
  .service-status { align-self: flex-start; }
  .connection-guide,
  .balance-strip { grid-template-columns: 1fr; }
  .connection-intro,
  .balance-strip > p { grid-column: auto; }
  .balance-asset { min-height: 0; padding: 22px; }
  .market-strip { padding: 20px; }
  .market-strip dl { grid-template-columns: 1fr 1fr; }
  .simple-section-heading { align-items: flex-start; flex-direction: column; gap: 8px; }
  .simple-section-heading p { text-align: left; }
  .terminal-grid { display: flex; flex-direction: column; }
  .chart-panel { order: 1; height: 470px; }
  .order-entry-panel { order: 2; min-height: 650px; }
  .orderbook-panel { order: 3; height: 660px; }
  .recent-trades-panel { order: 4; height: 430px; }
  .orders-panel { order: 5; min-height: 430px; }
}

@media (max-width: 500px) {
  .wallet-progress { min-width: 0; }
  .wallet-progress-text { display: none; }
  .simple-intro h1 { font-size: 32px; }
  .connection-step { min-height: 82px; padding: 15px; }
  .balance-asset > div { display: grid; grid-template-columns: 1fr; }
  .market-strip dl { gap: 16px; }
  .chart-header { align-items: flex-start; gap: 10px; }
  .chart-actions { width: 100%; overflow-x: auto; }
  .funding-card { padding: 24px 18px; }
  .funding-card .modal-actions { grid-template-columns: 1fr; }
}

/* Funds page and compact trading workspace */
.trade-workspace {
  max-width: 1600px;
  padding-top: 16px;
  padding-bottom: 24px;
}
.trade-workspace > .simple-intro,
.trade-workspace > .simple-section-heading { display: none; }
.trade-toolbar {
  min-height: 68px;
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
}
.trade-toolbar-pair,
.trade-mini-balances,
.trade-mini-balances > span { display: flex; align-items: center; }
.trade-toolbar-pair { min-width: 210px; gap: 12px; }
.trade-toolbar-pair > span:last-child { display: grid; gap: 2px; }
.trade-toolbar-pair small,
.trade-mini-balances small { color: var(--muted); font-size: 12px; }
.trade-toolbar-pair strong { font-size: 20px; }
.trade-mini-balances { flex: 1; gap: 10px; }
.trade-mini-balances > span {
  min-width: 210px;
  display: grid;
  grid-template-columns: 28px auto;
  column-gap: 10px;
  padding: 7px 12px;
  border-left: 1px solid var(--line);
}
.trade-mini-balances img { grid-row: 1 / 3; width: 27px; height: 27px; object-fit: contain; }
.trade-mini-balances strong { font-size: 16px; font-variant-numeric: tabular-nums; }
.manage-funds,
.back-to-market {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 15px;
  border: 1px solid #526688;
  border-radius: 9px;
  color: #edf2ff;
  background: #202b3a;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}
.manage-funds:hover,
.back-to-market:hover { border-color: #7893e6; background: #26354a; }
.trade-toolbar .service-status { flex: none; padding: 9px 12px; font-size: 13px; }

.trade-workspace > .market-strip {
  min-height: 86px;
  margin-top: 12px;
  padding: 12px 18px;
  border-radius: 12px;
  gap: 22px;
}
.trade-workspace .pair-identity { min-width: 190px; }
.trade-workspace .pair-identity strong { font-size: 18px; }
.trade-workspace .pair-icons .coin-icon { width: 31px; height: 31px; }
.trade-workspace .last-price { min-width: 120px; }
.trade-workspace .last-price strong { font-size: 25px; }
.trade-workspace .market-strip dl { gap: 12px; }
.trade-workspace .market-strip dt { font-size: 12px; }
.trade-workspace .market-strip dd { font-size: 15px; }

.trade-workspace .terminal-grid {
  height: calc(100vh - 292px);
  min-height: 650px;
  display: grid;
  grid-template-columns: minmax(450px, 1.35fr) minmax(270px, .65fr) minmax(330px, .72fr);
  grid-template-rows: minmax(405px, 1fr) 220px;
  gap: 10px;
  margin-top: 10px;
}
.trade-workspace .panel { border-radius: 11px; box-shadow: none; }
.trade-workspace .panel-header { height: 50px; padding: 0 14px; }
.trade-workspace .panel-header strong { font-size: 15px; }
.trade-workspace .panel-header > span { font-size: 12px; }
.trade-workspace .chart-panel { grid-column: 1; grid-row: 1; }
.trade-workspace .orderbook-panel { grid-column: 2; grid-row: 1; }
.trade-workspace .order-entry-panel { grid-column: 3; grid-row: 1; }
.trade-workspace .orders-panel { grid-column: 1 / 3; grid-row: 2; }
.trade-workspace .recent-trades-panel { grid-column: 3; grid-row: 2; }
.trade-workspace .chart-header { min-height: 50px; padding: 6px 12px; }
.trade-workspace .chart-header strong { font-size: 15px; }
.trade-workspace #ohlc-line { font-size: 11px; }
.trade-workspace .intervals button,
.trade-workspace .chart-zoom button { min-height: 28px; padding: 4px 7px; font-size: 11px; }
.trade-workspace .chart-wrap { height: calc(100% - 50px); min-height: 0; }
.trade-workspace #market-chart { touch-action: none; cursor: crosshair; }
.trade-workspace #market-chart.price-scale-dragging { cursor: ns-resize !important; }
.trade-workspace .trade-tabs { height: 50px; padding: 5px; }
.trade-workspace .trade-tabs button { font-size: 15px; }
.trade-workspace .wallet-hint { margin: 9px 12px 0; padding: 8px 10px; font-size: 12px; }
.trade-workspace .wallet-hint { display: none; }
.trade-workspace #order-form { display: flex; flex-direction: column; }
.trade-workspace .place-order { flex: none; }
.trade-workspace #order-form { padding: 0 12px 10px; }
.trade-workspace #order-form label { margin-top: 9px; font-size: 13px; }
.trade-workspace .input-shell { min-height: 44px; margin-top: 4px; }
.trade-workspace .input-shell input { padding: 8px 10px; font-size: 17px; }
.trade-workspace .input-shell b { min-width: 58px; padding-right: 10px; font-size: 11px; }
.trade-workspace .percent-row { gap: 5px; margin-top: 7px; }
.trade-workspace .percent-row button { min-height: 31px; font-size: 12px; }
.trade-workspace .place-order { min-height: 43px; margin-top: 10px; font-size: 15px; }
.trade-workspace .settlement-note { margin: 4px 0 0; padding: 0 12px; font-size: 11px; line-height: 1.35; }
.trade-workspace .book-columns,
.trade-workspace .trade-columns { padding: 8px 10px; font-size: 11px; }
.trade-workspace .book { height: calc((100% - 142px) / 2); min-height: 130px; overflow: hidden; }
.trade-workspace .book-row { min-height: 27px; padding: 5px 10px; font-size: 12px; }
.trade-workspace .mid-price { height: 48px; padding: 6px 10px; }
.trade-workspace .mid-price strong { font-size: 17px; }
.trade-workspace .mid-price span { font-size: 10px; }
.trade-workspace .trade-list { height: calc(100% - 80px); overflow: auto; }
.trade-workspace .trade-row { min-height: 29px; padding: 5px 10px; font-size: 12px; }
.trade-workspace .trade-row:hover { padding-left: 13px; }
.trade-workspace .orders-table-wrap { height: calc(100% - 50px); }
.trade-workspace table { font-size: 12px; }
.trade-workspace th,
.trade-workspace td { padding: 7px 10px; white-space: nowrap; }
.trade-workspace .empty-row td { padding: 38px 12px; }

.funds-page { max-width: 1180px; padding-top: 34px; }
.funds-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
}
.funds-heading h1 { margin: 4px 0 6px; font-size: 44px; letter-spacing: -.035em; }
.funds-heading p { margin: 0; color: var(--muted); font-size: 16px; }
.funds-page .connection-guide { margin-top: 20px; }
.funds-workspace,
.funds-history {
  margin-top: 22px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
}
.funds-tabs { display: flex; gap: 6px; padding: 8px; border-bottom: 1px solid var(--line); }
.funds-tabs button {
  min-width: 150px;
  min-height: 46px;
  border: 0;
  border-radius: 9px;
  color: var(--muted);
  background: transparent;
  font: inherit;
  font-size: 16px;
  font-weight: 750;
  cursor: pointer;
}
.funds-tabs button:hover { color: var(--text); background: #181f25; }
.funds-tabs button.active { color: #fff; background: #222b35; }
.funds-action-copy { padding: 22px 24px 0; }
.funds-action-copy > span,
.funds-history > header span { color: #aebeff; font-size: 13px; font-weight: 750; text-transform: uppercase; letter-spacing: .06em; }
.funds-action-copy h2,
.funds-history h2 { margin: 4px 0 6px; font-size: 25px; }
.funds-action-copy p { margin: 0; color: var(--muted); font-size: 15px; }
.funds-page .balance-strip { margin: 0; padding: 18px 24px 24px; }
.funds-page .balance-asset { min-height: 205px; }
.funds-page[data-mode="deposit"] #withdraw-usdt,
.funds-page[data-mode="deposit"] #withdraw-kad,
.funds-page[data-mode="withdraw"] #deposit-usdt,
.funds-page[data-mode="withdraw"] #deposit-kad { display: none; }
.funds-page .balance-asset > div { min-height: 48px; }
.funds-history > header {
  min-height: 82px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px 22px;
  border-bottom: 1px solid var(--line);
}
.funds-history-table { overflow-x: auto; }
.funds-history-table table { width: 100%; }
.funds-history-table th,
.funds-history-table td { padding: 14px 18px; }
.history-asset { display: flex; align-items: center; gap: 9px; font-weight: 700; }
.history-asset img { width: 24px; height: 24px; object-fit: contain; }
.history-amount { font-variant-numeric: tabular-nums; font-weight: 650; }
.funding-direction.deposit { color: var(--green); }
.funding-direction.withdraw { color: #aebeff; }
.history-status {
  display: inline-flex;
  padding: 5px 9px;
  border-radius: 999px;
  color: #d7dde4;
  background: #242c34;
  font-size: 12px;
  font-weight: 750;
}
.history-status.status-credited,
.history-status.status-claimed,
.history-status.status-sent { color: #b8f5df; background: rgba(53, 201, 149, .13); }
.history-status.status-failed { color: #ffc5c8; background: rgba(240, 113, 120, .13); }
.funds-history-table a { color: #aebeff; font-weight: 650; text-decoration: none; }
.funds-history-table a:hover { text-decoration: underline; }
.history-reference,
.history-date { color: var(--muted); }

@media (max-width: 1260px) {
  .trade-workspace .terminal-grid {
    height: auto;
    min-height: 0;
    grid-template-columns: minmax(420px, 1fr) minmax(300px, .7fr);
    grid-template-rows: 470px 560px 260px;
  }
  .trade-workspace .chart-panel { grid-column: 1; grid-row: 1; }
  .trade-workspace .orderbook-panel { grid-column: 2; grid-row: 1; }
  .trade-workspace .order-entry-panel { grid-column: 2; grid-row: 2; }
  .trade-workspace .orders-panel { grid-column: 1; grid-row: 2; }
  .trade-workspace .recent-trades-panel { grid-column: 1 / -1; grid-row: 3; }
  .trade-toolbar .service-status { display: none; }
}

@media (max-width: 820px) {
  .trade-toolbar { align-items: stretch; flex-wrap: wrap; }
  .trade-toolbar-pair { flex: 1; }
  .trade-mini-balances { order: 3; flex-basis: 100%; }
  .trade-mini-balances > span { min-width: 0; flex: 1; border-left: 0; padding-left: 0; }
  .trade-workspace .terminal-grid { display: flex; }
  .trade-workspace .chart-panel { height: 430px; }
  .trade-workspace .order-entry-panel { min-height: 520px; }
  .trade-workspace .orderbook-panel { height: 520px; }
  .trade-workspace .recent-trades-panel { height: 340px; }
  .trade-workspace .orders-panel { min-height: 340px; }
  .funds-heading { align-items: flex-start; }
  .funds-heading h1 { font-size: 36px; }
  .funds-tabs button { min-width: 0; flex: 1; }
  .funds-action-copy,
  .funds-page .balance-strip { padding-left: 16px; padding-right: 16px; }
}
