/* Crytex trading terminal design system. Loaded after the legacy component CSS. */
@font-face {
  font-family: "Avenir Next LT Pro";
  src: url("/font/AvenirNextLTPro-Regular.woff2") format("woff2"),
       url("/font/AvenirNextLTPro-Regular.woff") format("woff");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Avenir Next LT Pro";
  src: url("/font/AvenirNextLTPro-Medium.woff2") format("woff2"),
       url("/font/AvenirNextLTPro-Medium.woff") format("woff");
  font-style: normal;
  font-weight: 500;
  font-display: swap;
}

@font-face {
  font-family: "Avenir Next LT Pro";
  src: url("/font/AvenirNextLTPro-Demi.woff2") format("woff2"),
       url("/font/AvenirNextLTPro-Demi.woff") format("woff");
  font-style: normal;
  font-weight: 600;
  font-display: swap;
}

html:root {
  --bg0: #0c0f14;
  --bg1: #11151b;
  --bg2: #151a22;
  --bg3: #1a2029;
  --bg4: #202733;
  --bg5: #293241;
  --b1: #202630;
  --b2: #2a323e;
  --b3: #394453;
  --tx1: #edf1f7;
  --tx2: #aab2bf;
  --tx3: #6f7887;
  --g1: #18a979;
  --g2: rgba(24, 169, 121, .11);
  --r1: #df5b67;
  --r2: rgba(223, 91, 103, .11);
  --bl: #4f8cff;
  --bl2: #73a4ff;
  --yl: #d5a94e;
  --pu: #9888d8;
  --mono: "Avenir Next LT Pro", "Segoe UI", sans-serif;
  --sans: "Avenir Next LT Pro", "Segoe UI", sans-serif;
  --radius-sm: 4px;
  --radius-md: 7px;
  --radius-lg: 10px;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --header-h: 58px;
}

html[data-theme="light"] {
  --bg0: #f3f5f8;
  --bg1: #ffffff;
  --bg2: #f8f9fb;
  --bg3: #f0f2f5;
  --bg4: #e8ebf0;
  --bg5: #dfe3e9;
  --b1: #e4e7ec;
  --b2: #d6dbe3;
  --b3: #c3cad5;
  --tx1: #1b222d;
  --tx2: #515b69;
  --tx3: #7c8694;
  --g1: #087f5b;
  --g2: rgba(8, 127, 91, .09);
  --r1: #c53d4c;
  --r2: rgba(197, 61, 76, .09);
  --bl: #2563d9;
  --bl2: #1f5ac9;
}

html,
body {
  background: var(--bg0);
  color: var(--tx1);
  font-family: var(--sans);
  letter-spacing: 0;
}

html body,
html body * {
  font-family: "Avenir Next LT Pro", "Segoe UI", sans-serif !important;
}

html body *::before,
html body *::after {
  font-family: inherit;
}

html body h1,
html body h2,
html body h3,
html body h4,
html body h5,
html body h6,
html body b,
html body strong {
  font-weight: 600 !important;
}

body::before,
body::after {
  display: none;
  content: none;
}

button,
input,
select {
  font: inherit;
}

button:focus-visible,
[role="button"]:focus-visible,
input:focus-visible,
select:focus-visible,
a:focus-visible {
  outline: 2px solid var(--bl);
  outline-offset: 2px;
}

/* Exchange header */
.topbar {
  min-height: var(--header-h);
  height: var(--header-h);
  padding: 0 18px;
  gap: 14px;
  background: var(--bg1);
  border-bottom: 1px solid var(--b2);
  box-shadow: none;
}

.logo {
  display: flex;
  align-items: center;
  width: 132px;
  min-width: 132px;
  height: 100%;
  margin: 0 4px 0 0;
}

.logo img {
  display: block;
  width: 124px;
  height: auto !important;
  max-height: 46px;
  object-fit: contain;
}

.desktop-nav {
  display: flex;
  align-items: center;
  align-self: stretch;
  gap: 7px;
  margin-right: 8px;
}

.desktop-nav a,
.desktop-nav button {
  position: relative;
  display: flex;
  align-items: center;
  gap: 7px;
  height: 38px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: #a8b2c2;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color .16s ease, color .16s ease;
}

.desktop-nav a:hover,
.desktop-nav button:hover,
.desktop-nav a.active {
  color: var(--tx1);
  background: var(--bg3);
  border-color: var(--b1);
}

.desktop-nav a.active::after {
  position: absolute;
  right: 11px;
  bottom: 0;
  left: 11px;
  height: 2px;
  background: var(--bl);
  content: "";
}

.desktop-nav .nav-development {
  color: #909daf;
}

.desktop-nav .nav-development:hover {
  color: #c4ccd7;
}

.nav-status {
  display: inline-flex;
  align-items: center;
  height: 17px;
  padding: 0 6px;
  border: 1px solid #354154;
  border-radius: 999px;
  background: #171d27;
  color: #8795a9;
  font-size: 8px;
  font-weight: 600;
  letter-spacing: .055em;
  line-height: 1;
  text-transform: uppercase;
}

.nav-development:hover .nav-status {
  border-color: #4c6f9f;
  background: #182536;
  color: #8bb7ff;
}

.pair-pill {
  gap: 7px;
  padding: 5px 9px;
  border: 1px solid var(--b2);
  border-radius: var(--radius-md);
  background: var(--bg0);
  box-shadow: none;
}

.pair-pill:hover,
.pair-pill.open {
  border-color: var(--b3);
  background: var(--bg3);
  box-shadow: none;
}

.pair-tag {
  border: 1px solid var(--b2);
  border-radius: 3px;
  background: var(--bg4);
  color: var(--tx3);
}

.stats-row {
  gap: 0;
  margin-left: 2px;
}

.stats-row .st {
  min-width: 78px;
  padding: 0 clamp(8px, .85vw, 15px);
}

.stats-row .st:first-child {
  min-width: 116px;
  padding-left: 2px;
}

.stats-row .st + .st {
  border-left: 1px solid var(--b1);
}

.st-l,
.tb-bal-lbl {
  color: var(--tx3);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: .02em;
  text-transform: none;
}

.st-v,
.tb-bal-val,
.big-p,
.tk-p,
.cd-pr,
.cd-vl,
.cd-ch,
.ohlcv,
.ob-row,
.rt-row,
.tp-sum-val,
.tp-sum-v {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}

.big-p {
  font-size: clamp(14px, 1.05vw, 18px);
  letter-spacing: -.02em;
  text-shadow: none;
}

.market-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--g1);
}

.market-status::before {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  content: "";
}

.indicative-status {
  color: var(--yl);
}

.nav-r {
  gap: 6px;
}

.nb,
.nb-icon {
  border: 1px solid var(--b2);
  border-radius: var(--radius-md);
  background: var(--bg2);
  box-shadow: none;
  color: var(--tx2);
}

a.nb {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.nb-icon {
  width: 30px;
  height: 30px;
}

.nb-icon svg {
  width: 15px;
  height: 15px;
  stroke-width: 1.7;
}

.nb:hover,
.nb-icon:hover {
  border-color: var(--b3);
  background: var(--bg3);
  color: var(--tx1);
}

.nb-primary {
  border-color: var(--bl);
  background: var(--bl);
  color: #fff;
}

.nb-primary:hover {
  border-color: var(--bl2);
  background: var(--bl2);
  box-shadow: none;
  filter: none;
}

.tb-bal-wrap,
#priceSrc {
  border-color: var(--b2) !important;
  border-radius: var(--radius-md) !important;
  background: var(--bg2) !important;
}

/* Ticker and market selector */
.ticker {
  height: 28px;
  background: #0a0d12;
  border-bottom: 1px solid var(--b1);
}

.ticker-track {
  animation: ticker-scroll 460s linear infinite;
  transform: translate3d(0, 0, 0);
  backface-visibility: hidden;
  will-change: transform;
}

.ticker-track:hover {
  animation-play-state: running;
}

@keyframes ticker-scroll {
  from { transform: translate3d(0, 0, 0); }
  to { transform: translate3d(-50%, 0, 0); }
}

.tk-item {
  height: 28px;
  width: 136px;
  min-width: 136px;
  max-width: 136px;
  box-sizing: border-box;
  padding: 0 10px;
  overflow: hidden;
  border-color: var(--b1);
}

.tk-sym {
  flex: 0 0 auto;
}

.tk-p {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.tk-c {
  flex: 0 0 39px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.tk-item:hover {
  background: var(--bg2);
}

.cdrop {
  top: var(--header-h);
  left: 164px;
  width: min(560px, calc(100vw - 24px));
  border: 1px solid var(--b3);
  border-radius: var(--radius-lg);
  background: var(--bg1);
  box-shadow: 0 18px 48px rgba(0, 0, 0, .38);
}

.cd-search,
.cd-filter {
  border-color: var(--b1);
  background: var(--bg1);
}

.cd-search {
  position: relative;
}

.cd-search::before {
  position: absolute;
  top: 50%;
  left: 20px;
  width: 13px;
  height: 13px;
  border: 1.5px solid var(--tx3);
  border-radius: 50%;
  content: "";
  transform: translateY(-60%);
  pointer-events: none;
}

.cd-search::after {
  position: absolute;
  top: 24px;
  left: 31px;
  width: 5px;
  height: 1.5px;
  background: var(--tx3);
  content: "";
  transform: rotate(45deg);
  pointer-events: none;
}

.cd-search input {
  padding: 8px 11px 8px 32px;
  border: 1px solid var(--b2);
  border-radius: var(--radius-md);
  background: var(--bg0);
  color: var(--tx1);
}

.cd-search input:focus {
  border-color: var(--bl);
}

.cf {
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  color: var(--tx3);
}

.cf:hover,
.cf.on {
  border-color: var(--b2);
  background: var(--bg3);
  color: var(--tx1);
}

.cd-head,
.cd-row {
  grid-template-columns: minmax(155px, 1fr) 86px 62px 66px 66px 26px !important;
}

.cd-head {
  padding: 6px 12px;
  border-color: var(--b1);
  background: var(--bg0);
  color: var(--tx3);
}

.cd-row {
  min-height: 45px;
  padding: 6px 12px;
}

.cd-row:hover,
.cd-row.sel {
  background: var(--bg2);
}

.cd-row.sel {
  border-left: 2px solid var(--bl);
}

.cd-fav {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 0;
  background: transparent;
  color: var(--tx3);
  cursor: pointer;
}

.cd-fav:hover,
.cd-fav.on {
  color: var(--yl);
}

.cd-fav svg {
  width: 14px;
  height: 14px;
}

.cd-market-status {
  color: var(--g1);
  font-size: 9px;
  text-align: right;
}

.cd-empty {
  padding: 32px 16px;
  color: var(--tx3);
  text-align: center;
}

/* Terminal surfaces */
.body,
.chart-sec,
.ob-sec,
.tp-sec,
.btm,
.rt-sec {
  background: var(--bg1);
}

.body {
  gap: 1px;
  background: var(--b1);
}

.body > * {
  border-color: transparent !important;
}

.chart-sec,
.ob-sec,
.tp-sec {
  border-color: var(--b1);
}

.chart-bar,
.ohlcbar,
.sec-hdr,
.rt-hdr,
.tp-tabs,
.tp-ot-row,
.btm-tabs {
  border-color: var(--b1);
  background: var(--bg2);
  box-shadow: none;
}

.sec-title,
.rt-title {
  color: var(--tx2);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .025em;
}

.chart-bar {
  height: 38px;
  padding: 0 9px;
  overflow-x: auto;
  scrollbar-width: none;
}

.chart-bar::-webkit-scrollbar {
  display: none;
}

.chart-modes {
  display: flex;
  align-items: center;
  gap: 2px;
  height: 100%;
  padding-right: 6px;
  border-right: 1px solid var(--b1);
}

.chart-mode {
  height: 26px;
  padding: 0 8px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--tx3);
  cursor: pointer;
  white-space: nowrap;
}

.chart-mode:hover,
.chart-mode.on {
  background: var(--bg4);
  color: var(--tx1);
}

.chart-mode.on {
  box-shadow: inset 0 -2px var(--bl);
}

.terminal-depth-chart {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  padding: 16px 18px 10px;
  background: var(--bg0);
}

.terminal-depth-title {
  color: var(--tx2);
  font-size: 11px;
  font-weight: 600;
}

.terminal-depth-chart svg {
  flex: 1;
  width: 100%;
  min-height: 180px;
}

.terminal-depth-legend {
  display: flex;
  justify-content: center;
  gap: 24px;
  font-size: 10px;
}

.terminal-depth-legend .up {
  color: var(--g1);
}

.terminal-depth-legend .dn {
  color: var(--r1);
}

.ctb,
.tfb,
.ibb,
.dtb {
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  box-shadow: none;
  color: var(--tx3);
  text-shadow: none;
}

.ctb:hover,
.tfb:hover,
.ibb:hover,
.dtb:hover,
.ctb.on,
.tfb.on,
.ibb.on,
.dtb.on {
  border-color: var(--b2);
  background: var(--bg3);
  color: var(--tx1);
}

.tfb.on,
.ibb.on {
  color: var(--bl2);
}

.ctb svg,
.ibb svg {
  width: 14px;
  height: 14px;
}

.ohlcbar {
  height: 26px;
  background: var(--bg0);
}

.tv-wrap,
.chart-inner,
#tradingview_widget {
  background: var(--bg0);
}

.draw-toolbar {
  display: none;
}

.dtb[title]:hover::after {
  border: 1px solid var(--b3);
  border-radius: var(--radius-sm);
  background: var(--bg3);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .32);
}

/* Order book and trades */
.ob-sec {
  width: clamp(220px, 16vw, 286px);
}

.sec-hdr,
.rt-hdr {
  height: 36px;
}

.ob-toolbar {
  display: flex;
  align-items: center;
  gap: 5px;
}

.ob-select {
  height: 24px;
  padding: 0 5px;
  border: 1px solid var(--b2);
  border-radius: var(--radius-sm);
  background: var(--bg1);
  color: var(--tx2);
  font-size: 10px;
}

.ob-vb {
  border-radius: var(--radius-sm);
}

.ob-vb:hover,
.ob-vb.on {
  background: var(--bg4);
  color: var(--tx1);
}

.ob-cols,
.rt-cols {
  padding-top: 5px;
  padding-bottom: 5px;
  border-color: var(--b1);
  background: var(--bg0);
  color: var(--tx3);
  letter-spacing: 0;
  text-transform: none;
}

.ob-row,
.rt-row {
  min-height: 20px;
  line-height: 1.45;
}

.ob-row:hover,
.rt-row:hover {
  background: var(--bg3);
}

.ob-row.ask .bg {
  background: var(--r2);
}

.ob-row.bid .bg {
  background: var(--g2);
}

.ob-sec[data-view="asks"] .ob-bids,
.ob-sec[data-view="asks"] .ob-tab,
.ob-sec[data-view="bids"] .ob-asks,
.ob-sec[data-view="bids"] .ob-tab {
  display: none;
}

.ob-sec[data-view="asks"] .ob-asks,
.ob-sec[data-view="bids"] .ob-bids {
  flex: 1;
  overflow-y: auto;
}

.ob-sec[data-view="compact"] .ob-row {
  min-height: 16px;
  padding-top: 0;
  padding-bottom: 0;
  font-size: 9.5px;
}

.ob-mid {
  padding: 7px 8px;
  border-color: var(--b2);
  background: var(--bg2);
}

.ob-midp {
  font-size: 14px;
  text-shadow: none;
}

.ob-spread-pct {
  border-color: var(--b2);
  background: var(--bg3);
  color: var(--tx2);
}

.rt-dot {
  box-shadow: none;
  animation: none;
}

/* Trade ticket */
.tp-sec {
  width: clamp(280px, 20vw, 340px);
}

.tp-tab,
.tp-ot,
.btt,
.ob-tab {
  color: var(--tx3);
}

.tp-tab:hover,
.tp-tab.on,
.tp-ot:hover,
.tp-ot.on,
.btt:hover,
.btt.on,
.ob-tab:hover,
.ob-tab.on {
  color: var(--tx1);
}

.tp-tab.on,
.tp-ot.on,
.btt.on,
.ob-tab.on {
  border-bottom-color: var(--bl);
}

.tp-tab-long.on {
  color: var(--g1);
  border-bottom-color: var(--g1);
}

.tp-tab-short.on {
  color: var(--r1);
  border-bottom-color: var(--r1);
}

.tp-body {
  gap: 9px;
  padding: 10px 12px;
}

.tp-field,
.tp-pool-btn,
.tp-bal-badge,
.tp-cross-btn,
.tp-lev-btn,
.tp-sum,
.tp-exec,
#pnlCalcWrap,
.sw-box,
.sw-info-box {
  border-color: var(--b2) !important;
  border-radius: var(--radius-md) !important;
  background: var(--bg2) !important;
  box-shadow: none !important;
}

.tp-field:hover,
.tp-field.focus,
.sw-box:hover {
  border-color: var(--b3) !important;
  background: var(--bg3) !important;
  box-shadow: none !important;
}

.tp-field:focus-within {
  border-color: color-mix(in srgb, var(--bl) 58%, var(--b3)) !important;
  background: var(--bg0) !important;
}

.tp-field-input,
.sw-amount input,
#pnlCalcWrap input {
  color: var(--tx1) !important;
  font-family: var(--mono) !important;
  font-variant-numeric: tabular-nums;
}

.tp-sum-cell,
.tp-sum-rows,
.tp-exec-body {
  border-color: var(--b1);
}

.tp-submit,
.lev-ok,
.sw-submit {
  min-height: 38px;
  border: 0;
  border-radius: var(--radius-md);
  box-shadow: none;
  font-weight: 600;
  text-shadow: none;
}

.tp-submit.sub-long {
  background: var(--g1);
  color: #fff;
}

.tp-submit.sub-short {
  background: var(--r1);
  color: #fff;
}

.tp-submit.auth-required {
  border: 1px solid var(--b3);
  background: var(--bg4);
  color: var(--tx1);
}

.tp-trust,
.tp-about {
  display: none;
}

.tp-footer {
  border-color: var(--b1);
  background: var(--bg1);
}

.tp-footer-main {
  padding: 10px 12px;
}

.field-error {
  border-color: var(--r1) !important;
}

.trade-validation {
  min-height: 16px;
  color: var(--r1);
  font-size: 10px;
  line-height: 1.4;
}

/* Orders table states */
.btm {
  height: clamp(160px, 18vh, 220px);
}

.btm-tabs {
  min-height: 36px;
  padding: 0 10px;
  overflow-x: auto;
  scrollbar-width: none;
}

.btm-tabs::-webkit-scrollbar {
  display: none;
}

.btt {
  align-items: center;
  min-height: 36px;
  padding: 0 10px;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  background: transparent;
  white-space: nowrap;
}

.btm-body {
  display: block;
  overflow: auto;
  background: var(--bg1);
}

.orders-empty,
.orders-error,
.orders-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 104px;
  padding: 18px;
  color: var(--tx3);
  text-align: center;
}

.orders-state-copy strong {
  display: block;
  margin-bottom: 4px;
  color: var(--tx2);
  font-size: 12px;
}

.orders-table-wrap {
  min-width: 980px;
}

.orders-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--mono);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.orders-table th,
.orders-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--b1);
  text-align: right;
  white-space: nowrap;
}

.orders-table th:first-child,
.orders-table td:first-child,
.orders-table th:nth-child(2),
.orders-table td:nth-child(2) {
  text-align: left;
}

.orders-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--bg0);
  color: var(--tx3);
  font-family: var(--sans);
  font-weight: 500;
}

.orders-empty-cell {
  height: 94px;
  color: var(--tx3);
  font-family: var(--sans);
  text-align: center !important;
}

.orders-empty-cell strong,
.orders-empty-cell span {
  display: block;
}

.orders-empty-cell strong {
  margin-bottom: 4px;
  color: var(--tx2);
  font-size: 11px;
}

/* Toast and dialog */
.toast {
  right: 18px;
  bottom: 18px;
  left: auto;
  padding: 10px 13px;
  border: 1px solid var(--b3);
  border-left: 3px solid var(--g1);
  border-radius: var(--radius-md);
  background: var(--bg3);
  box-shadow: 0 12px 32px rgba(0, 0, 0, .28);
  color: var(--tx1);
}

.toast.error {
  border-left-color: var(--r1);
}

.toast.info {
  border-left-color: var(--bl);
}

.terminal-dialog-backdrop {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(7, 9, 12, .72);
}

.terminal-dialog {
  width: min(420px, 100%);
  padding: 20px;
  border: 1px solid var(--b3);
  border-radius: var(--radius-lg);
  background: var(--bg1);
  box-shadow: 0 24px 72px rgba(0, 0, 0, .4);
}

.terminal-dialog h2 {
  margin: 0 0 8px;
  font-size: 16px;
}

.terminal-dialog p {
  margin: 0 0 18px;
  color: var(--tx2);
  line-height: 1.5;
}

.terminal-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* Wallet modal cleanup */
#walletModal > div:nth-child(2) {
  border-color: var(--b3) !important;
  border-radius: var(--radius-lg) !important;
  background: var(--bg1) !important;
  box-shadow: 0 24px 72px rgba(0, 0, 0, .42) !important;
}

#walletModal > div:nth-child(2) > div:first-child {
  display: none !important;
}

.wallet-opt {
  border-color: var(--b2) !important;
  border-radius: var(--radius-md) !important;
  background: var(--bg2) !important;
}

.wallet-opt:hover {
  border-color: var(--b3) !important;
  background: var(--bg3) !important;
}

/* Light theme integrations */
html[data-theme="light"] .tradingview-widget-container,
html[data-theme="light"] #tradingview_widget {
  filter: saturate(.85);
}

/* Responsive desktop */
@media (max-width: 1500px) {
  .desktop-nav > :nth-child(4),
  .desktop-nav > :nth-child(5) {
    display: none;
  }

  .stats-row .st:nth-last-child(-n+2) {
    display: none;
  }
}

@media (max-width: 1260px) {
  .desktop-nav {
    display: none;
  }

  .cdrop {
    left: 164px;
  }

  .tp-sec {
    width: 292px;
  }

  .ob-sec {
    width: 222px;
  }
}

@media (max-width: 1060px) and (min-width: 901px) {
  .stats-row .st:nth-child(n+4) {
    display: none;
  }

  .nav-r .nb-ghost,
  .tb-bal-wrap {
    display: none;
  }

  .tp-sec {
    width: 276px;
  }
}

/* Mobile refinements complement the existing mobile layout. */
@media (max-width: 900px) {
  html,
  body {
    min-width: 0;
    overflow-x: hidden;
  }

  .topbar {
    height: 48px;
    min-height: 48px;
    padding: 0 10px;
  }

  .logo {
    width: 72px;
    min-width: 72px;
  }

  .logo img {
    width: 68px;
  }

  .pair-pill {
    max-width: 150px;
  }

  .cdrop {
    top: 48px;
    right: 8px;
    left: 8px;
    width: auto;
    max-height: calc(100dvh - 112px);
  }

  .cd-head,
  .cd-row {
    grid-template-columns: minmax(130px, 1fr) 78px 62px 26px !important;
  }

  .cd-head > :nth-child(3),
  .cd-head > :nth-child(4),
  .cd-row > :nth-child(3),
  .cd-row > :nth-child(4) {
    display: none;
  }

  .chart-modes {
    display: none;
  }

  .chart-bar {
    min-height: 36px;
  }

  .draw-toolbar {
    display: none;
  }

  .mob-nav,
  .mob-ls-bar {
    border-color: var(--b2) !important;
    background: var(--bg1) !important;
    box-shadow: none !important;
  }

  .mob-nav-btn.active {
    color: var(--bl2) !important;
  }

  .mob-sheet {
    border: 1px solid var(--b3) !important;
    border-bottom: 0 !important;
    border-radius: 12px 12px 0 0 !important;
    background: var(--bg1) !important;
    box-shadow: 0 -12px 40px rgba(0, 0, 0, .35) !important;
  }

  .mob-cat {
    border: 1px solid var(--b2);
    border-radius: var(--radius-sm);
    background: var(--bg2);
    color: var(--tx3);
  }

  .mob-cat.on {
    border-color: var(--b3);
    background: var(--bg4);
    color: var(--tx1);
  }

  .toast {
    right: 10px;
    bottom: 76px;
    left: 10px;
  }
}

/* Complete viewport adaptation */
html,
body {
  width: 100%;
  max-width: 100%;
}

body {
  height: 100vh !important;
  height: 100dvh !important;
  min-height: 0;
}

.topbar > *,
.body > *,
.chart-sec,
.tv-wrap,
.chart-inner {
  min-width: 0;
  min-height: 0;
}

@media (min-width: 2200px) {
  html:root {
    --header-h: 64px;
  }

  .topbar {
    padding-inline: clamp(24px, 2vw, 52px);
  }

  .logo {
    width: 150px;
    min-width: 150px;
  }

  .logo img {
    width: 142px;
  }

  .ob-sec {
    width: clamp(286px, 14vw, 340px);
  }

  .tp-sec {
    width: clamp(340px, 17vw, 410px);
  }

  .btm {
    height: clamp(210px, 19vh, 270px);
  }

  .chart-bar {
    height: 42px;
  }
}

@media (max-width: 1919px) and (min-width: 1501px) {
  .stats-row .st:nth-child(n + 6),
  .nav-r > #priceSrc,
  .nav-r > .nb-icon:not(#themeToggle),
  .nav-r > .tb-bal-wrap,
  .nav-r > .nb-ghost {
    display: none !important;
  }
}

@media (max-width: 1700px) and (min-width: 1501px) {
  .desktop-nav > :nth-child(4),
  .desktop-nav > :nth-child(5) {
    display: none;
  }
}

@media (max-width: 1500px) and (min-width: 1261px) {
  .topbar {
    padding-inline: 14px;
    gap: 10px;
  }

  .logo {
    width: 118px;
    min-width: 118px;
  }

  .logo img {
    width: 112px;
  }

  .desktop-nav {
    gap: 3px;
    margin-right: 2px;
  }

  .desktop-nav a,
  .desktop-nav button {
    padding-inline: 9px;
  }

  .stats-row .st:nth-child(n + 4),
  .nav-r > #priceSrc,
  .nav-r > .nb-icon:not(#themeToggle),
  .nav-r > .tb-bal-wrap,
  .nav-r > .nb-ghost,
  .nav-r > .nb-primary:nth-last-child(2) {
    display: none !important;
  }
}

@media (max-width: 1260px) and (min-width: 901px) {
  html:root {
    --header-h: 54px;
  }

  .topbar {
    padding-inline: 12px;
    gap: 10px;
  }

  .logo {
    width: 112px;
    min-width: 112px;
    margin-right: 0;
  }

  .logo img {
    width: 106px;
  }

  .pair-pill {
    max-width: 168px;
    flex-shrink: 0;
  }

  .stats-row .st {
    min-width: 70px;
    padding-inline: 8px;
  }

  .stats-row .st:first-child {
    min-width: 98px;
  }

  .nav-r > .nb-primary:nth-last-child(2),
  .nav-r > .nb-icon:not(#themeToggle) {
    display: none;
  }

  .cdrop {
    left: 134px;
  }

  .ob-sec {
    width: clamp(196px, 18vw, 226px);
  }

  .tp-sec {
    width: clamp(260px, 23vw, 292px);
  }

  .btm {
    height: clamp(136px, 17vh, 180px);
  }
}

@media (max-width: 1060px) and (min-width: 901px) {
  .stats-row .st:nth-child(n + 3) {
    display: none !important;
  }

  .pair-pill {
    max-width: 150px;
  }

  .pair-fav,
  .pair-tag {
    display: none;
  }

  .ind-btn,
  .analytics-tab,
  .btm-chk {
    display: none !important;
  }

  .chart-bar {
    gap: 1px;
  }

  .tp-body,
  .tp-footer-main {
    overflow-y: auto;
  }
}

@media (max-width: 900px) {
  html:root {
    --header-h: 50px;
  }

  html,
  body {
    min-width: 0;
    overflow: hidden;
    overscroll-behavior: none;
  }

  .topbar {
    height: var(--header-h);
    min-height: var(--header-h);
    padding: 0 max(10px, env(safe-area-inset-left));
    gap: 10px;
  }

  .desktop-nav,
  .stats-row,
  .nav-r > .nb-icon,
  .nav-r > .nb-ghost,
  .nav-r > .tb-bal-wrap,
  .nav-r > #priceSrc,
  .nav-r > .nb-primary:nth-last-child(2),
  .ob-sec,
  .tp-sec,
  .btm,
  .ohlcbar,
  .draw-toolbar {
    display: none !important;
  }

  .logo {
    width: 82px;
    min-width: 82px;
    margin: 0;
  }

  .logo img {
    width: 78px;
    max-height: 42px;
  }

  .pair-pill {
    flex: 1 1 auto;
    width: auto;
    max-width: 176px;
    min-width: 0;
    padding: 5px 8px;
  }

  .pair-sym {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .nav-r {
    min-width: 0;
    margin-left: auto;
  }

  .nav-r > .nb-primary:last-child {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding-inline: 11px;
  }

  .ticker {
    height: 24px;
    min-height: 24px;
  }

  .tk-item {
    width: 132px;
    min-width: 132px;
    max-width: 132px;
    height: 24px;
  }

  .body {
    flex: 1 1 auto;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
  }

  .chart-sec {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-height: 0;
    border-right: 0;
  }

  .chart-bar {
    min-height: 34px;
    padding-inline: 6px;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    -webkit-overflow-scrolling: touch;
  }

  .tv-wrap,
  .chart-inner,
  #tradingview_widget {
    flex: 1 1 auto;
    min-height: 0;
  }

  .mob-price-bar,
  .mob-ls-bar,
  .mob-nav {
    display: flex !important;
  }

  .mob-spacer {
    display: block !important;
    height: calc(58px + env(safe-area-inset-bottom));
  }

  .mob-nav {
    height: calc(58px + env(safe-area-inset-bottom));
    padding-right: env(safe-area-inset-right);
    padding-bottom: env(safe-area-inset-bottom);
    padding-left: env(safe-area-inset-left);
  }

  .mob-nav-btn {
    min-width: 0;
    min-height: 48px;
  }

  .mob-sheet {
    right: max(0px, env(safe-area-inset-right));
    left: max(0px, env(safe-area-inset-left));
    max-height: calc(100dvh - 8px) !important;
    padding-bottom: env(safe-area-inset-bottom);
  }

  .mob-sheet-body {
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }

  .cdrop {
    top: var(--header-h);
    right: max(8px, env(safe-area-inset-right));
    left: max(8px, env(safe-area-inset-left));
    width: auto;
    max-height: calc(100dvh - var(--header-h) - 12px);
  }
}

@media (max-width: 600px) {
  .topbar {
    padding-inline: 8px;
    gap: 8px;
  }

  .logo {
    width: 76px;
    min-width: 76px;
  }

  .logo img {
    width: 72px;
  }

  .pair-pill {
    max-width: 156px;
  }

  .pair-tag,
  .cd-fav {
    display: none;
  }

  .mob-price-bar {
    gap: 10px;
    padding: 6px 10px;
  }

  .mob-price-bar .stat:last-child {
    display: none;
  }

  .mob-ls-bar {
    gap: 6px;
    padding: 7px 10px;
  }

  .mob-ls-btn {
    min-height: 40px;
    padding: 8px;
    font-size: 13px;
  }

  .cd-head,
  .cd-row {
    grid-template-columns: minmax(118px, 1fr) 72px 52px 26px !important;
    padding-inline: 10px;
  }

  .terminal-dialog-backdrop {
    align-items: end;
    padding: 8px;
  }

  .terminal-dialog {
    width: 100%;
    border-radius: 12px;
  }
}

@media (max-width: 520px) {
  .nav-r > .nb-primary:last-child {
    display: none;
  }

  .pair-pill {
    max-width: none;
  }

  .mob-price-bar .stat {
    display: none;
  }

  .chart-bar .bsep,
  .chart-bar .ind-btn {
    display: none;
  }
}

@media (max-width: 380px) {
  html:root {
    --header-h: 46px;
  }

  .topbar {
    gap: 6px;
  }

  .logo {
    width: 70px;
    min-width: 70px;
  }

  .logo img {
    width: 67px;
  }

  .pair-ico,
  .pair-chev {
    display: none;
  }

  .pair-pill {
    justify-content: center;
  }

  .tk-item {
    width: 124px;
    min-width: 124px;
    max-width: 124px;
    padding-inline: 8px;
  }

  .tk-c {
    flex-basis: 36px;
  }

  .mob-nav-btn {
    font-size: 8px;
  }

  .mob-nav-btn svg {
    width: 18px;
    height: 18px;
  }
}

@media (max-width: 900px) and (max-height: 560px) {
  html:root {
    --header-h: 44px;
  }

  .ticker {
    height: 22px;
    min-height: 22px;
  }

  .tk-item {
    height: 22px;
  }

  .mob-price-bar {
    padding-block: 4px;
  }

  .mob-price-bar .stat {
    display: none;
  }

  .mob-ls-bar {
    padding-block: 5px;
  }

  .mob-ls-btn {
    min-height: 34px;
    padding-block: 5px;
  }

  .mob-nav,
  .mob-spacer {
    height: calc(50px + env(safe-area-inset-bottom));
  }

  .mob-sheet {
    max-height: 98dvh !important;
  }
}

@media (min-width: 901px) and (max-height: 720px) {
  .btm {
    height: 126px;
  }

  .tp-about,
  .tp-trust {
    display: none;
  }

  .tp-body,
  .tp-footer-main {
    overflow-y: auto;
  }

  .ob-row,
  .rt-row {
    min-height: 17px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
