/* Crypto Glasses premium trade interface. Loaded after the legacy stylesheet. */
.trade-section {
  background:
    radial-gradient(circle at 18% 0%, rgba(32, 214, 194, 0.13), transparent 28%),
    radial-gradient(circle at 78% 16%, rgba(200, 155, 60, 0.11), transparent 24%),
    linear-gradient(180deg, #07131d 0%, #050914 62%, #040711 100%);
  height: 100dvh;
  min-height: 760px;
  overflow: hidden;
  padding: 64px 12px 10px;
}

.trade-section::before {
  content: none;
}

.trade-shell {
  display: flex;
  flex-direction: column;
  gap: 10px;
  height: calc(100dvh - 74px);
  min-height: 0;
  width: 100%;
}

.trade-heading {
  align-items: center;
  display: flex;
  gap: 24px;
  justify-content: flex-start;
  min-height: 58px;
  padding: 0;
}

.trade-title-block,
.market-ribbon,
.chart-pane,
.action-rail {
  background: rgba(7, 15, 27, 0.86);
  border: 1px solid rgba(222, 233, 246, 0.105);
  border-radius: 12px;
  box-shadow: none;
}

.trade-title-block {
  align-items: flex-start;
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  gap: 6px;
  max-width: 360px;
  min-width: 0;
  padding: 14px 18px;
  width: fit-content;
}

.trade-heading h2 {
  color: #f7fbff;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1;
  margin: 0;
  white-space: nowrap;
}

.trade-description {
  color: rgba(211, 223, 238, 0.62);
  font-size: 12px;
  line-height: 1.35;
  margin: 0;
  white-space: nowrap;
}

.market-ribbon {
  display: flex;
  flex: 0 0 auto;
  gap: 0;
  justify-content: flex-start;
  max-width: none;
  overflow: hidden;
  padding: 0;
}

.ribbon-item {
  background: transparent;
  border: 0;
  border-radius: 0;
  display: flex;
  flex-direction: column;
  flex: 0 0 auto;
  justify-content: center;
  min-width: 0;
  padding: 12px 16px;
  width: auto;
}

.ribbon-item + .ribbon-item,
.ribbon-item:last-child {
  border-left: 1px solid rgba(222, 233, 246, 0.085);
  border-right: 0;
}

.ribbon-item .label,
.trade-section .label {
  color: rgba(211, 223, 238, 0.56);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.ribbon-item strong {
  color: #f4f8ff;
  font-size: 18px;
  font-weight: 720;
  letter-spacing: -0.025em;
  line-height: 1;
}

.ribbon-item.linked {
  background: linear-gradient(180deg, rgba(200, 155, 60, 0.11), rgba(200, 155, 60, 0.035));
}

.ribbon-item.linked strong,
.chart-readout div:first-child strong {
  color: #d4aa57;
}

.trade-grid {
  display: grid;
  flex: 1 1 auto;
  gap: 10px;
  grid-template-columns: minmax(0, 1fr) clamp(348px, 24vw, 392px);
  margin: 0;
  min-height: 0;
  width: 100%;
}

.chart-pane {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  padding: 0;
}

.chart-toolbar {
  align-items: center;
  background: rgba(9, 20, 34, 0.72);
  border-bottom: 1px solid rgba(222, 233, 246, 0.09);
  display: flex;
  flex: 0 0 auto;
  gap: 12px;
  justify-content: space-between;
  min-height: 54px;
  padding: 0 16px;
}

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

.pair-title strong {
  color: #f7fbff;
  font-size: 15px;
  font-weight: 720;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.pair-title span {
  color: rgba(211, 223, 238, 0.55);
  font-size: 12px;
}

.chart-controls {
  align-items: center;
  display: flex;
  flex: 0 0 auto;
  gap: 6px;
}

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

.timeframe-picker {
  position: relative;
}

.timeframe,
.timeframe-menu-button,
.chart-toggle {
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(222, 233, 246, 0.105);
  border-radius: 7px;
  color: rgba(230, 239, 249, 0.68);
  height: 32px;
  min-width: 0;
  transition:
    background 160ms ease,
    border-color 160ms ease,
    color 160ms ease;
}

.timeframe:hover,
.timeframe-menu-button:hover,
.chart-toggle:hover {
  background: rgba(255, 255, 255, 0.055);
  color: #f7fbff;
}

.timeframe.active,
.timeframe-menu-button.active,
.chart-toggle.active {
  background: rgba(32, 214, 194, 0.14);
  border-color: rgba(32, 214, 194, 0.45);
  color: #f7fbff;
}

.timeframe-menu-button {
  align-items: center;
  display: inline-flex;
  gap: 8px;
  justify-content: center;
  min-width: 58px;
  padding: 0 10px;
}

.timeframe-menu-button span:last-child {
  color: rgba(211, 223, 238, 0.5);
  font-size: 10px;
  transform: translateY(-1px);
}

.timeframe-menu {
  background: rgba(8, 20, 27, 0.98);
  border: 1px solid rgba(222, 233, 246, 0.12);
  border-radius: 10px;
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.34);
  max-height: min(620px, calc(100dvh - 170px));
  overflow: auto;
  padding: 7px;
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  width: 224px;
  z-index: 10;
}

.timeframe-menu-title {
  color: rgba(211, 223, 238, 0.45);
  display: block;
  font-size: 10px;
  font-weight: 760;
  letter-spacing: 0.06em;
  padding: 10px 9px 6px;
  text-transform: uppercase;
}

.timeframe-option {
  align-items: center;
  background: transparent;
  border-radius: 7px;
  color: rgba(230, 239, 249, 0.76);
  display: flex;
  font-size: 13px;
  font-weight: 600;
  height: 34px;
  padding: 0 10px;
  width: 100%;
}

.timeframe-option:hover {
  background: rgba(255, 255, 255, 0.055);
  color: #f7fbff;
}

.timeframe-option.active {
  background: rgba(32, 214, 194, 0.82);
  color: #06111a;
}

.timeframe-menu-title + .timeframe-option,
.timeframe-option + .timeframe-menu-title {
  margin-top: 2px;
}

.chart-toggle {
  align-items: center;
  display: inline-flex;
  gap: 7px;
}

.chart-toggle span:first-child {
  align-items: center;
  background: rgba(200, 155, 60, 0.18);
  border: 1px solid rgba(200, 155, 60, 0.3);
  border-radius: 999px;
  color: #d4aa57;
  display: inline-flex;
  font-size: 10px;
  height: 18px;
  justify-content: center;
  padding: 0 6px;
}

.chart-frame {
  background:
    linear-gradient(180deg, rgba(11, 14, 17, 0.98), rgba(5, 8, 12, 0.98)),
    radial-gradient(circle at 72% 6%, rgba(32, 214, 194, 0.055), transparent 34%);
  border: 0;
  border-radius: 0;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  padding: 0;
  position: relative;
}

.professional-chart {
  display: block;
  height: 100%;
  min-height: 0;
  width: 100%;
}

.chart-tooltip {
  background: rgba(10, 14, 19, 0.94);
  border: 1px solid rgba(222, 233, 246, 0.16);
  border-radius: 8px;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.34);
  color: rgba(234, 239, 247, 0.8);
  display: flex;
  flex-direction: column;
  font-size: 11px;
  gap: 5px;
  left: 0;
  min-width: 208px;
  padding: 10px 11px;
  pointer-events: none;
  position: absolute;
  top: 0;
  z-index: 5;
}

.chart-tooltip strong {
  color: #f7fbff;
  font-size: 12px;
}

.chart-tooltip span:nth-child(4) {
  color: #f0b84f;
  font-weight: 700;
}

.chart-stats {
  align-items: center;
  background: rgba(7, 17, 29, 0.58);
  border: 1px solid rgba(222, 233, 246, 0.1);
  border-radius: 999px;
  bottom: 16px;
  color: rgba(226, 235, 246, 0.58);
  display: flex;
  gap: 13px;
  left: 16px;
  padding: 8px 11px;
  position: absolute;
  z-index: 2;
}

.chart-stats span {
  font-size: 11px;
  white-space: nowrap;
}

.chart-stats strong {
  color: rgba(247, 251, 255, 0.82);
  font-weight: 720;
}

.chart-history-status,
.chart-live-button {
  align-items: center;
  border-radius: 999px;
  display: inline-flex;
  font-size: 11px;
  font-weight: 750;
  position: absolute;
  z-index: 4;
}

.chart-history-status {
  background: rgba(7, 17, 29, 0.72);
  border: 1px solid rgba(222, 233, 246, 0.1);
  color: rgba(226, 235, 246, 0.7);
  left: 50%;
  padding: 8px 12px;
  top: 18px;
  transform: translateX(-50%);
}

.chart-live-button {
  background: rgba(32, 214, 194, 0.9);
  border: 1px solid rgba(151, 255, 243, 0.42);
  box-shadow: 0 14px 36px rgba(32, 214, 194, 0.18);
  color: #041116;
  cursor: pointer;
  justify-content: center;
  padding: 9px 13px;
  right: 72px;
  top: 18px;
}

.chart-live-button:hover {
  background: #4bddcf;
}

.chart-readout {
  background: rgba(7, 17, 29, 0.76);
  border: 1px solid rgba(222, 233, 246, 0.13);
  border-radius: 10px;
  display: flex;
  left: 16px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  right: auto;
  top: 16px;
  z-index: 2;
}

.chart-readout > div {
  min-width: 132px;
  padding: 10px 13px;
}

.chart-readout > div + div {
  border-left: 1px solid rgba(222, 233, 246, 0.09);
}

.chart-readout strong {
  color: #f7fbff;
  display: block;
  font-size: 20px;
  font-weight: 720;
  letter-spacing: -0.035em;
  line-height: 1;
}

.chart-readout .label {
  margin-bottom: 6px;
}

.chart-btc-chip strong {
  color: var(--teal);
}

.chart-legend {
  align-items: center;
  background: rgba(7, 17, 29, 0.58);
  border: 1px solid rgba(222, 233, 246, 0.1);
  border-radius: 999px;
  color: rgba(226, 235, 246, 0.62);
  display: flex;
  gap: 13px;
  padding: 8px 11px;
  position: absolute;
  right: 16px;
  top: 17px;
  z-index: 2;
}

.chart-legend span {
  align-items: center;
  display: inline-flex;
  font-size: 11px;
  gap: 6px;
  white-space: nowrap;
}

.chart-legend i {
  display: inline-block;
  height: 0;
  width: 18px;
}

.legend-glasses {
  border-top: 2px solid #d4aa57;
}

.legend-btc {
  border-top: 2px solid #0ecb81;
}

.legend-volume {
  border-top: 6px solid rgba(132, 150, 170, 0.45);
}

.legend-base {
  border-top: 2px dashed rgba(226, 235, 246, 0.5);
}

.legend-entry {
  border-top: 2px dashed rgba(32, 214, 194, 0.8);
}

@media (max-width: 760px) {
  .chart-stats {
    align-items: flex-start;
    border-radius: 10px;
    bottom: 10px;
    flex-direction: column;
    gap: 5px;
    left: 10px;
    padding: 8px 10px;
  }

  .chart-tooltip {
    max-width: calc(100% - 20px);
    min-width: 188px;
  }
}

.active-strip {
  align-items: stretch;
  background:
    linear-gradient(90deg, rgba(32, 214, 194, 0.085), transparent 42%),
    rgba(10, 20, 34, 0.96);
  border-top: 1px solid rgba(222, 233, 246, 0.105);
  display: grid;
  flex: 0 0 auto;
  grid-template-columns: minmax(150px, 1.16fr) repeat(5, minmax(106px, 1fr)) auto;
  margin: 0;
  min-height: 72px;
  padding: 0;
}

.active-strip.hidden {
  display: none !important;
}

.active-strip > div {
  border-right: 1px solid rgba(222, 233, 246, 0.085);
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  padding: 13px 14px;
}

.position-label {
  background: rgba(32, 214, 194, 0.055);
}

.active-strip strong {
  color: #f7fbff;
  display: block;
  font-size: 14px;
  font-weight: 720;
  letter-spacing: -0.01em;
  line-height: 1.1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.active-strip .state-positive {
  color: #25d4bf;
}

.active-strip .state-negative {
  color: #ff858b;
}

.active-strip.idle {
  background:
    linear-gradient(90deg, rgba(222, 233, 246, 0.045), transparent 42%),
    rgba(10, 20, 34, 0.88);
}

.active-strip.idle strong {
  color: rgba(226, 235, 246, 0.72);
}

.active-strip.idle .position-label strong,
.active-strip.idle #stripCurrent {
  color: #f7fbff;
}

.active-strip.idle .button {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(222, 233, 246, 0.12);
  color: rgba(247, 251, 255, 0.86);
}

.active-strip .button {
  align-self: center;
  height: 38px;
  margin: 0 14px;
  min-width: 126px;
  white-space: nowrap;
}

.action-rail {
  color: #f7fbff;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
  overflow: hidden;
  padding: 14px;
}

.rail-heading {
  border-bottom: 1px solid rgba(222, 233, 246, 0.09);
  margin: 0;
  padding: 0 0 12px;
}

.rail-heading strong {
  color: #f7fbff;
  display: block;
  font-size: 18px;
  font-weight: 720;
  letter-spacing: -0.015em;
  margin-top: 4px;
}

.rail-section {
  border-bottom: 1px solid rgba(222, 233, 246, 0.09);
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-bottom: 12px;
}

.rail-section:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.rail-section-top {
  gap: 10px;
}

.mode-tabs {
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(222, 233, 246, 0.105);
  border-radius: 9px;
  display: grid;
  gap: 3px;
  grid-template-columns: 1fr 1fr;
  padding: 3px;
}

.mode-tab {
  border-radius: 7px;
  color: rgba(226, 235, 246, 0.66);
  font-size: 12px;
  font-weight: 700;
  height: 34px;
}

.mode-tab.active {
  background: rgba(32, 214, 194, 0.82);
  color: #041017;
}

.mode-tab.active:hover {
  background: rgba(56, 222, 207, 0.92);
  color: #041017;
}

.quote-block {
  background:
    radial-gradient(circle at 78% 0%, rgba(200, 155, 60, 0.16), transparent 40%),
    rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(222, 233, 246, 0.105);
  border-radius: 10px;
  margin: 0;
  padding: 14px;
}

.quote-block strong {
  color: #f7fbff;
  display: block;
  font-size: 35px;
  font-weight: 740;
  letter-spacing: -0.055em;
  line-height: 1;
  margin-top: 7px;
}

.quote-block p {
  color: rgba(211, 223, 238, 0.62);
  font-size: 12px;
  line-height: 1.38;
  margin: 9px 0 0;
}

.inverse-rule {
  align-items: center;
  background: rgba(32, 214, 194, 0.055);
  border: 1px solid rgba(32, 214, 194, 0.13);
  border-radius: 9px;
  display: flex;
  justify-content: space-between;
  min-height: 42px;
  padding: 0 12px;
}

.inverse-rule span {
  color: rgba(211, 223, 238, 0.58);
  font-size: 12px;
}

.inverse-rule strong {
  color: #25d4bf;
  font-size: 12px;
  font-weight: 760;
}

.preorder-controls {
  border: 0;
  padding: 0;
}

.preorder-controls > .label {
  display: block;
  margin-bottom: 8px;
}

.multiplier-control,
.asset-toggle {
  display: flex;
  gap: 6px;
}

.multiplier,
.asset {
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(222, 233, 246, 0.105);
  border-radius: 7px;
  color: rgba(226, 235, 246, 0.72);
  height: 34px;
}

.multiplier.active,
.asset.active {
  background: rgba(32, 214, 194, 0.82);
  border-color: rgba(32, 214, 194, 0.55);
  color: #041017;
}

.multiplier.active:hover,
.asset.active:hover {
  background: rgba(56, 222, 207, 0.92);
  border-color: rgba(56, 222, 207, 0.68);
  color: #041017;
}

.summary-rows {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0;
}

.summary-rows > div {
  align-items: center;
  border-top: 1px solid rgba(222, 233, 246, 0.08);
  display: flex;
  justify-content: space-between;
  min-height: 38px;
}

.summary-rows span,
.pay-row > .label {
  color: rgba(211, 223, 238, 0.58);
  font-size: 12px;
}

.summary-rows strong {
  color: #f7fbff;
  font-size: 13px;
  font-weight: 720;
}

.amount-primary,
.amount-reference {
  display: block;
  text-align: right;
}

.amount-reference {
  color: rgba(211, 223, 238, 0.56);
  font-size: 11px;
  font-weight: 620;
  letter-spacing: 0;
  margin-top: 3px;
}

.amount-retry {
  background: transparent;
  border: 0;
  color: #25d4bf;
  cursor: pointer;
  display: block;
  font-size: 11px;
  font-weight: 720;
  margin: 5px 0 0 auto;
  padding: 0;
  text-align: right;
}

.amount-retry:hover {
  color: #54e8d6;
}

.preorder-decision {
  background: rgba(200, 155, 60, 0.075);
  border: 1px solid rgba(200, 155, 60, 0.16);
  border-radius: 10px;
  margin: 0;
  padding: 12px;
}

.decision-heading,
.pay-row {
  align-items: center;
  display: flex;
  justify-content: space-between;
}

.decision-heading span,
.decision-grid span {
  color: rgba(211, 223, 238, 0.58);
  font-size: 12px;
}

.decision-heading strong,
.decision-grid strong {
  color: #f7fbff;
  font-size: 13px;
  font-weight: 720;
}

.decision-grid {
  border-top: 1px solid rgba(222, 233, 246, 0.08);
  display: grid;
  gap: 8px;
  grid-template-columns: 1fr 1fr;
  margin-top: 10px;
  padding-top: 10px;
}

.pay-row {
  gap: 10px;
}

.action-rail .button.full {
  height: 44px;
}

.action-rail .text-button {
  color: rgba(211, 223, 238, 0.62);
  height: 34px;
  margin-top: -4px;
}

@media (min-width: 1101px) and (max-height: 820px) {
  .trade-section {
    padding-top: 58px;
  }

  .trade-shell {
    gap: 8px;
    height: calc(100dvh - 68px);
  }

  .trade-heading {
    min-height: 54px;
  }

  .trade-title-block,
  .ribbon-item {
    padding-bottom: 10px;
    padding-top: 10px;
  }

  .chart-toolbar {
    min-height: 50px;
  }

  .quote-block strong {
    font-size: 31px;
  }

  .summary-rows > div {
    min-height: 35px;
  }

  .active-strip {
    min-height: 68px;
  }
}

@media (max-width: 1100px) {
  .trade-section {
    height: auto;
    min-height: 100dvh;
    overflow: visible;
    padding: 88px 12px 12px;
  }

  .trade-shell {
    height: auto;
    min-height: auto;
  }

  .trade-heading,
  .trade-grid {
    grid-template-columns: 1fr;
  }

  .trade-heading {
    align-items: stretch;
    flex-wrap: wrap;
  }

  .market-ribbon {
    flex-wrap: wrap;
  }

  .chart-frame,
  #priceChart {
    height: 520px;
    min-height: 520px;
  }

  .action-rail {
    overflow: visible;
  }

  .active-strip {
    grid-template-columns: repeat(3, 1fr);
  }

  .active-strip .button {
    grid-column: 1 / -1;
    justify-self: start;
    margin: 0 14px 14px;
  }
}

@media (max-width: 760px) {
  .trade-section {
    padding: 116px 8px 12px;
  }

  .trade-title-block {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }

  .trade-heading h2 {
    font-size: 20px;
  }

  .trade-description {
    white-space: normal;
  }

  .market-ribbon {
    width: 100%;
  }

  .ribbon-item {
    flex: 1 1 calc(50% - 6px);
    padding: 11px 12px;
  }

  .chart-toolbar {
    align-items: stretch;
    flex-direction: column;
    min-height: auto;
    padding: 12px;
  }

  .chart-controls {
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .chart-frame,
  #priceChart {
    height: 430px;
    min-height: 430px;
  }

  .chart-readout {
    left: 10px;
    right: 10px;
    top: 10px;
  }

  .chart-readout > div {
    min-width: 0;
    width: 50%;
  }

  .chart-legend {
    bottom: 10px;
    left: 10px;
    right: auto;
    top: auto;
  }

  .active-strip {
    grid-template-columns: 1fr 1fr;
  }

  .position-label,
  .active-strip .button {
    grid-column: 1 / -1;
  }
}
