* {
  box-sizing: border-box;
}

body {
  background:
    radial-gradient(circle at top left, rgba(92, 61, 255, .08), transparent 34%),
    #080b18;
}

.currency-main {
  width: min(1380px, calc(100% - 40px));
  margin: 0 auto;
  padding: 122px 0 70px;
  color: #eef2fb;
}

.currency-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
  margin-bottom: 26px;
}

.currency-kicker {
  margin-bottom: 10px;
  color: #7968ff;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .12em;
}

.currency-head h1 {
  margin: 0 0 8px;
  font-size: clamp(32px, 4vw, 50px);
  line-height: 1.03;
}

.currency-head p {
  margin: 0;
  max-width: 680px;
  color: #8993b0;
  font-size: 14px;
  line-height: 1.55;
}

.currency-status {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 13px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 999px;
  background: rgba(15,18,38,.78);
  color: #939cb7;
  font-size: 12px;
  white-space: nowrap;
}

.currency-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #49e39a;
  box-shadow: 0 0 0 4px rgba(73,227,154,.08);
}

.currency-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  margin-bottom: 18px;
  scrollbar-width: none;
}

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

.currency-tabs button {
  flex: 0 0 auto;
  height: 38px;
  padding: 0 15px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 10px;
  background: rgba(255,255,255,.025);
  color: #8e98b5;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: .18s ease;
}

.currency-tabs button:hover {
  border-color: rgba(122,101,255,.28);
  color: #fff;
}

.currency-tabs button.active {
  border-color: rgba(122,101,255,.45);
  background: rgba(110,82,255,.14);
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.025);
}

.currency-tabs button.is-empty {
  opacity: .42;
}

.currency-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.currency-card {
  min-height: 145px;
  padding: 22px;
  border: 1px solid rgba(122,101,255,.14);
  border-radius: 18px;
  background:
    linear-gradient(
      180deg,
      rgba(16,19,40,.98),
      rgba(10,13,27,.99)
    );
}

.currency-card-accent {
  border-color: rgba(117,89,255,.34);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.025),
    0 0 40px rgba(82,39,255,.055);
}

.currency-card-label {
  margin-bottom: 18px;
  color: #747e9c;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.currency-card-exchange {
  margin-bottom: 7px;
  color: #9ba5c1;
  font-size: 13px;
  font-weight: 700;
}

.currency-card-value {
  color: #fff;
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -.03em;
}

.currency-card-accent .currency-card-value {
  color: #9f8cff;
}

.currency-opportunities,
.currency-market {
  margin-bottom: 18px;
  border: 1px solid rgba(122,101,255,.14);
  border-radius: 18px;
  background:
    linear-gradient(
      180deg,
      rgba(13,16,34,.98),
      rgba(8,11,23,.99)
    );
  overflow: hidden;
}

.currency-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 20px 22px;
  border-bottom: 1px solid rgba(255,255,255,.055);
}

.currency-section-head h2 {
  margin: 0 0 4px;
  color: #fff;
  font-size: 15px;
  font-weight: 750;
}

.currency-section-head p {
  margin: 0;
  color: #727d9a;
  font-size: 11px;
}

.currency-refresh {
  height: 38px;
  padding: 0 14px;
  border: 1px solid rgba(117,89,255,.34);
  border-radius: 10px;
  background: rgba(100,72,255,.08);
  color: #afa4ff;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}

.currency-refresh:hover {
  background: rgba(100,72,255,.14);
}

.currency-opportunity-list {
  display: grid;
  gap: 0;
}

.currency-opportunity {
  display: grid;
  grid-template-columns: 50px minmax(110px, .8fr) 1fr 1fr 110px;
  align-items: center;
  gap: 14px;
  min-height: 66px;
  padding: 0 22px;
  border-top: 1px solid rgba(255,255,255,.045);
  cursor: pointer;
  transition: background .15s ease;
}

.currency-opportunity:first-child {
  border-top: 0;
}

.currency-opportunity:hover {
  background: rgba(255,255,255,.018);
}

.currency-opportunity-rank {
  color: #616b88;
  font-size: 11px;
  font-weight: 700;
}

.currency-opportunity-pair {
  color: #fff;
  font-size: 13px;
  font-weight: 800;
}

.currency-opportunity-route {
  color: #8d97b4;
  font-size: 12px;
}

.currency-opportunity-price {
  color: #b8c0d7;
  font-size: 12px;
}

.currency-opportunity-diff {
  text-align: right;
  color: #54de9c;
  font-size: 13px;
  font-weight: 800;
}

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

.currency-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
}

.currency-table th {
  height: 46px;
  padding: 0 20px;
  text-align: left;
  color: #6e7896;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.currency-table td {
  padding: 18px 20px;
  border-top: 1px solid rgba(255,255,255,.045);
  color: #c4cadd;
  font-size: 13px;
}

.currency-exchange {
  color: #fff;
  font-weight: 750;
  text-transform: capitalize;
}

.currency-buy {
  color: #8ee9b7;
  font-weight: 700;
}

.currency-sell {
  color: #ffb0b0;
  font-weight: 700;
}

.currency-mid {
  color: #d9dded;
  font-weight: 700;
}

.currency-spread {
  color: #9185ff;
  font-weight: 700;
}

.currency-empty {
  padding: 34px 22px !important;
  text-align: center;
  color: #727d99 !important;
}

.currency-disclaimer {
  padding: 14px 2px 0;
  color: #59627c;
  font-size: 10px;
  line-height: 1.55;
}

@media (max-width: 900px) {
  .currency-summary {
    grid-template-columns: 1fr;
  }

  .currency-opportunity {
    grid-template-columns: 34px 1fr 90px;
    gap: 10px;
    padding: 12px 16px;
  }

  .currency-opportunity-route,
  .currency-opportunity-price {
    display: none;
  }
}

@media (max-width: 720px) {
  .currency-main {
    width: min(100% - 24px, 1380px);
    padding-top: 104px;
  }

  .currency-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .currency-head h1 {
    font-size: 32px;
  }

  .currency-status {
    align-self: flex-start;
  }

  .currency-card {
    min-height: 126px;
    padding: 18px;
  }

  .currency-card-value {
    font-size: 26px;
  }

  .currency-section-head {
    padding: 17px 16px;
  }

  .currency-tabs {
    margin-right: -12px;
  }
}

/* ===== CURRENCY VISUAL TUNE ===== */

.currency-main {
  padding-top: 112px;
}

.currency-head {
  margin-bottom: 20px;
}

.currency-head h1 {
  font-size: clamp(34px, 4vw, 46px);
  letter-spacing: -.035em;
}

.currency-head p {
  font-size: 13px;
}

.currency-status {
  margin-bottom: 2px;
  padding: 8px 12px;
  font-size: 11px;
}

.currency-tabs {
  margin-bottom: 16px;
}

.currency-tabs button {
  height: 36px;
  padding: 0 14px;
}

.currency-tabs button.is-empty {
  opacity: .62;
}

.currency-summary {
  gap: 12px;
  margin-bottom: 16px;
}

.currency-card {
  min-height: 126px;
  padding: 19px 22px;
}

.currency-card-label {
  margin-bottom: 14px;
}

.currency-card-exchange {
  margin-bottom: 5px;
}

.currency-card-value {
  font-size: 28px;
}

.currency-opportunities {
  border-color: rgba(117,89,255,.22);
}

.currency-opportunities .currency-section-head {
  background:
    linear-gradient(
      180deg,
      rgba(111,82,255,.06),
      transparent
    );
}

.currency-opportunities .currency-section-head h2 {
  font-size: 16px;
}

.currency-opportunity {
  min-height: 62px;
}

.currency-opportunity:hover {
  background: rgba(105,82,255,.05);
}

.currency-opportunity-pair {
  font-size: 13px;
}

.currency-opportunity-diff {
  font-size: 14px;
}

.currency-card-accent {
  background:
    radial-gradient(
      circle at 90% 10%,
      rgba(111,82,255,.12),
      transparent 45%
    ),
    linear-gradient(
      180deg,
      rgba(16,19,40,.98),
      rgba(10,13,27,.99)
    );
}

.currency-card-accent .currency-card-exchange {
  color: #a49cbc;
}

.currency-card-accent .currency-card-value {
  font-size: 30px;
}

@media (max-width: 720px) {
  .currency-main {
    padding-top: 100px;
  }

  .currency-head {
    margin-bottom: 18px;
  }

  .currency-card {
    min-height: 116px;
  }

  .currency-card-value {
    font-size: 24px;
  }
}

/* ===== EXCHANGE LOGOS + RANKS ===== */

.currency-exchange-wrap {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.currency-exchange-wrap .exchange-logo {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;

  width: 24px;
  height: 24px;
  margin: 0;

  border: 1px solid rgba(255,255,255,.08);
  border-radius: 6px;

  background: #111528;
  color: #fff;

  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.035);

  overflow: hidden;
}

.currency-exchange-wrap .exchange-logo svg {
  width: 15px;
  height: 15px;

  fill: currentColor;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.currency-exchange-wrap .exchange-logo.ex-BINANCE {
  color: #f3ba2f;
  background: rgba(243,186,47,.08);
}

.currency-exchange-wrap .exchange-logo.ex-KUCOIN {
  color: #24e8ad;
  background: rgba(36,232,173,.07);
}

.currency-exchange-wrap .exchange-logo.ex-MEXC {
  color: #39a7ff;
  background: rgba(57,167,255,.08);
}

.currency-exchange-wrap .exchange-logo.ex-BYBIT {
  color: #ffb11a;
  background: rgba(255,177,26,.07);
}

.currency-exchange-wrap .exchange-logo.ex-BITGET {
  color: #33d6df;
  background: rgba(51,214,223,.08);
}

.currency-exchange-wrap .exchange-logo.ex-BINGX {
  color: #6387ff;
  background: rgba(99,135,255,.08);
}

.currency-exchange-wrap .exchange-logo.ex-GATE {
  color: #3d8aff;
  background: rgba(61,138,255,.08);
}

.currency-exchange-wrap .exchange-logo.ex-OKX {
  color: #f3f4f8;
  background: rgba(255,255,255,.055);
}

.currency-exchange-wrap .exchange-logo.ex-HTX {
  color: #528dff;
  background: rgba(82,141,255,.08);
}

.currency-exchange-wrap .exchange-logo-fallback {
  font-size: 8px;
  font-weight: 800;
}

.currency-card-exchange .exchange-logo {
  width: 25px;
  height: 25px;
}

.currency-opportunity-rank {
  width: 30px;
  height: 30px;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  border: 1px solid rgba(255,255,255,.07);
  border-radius: 9px;

  background: rgba(255,255,255,.025);
  color: #737d9a;

  font-size: 10px;
  font-weight: 800;
}

.currency-opportunity-rank.rank-1 {
  color: #b8aaff;
  border-color: rgba(116,91,255,.35);
  background: rgba(116,91,255,.10);
}

.currency-opportunity-rank.rank-2 {
  color: #aeb6ce;
  border-color: rgba(174,182,206,.16);
}

.currency-opportunity-rank.rank-3 {
  color: #a58f84;
  border-color: rgba(165,143,132,.18);
}

@media (max-width: 720px) {
  .currency-exchange-wrap .exchange-logo {
    width: 21px;
    height: 21px;
  }

  .currency-exchange-wrap .exchange-logo svg {
    width: 13px;
    height: 13px;
  }

  .currency-opportunity-rank {
    width: 27px;
    height: 27px;
  }
}

/* ===== CURRENCY HISTORY CHART ===== */

.currency-chart-modal {
  display: none;

  position: fixed;
  inset: 0;

  z-index: 900000;

  align-items: center;
  justify-content: center;

  padding: 24px;
}

.currency-chart-modal.open {
  display: flex;
}

.currency-chart-backdrop {
  position: absolute;
  inset: 0;

  background: rgba(3,5,15,.78);

  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.currency-chart-body {
  position: relative;
  z-index: 1;

  width: min(1050px, 100%);
  max-height: 90vh;

  overflow-y: auto;

  padding: 24px;

  border: 1px solid rgba(126,101,255,.22);
  border-radius: 20px;

  background:
    linear-gradient(
      180deg,
      rgba(15,18,38,.99),
      rgba(7,10,23,.995)
    );

  box-shadow:
    0 30px 100px rgba(0,0,0,.52);
}

.currency-chart-close {
  position: absolute;

  top: 17px;
  right: 17px;

  width: 36px;
  height: 36px;

  display: flex;
  align-items: center;
  justify-content: center;

  border: 1px solid rgba(255,255,255,.09);
  border-radius: 10px;

  background: rgba(255,255,255,.04);

  color: #9ca5bf;

  font-size: 14px;

  cursor: pointer;

  z-index: 10;
}

.currency-chart-close:hover {
  color: #fff;
  background: rgba(255,255,255,.07);
}

.currency-chart-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;

  gap: 20px;

  margin-bottom: 20px;
  padding-right: 46px;
}

.currency-chart-kicker {
  margin-bottom: 7px;

  color: #7e6cff;

  font-size: 9px;
  font-weight: 800;

  letter-spacing: .11em;
}

.currency-chart-header h2 {
  margin: 0 0 6px;

  color: #fff;

  font-size: 25px;
  letter-spacing: -.025em;
}

.currency-chart-meta {
  color: #818ba8;

  font-size: 11px;
}

.currency-chart-periods {
  display: flex;

  gap: 5px;

  padding: 4px;

  border: 1px solid rgba(255,255,255,.06);
  border-radius: 10px;

  background: rgba(255,255,255,.02);
}

.currency-chart-periods button {
  height: 30px;

  min-width: 40px;

  padding: 0 10px;

  border: 0;
  border-radius: 7px;

  background: transparent;

  color: #777f9d;

  font: inherit;
  font-size: 10px;
  font-weight: 700;

  cursor: pointer;
}

.currency-chart-periods button.active {
  background: rgba(110,82,255,.15);

  color: #b9afff;
}

.currency-chart-section {
  margin-top: 12px;

  padding: 15px 16px 10px;

  border: 1px solid rgba(255,255,255,.055);
  border-radius: 14px;

  background: rgba(255,255,255,.012);
}

.currency-chart-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;

  gap: 14px;

  margin-bottom: 10px;

  color: #8993af;

  font-size: 10px;
  font-weight: 700;

  text-transform: uppercase;
  letter-spacing: .05em;
}

.currency-chart-section-head strong {
  color: #9f8cff;

  font-size: 12px;
}

.currency-chart-legend {
  display: flex;
  align-items: center;

  gap: 13px;

  font-size: 9px;

  text-transform: none;
  letter-spacing: 0;
}

.legend-buy {
  color: #58df9d;
}

.legend-sell {
  color: #ff8585;
}

.currency-chart-container {
  width: 100%;
  height: 290px;
}

.currency-chart-spread {
  height: 190px;
}

.currency-chart-empty {
  display: none;

  padding: 22px 10px 4px;

  color: #6f7896;

  font-size: 11px;

  text-align: center;
}

.currency-chart-empty.show {
  display: block;
}

.currency-opportunity {
  cursor: pointer;
}

.currency-table tbody tr {
  cursor: pointer;
}

.currency-table tbody tr:hover {
  background: rgba(105,82,255,.035);
}

@media (max-width: 720px) {

  .currency-chart-modal {
    align-items: flex-start;

    padding:
      112px
      10px
      14px;
  }

  .currency-chart-body {
    width: 100%;
    max-height:
      calc(100dvh - 126px);

    padding: 17px 13px;
  }

  .currency-chart-header {
    display: block;

    padding-right: 40px;
  }

  .currency-chart-header h2 {
    font-size: 21px;
  }

  .currency-chart-periods {
    margin-top: 14px;

    overflow-x: auto;

    width:
      calc(100vw - 72px);
  }

  .currency-chart-periods button {
    flex: 0 0 auto;
  }

  .currency-chart-section {
    padding: 13px 8px 8px;
  }

  .currency-chart-container {
    height: 235px;
  }

  .currency-chart-spread {
    height: 165px;
  }

}

/* ===== CURRENCY CHART — HEADER OFFSET FIX ===== */

@media (min-width: 721px) {

  .currency-chart-modal {
    align-items: flex-start !important;
    padding:
      92px
      24px
      24px !important;
  }

  .currency-chart-body {
    max-height:
      calc(100dvh - 116px) !important;

    margin: 0 auto !important;
  }

  .currency-chart-close {
    top: 18px !important;
    right: 18px !important;
    z-index: 50 !important;
  }

}
