.trade-page .topbar .top-nav a {
  color: rgba(226, 232, 240, 0.86);
}

.trade-page .topbar .top-nav a.is-current,
.trade-page .topbar .top-nav a:hover {
  color: #fbbf24;
}

.trade-page .dapp-hero::before {
  background:
    linear-gradient(135deg, rgba(26, 20, 17, 0.94), rgba(10, 12, 18, 0.82)),
    url("../assets/bg.jpg") center center / cover no-repeat;
}

.trade-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: 22px;
  align-items: start;
  justify-content: center;
}

.trade-page .dapp-reference-shell {
  width: min(100%, 1200px);
  max-width: 1200px;
  min-height: 812px;
  overflow: clip;
}

.trade-page .dapp-reference-shell > .topbar::after {
  left: 18%;
}

.trade-page .module-tabs {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.module-badge-button {
  cursor: pointer;
  font: inherit;
  min-height: 42px;
  padding: 0 16px;
  border: 0;
  border-radius: 999px;
  color: #0b0802;
  font-size: 13px;
  font-weight: 800;
  background-image: linear-gradient(90deg, #f4d35e 0%, #f2c94c 52%, #eea63a 100%);
  box-shadow: 0 12px 26px -14px rgba(242, 201, 76, 0.78);
  transition: transform 0.18s ease, filter 0.18s ease, box-shadow 0.18s ease;
}

.module-badge-button:hover:not(:disabled) {
  filter: brightness(1.05);
  transform: translateY(-1px);
}

.module-badge-button:active:not(:disabled) {
  transform: scale(0.985);
}

.module-badge-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.trade-page #refreshBtn.module-badge-button {
  min-height: 42px;
  padding: 0 16px;
  border: 0;
  border-radius: 999px;
  color: #0b0802;
  font-size: 13px;
  font-weight: 800;
  background-image: linear-gradient(90deg, #f4d35e 0%, #f2c94c 52%, #eea63a 100%);
  box-shadow: 0 12px 26px -14px rgba(242, 201, 76, 0.78);
}

.trade-price-hero {
  margin-bottom: 18px;
  padding: 18px 20px;
  border-radius: 22px;
  border: 1px solid rgba(249, 115, 22, 0.12);
  background: rgba(255, 255, 255, 0.04);
  text-align: center;
}

.trade-price-line {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.trade-price-reserves {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 12px;
  align-items: center;
}

.trade-price-reserve-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  line-height: 1.5;
  color: rgba(255, 241, 212, 0.76);
}

.trade-price-reserve-label {
  color: rgba(255, 241, 212, 0.68);
}

.trade-price-reserve-value {
  color: #fde68a;
  font-size: 13px;
  font-weight: 700;
}

.trade-price-pair {
  color: #fde68a;
  font-size: clamp(22px, 3vw, 30px);
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.trade-price-value {
  color: #ffffff;
  font-size: clamp(30px, 4.4vw, 42px);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
}

.trade-page .trade-chart-module .dapp-module-body {
  margin: 0;
  padding: 18px 20px 20px;
}

.trade-layout > section {
  min-width: 0;
}

.trade-page .trade-chart-module h2 {
  font-size: clamp(22px, 2.4vw, 28px);
}

.candle-description,
.candle-status {
  color: rgba(223, 204, 170, 0.72);
  font-size: 12px;
  line-height: 1.7;
  margin: 0 0 18px;
}

.candle-summary,
.candle-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 18px;
}

.candle-summary span {
  display: block;
  color: rgba(223, 204, 170, 0.72);
  font-size: 12px;
  margin-bottom: 6px;
}

#candlePrice {
  font-size: clamp(24px, 3vw, 34px);
  color: #fff;
  overflow-wrap: anywhere;
}

.candle-summary small {
  color: #fde68a;
  margin-left: 8px;
}

#candleChange { color: rgba(223, 204, 170, 0.72); }
#candleChange.is-up { color: #69dfb7; }
#candleChange.is-down { color: #ff8aa3; }

.candle-intervals {
  display: flex;
  gap: 4px;
  border-radius: 14px;
  padding: 4px;
  background: rgba(0, 0, 0, 0.25);
}

.candle-intervals button,
.candle-refresh {
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: rgba(223, 204, 170, 0.8);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}

.candle-intervals button[aria-pressed="true"] {
  background: linear-gradient(100deg, #f4d35e, #eea63a);
  color: #0b0802;
  font-weight: 700;
}

.candle-refresh {
  border-color: rgba(249, 115, 22, 0.2);
  color: #fde68a;
}

.candle-toolbar button:focus-visible {
  outline: 2px solid #fbbf24;
  outline-offset: 3px;
}

.candle-refresh:disabled { opacity: 0.5; cursor: wait; }
.candle-shell { position: relative; isolation: isolate; }
.candle-legend {
  min-height: 36px;
  color: #dfccaa;
  font-size: 11px;
  line-height: 1.6;
  overflow-wrap: anywhere;
  font-variant-numeric: tabular-nums;
}

.candle-overlay {
  position: absolute;
  z-index: 4;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 28px;
  color: #dfccaa;
  text-align: center;
  font-size: 13px;
  line-height: 1.8;
  pointer-events: none;
}

.candle-overlay[hidden] { display: none; }
.candle-status { margin: 12px 0 0; min-height: 40px; }
.candle-status.is-warning { color: #fbbf24; }

@media (max-width: 480px) {
  .candle-toolbar { gap: 8px; }
  .candle-intervals { flex: 1; }
  .candle-intervals button { flex: 1; padding: 0 8px; }
  .candle-refresh { width: 100%; }
}

.trade-chart-body .trade-chart-panel {
  margin-bottom: 0;
}

.trade-chart-panel {
  padding: 0;
  border: 0;
  background: transparent;
}

.trade-chart-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.trade-chart-symbol {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.trade-chart-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 52px;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(249, 115, 22, 0.18);
  background: rgba(249, 115, 22, 0.08);
  color: #fde68a;
  font-size: 12px;
  font-weight: 700;
}

.trade-chart-symbol strong {
  display: block;
  color: #ffffff;
  font-size: 24px;
  letter-spacing: -0.8px;
}

.trade-chart-symbol p {
  margin: 6px 0 0;
  color: rgba(223, 204, 170, 0.72);
  font-size: 13px;
}

.trade-chart-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  flex: 1;
}

.trade-chart-stats article {
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(249, 115, 22, 0.08);
  background: rgba(255, 255, 255, 0.03);
}

.trade-chart-stats span {
  display: block;
  color: rgba(223, 204, 170, 0.64);
  font-size: 11px;
  margin-bottom: 8px;
}

.trade-chart-stats strong {
  color: #ffffff;
  font-size: 20px;
  line-height: 1.2;
  letter-spacing: -0.6px;
}

.trade-chart-stats strong.is-up {
  color: #69dfb7;
}

.trade-chart-stats strong.is-down {
  color: #ff8aa3;
}

.chart-status {
  min-height: 20px;
  margin-bottom: 10px;
  color: rgba(223, 204, 170, 0.72);
  font-size: 12px;
  line-height: 1.7;
}

.trade-chart-canvas {
  width: 100%;
  height: 360px;
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid rgba(249, 115, 22, 0.08);
  background: rgba(7, 8, 14, 0.92);
}

.trade-daily-table-wrap {
  margin-top: 14px;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(249, 115, 22, 0.08);
  background: rgba(255, 255, 255, 0.03);
}

.trade-daily-table {
  width: 100%;
  border-collapse: collapse;
}

.trade-daily-table th,
.trade-daily-table td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid rgba(249, 115, 22, 0.08);
  font-size: 13px;
}

.trade-daily-table th {
  color: rgba(223, 204, 170, 0.7);
  font-weight: 600;
  background: rgba(255, 255, 255, 0.03);
}

.trade-daily-table td {
  color: #ffffff;
}

.trade-daily-table tbody tr:last-child td {
  border-bottom: 0;
}

.trade-daily-table .is-up {
  color: #69dfb7;
}

.trade-daily-table .is-down {
  color: #ff8aa3;
}

.trade-note-box {
  margin-top: 14px;
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px solid rgba(249, 115, 22, 0.08);
  background: rgba(255, 255, 255, 0.03);
  color: rgba(223, 204, 170, 0.76);
  font-size: 13px;
  line-height: 1.8;
}

.trade-note-compact {
  margin-top: 16px;
}

.trade-note-line {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(249, 115, 22, 0.08);
}

.trade-note-line:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.trade-note-line:first-child {
  padding-top: 0;
}

.trade-note-line span {
  color: rgba(223, 204, 170, 0.68);
  font-size: 12px;
}

.trade-note-line strong {
  color: #ffffff;
  font-size: 13px;
  line-height: 1.7;
  text-align: right;
  word-break: break-word;
}

.trade-field {
  padding: 16px;
  border-radius: 20px;
  border: 1px solid rgba(249, 115, 22, 0.1);
  background: rgba(13, 15, 20, 0.92);
}

.trade-field + .trade-field {
  margin-top: 12px;
}

.field-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: rgba(223, 204, 170, 0.66);
  font-size: 12px;
  margin-bottom: 12px;
}

.field-main {
  display: flex;
  align-items: center;
  gap: 12px;
}

.field-main input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: #ffffff;
  font-size: 30px;
  font-weight: 700;
  padding: 0;
}

.field-main input::placeholder {
  color: rgba(247, 244, 237, 0.26);
}

.token-pill {
  min-width: 86px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(249, 115, 22, 0.1);
  background: rgba(255, 255, 255, 0.04);
  color: #f7f4ed;
  text-align: center;
  font-weight: 700;
}

.helper-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
}

.helper-text {
  color: rgba(223, 204, 170, 0.7);
  font-size: 12px;
  line-height: 1.6;
}

.helper-balances {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.balance-spx {
  color: #fbbf24;
  font-weight: 600;
}

.balance-gas {
  color: #69dfb7;
  font-weight: 600;
}

.percent-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.percent-btn {
  min-width: 54px;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(249, 115, 22, 0.14);
  background: rgba(255, 255, 255, 0.04);
  color: #f7f4ed;
  cursor: pointer;
}

.swap-arrow {
  width: 44px;
  height: 44px;
  margin: 10px auto;
  border-radius: 50%;
  display: grid;
  place-items: center;
  border: 1px solid rgba(249, 115, 22, 0.1);
  background: rgba(255, 255, 255, 0.04);
  color: #fbbf24;
  font-size: 18px;
}

.summary-list {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.summary-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(249, 115, 22, 0.08);
  background: rgba(255, 255, 255, 0.03);
  color: rgba(223, 204, 170, 0.72);
  font-size: 13px;
}

.summary-item strong {
  color: #ffffff;
  text-align: right;
  word-break: break-word;
}

.secondary-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.trade-page .dapp-module .ghost-action,
.trade-page .dapp-module .primary-action {
  min-height: 50px;
  width: 100%;
  border-radius: 14px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
}

.trade-status {
  min-height: 22px;
  margin-top: 14px;
  color: rgba(223, 204, 170, 0.76);
  font-size: 13px;
  line-height: 1.8;
}

.trade-status.error {
  color: #ffb7c4;
}

.trade-status.success {
  color: #93e7bf;
}

.toast {
  position: fixed;
  top: 18px;
  left: 50%;
  transform: translateX(-50%) translateY(-8px);
  min-width: 220px;
  max-width: calc(100vw - 32px);
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(8, 8, 14, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #ffffff;
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.28);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 60;
  text-align: center;
  font-size: 13px;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

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

.trade-page .mobile-bottom-nav {
  display: none;
}

@media (max-width: 760px) {
  .trade-page .mobile-bottom-nav {
    display: flex;
  }

  .trade-chart-head {
    flex-direction: column;
  }

  .trade-chart-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }

  .trade-chart-canvas {
    height: 280px;
  }

  .trade-chart-module .dapp-module-body {
    margin: 18px;
    padding: 18px;
  }

  .trade-page .module-tabs {
    grid-template-columns: 1fr;
  }

  .secondary-row {
    grid-template-columns: 1fr;
  }

  .field-main input {
    font-size: 24px;
  }

  .helper-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .token-pill {
    min-width: 76px;
    padding-left: 12px;
    padding-right: 12px;
  }
}
