/* Spot terminal — premium hub theme (cyan glossy CTAs) */
body[data-page="spot-terminal"] {
  --spot-bg: #05070f;
  --spot-surface: rgba(14, 20, 36, 0.92);
  --spot-surface-2: rgba(10, 14, 28, 0.88);
  --spot-border: rgba(112, 247, 255, 0.22);
  --spot-border-soft: rgba(255, 255, 255, 0.08);
  --spot-text: #effbff;
  --spot-muted: #8fa3b8;
  --spot-gold: #f4d47b;
  --spot-cyan: #70f7ff;
  --spot-cyan-bright: #9ffcff;
  --spot-cyan-deep: #0d9488;
  --spot-green: #35f0a3;
  --spot-red: #ff5c8a;
  --spot-r-xl: 22px;
  --spot-r-lg: 16px;
  --spot-r-md: 12px;
  --spot-r-sm: 8px;
  --spot-pad-x: 16px;
  --spot-pad-y: 12px;
  --spot-card-bg: linear-gradient(165deg, rgba(34, 46, 72, 0.96) 0%, rgba(12, 18, 32, 0.98) 48%, rgba(6, 10, 18, 1) 100%);
  --spot-card-shadow:
    0 1px 0 rgba(255, 255, 255, 0.16) inset,
    0 -14px 28px rgba(0, 0, 0, 0.45) inset,
    0 22px 48px rgba(0, 0, 0, 0.48),
    0 0 36px rgba(112, 247, 255, 0.1);
  --spot-btn-cyan: linear-gradient(180deg, #9ffcff 0%, var(--spot-cyan) 45%, var(--spot-cyan-deep) 100%);
  --spot-btn-cyan-shadow:
    0 1px 0 rgba(255, 255, 255, 0.45) inset,
    0 12px 24px rgba(112, 247, 255, 0.28),
    0 4px 0 rgba(13, 148, 136, 0.55);

}

.spot-terminal {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  grid-template-areas:
    "header header"
    "book form"
    "bottom bottom";
  gap: 0;
  width: 100%;
  max-width: 100%;
  min-height: 100dvh;
  margin: 0;
  padding: 88px 0 calc(118px + env(safe-area-inset-bottom, 0px));
  color: var(--spot-text);
  font-size: 12px;
}

/* Pair header card — trading hub premium panel */
.spot-pair-header {
  grid-area: header;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 var(--spot-pad-x) 12px;
  padding: 16px 18px;
  overflow: hidden;
  border-radius: var(--spot-r-xl);
  border: 1px solid rgba(112, 247, 255, 0.22);
  background: var(--spot-card-bg);
  box-shadow: var(--spot-card-shadow);
}

.spot-pair-header::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.12) 0%, transparent 28%, transparent 100%);
  pointer-events: none;
}

.spot-pair-link {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-decoration: none;
  cursor: pointer;
  text-align: left;
}

.spot-chart-btn {
  position: relative;
  z-index: 1;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  flex-shrink: 0;
  min-width: 52px;
  padding: 8px 10px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  color: #081018;
  background: var(--spot-btn-cyan);
  cursor: pointer;
  font-size: 0.58rem;
  font-weight: 950;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  box-shadow: var(--spot-btn-cyan-shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.spot-chart-btn::before {
  content: "";
  position: absolute;
  inset: 1px 1px auto;
  height: 46%;
  border-radius: 999px 999px 50% 50%;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.38), transparent);
  pointer-events: none;
}

.spot-chart-btn svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.spot-chart-btn:hover {
  transform: translateY(-2px);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.5) inset,
    0 16px 30px rgba(112, 247, 255, 0.34),
    0 4px 0 rgba(13, 148, 136, 0.55);
}

.spot-chart-btn:active {
  transform: translateY(1px);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.25) inset,
    0 6px 16px rgba(112, 247, 255, 0.22),
    0 2px 0 rgba(13, 148, 136, 0.55);
}

.spot-chart-btn.is-active {
  color: #081018;
  border-color: rgba(255, 255, 255, 0.35);
  background: var(--spot-btn-cyan);
}

.spot-coin-logo {
  width: 36px;
  height: 36px;
  padding: 4px;
  border-radius: 50%;
  border: 1px solid var(--spot-border-soft);
  background: rgba(0, 0, 0, 0.35);
  object-fit: cover;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}

.spot-pair-names {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  min-width: 0;
}

.spot-pair-names strong {
  font-size: 1.12rem;
  font-weight: 900;
  letter-spacing: -0.03em;
}

.spot-pair-change {
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
  font-style: normal;
  background: rgba(255, 255, 255, 0.05);
}

.spot-pair-change.up,
.spot-pair-change.gain {
  color: var(--spot-green);
  background: rgba(53, 240, 163, 0.12);
  border: 1px solid rgba(53, 240, 163, 0.25);
}

.spot-pair-change.down,
.spot-pair-change.loss {
  color: var(--spot-red);
  background: rgba(255, 92, 138, 0.12);
  border: 1px solid rgba(255, 92, 138, 0.25);
}

/* Order book + form — full bleed edge to edge */
.spot-book {
  grid-area: book;
  display: flex;
  flex-direction: column;
  min-height: 340px;
  padding: 12px 10px 12px max(12px, env(safe-area-inset-left, 12px));
  border-right: 1px solid var(--spot-border-soft);
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.18), transparent);
}

.spot-book-head {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 0 4px 10px;
  margin-bottom: 4px;
  color: var(--spot-muted);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--spot-border-soft);
}

.spot-book-head em {
  font-style: normal;
  color: var(--spot-gold);
}

.spot-book-asks,
.spot-book-bids {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
  padding: 4px 0;
}

.spot-book-row {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 4px 6px;
  border-radius: 6px;
  font-size: 0.68rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1.3;
}

.spot-book-row::before {
  content: "";
  position: absolute;
  inset: 0;
  width: var(--depth, 0%);
  max-width: 100%;
  border-radius: 6px;
  opacity: 0.22;
  pointer-events: none;
}

.spot-book-row.ask::before {
  right: 0;
  left: auto;
  background: linear-gradient(270deg, rgba(255, 92, 138, 0.45), transparent);
}

.spot-book-row.bid::before {
  left: 0;
  background: linear-gradient(90deg, rgba(53, 240, 163, 0.4), transparent);
}

.spot-book-row.ask span:first-child {
  color: var(--spot-red);
}

.spot-book-row.bid span:first-child {
  color: var(--spot-green);
}

.spot-book-row span:last-child {
  text-align: right;
  color: rgba(239, 251, 255, 0.88);
}

.spot-book-mid {
  display: grid;
  gap: 3px;
  padding: 14px 10px;
  margin: 6px 0;
  border-radius: var(--spot-r-lg);
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.34) 0%, rgba(255, 255, 255, 0.03) 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow:
    0 2px 0 rgba(255, 255, 255, 0.06) inset,
    0 -8px 16px rgba(0, 0, 0, 0.35) inset,
    0 10px 20px rgba(0, 0, 0, 0.28);
  text-align: center;
  justify-items: center;
}

.spot-mid-price {
  display: block;
  width: 100%;
  font-size: 1.12rem;
  font-weight: 950;
  letter-spacing: -0.03em;
  color: var(--spot-cyan);
  text-align: center;
  text-shadow: 0 0 18px rgba(112, 247, 255, 0.28);
}

.spot-mid-price.up {
  color: var(--spot-cyan);
  text-shadow: 0 0 22px rgba(112, 247, 255, 0.38);
}

.spot-mid-price.down {
  color: var(--spot-red);
  text-shadow: 0 0 20px rgba(255, 92, 138, 0.35);
}

.spot-book-mid small {
  display: block;
  width: 100%;
  color: var(--spot-muted);
  font-size: 0.65rem;
  font-weight: 600;
  text-align: center;
}

.spot-book-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 8px;
  padding: 10px 6px 4px;
  border-top: 1px solid var(--spot-border-soft);
}

.spot-precision {
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid var(--spot-border-soft);
  border-radius: var(--spot-r-sm);
  color: var(--spot-text);
  background: rgba(0, 0, 0, 0.35);
  font-size: 0.68rem;
  font-weight: 700;
}

.spot-live-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 11px;
  border-radius: 999px;
  color: var(--spot-cyan);
  font-size: 0.58rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  background: linear-gradient(180deg, rgba(112, 247, 255, 0.18), rgba(112, 247, 255, 0.08));
  border: 1px solid rgba(112, 247, 255, 0.28);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.18) inset,
    0 4px 10px rgba(0, 0, 0, 0.25);
}

.spot-live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 8px currentColor;
  animation: spotLiveBlink 1.4s ease-in-out infinite;
}

@keyframes spotLiveBlink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}

/* Order form column — premium panel */
.spot-trade-form {
  grid-area: form;
  display: grid;
  gap: 10px;
  align-content: start;
  margin-right: max(8px, env(safe-area-inset-right, 8px));
  padding: 14px 12px 16px;
  border-radius: var(--spot-r-xl);
  border: 1px solid rgba(112, 247, 255, 0.18);
  background: var(--spot-card-bg);
  box-shadow: var(--spot-card-shadow);
  text-align: center;
}

.spot-side-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 5px;
  border-radius: var(--spot-r-md);
  border: 1px solid var(--spot-border-soft);
  background: rgba(0, 0, 0, 0.35);
}

.spot-side-tabs button {
  min-height: 36px;
  border: 0;
  border-radius: var(--spot-r-sm);
  color: var(--spot-muted);
  background: transparent;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 800;
  text-align: center;
  transition: transform 0.15s, box-shadow 0.2s;
}

.spot-side-tabs button.active.buy {
  color: #03140e;
  background: linear-gradient(135deg, #35f0a3, #1bc77a);
  box-shadow: 0 6px 18px rgba(53, 240, 163, 0.3);
}

.spot-side-tabs button.active.sell {
  color: #1a050c;
  background: linear-gradient(135deg, #ff5c8a, #e83868);
  box-shadow: 0 6px 18px rgba(255, 92, 138, 0.3);
}

.spot-order-type-wrap select {
  width: 100%;
  min-height: 38px;
  padding: 0 36px;
  border: 1px solid var(--spot-border-soft);
  border-radius: var(--spot-r-md);
  color: var(--spot-text);
  background: rgba(0, 0, 0, 0.32);
  font-size: 0.78rem;
  font-weight: 700;
  text-align: center;
  text-align-last: center;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238fa3b8' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.spot-order-type-wrap select:focus {
  outline: none;
  border-color: rgba(112, 247, 255, 0.4);
  box-shadow: 0 0 0 3px rgba(112, 247, 255, 0.1);
}

.spot-step-field {
  display: grid;
  grid-template-columns: 36px 1fr 36px;
  gap: 6px;
  align-items: end;
}

.spot-step-field > button {
  display: grid;
  place-items: center;
  min-height: 38px;
  border: 1px solid var(--spot-border-soft);
  border-radius: var(--spot-r-sm);
  color: var(--spot-muted);
  background: rgba(0, 0, 0, 0.32);
  cursor: pointer;
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1;
  text-align: center;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}

.spot-step-field > button:hover {
  color: var(--spot-cyan);
  border-color: rgba(112, 247, 255, 0.3);
  background: rgba(112, 247, 255, 0.08);
}

.spot-step-field label {
  display: grid;
  gap: 4px;
  min-width: 0;
  text-align: center;
}

.spot-step-field label span {
  color: var(--spot-muted);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-align: center;
}

.spot-step-field input,
.spot-field-total input {
  width: 100%;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--spot-border-soft);
  border-radius: var(--spot-r-md);
  color: var(--spot-text);
  background: rgba(0, 0, 0, 0.38);
  font-size: 0.82rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  text-align: center;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.spot-step-field input:focus,
.spot-field-total input:focus {
  outline: none;
  border-color: rgba(112, 247, 255, 0.45);
  box-shadow: 0 0 0 3px rgba(112, 247, 255, 0.1);
}

.spot-step-field input:disabled {
  opacity: 0.5;
}

.spot-pct-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.spot-pct-row button {
  min-height: 30px;
  border: 1px solid var(--spot-border-soft);
  border-radius: var(--spot-r-sm);
  color: var(--spot-muted);
  background: rgba(0, 0, 0, 0.28);
  cursor: pointer;
  font-size: 0.62rem;
  font-weight: 800;
  text-align: center;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}

.spot-pct-row button:hover {
  color: var(--spot-cyan);
  border-color: rgba(112, 247, 255, 0.35);
  background: rgba(112, 247, 255, 0.08);
}

.spot-field-total {
  display: grid;
  gap: 4px;
  text-align: center;
}

.spot-field-total span {
  color: var(--spot-muted);
  font-size: 0.62rem;
  font-weight: 700;
  text-align: center;
}

.spot-avbl-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: var(--spot-r-md);
  color: var(--spot-muted);
  font-size: 0.68rem;
  font-weight: 700;
  text-align: center;
  background: rgba(112, 247, 255, 0.06);
  border: 1px solid rgba(112, 247, 255, 0.1);
}

.spot-avbl-row strong {
  color: var(--spot-cyan);
  font-weight: 900;
}

.spot-avbl-plus {
  position: relative;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  color: #081018;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: var(--spot-btn-cyan);
  font-size: 0.9rem;
  font-weight: 950;
  text-decoration: none;
  line-height: 1;
  box-shadow: var(--spot-btn-cyan-shadow);
}

.spot-submit {
  position: relative;
  min-height: 48px;
  margin-top: 4px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 950;
  letter-spacing: 0.02em;
  text-align: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.spot-submit::before {
  content: "";
  position: absolute;
  inset: 1px 1px auto;
  height: 46%;
  border-radius: 999px 999px 50% 50%;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.38), transparent);
  pointer-events: none;
}

.spot-submit:active {
  transform: translateY(1px);
}

.spot-submit.buy {
  color: #081018;
  background: var(--spot-btn-cyan);
  box-shadow: var(--spot-btn-cyan-shadow);
}

.spot-submit.buy:hover {
  transform: translateY(-2px);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.5) inset,
    0 16px 30px rgba(112, 247, 255, 0.34),
    0 4px 0 rgba(13, 148, 136, 0.55);
}

.spot-submit.buy:active {
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.25) inset,
    0 6px 16px rgba(112, 247, 255, 0.22),
    0 2px 0 rgba(13, 148, 136, 0.55);
}

.spot-submit.sell {
  color: #1a050c;
  background: linear-gradient(180deg, #ffc4d4 0%, var(--spot-red) 48%, #c9184a 100%);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.4) inset,
    0 12px 24px rgba(255, 92, 138, 0.28),
    0 4px 0 rgba(160, 24, 64, 0.55);
}

.spot-submit.sell:hover {
  transform: translateY(-2px);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.45) inset,
    0 16px 30px rgba(255, 92, 138, 0.34),
    0 4px 0 rgba(160, 24, 64, 0.55);
}

/* Open orders / funds */
.spot-bottom {
  grid-area: bottom;
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 108px;
  overflow: hidden;
  margin: 12px var(--spot-pad-x) 0;
  border-radius: var(--spot-r-xl);
  border: 1px solid rgba(112, 247, 255, 0.22);
  background: var(--spot-card-bg);
  box-shadow: var(--spot-card-shadow);
}

.spot-bottom::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.1) 0%, transparent 24%, transparent 100%);
  pointer-events: none;
}

.spot-bottom-tabs {
  display: flex;
  gap: 24px;
  padding: 0 16px;
  border-bottom: 1px solid var(--spot-border-soft);
  background: rgba(0, 0, 0, 0.2);
}

.spot-bottom-tabs button {
  position: relative;
  padding: 14px 0;
  border: 0;
  color: var(--spot-muted);
  background: transparent;
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 800;
  transition: color 0.2s;
}

.spot-bottom-tabs button.active {
  color: var(--spot-text);
}

.spot-bottom-tabs button.active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  border-radius: 2px 2px 0 0;
  background: linear-gradient(90deg, var(--spot-cyan-bright), var(--spot-cyan));
  box-shadow: 0 0 12px rgba(112, 247, 255, 0.45);
}

.spot-bottom-panel {
  flex: 1;
  padding: 16px;
  min-height: 64px;
}

.spot-bottom-panel[hidden] {
  display: none !important;
}

.spot-empty {
  margin: 8px 0 0;
  padding: 20px;
  border-radius: var(--spot-r-md);
  color: var(--spot-muted);
  font-size: 0.78rem;
  text-align: center;
  background: rgba(0, 0, 0, 0.2);
  border: 1px dashed var(--spot-border-soft);
}

.spot-funds-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 14px;
  border-radius: var(--spot-r-md);
  font-weight: 800;
  background: rgba(112, 247, 255, 0.06);
  border: 1px solid rgba(112, 247, 255, 0.1);
}

.spot-funds-link {
  display: inline-block;
  margin-top: 12px;
  padding: 8px 0;
  color: var(--spot-cyan);
  font-size: 0.78rem;
  font-weight: 800;
  text-decoration: none;
  text-shadow: 0 0 12px rgba(112, 247, 255, 0.2);
}

.spot-funds-link:hover {
  color: var(--spot-cyan-bright);
}

/* Chart drawer */
.spot-chart-drawer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: calc(72px + env(safe-area-inset-bottom, 0px));
  z-index: 15;
  width: 100%;
  max-width: 100%;
  transform: none;
  overflow: hidden;
  border: 1px solid rgba(112, 247, 255, 0.2);
  border-bottom: 0;
  border-radius: var(--spot-r-xl) var(--spot-r-xl) 0 0;
  background: var(--spot-card-bg);
  box-shadow:
    0 -4px 0 rgba(112, 247, 255, 0.12),
    0 -20px 50px rgba(0, 0, 0, 0.55),
    0 0 36px rgba(112, 247, 255, 0.08);
  backdrop-filter: blur(16px);
}

.spot-chart-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 44px;
  padding: 0 18px;
  border: 0;
  color: var(--spot-text);
  background: transparent;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 800;
}

.spot-chart-chevron {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: var(--spot-muted);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.25s ease, stroke 0.2s;
}

.spot-chart-drawer.is-open .spot-chart-chevron {
  transform: rotate(180deg);
  stroke: var(--spot-cyan);
}

.spot-chart-body {
  border-top: 1px solid var(--spot-border-soft);
}

.spot-chart-body[hidden] {
  display: none !important;
}

.spot-intervals {
  display: flex;
  gap: 6px;
  padding: 12px 14px;
  overflow-x: auto;
  scrollbar-width: none;
}

.spot-intervals::-webkit-scrollbar {
  display: none;
}

.spot-intervals button {
  flex: 0 0 auto;
  min-width: 40px;
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid var(--spot-border-soft);
  border-radius: var(--spot-r-sm);
  color: var(--spot-muted);
  background: rgba(0, 0, 0, 0.35);
  cursor: pointer;
  font-size: 0.68rem;
  font-weight: 800;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}

.spot-intervals button.active {
  color: var(--spot-cyan);
  border-color: rgba(112, 247, 255, 0.45);
  background: rgba(112, 247, 255, 0.12);
  box-shadow: 0 0 14px rgba(112, 247, 255, 0.15);
}

.spot-quick-trade-btn {
  flex: 0 0 auto;
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 0 14px;
  border: 1px solid rgba(14, 203, 129, 0.45);
  border-radius: var(--spot-r-sm);
  color: #0ecb81;
  background: rgba(14, 203, 129, 0.12);
  text-decoration: none;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  box-shadow: 0 0 14px rgba(14, 203, 129, 0.18);
}

.spot-quick-trade-btn:hover {
  color: #04120c;
  background: linear-gradient(135deg, #0ecb81, #70f7ff);
  border-color: transparent;
}

.spot-chart-wrap {
  position: relative;
  height: 280px;
  margin: 0 10px 10px;
  overflow: hidden;
  border-radius: var(--spot-r-md);
  border: 1px solid var(--spot-border-soft);
  background:
    radial-gradient(circle at 80% 0%, rgba(112, 247, 255, 0.06), transparent 50%),
    #05070f;
}

.spot-chart-mount {
  width: 100%;
  height: 280px;
  min-height: 240px;
}

.spot-chart-status {
  position: absolute;
  right: 10px;
  bottom: 8px;
  margin: 0;
  padding: 4px 8px;
  border-radius: 6px;
  color: var(--spot-muted);
  font-size: 0.6rem;
  font-weight: 700;
  background: rgba(0, 0, 0, 0.5);
}

/* Bottom nav polish */
body[data-page="spot-terminal"] .spot-bottom-nav {
  z-index: 20;
  margin: 0;
  border-radius: 20px 20px 0 0;
  border-color: var(--spot-border);
  background: rgba(5, 10, 21, 0.88);
  backdrop-filter: blur(20px);
}

body[data-page="spot-terminal"] .spot-bottom-nav .nav-link.active {
  color: var(--spot-cyan);
  text-shadow: 0 0 14px rgba(112, 247, 255, 0.35);
}

body[data-page="spot-terminal"].spot-chart-open .spot-terminal {
  padding-bottom: calc(408px + env(safe-area-inset-bottom, 0px));
}

@media (max-width: 380px) {
  .spot-terminal {
    --spot-pad-x: 10px;
    grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
  }

  .spot-book {
    padding-left: max(8px, env(safe-area-inset-left, 8px));
  }

  .spot-trade-form {
    padding-right: max(8px, env(safe-area-inset-right, 8px));
  }
}

.spot-pair-caret {
  margin-left: auto;
  color: var(--spot-cyan);
  font-size: 14px;
  text-shadow: 0 0 12px rgba(112, 247, 255, 0.45);
}

.spot-pair-sheet {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  align-items: end;
  background: rgba(4, 8, 16, 0.78);
  backdrop-filter: blur(10px);
}

.spot-pair-sheet[hidden] {
  display: none !important;
}

.spot-pair-sheet-card {
  position: relative;
  overflow: hidden;
  padding: 18px 18px calc(18px + env(safe-area-inset-bottom));
  border-radius: 22px 22px 0 0;
  border: 1px solid rgba(112, 247, 255, 0.22);
  background: var(--spot-card-bg);
  box-shadow: var(--spot-card-shadow);
}

.spot-pair-sheet-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.12) 0%, transparent 28%);
  pointer-events: none;
}

.spot-pair-sheet-head {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.spot-pair-sheet-head h3 {
  margin: 0;
  font-size: 16px;
  color: var(--spot-cyan-bright);
}

.spot-pair-sheet-head button {
  width: 36px;
  height: 36px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.28);
  color: #fff;
  font-size: 22px;
  cursor: pointer;
}

.spot-pair-sheet-note {
  position: relative;
  z-index: 1;
  margin: 0 0 12px;
  color: var(--spot-muted);
  font-size: 12px;
}

.spot-pair-list {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 8px;
  max-height: 52vh;
  overflow: auto;
}

.spot-pair-list button {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 0 14px;
  border: 1px solid rgba(112, 247, 255, 0.16);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06) 0%, rgba(0, 0, 0, 0.28) 100%);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.08) inset,
    0 -6px 14px rgba(0, 0, 0, 0.28) inset;
  color: #effbff;
  font-weight: 800;
  cursor: pointer;
}

.spot-pair-list button.is-on {
  border-color: rgba(112, 247, 255, 0.45);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.12) inset,
    0 0 18px rgba(112, 247, 255, 0.18);
}

.spot-pair-list img {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid rgba(112, 247, 255, 0.2);
}
