/* Binance — local trading dashboard prototype */
:root {
  color-scheme: dark;
  --bg: #0b0e11;
  --surface: #11151a;
  --surface-raised: #171c23;
  --surface-hover: #1c222b;
  --surface-input: #1e242d;
  --border: #242b35;
  --border-soft: #1c232c;
  --text: #eef1f5;
  --text-secondary: #b2bcc9;
  --muted: #788493;
  --gold: #f0b90b;
  --gold-hover: #fcd535;
  --gold-soft: rgba(240, 185, 11, 0.11);
  --green: #0ecb81;
  --green-soft: rgba(14, 203, 129, 0.1);
  --red: #f6465d;
  --red-soft: rgba(246, 70, 93, 0.1);
  --radius: 10px;
  --font: Inter, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 118px; }
body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(ellipse 60% 280px at 45% -80px, rgba(240, 185, 11, 0.055), transparent 72%),
    var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 13px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
button, input { font: inherit; }
button, a, input { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: 0.45; }
[hidden] { display: none !important; }
::selection { background: rgba(240, 185, 11, 0.28); color: #fff; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }

.svg-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.icon-small { width: 14px; height: 14px; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 1000;
  transform: translateY(-160%);
  padding: 10px 16px;
  border-radius: 6px;
  background: var(--gold);
  color: #111;
  font-weight: 700;
}
.skip-link:focus { transform: translateY(0); }

/* Top navigation */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  height: 68px;
  display: flex;
  align-items: center;
  gap: 30px;
  padding: 0 26px;
  border-bottom: 1px solid var(--border-soft);
  background: rgba(11, 14, 17, 0.94);
  backdrop-filter: blur(18px);
}
.brand { display: inline-flex; align-items: center; gap: 9px; flex: 0 0 auto; }
.brand-logo { display: block; width: auto; height: 24px; }
.brand-name { font-size: 20px; line-height: 1; font-weight: 800; letter-spacing: 0.075em; }
.brand-tag {
  margin-left: -3px;
  padding: 2px 5px;
  border: 1px solid rgba(240, 185, 11, 0.38);
  border-radius: 4px;
  color: var(--gold);
  font-size: 8px;
  line-height: 1.3;
  font-weight: 800;
  letter-spacing: 0.12em;
}
.primary-nav { display: flex; align-items: stretch; height: 100%; gap: 25px; }
.nav-link {
  position: relative;
  display: flex;
  align-items: center;
  color: var(--text-secondary);
  font-weight: 550;
  white-space: nowrap;
  transition: color 150ms ease;
}
.nav-link:hover, .nav-link.active { color: var(--text); }
.nav-link.active::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  border-radius: 2px 2px 0 0;
  background: var(--gold);
}
.global-search {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 248px;
  height: 36px;
  margin-left: auto;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: var(--surface-raised);
  color: var(--muted);
  transition: border-color 150ms ease, background 150ms ease;
}
.global-search:focus-within { border-color: rgba(240, 185, 11, 0.5); background: var(--surface-input); }
.global-search input, .market-search input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
}
.global-search input::placeholder, .market-search input::placeholder { color: var(--muted); }
.global-search kbd {
  display: grid;
  place-items: center;
  width: 19px;
  height: 20px;
  border: 1px solid #303844;
  border-radius: 4px;
  color: var(--muted);
  font: 11px var(--font);
}
.topbar-actions { display: flex; align-items: center; gap: 9px; flex: 0 0 auto; }
.icon-button {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--text-secondary);
  transition: color 150ms ease, background 150ms ease;
}
.icon-button:hover { background: var(--surface-hover); color: var(--text); }
.icon-button.subtle { width: 28px; height: 28px; color: var(--muted); }
.icon-button.subtle .icon { width: 16px; height: 16px; }
.icon-button.bordered { border: 1px solid var(--border); background: var(--surface); }
.notification-button { position: relative; }
.notification-dot {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 6px;
  height: 6px;
  border: 1.5px solid var(--bg);
  border-radius: 50%;
  background: var(--gold);
}
.wallet-link {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 36px;
  padding: 0 9px;
  border-radius: 6px;
  color: var(--text-secondary);
  font-weight: 550;
}
.wallet-link:hover { background: var(--surface-hover); color: var(--text); }
.avatar-button {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 0 0 4px;
  border: 0;
  background: transparent;
  color: var(--muted);
}
.avatar {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid rgba(240, 185, 11, 0.28);
  border-radius: 50%;
  background: linear-gradient(145deg, #3e3419, #211d13);
  color: #f6d665;
  font-size: 10px;
  font-weight: 750;
}

/* Simulated ticker */
.ticker-bar {
  position: sticky;
  top: 68px;
  z-index: 40;
  display: flex;
  align-items: center;
  height: 35px;
  padding: 0 26px;
  border-bottom: 1px solid var(--border-soft);
  background: rgba(15, 19, 24, 0.96);
  backdrop-filter: blur(14px);
  overflow: hidden;
}
.ticker-track { display: flex; align-items: center; gap: 26px; min-width: 0; overflow: hidden; }
.ticker-item {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  padding: 0;
  border: 0;
  background: none;
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}
.ticker-item:hover strong { color: var(--gold); }
.ticker-item span { color: var(--text-secondary); }
.ticker-item strong { font-weight: 550; transition: color 150ms ease; }
.ticker-item em { font-style: normal; font-weight: 600; }
.market-clock { margin-left: auto; padding-left: 18px; color: var(--muted); font-size: 10px; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* Overview */
#main-content { width: 100%; max-width: 1920px; margin: 0 auto; padding: 25px 26px 0; }
.account-overview { scroll-margin-top: 120px; }
.overview-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 20px; }
.eyebrow { margin: 0 0 5px; color: var(--gold); font-size: 9px; font-weight: 750; letter-spacing: 0.15em; }
.overview-heading h1 { margin: 0; font-size: 24px; line-height: 1.25; letter-spacing: -0.025em; font-weight: 680; }
.heading-subtitle { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.account-actions { display: flex; gap: 8px; }
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 37px;
  padding: 0 15px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 650;
  transition: background 150ms ease, border-color 150ms ease;
}
.button .icon { width: 15px; height: 15px; }
.button-primary { border: 1px solid var(--gold); background: var(--gold); color: #181509; }
.button-primary:hover { border-color: var(--gold-hover); background: var(--gold-hover); }
.button-secondary { border: 1px solid var(--border); background: var(--surface-raised); color: var(--text); }
.button-secondary:hover { border-color: #3a4451; background: var(--surface-hover); }
.verify-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 14px;
  padding: 12px 16px;
  border: 1px solid rgba(240, 185, 11, 0.38);
  border-radius: var(--radius);
  background: linear-gradient(120deg, rgba(240, 185, 11, 0.13), rgba(240, 185, 11, 0.03) 70%), var(--surface);
}
.verify-banner > .icon { flex: 0 0 auto; color: var(--gold); }
.verify-banner p { flex: 1; margin: 0; color: var(--text-secondary); font-size: 11px; }
.verify-banner p strong { color: var(--text); }
.verify-banner .button { flex: 0 0 auto; min-height: 33px; }
.stats-grid { display: grid; grid-template-columns: 1.65fr 1fr; gap: 12px; }
.stat-card {
  position: relative;
  min-width: 0;
  min-height: 132px;
  padding: 16px 18px;
  overflow: hidden;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(255,255,255,0.012), transparent 55%), var(--surface);
}
.portfolio-card { border-color: rgba(240, 185, 11, 0.16); background: linear-gradient(120deg, rgba(240, 185, 11, 0.055), transparent 65%), var(--surface); }
.stat-card-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 23px; }
.stat-label { color: var(--text-secondary); font-size: 11px; font-weight: 520; }
.stat-icon { display: grid; place-items: center; width: 27px; height: 27px; border-radius: 6px; background: var(--gold-soft); color: var(--gold); }
.stat-icon .icon { width: 14px; height: 14px; }
.portfolio-content { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-top: 10px; }
.balance-hint { margin: 0 0 4px; color: var(--muted); font-size: 10px; }
.portfolio-value { font-size: clamp(24px, 2vw, 31px); line-height: 1.2; font-weight: 680; letter-spacing: -0.035em; white-space: nowrap; }
.portfolio-value span, .stat-value span { color: var(--text-secondary); font-size: 12px; font-weight: 550; letter-spacing: 0; }
.portfolio-sparkline { width: 145px; max-width: 38%; height: 48px; overflow: visible; }
.stat-value { margin-top: 13px; font-size: 23px; line-height: 1.2; font-weight: 650; letter-spacing: -0.025em; white-space: nowrap; }
.stat-value .unit { font-size: 12px; }
.stat-footnote { display: flex; align-items: center; gap: 7px; margin: 8px 0 0; color: var(--muted); font-size: 10px; }
.positive { color: var(--green) !important; }
.negative { color: var(--red) !important; }
.stat-value.warning { color: var(--gold); }
.stat-footnote .text-button { padding: 0; font-size: inherit; color: var(--gold); }

/* Shared panels and controls */
.panel {
  min-width: 0;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
}
.panel-header { display: flex; align-items: center; justify-content: space-between; min-height: 51px; padding: 0 16px; border-bottom: 1px solid var(--border-soft); }
.panel-header h2 { margin: 0; font-size: 13px; font-weight: 620; }
.panel-tabs { display: flex; align-items: center; align-self: stretch; gap: 21px; }
.panel-tabs > button {
  position: relative;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 560;
}
.panel-tabs > button:hover, .panel-tabs > button.active { color: var(--text); }
.panel-tabs > button.active::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--gold); }
.panel-tabs h2 { color: inherit; font-size: inherit; }
.tab-count { display: inline-grid; place-items: center; min-width: 18px; height: 17px; padding: 0 4px; border-radius: 4px; background: var(--surface-input); color: var(--text-secondary); font-size: 9px; }
.segmented-tabs { display: flex; align-items: center; }
.segmented-tabs button {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 10px;
  font-weight: 550;
}
.segmented-tabs button.active { color: var(--gold); }
.text-button { padding: 4px 0; border: 0; background: transparent; color: var(--text-secondary); font-size: 10px; }
.text-button:hover { color: var(--gold); }
.tool-button {
  display: inline-grid;
  place-items: center;
  width: 29px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--muted);
}
.tool-button .icon { width: 15px; height: 15px; }
.tool-button:hover { background: var(--surface-hover); color: var(--text); }
.tool-button.active { background: var(--gold-soft); color: var(--gold); }

/* Main terminal grid */
.terminal-grid {
  display: grid;
  grid-template-columns: 232px minmax(420px, 1fr) 286px;
  grid-template-areas: "watch chart book" "watch trade book";
  gap: 12px;
  align-items: stretch;
  margin-top: 16px;
}
.watchlist-panel { grid-area: watch; display: flex; flex-direction: column; min-height: 790px; scroll-margin-top: 118px; }
.chart-panel { grid-area: chart; scroll-margin-top: 118px; }
.orderbook-panel { grid-area: book; display: flex; flex-direction: column; min-height: 790px; }
.trade-panel { grid-area: trade; }

/* Watchlist */
.watchlist-header { min-height: 50px; }
#favorite-filter-shortcut.active { color: var(--gold); background: var(--gold-soft); }
#favorite-filter-shortcut.active .icon { fill: currentColor; }
.watchlist-tabs { gap: 18px; height: 37px; padding: 0 14px; border-bottom: 1px solid var(--border-soft); }
.watchlist-tabs button { height: 100%; padding: 0; }
.watchlist-tabs button:hover { color: var(--text); }
.watchlist-tabs button.active { color: var(--gold); }
.market-search {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 31px;
  margin: 11px 12px 8px;
  padding: 0 9px;
  border: 1px solid transparent;
  border-radius: 5px;
  background: var(--surface-raised);
  color: var(--muted);
}
.market-search:focus-within { border-color: rgba(240, 185, 11, 0.42); }
.market-search .icon { width: 13px; height: 13px; }
.market-search input { font-size: 10px; }
.watchlist-columns { display: grid; grid-template-columns: 1.25fr 0.85fr 0.55fr; gap: 5px; padding: 3px 13px 8px; color: var(--muted); font-size: 9px; }
.watchlist-columns span:nth-child(n+2) { text-align: right; }
.watchlist-rows { display: flex; flex: 1; flex-direction: column; padding: 0 6px 6px; }
.watch-row {
  position: relative;
  display: grid;
  grid-template-columns: 1.25fr 0.85fr 0.55fr;
  align-items: center;
  gap: 5px;
  flex: 1;
  min-height: 49px;
  padding: 4px 7px;
  border-radius: 6px;
  transition: background 140ms ease;
}
.watch-row:hover { background: var(--surface-raised); }
.watch-row.selected { background: var(--gold-soft); }
.watch-row.selected::before { content: ""; position: absolute; left: 0; top: 12px; bottom: 12px; width: 2px; border-radius: 2px; background: var(--gold); }
.watch-market {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
}
.watch-coin-select {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  text-align: left;
}
.watch-coin-select:hover strong { color: var(--gold); }
.favorite-toggle {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 14px;
  height: 25px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #424c59;
}
.favorite-toggle .icon { width: 11px; height: 11px; }
.favorite-toggle:hover, .favorite-toggle.active { color: var(--gold); }
.favorite-toggle.active .icon { fill: currentColor; }
.coin-icon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 25px;
  height: 25px;
  border-radius: 50%;
  background: var(--coin-bg, #28303b);
  color: var(--coin-color, #dce2e9);
  font-size: 11px;
  font-weight: 750;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.06);
}
.coin-icon.large { width: 35px; height: 35px; font-size: 17px; }
.watch-coin { min-width: 0; }
.watch-coin strong { display: block; font-size: 10px; font-weight: 650; }
.watch-coin small { display: block; margin-top: 1px; color: var(--muted); font-size: 8px; }
.watch-price { min-width: 0; text-align: right; font-variant-numeric: tabular-nums; }
.watch-price strong { display: block; font-size: 10px; font-weight: 550; }
.watch-price small { display: block; margin-top: 1px; color: var(--muted); font-size: 8px; }
.watch-spark { display: block; width: 100%; height: 15px; margin-top: 3px; overflow: visible; }
.watch-change { text-align: right; font-size: 9px; font-weight: 600; font-variant-numeric: tabular-nums; }
.watchlist-empty { display: grid; place-items: center; flex: 1; min-height: 180px; padding: 20px; color: var(--muted); font-size: 11px; text-align: center; }

/* Pair and chart */
.pair-header { display: grid; grid-template-columns: auto auto 1fr; align-items: center; gap: 25px; min-height: 79px; padding: 13px 17px; }
.pair-identity { display: flex; align-items: center; gap: 10px; }
.pair-title-row { display: flex; align-items: center; gap: 3px; }
.pair-title-row h2 { margin: 0; font-size: 16px; line-height: 1.2; font-weight: 680; }
.favorite-pair.active { color: var(--gold); }
.favorite-pair.active .icon { fill: currentColor; }
.favorite-pair .icon { width: 13px; height: 13px; }
.pair-subtitle { display: block; margin-top: 4px; color: var(--muted); font-size: 9px; }
.pair-quote { padding-left: 20px; border-left: 1px solid var(--border); }
.pair-price { font-size: 21px; line-height: 1.2; font-weight: 670; letter-spacing: -0.025em; font-variant-numeric: tabular-nums; }
.pair-change { margin-top: 4px; font-size: 10px; font-weight: 620; }
.pair-metrics { display: flex; align-items: center; justify-content: flex-end; gap: clamp(15px, 2.2vw, 32px); }
.pair-metrics > div { display: flex; flex-direction: column; gap: 5px; }
.pair-metrics span { color: var(--muted); font-size: 9px; }
.pair-metrics strong { font-size: 10px; font-weight: 550; font-variant-numeric: tabular-nums; white-space: nowrap; }
.chart-toolbar { display: flex; align-items: center; justify-content: space-between; height: 39px; padding: 0 13px; border-top: 1px solid var(--border-soft); border-bottom: 1px solid var(--border-soft); }
.timeframe-tabs { display: flex; align-items: center; gap: 3px; }
.timeframe-tabs button, .order-type-tabs button {
  min-width: 33px;
  height: 25px;
  padding: 0 8px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--muted);
  font-size: 9px;
  font-weight: 600;
}
.timeframe-tabs button:hover, .order-type-tabs button:hover { color: var(--text); background: var(--surface-hover); }
.timeframe-tabs button.active, .order-type-tabs button.active { background: var(--gold-soft); color: var(--gold); }
.chart-tools { display: flex; align-items: center; gap: 2px; }
.toolbar-divider { width: 1px; height: 15px; margin: 0 5px; background: var(--border); }
.chart-stage { height: 330px; background: #101419; }
.chart-caption { display: flex; align-items: center; justify-content: space-between; height: 30px; padding: 8px 16px 0; color: var(--text-secondary); font-size: 9px; }
.chart-source { color: #596575; font-size: 7px; letter-spacing: 0.11em; }
.chart-source.live { color: var(--green); }
.chart-wrap { position: relative; width: 100%; height: 300px; outline: none; }
.chart-wrap:focus-visible { box-shadow: inset 0 0 0 1px var(--gold); }
#price-chart { display: block; width: 100%; height: 100%; overflow: visible; cursor: crosshair; }
.chart-grid { stroke: #20262e; stroke-width: 1; vector-effect: non-scaling-stroke; }
.chart-axis-label { fill: #697586; font-family: var(--font); font-size: 9px; font-variant-numeric: tabular-nums; }
.chart-crosshair { stroke: #687383; stroke-width: 1; vector-effect: non-scaling-stroke; pointer-events: none; }
.chart-tooltip {
  position: absolute;
  z-index: 5;
  width: 174px;
  padding: 10px 11px;
  border: 1px solid #343d49;
  border-radius: 7px;
  background: rgba(23, 28, 35, 0.97);
  box-shadow: 0 12px 30px rgba(0,0,0,0.36);
  pointer-events: none;
}
.tooltip-time { margin-bottom: 7px; color: var(--muted); font-size: 9px; }
.tooltip-price { display: block; margin-bottom: 7px; color: var(--text); font-size: 15px; font-weight: 650; font-variant-numeric: tabular-nums; }
.tooltip-grid { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; font-size: 9px; font-variant-numeric: tabular-nums; }
.tooltip-grid span { color: var(--muted); }
.tooltip-grid strong { font-weight: 550; }
.chart-table-wrap { height: 300px; padding: 0 12px 12px; overflow: auto; }
.chart-data-table { min-width: 620px; }
.chart-data-table tbody { max-height: 280px; }

/* Order book */
.orderbook-header { padding: 0 12px 0 15px; }
.orderbook-header .panel-tabs { gap: 18px; }
.live-toggle { width: 27px; height: 27px; }
.live-toggle.active { color: var(--green); background: var(--green-soft); }
#orderbook-view { display: flex; flex: 1; flex-direction: column; }
.book-columns { display: grid; grid-template-columns: 1.1fr 0.75fr 0.85fr; gap: 6px; padding: 11px 13px 8px; color: var(--muted); font-size: 8px; }
.book-columns span:nth-child(n+2) { text-align: right; }
.book-rows { display: grid; flex: 1; grid-template-rows: repeat(8, minmax(26px, 1fr)); min-height: 216px; }
.book-row {
  position: relative;
  display: grid;
  grid-template-columns: 1.1fr 0.75fr 0.85fr;
  align-items: center;
  gap: 6px;
  width: 100%;
  min-height: 26px;
  padding: 0 13px;
  border: 0;
  background: transparent;
  font-size: 9px;
  font-variant-numeric: tabular-nums;
  text-align: right;
}
.book-row::before { content: ""; position: absolute; z-index: 0; top: 1px; right: 0; bottom: 1px; width: var(--depth, 0%); background: var(--row-color); transition: width 240ms ease; }
.book-row:hover { background: var(--surface-hover); }
.book-row > span { position: relative; z-index: 1; }
.book-row .book-price { text-align: left; font-weight: 580; }
.book-row .book-amount { color: var(--text-secondary); }
.book-row .book-total { color: var(--muted); }
.book-mid {
  display: grid;
  grid-template-columns: auto auto 1fr;
  align-items: center;
  gap: 7px;
  min-height: 48px;
  margin: 3px 0;
  padding: 4px 13px;
  border: 0;
  border-top: 1px solid var(--border-soft);
  border-bottom: 1px solid var(--border-soft);
  background: var(--surface-raised);
  text-align: left;
}
.book-mid:hover { background: var(--surface-hover); }
.book-mid strong { font-size: 16px; font-weight: 650; font-variant-numeric: tabular-nums; }
.book-mid > span { font-size: 15px; }
.book-mid small { justify-self: end; color: var(--muted); font-size: 8px; }
.book-mid small span { color: var(--text-secondary); }
.book-footer { display: flex; align-items: center; justify-content: center; gap: 18px; min-height: 34px; margin-top: auto; border-top: 1px solid var(--border-soft); color: var(--muted); font-size: 8px; }
.book-footer span { display: flex; align-items: center; gap: 5px; }
.legend-line { display: inline-block; width: 11px; height: 2px; }
.legend-line.ask { background: var(--red); }
.legend-line.bid { background: var(--green); }
.trades-view { flex: 1; }
.recent-trades { padding: 0 13px; }
.trade-row { display: grid; grid-template-columns: 1.1fr 0.75fr 0.85fr; gap: 6px; padding: 9px 0; border-bottom: 1px solid rgba(36,43,53,0.48); font-size: 9px; font-variant-numeric: tabular-nums; }
.trade-row span:nth-child(2) { color: var(--text-secondary); text-align: right; }
.trade-row time { color: var(--muted); text-align: right; }

/* Trading forms */
.trade-header { min-height: 46px; }
.trade-title-wrap { display: flex; align-items: center; gap: 8px; }
.mini-badge { display: inline-flex; align-items: center; padding: 2px 5px; border-radius: 4px; background: var(--surface-input); color: var(--muted); font-size: 8px; font-weight: 550; }
.order-type-tabs { display: flex; gap: 2px; }
.order-type-tabs button { min-width: auto; height: 24px; padding: 0 9px; }
.trade-forms { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.trade-form { min-width: 0; padding: 14px 16px 12px; }
.trade-form + .trade-form { border-left: 1px solid var(--border-soft); }
.trade-form-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.trade-form-heading h3 { display: flex; align-items: center; gap: 6px; margin: 0; font-size: 11px; font-weight: 650; }
.side-dot { width: 5px; height: 5px; border-radius: 50%; }
.side-dot.buy { background: var(--green); }
.side-dot.sell { background: var(--red); }
.trade-form-heading > span { color: var(--muted); font-size: 8px; white-space: nowrap; }
.trade-form-heading strong { color: var(--text-secondary); font-weight: 550; font-variant-numeric: tabular-nums; }
.field-label { display: block; margin: 7px 0 4px; color: var(--muted); font-size: 8px; }
.input-shell { display: flex; align-items: center; height: 33px; border: 1px solid #2a323e; border-radius: 5px; background: var(--surface-input); transition: border-color 150ms ease; }
.input-shell:focus-within { border-color: var(--gold); }
.input-shell input { width: 100%; min-width: 0; height: 100%; padding: 0 10px; border: 0; outline: 0; background: transparent; color: var(--text); font-size: 10px; font-variant-numeric: tabular-nums; }
.input-shell input::-webkit-inner-spin-button, .input-shell input::-webkit-outer-spin-button { margin: 0; appearance: none; }
.input-shell input[type=number] { appearance: textfield; }
.input-shell > span { padding-right: 10px; color: var(--text-secondary); font-size: 9px; }
.percent-slider { width: 100%; height: 14px; margin: 12px 0 0; appearance: none; background: transparent; cursor: pointer; --range-progress: 0%; }
.percent-slider::-webkit-slider-runnable-track { height: 3px; border-radius: 3px; background: linear-gradient(to right, var(--gold) 0 var(--range-progress), #343c47 var(--range-progress) 100%); }
.percent-slider::-moz-range-track { height: 3px; border-radius: 3px; background: #343c47; }
.percent-slider::-moz-range-progress { height: 3px; border-radius: 3px; background: var(--gold); }
.percent-slider::-webkit-slider-thumb { width: 11px; height: 11px; margin-top: -4px; appearance: none; border: 2px solid var(--surface); border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 1px var(--gold); }
.percent-slider::-moz-range-thumb { width: 9px; height: 9px; border: 2px solid var(--surface); border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 1px var(--gold); }
.range-labels { display: flex; justify-content: space-between; margin-top: 0; color: #657181; font-size: 7px; }
.order-total { display: flex; align-items: center; justify-content: space-between; margin: 11px 0 9px; color: var(--muted); font-size: 9px; }
.order-total output { color: var(--text); font-weight: 550; font-variant-numeric: tabular-nums; }
.trade-submit { display: flex; align-items: center; justify-content: center; gap: 5px; width: 100%; height: 34px; border: 0; border-radius: 5px; color: #07130e; font-size: 10px; font-weight: 700; transition: filter 150ms ease, transform 100ms ease; }
.trade-submit:hover { filter: brightness(1.08); }
.trade-submit:active { transform: translateY(1px); }
.trade-submit.buy { background: var(--green); }
.trade-submit.sell { background: var(--red); color: #fff; }
.trade-submit .icon { width: 13px; height: 13px; }
.market-order-note { border-color: #34312a; background: rgba(240,185,11,0.04); }
.market-order-note input { color: var(--muted); }

/* Orders and tables */
.orders-panel { margin-top: 12px; scroll-margin-top: 118px; }
.orders-header { min-height: 49px; }
.orders-table-wrap { width: 100%; overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 10px; font-variant-numeric: tabular-nums; text-align: left; }
.data-table th { height: 34px; padding: 0 16px; border-bottom: 1px solid var(--border-soft); color: var(--muted); font-size: 8px; font-weight: 520; white-space: nowrap; }
.data-table td { height: 43px; padding: 0 16px; border-bottom: 1px solid rgba(36,43,53,0.52); color: var(--text-secondary); white-space: nowrap; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover { background: rgba(255,255,255,0.012); }
.data-table td strong { color: var(--text); font-weight: 560; }
.data-table td.numeric, .data-table th.numeric { text-align: right; }
.table-pair { display: flex; align-items: center; gap: 7px; }
.table-pair .coin-icon { width: 20px; height: 20px; font-size: 8px; }
.side-label { display: inline-flex; align-items: center; gap: 5px; font-weight: 600; }
.side-label::before { content: ""; width: 4px; height: 4px; border-radius: 50%; background: currentColor; }
.status-label { display: inline-flex; align-items: center; gap: 5px; padding: 3px 6px; border-radius: 4px; background: var(--gold-soft); color: #e6c34f; font-size: 8px; }
.status-label.filled { background: var(--green-soft); color: var(--green); }
.status-label.cancelled { background: rgba(120,132,147,0.1); color: var(--muted); }
.cancel-order { padding: 4px 7px; border: 1px solid var(--border); border-radius: 4px; background: transparent; color: var(--text-secondary); font-size: 8px; }
.cancel-order:hover { border-color: var(--red); color: var(--red); }
.empty-orders { padding: 30px !important; color: var(--muted) !important; text-align: center; }
.asset-name { display: flex; align-items: center; gap: 8px; }
.asset-allocation { display: flex; align-items: center; gap: 8px; }
.allocation-track { width: 80px; height: 4px; border-radius: 4px; background: #2a313a; overflow: hidden; }
.allocation-track i { display: block; height: 100%; border-radius: 4px; background: var(--gold); }

/* Footer, popovers, notifications */
.page-footer { display: flex; align-items: center; gap: 20px; min-height: 74px; color: var(--muted); font-size: 9px; }
.footer-brand { display: flex; align-items: center; gap: 7px; color: var(--text-secondary); font-size: 10px; letter-spacing: 0.06em; }
.footer-brand strong { color: var(--gold); font-size: 7px; }
.footer-logo { display: block; width: auto; height: 15px; }
.page-footer p { margin: 0; }
.page-footer > span:last-child { margin-left: auto; }
.popover {
  position: fixed;
  top: 60px;
  right: 22px;
  z-index: 100;
  width: 320px;
  border: 1px solid #303844;
  border-radius: 9px;
  background: #171c23;
  box-shadow: 0 20px 55px rgba(0,0,0,0.48);
  animation: popover-in 140ms ease-out;
}
@keyframes popover-in { from { opacity: 0; transform: translateY(-5px); } to { opacity: 1; transform: translateY(0); } }
.popover-header { display: flex; align-items: center; justify-content: space-between; padding: 14px 15px; border-bottom: 1px solid var(--border); }
.notification-item { display: flex; gap: 10px; padding: 13px 15px; border-bottom: 1px solid var(--border-soft); }
.notification-icon { display: grid; place-items: center; flex: 0 0 auto; width: 29px; height: 29px; border-radius: 50%; background: var(--gold-soft); color: var(--gold); }
.notification-icon.success { background: var(--green-soft); color: var(--green); }
.notification-icon.warning { background: var(--gold-soft); color: var(--gold); }
.notification-icon .icon { width: 14px; height: 14px; }
.notification-item strong { font-size: 10px; font-weight: 600; }
.notification-item p { margin: 3px 0; color: var(--text-secondary); font-size: 9px; }
.notification-item small { color: var(--muted); font-size: 8px; }
.profile-popover { width: 245px; padding: 8px; }
.profile-summary { display: flex; align-items: center; gap: 10px; padding: 8px; }
.large-avatar { width: 37px; height: 37px; }
.profile-summary strong { display: block; font-size: 11px; }
.profile-summary span:not(.avatar) { display: block; margin-top: 2px; color: var(--muted); font-size: 9px; }
.verify-label { display: flex; align-items: center; gap: 5px; margin: 3px 8px 9px; padding: 7px 8px; border-radius: 5px; background: var(--gold-soft); color: var(--gold); font-size: 8px; }
.verify-label .icon { width: 11px; height: 11px; }
.profile-popover > button { display: flex; align-items: center; gap: 9px; width: 100%; padding: 10px 8px; border: 0; border-radius: 5px; background: transparent; color: var(--text-secondary); font-size: 10px; text-align: left; }
.profile-popover > button:hover { background: var(--surface-hover); color: var(--text); }
.profile-popover > button .icon { width: 14px; height: 14px; }
.toast-region { position: fixed; right: 24px; bottom: 24px; z-index: 200; display: flex; flex-direction: column; gap: 8px; width: min(340px, calc(100vw - 32px)); }
.toast { display: flex; align-items: flex-start; gap: 10px; padding: 13px 14px; border: 1px solid #38414d; border-left: 3px solid var(--gold); border-radius: 8px; background: #1a2028; box-shadow: 0 15px 45px rgba(0,0,0,0.45); animation: toast-in 180ms ease-out; }
.toast.success { border-left-color: var(--green); }
.toast.error { border-left-color: var(--red); }
.toast .icon { width: 16px; height: 16px; margin-top: 1px; color: var(--gold); }
.toast.success .icon { color: var(--green); }
.toast.error .icon { color: var(--red); }
.toast strong { display: block; margin-bottom: 2px; font-size: 10px; }
.toast p { margin: 0; color: var(--text-secondary); font-size: 9px; }
.toast.removing { opacity: 0; transform: translateX(10px); transition: opacity 180ms ease, transform 180ms ease; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* Responsive layouts */
@media (max-width: 1450px) {
  .topbar { gap: 22px; padding: 0 20px; }
  .primary-nav { gap: 19px; }
  .global-search { width: 210px; }
  #main-content { padding-right: 20px; padding-left: 20px; }
  .ticker-bar { padding: 0 20px; }
  .terminal-grid { grid-template-columns: 215px minmax(390px, 1fr) 266px; }
  .pair-header { gap: 18px; }
  .pair-metrics { gap: 17px; }
  .portfolio-sparkline { width: 120px; }
  .trade-form { padding-right: 13px; padding-left: 13px; }
}
@media (max-width: 1250px) {
  .brand-tag { display: none; }
  .global-search { display: none; }
  .topbar-actions { margin-left: auto; }
  .terminal-grid { grid-template-columns: 205px minmax(365px, 1fr) 252px; }
  .pair-metrics > div:last-child { display: none; }
  .pair-header { gap: 15px; }
  .pair-quote { padding-left: 15px; }
  .stats-grid { grid-template-columns: 1.5fr 1fr; }
  .stat-card { padding: 14px; }
  .portfolio-sparkline { display: none; }
  .trade-form-heading { align-items: flex-start; flex-direction: column; gap: 4px; }
}
@media (max-width: 1080px) {
  .primary-nav { gap: 15px; }
  .terminal-grid { grid-template-columns: 215px minmax(0, 1fr); grid-template-areas: "watch chart" "watch trade" "book book"; }
  .watchlist-panel { min-height: 790px; }
  .orderbook-panel { min-height: 610px; }
  .book-rows { min-height: 220px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .portfolio-card { grid-column: span 2; min-height: 120px; }
  .verify-card { grid-column: span 2; min-height: auto; }
  .portfolio-sparkline { display: block; width: 180px; }
  .portfolio-content { align-items: center; }
  .ticker-track { gap: 19px; }
}
@media (max-width: 820px) {
  .topbar { gap: 16px; }
  .primary-nav { display: none; }
  .overview-heading h1 { font-size: 21px; }
  .heading-subtitle { font-size: 11px; }
  .terminal-grid { grid-template-columns: minmax(0, 1fr); grid-template-areas: "chart" "trade" "watch" "book"; }
  .watchlist-panel, .orderbook-panel { min-height: auto; }
  .watchlist-rows { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px; }
  .watch-row { min-height: 53px; }
  .orderbook-panel { min-height: 600px; }
  .trade-form-heading { align-items: center; flex-direction: row; }
  .market-clock { display: none; }
  .ticker-track::after { content: ""; }
  .page-footer { flex-wrap: wrap; gap: 8px 15px; padding: 20px 0; }
  .page-footer p { order: 3; width: 100%; }
}
@media (max-width: 600px) {
  html { scroll-padding-top: 104px; }
  .topbar { height: 59px; padding: 0 13px; }
  .brand { gap: 7px; }
  .brand-logo { height: 20px; }
  .topbar-actions { gap: 3px; }
  .wallet-link { padding: 0 6px; }
  .wallet-link span { display: none; }
  .avatar-button > .icon { display: none; }
  .avatar { width: 29px; height: 29px; }
  .ticker-bar { top: 59px; height: 32px; padding: 0 13px; }
  .ticker-track { gap: 22px; }
  #main-content { padding: 18px 12px 0; }
  .overview-heading { align-items: flex-start; flex-direction: column; margin-bottom: 16px; }
  .account-actions { width: 100%; }
  .account-actions .button { flex: 1; }
  .verify-banner { flex-wrap: wrap; }
  .verify-banner .button { width: 100%; }
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .portfolio-card { grid-column: span 2; }
  .stat-card { min-height: 125px; padding: 13px; }
  .portfolio-sparkline { width: 115px; }
  .portfolio-value { font-size: 26px; }
  .stat-value { font-size: 19px; }
  .stat-value span { font-size: 10px; }
  .balance-split { align-items: flex-start; flex-direction: column; gap: 2px; }
  .terminal-grid { gap: 10px; margin-top: 10px; }
  .pair-header { grid-template-columns: 1fr auto; gap: 13px; padding: 13px; }
  .pair-metrics { grid-column: 1 / -1; justify-content: flex-start; gap: 35px; padding-top: 10px; border-top: 1px solid var(--border-soft); }
  .pair-metrics > div:last-child { display: flex; }
  .pair-quote { padding-left: 0; border-left: 0; text-align: right; }
  .pair-price { font-size: 19px; }
  .chart-toolbar { padding: 0 8px; }
  .timeframe-tabs button { min-width: 29px; padding: 0 6px; }
  .chart-tools { gap: 0; }
  .toolbar-divider { margin: 0 2px; }
  .chart-stage { height: 311px; }
  .chart-wrap, .chart-table-wrap { height: 281px; }
  .chart-caption { padding-right: 12px; padding-left: 12px; }
  .chart-source { display: none; }
  .trade-forms { grid-template-columns: 1fr; }
  .trade-form + .trade-form { border-top: 1px solid var(--border-soft); border-left: 0; }
  .trade-form { padding: 15px; }
  .trade-form-heading { margin-bottom: 12px; }
  .field-label { font-size: 9px; }
  .input-shell { height: 38px; }
  .input-shell input { font-size: 12px; }
  .trade-submit { height: 39px; font-size: 11px; }
  .watchlist-rows { grid-template-columns: 1fr; }
  .watch-row { min-height: 51px; }
  .orders-header { align-items: flex-start; flex-direction: column; gap: 8px; padding: 12px 14px; }
  .orders-header .panel-tabs { width: 100%; min-height: 28px; gap: 15px; overflow-x: auto; }
  .orders-header .panel-tabs > button { flex: 0 0 auto; padding-bottom: 8px; }
  .orders-header > .text-button { align-self: flex-end; }
  .orders-table { min-width: 850px; }
  .popover { top: 53px; right: 12px; width: min(320px, calc(100vw - 24px)); }
  .profile-popover { width: 245px; }
  .toast-region { right: 16px; bottom: 16px; }
  .page-footer > span:last-child { margin-left: auto; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
