:root {
  color-scheme: light;
  --bg: #f5f7f8;
  --surface: #ffffff;
  --surface-soft: #f2f5f6;
  --surface-strong: #e9eef1;
  --border: #dbe2e7;
  --border-strong: #c7d1d8;
  --text: #20272d;
  --muted: #77828b;
  --muted-strong: #56616a;
  --brand: #25b5a5;
  --brand-dark: #119d90;
  --green: #00a35b;
  --red: #e34444;
  --blue: #3678f5;
  --amber: #f7931a;
  --shadow: 0 12px 32px rgba(25, 36, 48, 0.14);
  --topbar-height: 54px;
}

* {
  box-sizing: border-box;
}

html,
body,
#app {
  min-height: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 13px;
  letter-spacing: 0;
}

button,
input,
select {
  font: inherit;
}

button {
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

input,
select {
  width: 100%;
  height: 38px;
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  background: var(--surface);
  color: var(--text);
  padding: 0 12px;
  outline: none;
}

input:focus,
select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(37, 181, 165, 0.14);
}

a {
  color: var(--brand-dark);
  text-decoration: none;
}

.dark {
  color-scheme: dark;
  --bg: #111820;
  --surface: #17212b;
  --surface-soft: #1d2a35;
  --surface-strong: #22323e;
  --border: #283846;
  --border-strong: #3a4a58;
  --text: #e6edf2;
  --muted: #9ba7b1;
  --muted-strong: #bfccd6;
  --shadow: 0 16px 40px rgba(0, 0, 0, 0.36);
}

.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}

.app-footer {
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-top: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  font-size: 12px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 2000;
  height: var(--topbar-height);
  display: grid;
  grid-template-columns: auto auto 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(14px);
}

.dark .topbar {
  background: rgba(23, 33, 43, 0.96);
}

.brand {
  display: flex;
  align-items: center;
  min-width: 118px;
  font-weight: 700;
  font-size: 16px;
}

.brand img {
  width: 108px;
  height: 32px;
  object-fit: contain;
  object-position: left center;
}

.brand-mark {
  color: var(--brand-dark);
}

.icon-btn {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  color: var(--muted-strong);
}

.svg-btn {
  color: #707070;
}

.topbar-svg {
  width: 18px;
  height: 18px;
  display: block;
  pointer-events: none;
}

.user-menu-btn .topbar-svg {
  width: 22px;
  height: 22px;
}

.settings-svg {
  width: 18px;
  height: 18px;
}

.bell-btn {
  position: relative;
}

.bell-svg {
  width: 18px;
  height: 18px;
}

.bell-btn.has-unread::after {
  content: "";
  position: absolute;
  top: 6px;
  right: 6px;
  width: 8px;
  height: 8px;
  border: 2px solid var(--surface);
  border-radius: 50%;
  background: var(--red);
}

.icon-btn:hover,
.nav-link:hover,
.account-chip:hover,
.bell-btn:hover {
  background: var(--surface-strong);
}

.nav {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
}

.nav-link {
  height: 32px;
  padding: 0 12px;
  border-radius: 4px;
  color: var(--text);
  white-space: nowrap;
}

.nav-home-link {
  width: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  color: #515151;
}

.home-svg {
  width: 18px;
  height: 18px;
}

.nav-link.active {
  color: var(--brand-dark);
  background: rgba(37, 181, 165, 0.1);
  box-shadow: inset 0 -2px 0 var(--brand);
  font-weight: 700;
}

.topbar-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
}

.market-strip {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.market-pill {
  height: 38px;
  min-width: 126px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 7px;
  background: var(--surface-strong);
  text-align: left;
  border: 1px solid transparent;
}

.market-pill.option-market-pill {
  grid-template-columns: auto 1fr;
  min-width: 132px;
}

.market-pill.active {
  border-color: var(--brand);
  background: rgba(37, 181, 165, 0.1);
  box-shadow: 0 0 0 1px rgba(37, 181, 165, 0.16);
}

.market-logo {
  width: 18px;
  height: 18px;
  object-fit: contain;
  display: block;
}

.market-pill .spot-asset-icon,
.market-pill .spot-asset-fallback {
  width: 18px;
  height: 18px;
  font-size: 11px;
}

.coin-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 11px;
  font-weight: 700;
}

.coin-dot.btc {
  background: var(--amber);
}

.coin-dot.eth {
  background: #627eea;
}

.coin-dot.okx,
.coin-dot.x {
  background: #111827;
}

.coin-main,
.coin-side,
.mini-risk {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
  min-width: 0;
}

.coin-main.centered {
  align-items: center;
  text-align: center;
}

.coin-name {
  font-weight: 700;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.coin-price {
  color: var(--green);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.coin-price.red {
  color: var(--red);
}

.coin-side {
  color: var(--muted-strong);
  align-items: flex-end;
  gap: 1px;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.coin-side strong {
  color: var(--muted-strong);
  font-weight: 700;
}

.coin-side span {
  font-weight: 500;
}

.mini-mode {
  min-width: 42px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-left: 1px solid var(--border-strong);
  border-right: 1px solid var(--border-strong);
  font-weight: 700;
}

.mini-risk {
  min-width: 92px;
  gap: 2px;
}

.risk-row {
  display: grid;
  grid-template-columns: 22px 1fr;
  align-items: center;
  gap: 6px;
  font-variant-numeric: tabular-nums;
}

.risk-bar {
  height: 3px;
  background: var(--surface-strong);
}

.risk-fill {
  height: 3px;
  width: var(--risk, 0%);
  background: var(--brand);
}

.account-chip {
  height: 38px;
  min-width: 128px;
  max-width: 170px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  border-radius: 7px;
  background: var(--surface-strong);
}

.exchange-chip-logo {
  width: 22px;
  height: 22px;
  object-fit: contain;
  display: block;
  flex: 0 0 auto;
}

.chip-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.login-chip {
  height: 38px;
  padding: 0 18px;
  border-radius: 5px;
  background: var(--brand);
  color: white;
  font-weight: 700;
}

.login-chip:hover,
.primary-btn:hover {
  background: var(--brand-dark);
}

.dropdown {
  position: absolute;
  top: calc(var(--topbar-height) + 8px);
  right: 12px;
  z-index: 2100;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.dropdown::before {
  content: "";
  position: absolute;
  top: -8px;
  right: 28px;
  width: 14px;
  height: 14px;
  background: var(--surface);
  border-left: 1px solid var(--border);
  border-top: 1px solid var(--border);
  transform: rotate(45deg);
}

.tools-menu {
  left: 12px;
  right: auto;
  width: min(650px, calc(100vw - 24px));
  display: grid;
  grid-template-columns: 1fr 250px;
  gap: 22px;
  padding: 24px;
}

.tools-menu::before {
  left: 108px;
  right: auto;
}

.option-products-menu {
  position: fixed;
  right: auto;
  padding: 14px 14px 24px;
  border-radius: 7px;
  overflow-x: auto;
}

.option-products-menu::before {
  display: none;
}

.spot-products-menu {
  position: fixed;
  right: auto;
  padding: 14px;
  border-radius: 7px;
}

.spot-products-menu::before {
  display: none;
}

.spot-menu-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.spot-filter-groups {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.spot-filter-tabs {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 1px;
  padding: 4px;
  border-radius: 6px;
  background: var(--surface-strong);
  overflow-x: auto;
}

.spot-filter-tab {
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 0 9px;
  border-radius: 5px;
  color: var(--muted-strong);
  white-space: nowrap;
  font-size: 13px;
}

.spot-filter-tab:disabled {
  cursor: not-allowed;
  color: var(--muted);
  opacity: 0.45;
}

.spot-filter-tab.active {
  color: var(--brand-dark);
  background: var(--surface);
  font-weight: 700;
}

.spot-asset-icon {
  width: 16px;
  height: 16px;
  object-fit: contain;
  flex: 0 0 auto;
}

.spot-asset-fallback {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  font-size: 10px;
}

.spot-search {
  position: relative;
  width: min(220px, 100%);
  flex: 0 0 auto;
}

.spot-search input {
  width: 100%;
  height: 32px;
  padding: 0 12px 0 34px;
  border: 1px solid var(--border-strong);
  border-radius: 5px;
  background: var(--surface);
  color: var(--text);
  outline: none;
}

.spot-search input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 2px rgba(37, 181, 165, 0.12);
}

.spot-search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  width: 12px;
  height: 12px;
  border: 2px solid var(--muted);
  border-radius: 50%;
  transform: translateY(-58%);
  pointer-events: none;
}

.spot-search-icon::after {
  content: "";
  position: absolute;
  right: -5px;
  bottom: -4px;
  width: 6px;
  height: 2px;
  border-radius: 1px;
  background: var(--muted);
  transform: rotate(45deg);
}

.spot-table-wrap {
  max-height: min(58vh, 520px);
  overflow: auto;
}

.spot-products-table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
  font-size: 14px;
}

.spot-products-table th,
.spot-products-table td {
  height: 39px;
  padding: 0 16px;
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.spot-products-table th:first-child,
.spot-products-table td:first-child {
  text-align: left;
}

.spot-products-table th {
  color: var(--muted-strong);
  font-size: 12px;
  font-weight: 700;
  background: var(--surface-strong);
}

.spot-products-table tbody tr:nth-child(even) {
  background: var(--surface-soft);
}

.spot-product-row {
  cursor: pointer;
}

.spot-product-row:hover {
  background: rgba(37, 181, 165, 0.08);
}

.spot-contract {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.spot-contract strong {
  font-weight: 700;
}

.spot-num {
  color: var(--text);
}

.spot-detail-panel .panel-title {
  min-width: 0;
}

.spot-pair-overview {
  min-height: 66px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
}

.spot-pair-selector {
  min-width: 210px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  text-align: left;
}

.spot-pair-name {
  font-size: 16px;
  font-weight: 800;
  color: var(--text);
  white-space: nowrap;
}

.spot-pair-price {
  font-weight: 800;
  white-space: nowrap;
}

.spot-pair-caret {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.select-caret {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.spot-pair-metrics {
  flex: 1;
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(5, minmax(116px, 1fr));
  gap: 10px 22px;
}

.spot-pair-metric {
  min-width: 0;
  display: grid;
  gap: 3px;
  font-variant-numeric: tabular-nums;
}

.spot-pair-metric span {
  color: var(--muted);
  font-size: 11px;
}

.spot-pair-metric strong {
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--text);
  font-size: 13px;
}

.spot-chart-panel {
  min-height: 454px;
}

.spot-chart-head {
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 12px;
  border-bottom: 1px solid var(--border);
}

.spot-chart-source,
.spot-chart-interval,
.spot-chart-symbol {
  color: var(--muted-strong);
  font-size: 12px;
  white-space: nowrap;
}

.spot-chart-toolbar {
  min-height: 40px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
}

.spot-chart-symbol {
  color: var(--text);
  font-weight: 800;
}

.spot-chart-select {
  width: 126px;
  flex: 0 0 auto;
}

.spot-chart-type-tabs,
.spot-chart-range-tabs {
  flex: 0 0 auto;
}

.spot-chart-type-tabs button {
  min-width: 60px;
}

.spot-chart-range-tabs button {
  min-width: 48px;
}

.spot-chart-ohlc {
  min-height: 28px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 10px;
  color: var(--muted-strong);
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  overflow-x: auto;
  white-space: nowrap;
}

.spot-chart-ohlc span {
  flex: 0 0 auto;
}

.spot-chart-muted {
  color: var(--muted);
}

.spot-chart-stage {
  position: relative;
  height: 380px;
  min-height: 330px;
  background: var(--surface);
}

.spot-chart-scroll {
  width: 100%;
  height: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  cursor: crosshair;
}

.spot-chart-canvas {
  display: block;
  height: 100%;
}

.spot-chart-price-axis {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 66px;
  pointer-events: none;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0), var(--surface) 24%);
  border-left: 1px solid rgba(219, 226, 231, 0.72);
  z-index: 2;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.spot-chart-price-axis-label,
.spot-chart-current-price-axis-label {
  position: absolute;
  right: 6px;
  transform: translateY(-50%);
  white-space: nowrap;
}

.spot-chart-price-axis-label {
  color: var(--muted);
}

.spot-chart-current-price-axis-label {
  min-width: 48px;
  padding: 2px 5px;
  border-radius: 3px;
  background: var(--brand);
  color: white;
  text-align: center;
  font-weight: 700;
}

.spot-chart-message {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.72);
}

.dark .spot-chart-message {
  background: rgba(23, 33, 43, 0.72);
}

.spot-chart-message.hidden {
  display: none;
}

.spot-trading-grid {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) minmax(280px, 0.8fr) minmax(280px, 0.8fr);
  gap: 8px;
  align-items: stretch;
  min-width: 0;
}

.spot-order-panel,
.spot-depth-panel,
.spot-recent-trades-panel {
  min-height: 420px;
  height: 100%;
  overflow: hidden;
}

.spot-depth-panel,
.spot-recent-trades-panel {
  display: flex;
  flex-direction: column;
}

.spot-depth-rows,
.spot-recent-rows {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
}

.spot-recent-rows .spot-mini-table {
  width: 100%;
}

.spot-order-panel .order-type-tabs {
  padding: 0 12px;
}

.spot-order-panel .order-form-stack {
  padding: 12px;
}

.spot-order-slider {
  position: relative;
  padding-top: 10px;
}

.spot-order-slider-value {
  position: absolute;
  left: var(--spot-order-percent, 0%);
  top: -8px;
  transform: translateX(-50%);
  min-width: 28px;
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--brand);
  color: white;
  font-size: 11px;
  font-weight: 800;
  line-height: 16px;
  text-align: center;
  pointer-events: none;
}

.spot-order-slider input {
  width: 100%;
  accent-color: var(--brand);
}

.spot-order-slider-labels {
  display: flex;
  justify-content: space-between;
  color: var(--muted-strong);
  font-size: 12px;
}

.spot-balance-line {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

.spot-trigger-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 96px;
  gap: 8px;
  align-items: end;
  min-width: 0;
}

.spot-trigger-row .order-field {
  min-width: 0;
}

.spot-trigger-row .order-field:last-child {
  width: 96px;
  max-width: 96px;
}

.spot-trigger-row .order-field:last-child .order-label-row {
  gap: 0;
}

.spot-trigger-row .order-field:last-child .order-label-row span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.spot-trigger-select {
  width: 100%;
  height: 38px;
  min-width: 0;
  max-width: 96px;
  box-sizing: border-box;
  line-height: 38px;
  padding: 0 8px;
}

.spot-contract-info {
  margin: 2px -12px -12px;
  border-top: 1px solid var(--border);
}

.spot-contract-info h4 {
  margin: 0;
  padding: 10px 12px;
  font-size: 13px;
}

.spot-contract-info div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 12px;
  color: var(--muted-strong);
}

.spot-contract-info strong {
  color: var(--text);
  font-weight: 700;
}

.spot-depth-head,
.spot-depth-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  padding: 0 12px;
  min-height: 28px;
  align-items: center;
  font-variant-numeric: tabular-nums;
}

.spot-depth-head {
  color: var(--muted-strong);
  background: var(--surface-soft);
  font-size: 12px;
}

.spot-depth-row {
  font-size: 12px;
}

.spot-depth-row:nth-child(even),
.spot-mini-table tbody tr:nth-child(even) {
  background: rgba(126, 139, 151, 0.06);
}

.spot-depth-row span:not(:first-child),
.spot-depth-head span:not(:first-child) {
  text-align: right;
}

.spot-depth-mid {
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 12px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.spot-depth-mid strong {
  font-size: 20px;
}

.spot-depth-mid span {
  color: var(--muted-strong);
  font-size: 12px;
  text-align: right;
}

.spot-mini-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-variant-numeric: tabular-nums;
}

.spot-mini-table th,
.spot-mini-table td {
  height: 28px;
  padding: 0 12px;
  font-size: 12px;
  text-align: right;
}

.spot-mini-table th {
  color: var(--muted-strong);
  background: var(--surface-soft);
  font-weight: 700;
}

.spot-mini-table th:first-child,
.spot-mini-table td:first-child {
  text-align: left;
}

.transaction-log-panel {
  min-height: calc(100vh - 112px);
  margin-bottom: 0;
}

.transaction-log-head {
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  border-bottom: 1px solid var(--border);
}

.transaction-log-toolbar {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 12px;
  border-bottom: 1px solid var(--border);
}

.transaction-log-filters {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  overflow: visible;
}

.transaction-log-currency-dropdown {
  position: relative;
  flex: 0 0 auto;
}

.transaction-log-currency-trigger {
  height: 30px;
  min-width: 94px;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 0 10px;
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  background: var(--surface);
  color: var(--text);
  font-weight: 700;
}

.transaction-log-currency-trigger .currency-logo,
.transaction-log-currency-option .currency-logo {
  width: 14px;
  height: 14px;
}

.transaction-log-currency-menu {
  position: absolute;
  left: 0;
  top: calc(100% + 4px);
  z-index: 40;
  width: 118px;
  padding: 4px;
  border: 1px solid var(--border-strong);
  border-radius: 5px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.transaction-log-currency-option {
  width: 100%;
  height: 30px;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 8px;
  border-radius: 4px;
  text-align: left;
  color: var(--text);
}

.transaction-log-currency-option:hover,
.transaction-log-currency-option.active {
  background: rgba(37, 181, 165, 0.12);
  color: var(--brand-strong);
}

.date-field {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted-strong);
  font-size: 12px;
  white-space: nowrap;
}

.date-field input {
  width: 138px;
  height: 30px;
  padding: 0 8px;
}

.transaction-log-toolbar .transaction-log-download-btn {
  flex: 0 0 auto;
  width: auto;
  min-width: 0;
  height: 30px;
  padding: 0 16px;
  white-space: nowrap;
}

.transaction-log-table-wrap {
  overflow: auto;
  height: calc(100vh - 174px);
}

.transaction-log-table {
  width: 100%;
  min-width: 2240px;
  border-collapse: collapse;
  table-layout: fixed;
  font-variant-numeric: tabular-nums;
}

.transaction-log-table th,
.transaction-log-table td {
  height: 34px;
  padding: 0 10px;
  border-bottom: 1px solid var(--border);
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.transaction-log-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--surface-soft);
  color: var(--muted-strong);
  font-size: 12px;
  font-weight: 700;
}

.transaction-log-table td:first-child,
.transaction-log-table th:first-child,
.transaction-log-table td:nth-child(2),
.transaction-log-table th:nth-child(2),
.transaction-log-table td:nth-child(3),
.transaction-log-table th:nth-child(3),
.transaction-log-table td:nth-child(4),
.transaction-log-table th:nth-child(4) {
  text-align: left;
}

.transaction-log-table tbody tr:nth-child(even) {
  background: var(--surface-soft);
}

.option-product-grid {
  display: grid;
  grid-template-columns: repeat(var(--option-product-columns, 8), 128px);
  gap: 14px;
  min-width: max-content;
  align-items: start;
}

.option-product-column {
  display: grid;
  gap: 10px;
}

.option-product-card {
  width: 128px;
  min-height: 62px;
  display: grid;
  grid-template-rows: auto auto;
  align-content: center;
  gap: 3px;
  padding: 7px 8px;
  border: 1px solid transparent;
  border-radius: 5px;
  background: var(--surface-strong);
  text-align: center;
}

.option-product-card.active {
  border-color: var(--brand);
  background: rgba(37, 181, 165, 0.1);
}

.option-product-title,
.option-product-market {
  display: flex;
  align-items: center;
  min-width: 0;
}

.option-product-title {
  gap: 5px;
  justify-content: center;
}

.option-product-title strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.option-product-logo {
  width: 17px;
  height: 17px;
  object-fit: contain;
  flex: 0 0 auto;
}

.option-product-market {
  justify-content: center;
  flex-direction: column;
  gap: 1px;
  width: 100%;
  font-size: 12px;
}

.option-product-dvol {
  color: var(--muted-strong);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.option-product-market .coin-price {
  max-width: 100%;
  white-space: nowrap;
}

.option-product-expiries {
  display: grid;
  gap: 2px;
}

.option-product-expiry,
.option-product-empty {
  width: 128px;
  height: 31px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: 4px;
  color: var(--text);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.option-product-expiry:hover,
.option-product-expiry.active {
  background: var(--surface-soft);
  color: var(--brand-dark);
  font-weight: 700;
}

.option-product-expiry.missing,
.option-product-empty {
  color: var(--muted);
}

.position-count-badge {
  min-width: 16px;
  height: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
  border-radius: 8px;
  background: var(--red);
  color: white;
  font-size: 11px;
  line-height: 16px;
}

.tool-list {
  display: grid;
  gap: 25px;
}

.tool-item {
  display: grid;
  grid-template-columns: 30px 1fr;
  gap: 12px;
}

.tool-title {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 4px;
}

.tool-desc {
  color: var(--muted);
  line-height: 1.5;
}

.tool-tags {
  display: flex;
  gap: 34px;
  margin-top: 10px;
  color: var(--muted);
}

.tool-side {
  position: relative;
  overflow: hidden;
  min-height: 548px;
  padding: 18px 24px;
  border-radius: 5px;
  background: rgba(37, 181, 165, 0.08);
}

.tool-side::after {
  content: "";
  position: absolute;
  right: -10px;
  bottom: 20px;
  width: 170px;
  height: 170px;
  background: url("/assets/logo.png") center/contain no-repeat;
  opacity: 0.08;
}

.side-title {
  margin: 0 0 18px;
  color: var(--brand-dark);
  font-size: 15px;
  font-weight: 800;
}

.side-link {
  display: block;
  margin: 0 0 17px;
  color: var(--muted);
  font-size: 15px;
  font-weight: 700;
}

.badge-new {
  display: inline-flex;
  align-items: center;
  height: 18px;
  padding: 0 6px;
  border-radius: 9px;
  background: var(--red);
  color: white;
  font-size: 11px;
}

.small-menu {
  width: 290px;
  padding: 18px;
}

.user-dropdown {
  right: 8px;
}

.menu-title {
  margin: 0 0 12px;
  color: var(--muted);
  font-weight: 700;
}

.menu-user {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 10px;
  align-items: center;
  margin-bottom: 16px;
}

.avatar {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #20272d;
  color: white;
  font-weight: 800;
}

.menu-row {
  width: 100%;
  height: 38px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 8px;
  border-radius: 4px;
  color: var(--text);
  text-align: left;
}

.menu-row:hover {
  background: var(--surface-soft);
}

.menu-sep {
  height: 1px;
  margin: 12px 0;
  background: var(--border);
}

.download-menu {
  width: 220px;
  padding: 18px;
  text-align: center;
}

.download-menu img {
  width: 142px;
  height: 142px;
  margin: 10px auto 16px;
}

.notifications-menu {
  width: 380px;
  max-width: calc(100vw - 24px);
  padding: 14px;
}

.notifications-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.notifications-head .menu-title {
  margin: 0;
}

.unread-pill {
  min-width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
  border-radius: 9px;
  background: var(--red);
  color: white;
  font-size: 11px;
  font-weight: 700;
}

.notifications-list {
  max-height: 430px;
  overflow-y: auto;
  display: grid;
  gap: 6px;
}

.notification-item {
  width: 100%;
  display: grid;
  grid-template-columns: 8px 1fr;
  gap: 8px;
  align-items: start;
  padding: 9px 8px;
  border-radius: 5px;
  text-align: left;
}

.notification-item:hover {
  background: var(--surface-soft);
}

.notification-item.unread {
  background: rgba(37, 181, 165, 0.08);
}

.dark .notification-item.unread {
  background: rgba(37, 181, 165, 0.14);
}

.notification-dot {
  width: 7px;
  height: 7px;
  margin-top: 6px;
  border-radius: 50%;
  background: transparent;
}

.notification-item.unread .notification-dot {
  background: var(--red);
}

.notification-copy {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.notification-copy strong,
.notification-copy span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.notification-copy span,
.notification-copy em {
  color: var(--muted);
  font-style: normal;
  font-size: 12px;
}

.notification-item.unread .notification-copy strong {
  color: var(--text);
}

.settings-grid {
  display: grid;
  gap: 14px;
}

.setting-row {
  display: grid;
  grid-template-columns: 74px 1fr;
  align-items: center;
  gap: 10px;
}

.segmented {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  overflow: hidden;
  justify-self: start;
}

.segmented button {
  height: 28px;
  min-width: 32px;
  padding: 0 8px;
}

.segmented .active {
  background: var(--brand);
  color: white;
}

.toggle {
  width: 44px;
  height: 24px;
  padding: 2px;
  border-radius: 12px;
  background: #aab5bf;
}

.toggle span {
  display: block;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: white;
  transition: transform 0.15s ease;
}

.toggle.active {
  background: var(--brand);
}

.toggle.active span {
  transform: translateX(20px);
}

.workspace {
  flex: 1;
  padding: 10px 12px 24px;
}

.panel {
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--surface);
  overflow: visible;
  margin-bottom: 10px;
}

.panel-head {
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  border-bottom: 1px solid var(--border);
}

.panel-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
}

.panel-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  position: relative;
}

.column-menu {
  position: absolute;
  top: 36px;
  right: 36px;
  z-index: 12;
  min-width: 190px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.check-row {
  width: 100%;
  height: 28px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-radius: 4px;
  text-align: left;
}

.check-box {
  width: 16px;
  height: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  color: white;
}

.check-row.active .check-box {
  border-color: var(--brand);
  background: var(--brand);
}

.data-table-wrap {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  min-width: 1080px;
  border-collapse: collapse;
  table-layout: fixed;
  font-variant-numeric: tabular-nums;
}

.data-table th,
.data-table td {
  height: 32px;
  padding: 0 10px;
  border-bottom: 1px solid var(--border);
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.data-table th {
  background: var(--surface-soft);
  color: var(--muted-strong);
  font-size: 12px;
  font-weight: 500;
}

.data-table td:first-child,
.data-table th:first-child {
  text-align: left;
}

.data-table tfoot td {
  height: 36px;
  background: var(--surface);
  font-weight: 800;
}

.currency-cell {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
}

.currency-logo {
  width: 16px;
  height: 16px;
  object-fit: contain;
  display: block;
  flex: 0 0 auto;
}

.num-positive {
  color: var(--green);
}

.num-negative {
  color: var(--red);
}

.subnum {
  margin-left: 6px;
  color: var(--muted);
}

.empty-state {
  height: 132px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
}

.query-state {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-direction: column;
  text-align: center;
}

.loading-spinner {
  width: 22px;
  height: 22px;
  border: 2px solid rgba(37, 181, 165, 0.18);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: query-spin 0.82s linear infinite;
}

.mini-spinner {
  width: 14px;
  height: 14px;
}

.inline-query-state {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.query-error {
  color: var(--red);
}

.retry-btn {
  width: auto;
  min-width: 72px;
  height: 30px;
  padding: 0 12px;
}

@keyframes query-spin {
  to {
    transform: rotate(360deg);
  }
}

.placeholder-table {
  height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
}

.option-panel {
  overflow: visible;
}

.option-head {
  position: relative;
}

.filter-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 15px;
}

.compact-select {
  width: 132px;
  height: 30px;
  padding: 0 28px 0 10px;
  background: var(--surface);
}

.compact-select.spot-trigger-select {
  width: 100%;
  height: 38px;
  max-width: 96px;
  box-sizing: border-box;
  line-height: 38px;
  padding: 0 8px;
}

.option-column-menu {
  right: 0;
  max-height: 360px;
  overflow-y: auto;
}

.expiry-tabs {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
}

.expiry-tabs button {
  flex: 0 0 auto;
  height: 30px;
  min-width: 98px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-left: 0;
  background: var(--surface-soft);
  color: var(--muted-strong);
  font-size: 12px;
}

.expiry-tabs button:first-child {
  border-left: 1px solid var(--border);
  border-radius: 4px 0 0 4px;
}

.expiry-tabs button:last-child {
  border-radius: 0 4px 4px 0;
}

.expiry-tabs button.active {
  border-color: var(--brand);
  background: var(--brand);
  color: white;
  font-weight: 700;
}

.option-table-wrap {
  overflow: auto;
  max-height: calc(100vh - 310px);
}

.option-table {
  width: 100%;
  min-width: 1880px;
  border-collapse: collapse;
  table-layout: fixed;
  font-variant-numeric: tabular-nums;
}

.option-table th,
.option-table td {
  height: 34px;
  padding: 0 8px;
  border-bottom: 1px solid var(--border);
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.option-cell-main,
.option-cell-sub {
  display: block;
  line-height: 1.15;
}

.option-cell-sub {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
}

.option-table td.greeks-hover-cell {
  overflow: visible;
}

.greeks-hover {
  position: relative;
  display: inline-block;
  outline: none;
}

.greeks-tooltip {
  position: fixed;
  z-index: 2400;
  width: 140px;
  display: grid;
  gap: 7px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--surface);
  box-shadow: var(--shadow);
  color: var(--text);
  text-align: left;
  font-size: 12px;
  line-height: 1.35;
}

.greeks-tooltip::after {
  content: "";
  position: absolute;
  left: 50%;
  width: 10px;
  height: 10px;
  transform: translateX(-50%) rotate(45deg);
  background: var(--surface);
}

.greeks-tooltip.above::after {
  bottom: -6px;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.greeks-tooltip.below::after {
  top: -6px;
  border-left: 1px solid var(--border);
  border-top: 1px solid var(--border);
}

.greeks-tooltip-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.greeks-tooltip-row strong {
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.option-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--surface-soft);
  color: var(--muted-strong);
  font-size: 12px;
  font-weight: 500;
}

.option-table thead tr:first-child th {
  height: 28px;
  font-weight: 700;
}

.option-table .call-zone,
.option-table .option-bg-cyan {
  background: rgba(37, 181, 165, 0.045);
}

.option-table .put-zone,
.option-table .option-bg-pink {
  background: rgba(227, 68, 68, 0.045);
}

.strike-head,
.strike-cell,
.strike-index-cell {
  text-align: center !important;
  background: var(--surface-soft) !important;
  font-weight: 700;
}

.strike-cell {
  color: var(--text);
}

.option-index-row {
  height: 0;
}

.option-index-row td {
  height: 0;
  padding: 0;
  border-bottom: 0;
  background: transparent;
  overflow: visible;
  line-height: 0;
  position: relative;
}

.option-index-row td::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 1px;
  background: var(--border-strong);
  z-index: 3;
}

.strike-index-cell span,
.full-index-cell span {
  position: absolute;
  left: 50%;
  top: 0;
  z-index: 5;
  transform: translate(-50%, -50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 74px;
  height: 18px;
  padding: 0 8px;
  border-radius: 4px;
  background: #89939c;
  color: white;
  font-size: 12px;
  font-weight: 700;
  line-height: 18px;
}

.option-activity-panel {
  position: relative;
}

.activity-head {
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 12px;
  border-bottom: 1px solid var(--border);
}

.activity-tabs {
  display: flex;
  align-items: center;
  gap: 20px;
  min-width: 0;
}

.activity-tabs button {
  height: 38px;
  color: var(--text);
  font-weight: 700;
  white-space: nowrap;
}

.activity-tabs button.active {
  color: var(--brand-dark);
  box-shadow: inset 0 -2px 0 var(--brand);
}

.activity-actions {
  position: relative;
}

.activity-actions .icon-btn.active {
  color: var(--brand-dark);
  background: rgba(37, 181, 165, 0.1);
}

.activity-filters {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
}

.compact-segmented {
  height: 28px;
}

.compact-segmented button {
  min-width: 42px;
  height: 28px;
  padding: 0 10px;
}

.compact-segmented .settlement-filter-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.compact-segmented .settlement-filter-btn .currency-logo {
  width: 14px;
  height: 14px;
}

.activity-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted-strong);
  user-select: none;
}

.activity-check input {
  width: 14px;
  height: 14px;
  padding: 0;
}

.activity-column-menu {
  right: 0;
  top: 34px;
  max-height: 360px;
  overflow-y: auto;
}

.activity-table-wrap {
  overflow: auto;
  max-height: 340px;
}

.activity-table-wrap.auto-height {
  max-height: none;
}

.activity-table {
  width: 100%;
  min-width: 1500px;
  border-collapse: collapse;
  table-layout: fixed;
  font-variant-numeric: tabular-nums;
}

.activity-table th,
.activity-table td {
  height: 34px;
  padding: 0 10px;
  border-bottom: 1px solid var(--border);
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.activity-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--surface-soft);
  color: var(--muted-strong);
  font-size: 12px;
  font-weight: 600;
}

.activity-table th:first-child,
.activity-table td:first-child {
  width: 260px;
  text-align: left;
}

.activity-table .instrument-name,
.activity-group-row td:first-child {
  padding-left: calc(10px + var(--depth, 0) * 14px);
}

.activity-group-row {
  background: var(--surface-soft);
  font-weight: 700;
}

.group-toggle {
  width: 14px;
  height: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-right: 6px;
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  background: var(--surface);
  color: var(--muted-strong);
  font-size: 11px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}

.collapse-triangle-svg {
  width: 11px;
  height: 11px;
  flex: 0 0 auto;
}

.collapse-triangle-down {
  color: #515151;
}

.collapse-triangle-up {
  color: #707070;
}

.collapse-toggle-btn .collapse-triangle-svg {
  width: 12px;
  height: 12px;
}

.group-toggle .collapse-triangle-svg {
  width: 8px;
  height: 8px;
}

.empty-cell {
  height: 120px !important;
  text-align: center !important;
  color: var(--muted);
}

.recent-option-trades-panel {
  overflow: hidden;
}

.recent-trades-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 1px;
  background: var(--border);
}

.recent-trades-side {
  min-width: 0;
  background: var(--surface);
}

.recent-trades-side-head {
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 12px;
  border-bottom: 1px solid var(--border);
}

.recent-trades-side-head strong {
  font-size: 13px;
}

.recent-trades-side-head span {
  color: var(--muted-strong);
  font-size: 12px;
}

.recent-trades-side-head b {
  color: #ff8a00;
}

.recent-trades-table-wrap {
  overflow: auto;
  max-height: 310px;
}

.recent-trades-table {
  width: 100%;
  min-width: 820px;
  border-collapse: collapse;
  table-layout: fixed;
  font-variant-numeric: tabular-nums;
}

.recent-trades-table th,
.recent-trades-table td {
  height: 32px;
  padding: 0 10px;
  border-bottom: 1px solid var(--border);
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.recent-trades-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--surface-soft);
  color: var(--muted-strong);
  font-size: 12px;
  font-weight: 600;
}

.recent-trades-table th:first-child,
.recent-trades-table td:first-child {
  width: 220px;
  text-align: left;
}

@media (max-width: 980px) {
  .recent-trades-grid {
    grid-template-columns: 1fr;
  }
}

.text-action {
  color: var(--brand-dark);
  font-weight: 700;
}

.form-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(420px, 560px) minmax(340px, 390px);
  align-items: start;
  justify-content: center;
  column-gap: clamp(48px, 6vw, 96px);
  padding: clamp(220px, 30vh, 300px) clamp(32px, 6vw, 72px) 64px;
  background: linear-gradient(180deg, #eafffb 0%, #f9fffd 55%, #ffffff 100%);
}

.dark .form-page {
  background: var(--bg);
}

.form-visual {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0;
}

.form-visual .brand-big {
  display: flex;
  align-items: center;
  font-size: 40px;
  font-weight: 500;
}

.form-visual .brand-big img {
  width: min(260px, 70vw);
  height: 84px;
  object-fit: contain;
  object-position: left center;
}

.form-visual h1 {
  margin: 18px 0 26px;
  font-size: 28px;
  line-height: 1.25;
}

.visual-board {
  width: min(460px, 100%);
  min-height: 250px;
  display: grid;
  gap: 14px;
  padding: 28px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.62);
  box-shadow: 0 18px 60px rgba(37, 181, 165, 0.16);
}

.dark .visual-board {
  background: var(--surface);
}

.visual-card {
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
  border-radius: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
}

.visual-line {
  width: 44%;
  height: 6px;
  border-radius: 3px;
  background: var(--brand);
}

.form-side {
  display: flex;
  align-self: start;
  align-items: flex-start;
  justify-content: center;
  padding: 150px 0 0;
}

.form-card {
  width: 100%;
  max-width: 390px;
  min-width: 0;
  padding: 34px;
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.form-card h2,
.exchange-page h2 {
  margin: 0 0 24px;
  font-size: 25px;
}

.form-stack {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.autofill-guard {
  position: fixed;
  left: -10000px;
  top: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.verification-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 118px;
  gap: 10px;
  min-width: 0;
}

.verification-row input {
  min-width: 0;
}

.password-group {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.password-field {
  position: relative;
  min-width: 0;
}

.password-field input {
  min-width: 0;
  padding-right: 46px;
}

.password-toggle {
  position: absolute;
  top: 2px;
  right: 4px;
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  color: var(--muted-strong);
}

.password-toggle:hover {
  background: var(--surface-soft);
  color: var(--text);
}

.password-eye-svg {
  width: 18px;
  height: 18px;
  display: block;
  pointer-events: none;
}

.password-rule {
  color: var(--muted-strong);
  font-size: 12px;
  line-height: 1.45;
}

.code-btn {
  min-width: 0;
  height: 38px;
  padding: 0 10px;
  white-space: nowrap;
}

.dev-code-box {
  min-height: 34px;
  display: flex;
  align-items: center;
  padding: 8px 10px;
  border: 1px solid rgba(37, 181, 165, 0.32);
  border-radius: 4px;
  background: rgba(37, 181, 165, 0.08);
  color: var(--brand-dark);
}

.email-code-notice {
  min-width: 0;
  overflow-wrap: anywhere;
}

.field-error,
.error-box {
  min-width: 0;
  color: var(--red);
  line-height: 1.5;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.error-box {
  padding: 10px 12px;
  border: 1px solid rgba(227, 68, 68, 0.32);
  border-radius: 4px;
  background: rgba(227, 68, 68, 0.08);
}

.primary-btn,
.secondary-btn {
  width: 100%;
  height: 42px;
  border-radius: 5px;
  font-weight: 800;
}

.primary-btn {
  background: var(--brand);
  color: white;
}

.secondary-btn {
  border: 1px solid var(--border-strong);
  background: var(--surface);
}

.secondary-btn:hover {
  background: var(--surface-soft);
}

.form-footer {
  margin-top: 18px;
  color: var(--muted);
  text-align: center;
}

.exchange-page {
  min-height: calc(100vh - var(--topbar-height));
  display: flex;
  justify-content: center;
  padding: 52px 20px;
  background: var(--bg);
}

.exchange-card {
  width: min(520px, 100%);
}

.exchange-tabs {
  display: flex;
  gap: 22px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.exchange-tab {
  height: 42px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-bottom: 2px solid transparent;
  font-weight: 800;
}

.exchange-logo {
  width: 20px;
  height: 20px;
  object-fit: contain;
  display: block;
}

.exchange-tab.active {
  border-color: var(--brand);
}

.method-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 14px 0 20px;
}

.method-btn {
  height: 46px;
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  background: var(--surface);
}

.method-btn.active {
  border-color: var(--brand);
  color: var(--brand-dark);
}

.option-order-clickable {
  cursor: pointer;
}

.option-order-clickable:hover {
  box-shadow: inset 0 0 0 1px rgba(37, 181, 165, 0.42);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(16, 24, 32, 0.48);
}

.option-order-backdrop {
  z-index: 2200;
  padding: 10px;
}

.option-order-modal {
  width: min(980px, calc(100vw - 18px));
  max-height: calc(100vh - 20px);
  overflow: hidden;
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.option-order-head {
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  border-bottom: 1px solid var(--border);
}

.option-order-head h3 {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  font-size: 21px;
}

.option-order-body {
  display: grid;
  grid-template-columns: 407px minmax(0, 1fr);
  min-height: 620px;
  max-height: calc(100vh - 100px);
}

.option-order-left,
.option-order-right {
  overflow-y: auto;
}

.option-order-left {
  border-right: 1px solid var(--border);
  padding: 0 24px 24px;
}

.option-order-right {
  padding: 16px 22px 24px;
}

.order-type-tabs,
.order-right-tabs,
.order-lower-tabs {
  display: flex;
  align-items: center;
  gap: 26px;
  border-bottom: 1px solid var(--border);
}

.order-type-tabs button,
.order-right-tabs button,
.order-lower-tabs button {
  height: 46px;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  font-weight: 700;
}

.order-type-tabs button.active,
.order-right-tabs button.active,
.order-lower-tabs button.active {
  border-color: var(--brand);
  color: var(--brand-dark);
}

.order-form-stack {
  display: grid;
  gap: 16px;
  padding-top: 12px;
}

.order-field,
.order-price-block {
  display: grid;
  gap: 8px;
}

.order-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--text);
  font-weight: 700;
}

.order-label-row span:last-child,
.order-help-line {
  color: var(--muted-strong);
  font-size: 12px;
  font-weight: 600;
}

.order-help-line {
  text-align: right;
}

.order-input-with-unit {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.order-input-with-unit input {
  border-radius: 4px 0 0 4px;
}

.order-input-with-unit span:last-child {
  min-width: 58px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  border: 1px solid var(--border-strong);
  border-left: 0;
  border-radius: 0 4px 4px 0;
  background: var(--surface-soft);
  color: var(--brand-dark);
  font-weight: 700;
}

.price-mode-tabs {
  display: inline-flex;
  width: max-content;
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  overflow: hidden;
}

.price-mode-tabs button {
  height: 30px;
  min-width: 70px;
  padding: 0 10px;
  color: var(--muted-strong);
}

.price-mode-tabs button.active {
  background: var(--brand);
  color: white;
}

.greeks-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  border-radius: 4px;
  background: var(--surface-soft);
}

.greeks-grid div {
  min-width: 0;
  padding: 9px 10px;
}

.greeks-grid span {
  display: block;
  color: var(--muted-strong);
  font-size: 12px;
  white-space: nowrap;
}

.greeks-grid strong {
  display: block;
  margin-top: 6px;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.order-controls {
  min-height: 38px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 72px;
  align-items: center;
  gap: 14px;
}

.order-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted-strong);
  white-space: nowrap;
}

.order-check input {
  width: 16px;
  height: 16px;
  padding: 0;
  accent-color: var(--brand);
}

.order-tif-select {
  height: 32px;
  padding: 0 8px;
  border: 0;
  border-bottom: 1px dashed var(--border-strong);
  border-radius: 0;
  background: transparent;
  font-weight: 800;
}

.order-action-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.buy-btn,
.sell-btn {
  height: 42px;
  border-radius: 7px;
  color: white;
  font-size: 16px;
  font-weight: 800;
}

.buy-btn {
  background: #00b83f;
}

.sell-btn {
  background: #ff3e45;
}

.order-margin-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px 26px;
}

.order-margin-box {
  min-height: 48px;
  display: grid;
  align-content: start;
  gap: 3px;
  color: var(--muted-strong);
}

.order-margin-box span {
  text-decoration: underline;
  text-decoration-style: dashed;
  text-underline-offset: 4px;
}

.order-margin-box strong {
  min-height: 18px;
  color: var(--text);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.mm-box {
  grid-template-columns: 1fr auto;
}

.mm-box span {
  grid-column: 1 / 2;
}

.mm-box button {
  grid-column: 2 / 3;
  color: var(--brand-dark);
  font-weight: 800;
}

.mm-box strong,
.mm-box em {
  grid-column: 1 / -1;
  color: var(--brand-dark);
  font-style: normal;
}

.success-box {
  padding: 10px 12px;
  border: 1px solid rgba(37, 181, 165, 0.32);
  border-radius: 4px;
  background: rgba(37, 181, 165, 0.08);
  color: var(--brand-dark);
  line-height: 1.5;
}

.order-stat-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(82px, 1fr));
  gap: 14px;
  margin-bottom: 12px;
}

.order-stat-grid div {
  min-width: 0;
}

.order-stat-grid span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.order-stat-grid strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.order-book-table {
  margin-bottom: 18px;
  font-variant-numeric: tabular-nums;
}

.book-head,
.book-row {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  align-items: center;
  min-height: 30px;
  text-align: right;
}

.book-head {
  background: var(--surface-soft);
  color: var(--muted-strong);
  font-size: 12px;
}

.book-row:nth-child(odd) {
  background: rgba(32, 39, 45, 0.025);
}

.book-head span,
.book-row span {
  overflow: hidden;
  padding: 0 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.contract-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 18px;
  margin-bottom: 18px;
}

.contract-info-grid div {
  display: grid;
  gap: 4px;
  min-height: 44px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.contract-info-grid span {
  color: var(--muted);
  font-size: 12px;
}

.contract-info-grid strong {
  font-weight: 800;
}

.order-lower-tabs {
  margin-top: 8px;
}

.mini-order-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-variant-numeric: tabular-nums;
}

.mini-order-table th,
.mini-order-table td {
  height: 31px;
  padding: 0 10px;
  border-bottom: 1px solid var(--border);
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mini-order-table th {
  background: var(--surface-soft);
  color: var(--muted-strong);
  font-size: 12px;
  font-weight: 600;
}

.mini-order-table th:first-child,
.mini-order-table td:first-child {
  text-align: left;
}

.compact-empty {
  height: 160px;
}

.chart-placeholder {
  height: 160px;
}

.modal {
  width: min(540px, calc(100vw - 32px));
  padding: 22px;
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.modal-head h3 {
  margin: 0;
  font-size: 17px;
}

.announcement-modal {
  width: min(640px, calc(100vw - 32px));
}

.announcement-detail {
  display: grid;
  gap: 12px;
}

.announcement-detail h4 {
  margin: 0;
  font-size: 18px;
  line-height: 1.35;
}

.announcement-detail-content {
  max-height: min(56vh, 520px);
  overflow-y: auto;
  color: var(--text);
  line-height: 1.7;
}

.announcement-detail-content p,
.announcement-detail-content div {
  margin: 0 0 10px;
}

.announcement-detail-content p:last-child,
.announcement-detail-content div:last-child {
  margin-bottom: 0;
}

.announcement-detail-content a {
  color: var(--brand-dark);
  font-weight: 700;
}

.account-option {
  width: 100%;
  min-height: 64px;
  display: grid;
  grid-template-columns: 26px 1fr;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--surface-soft);
  text-align: left;
}

.account-option.active {
  border-color: var(--brand);
}

.modal-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 22px;
}

.status-line {
  color: var(--muted);
  font-size: 12px;
}

.nowrap {
  white-space: nowrap;
}

@media (max-width: 1120px) {
  .topbar {
    grid-template-columns: auto 1fr auto;
  }

  .nav {
    display: none;
  }

  .mini-risk {
    display: none;
  }

  .option-order-body {
    grid-template-columns: 1fr;
  }

  .option-order-left {
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .option-order-modal {
    overflow-y: auto;
  }

  .spot-pair-overview {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .spot-pair-metrics {
    width: 100%;
    grid-template-columns: repeat(3, minmax(120px, 1fr));
  }

  .spot-trading-grid {
    grid-template-columns: 1fr 1fr;
  }

  .spot-order-panel {
    grid-column: 1 / -1;
  }
}

@media (max-width: 820px) {
  .topbar {
    height: auto;
    min-height: var(--topbar-height);
    grid-template-columns: 1fr auto;
    padding: 8px;
  }

  .brand {
    min-width: 0;
  }

  .topbar-right {
    grid-column: 1 / -1;
    justify-content: flex-start;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .tools-menu {
    grid-template-columns: 1fr;
    max-height: calc(100vh - 80px);
    overflow-y: auto;
  }

  .spot-products-menu {
    padding: 14px;
    width: min(420px, calc(100vw - 16px)) !important;
  }

  .spot-menu-toolbar {
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
  }

  .spot-pair-metrics {
    grid-template-columns: repeat(2, minmax(120px, 1fr));
  }

  .spot-chart-toolbar {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .spot-chart-stage {
    height: 340px;
  }

  .spot-trading-grid {
    grid-template-columns: 1fr;
  }

  .spot-filter-groups {
    align-items: stretch;
    flex-direction: column;
    gap: 8px;
  }

  .spot-search {
    width: 100%;
  }

  .tool-side {
    min-height: auto;
  }

  .market-pill {
    min-width: 108px;
  }

  .form-page {
    grid-template-columns: 1fr;
  }

  .form-visual {
    display: none;
  }

  .form-side {
    padding: 24px;
  }

  .method-grid,
  .modal-actions {
    grid-template-columns: 1fr;
  }

  .option-order-head {
    height: auto;
    min-height: 66px;
    padding: 12px 14px;
  }

  .option-order-head h3 {
    font-size: 16px;
  }

  .option-order-left,
  .option-order-right {
    padding: 0 14px 18px;
  }

  .order-stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .greeks-grid,
  .order-margin-grid,
  .contract-info-grid {
    grid-template-columns: 1fr 1fr;
  }

  .order-controls {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .book-head,
  .book-row {
    grid-template-columns: repeat(6, minmax(58px, 1fr));
    min-width: 520px;
  }

  .order-book-table,
  .mini-order-table {
    overflow-x: auto;
  }
}
