/* Compact top controls and visible live-price labels. */
:root {
  --live-label-fill: linear-gradient(90deg, transparent 0%, var(--price-label-bg) 100%);
}
.topbar {
  gap: 11px;
}
.top-actions {
  gap: 2px;
  position: relative;
  z-index: 40;
}
.language-picker {
  margin-left: 2px;
}
.language-trigger {
  width: 80px;
  min-width: 80px;
  gap: 3px;
  padding: 0 4px;
}
.language-trigger #languageCurrentName {
  max-width: 28px;
}
.language-trigger .language-flag {
  width: 20px;
  height: 14px;
  flex-basis: 20px;
}
.language-trigger-chevron {
  font-size: 12px;
}
.top-actions .icon-button {
  width: 31px;
  height: 31px;
}

/* Keep the original coin's live marker above the fixed price-scale panel. */
.price-line,
.lab-mode .price-line {
  right: 0;
  /* The fixed price panel is intentionally matte, but live quotes must sit
     above it so the last price remains readable at the chart edge. */
  z-index: 10;
  overflow: visible;
}

/* Bybit-style live guide: a white dashed extension from the latest candle to the price scale. */
.price-line::before {
  display: block;
  left: var(--live-line-start, 0px);
  top: 0;
  width: calc(var(--live-line-width, 100%) - var(--live-line-start, 0px));
  border-top: 1px dashed color-mix(in srgb, var(--space-white) 58%, transparent);
  opacity: 1;
}

/* Keep the fixed vertical price scale anchored to the chart's old right edge.
   The storm layer can extend beyond the clipped plot, but it must not move or
   visually cover the price panel. */
.price-scale-zone {
  right: 0;
  width: 50px;
  z-index: 8;
}
.axis-label {
  right: 2px;
  width: 46px;
  z-index: 9;
}

@media (max-width: 700px) {
  .price-scale-zone {
    right: 0;
    width: 50px;
  }
}
.price-line-marker {
  z-index: 7;
  left: var(--live-label-left, calc(var(--live-line-width, 100%) + 18px));
  right: auto;
  width: var(--live-label-width, 50px);
  min-width: var(--live-label-width, 50px);
  height: 26px;
  box-sizing: border-box;
  padding: 0;
  background: var(--live-label-fill);
  box-shadow: none;
  text-align: right;
  overflow: visible;
}
.lab-mode .price-line-marker,
.integrated-price-label .price-line-marker {
  width: var(--live-label-width, 50px);
  min-width: var(--live-label-width, 50px);
}
.price-line-marker .price-line-copy {
  position: absolute;
  top: 2px;
  right: 4px;
  left: auto;
  width: calc(100% - 4px);
  font-family: Inter, sans-serif;
  font-size: 10px;
  line-height: 1.15;
  text-align: right;
}
.price-line-marker .price-line-copy b,
.price-line-marker .price-line-copy em {
  display: block;
  max-width: 100%;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: clip;
}
.price-line-marker .price-line-copy b {
  font: 800 10px/1.15 Inter, sans-serif;
}
.price-line-marker .price-line-copy em {
  margin-top: 2px;
  font: 700 9px/1.15 Inter, sans-serif;
  font-style: normal;
}
.wufle-price-label {
  /* Match the original coin marker: the Wufle quote must also stay above
     the matte price-scale panel at the far right. */
  z-index: 10;
  width: 50px;
  height: 26px;
  min-height: 26px;
  box-sizing: border-box;
  padding: 0;
  overflow: visible;
}
.price-line-simple {
  left: var(--live-label-left, calc(var(--live-line-width, 100%) + 18px));
  right: auto;
  width: var(--live-label-width, 50px);
  min-width: var(--live-label-width, 50px);
  height: 26px;
  box-sizing: border-box;
  padding: 0 4px;
  background: var(--live-label-fill);
  box-shadow: none;
  color: var(--green);
  font: 800 10px/1.15 Inter, sans-serif;
  line-height: 26px;
  text-align: right;
  white-space: nowrap;
}
.price-line.negative .price-line-simple {
  color: var(--red);
}
.axis-label {
  z-index: 8;
}

@media (max-width: 700px) {
  .topbar {
    gap: 6px;
  }
  .top-actions {
    gap: 1px;
  }
  .language-picker {
    margin-left: 0;
  }
  .language-trigger {
    width: 72px;
    min-width: 72px;
    padding: 0 3px;
  }
  .language-trigger #languageCurrentName {
    max-width: 25px;
  }
  .language-trigger .language-flag {
    width: 19px;
    height: 13px;
    flex-basis: 19px;
  }
  .top-actions .icon-button {
    width: 28px;
    height: 30px;
  }
  .price-line,
  .lab-mode .price-line {
    right: 0;
  }
  .price-line-marker {
    left: var(--live-label-left, calc(var(--live-line-width, 100%) + 18px));
    right: auto;
  }
}

/* Center the lab entrance on the 50px price panel and seat it on the chart's bottom line. */
.lab-door {
  right: -7px;
  bottom: 7px;
  transform: scale(.54);
  transform-origin: bottom right;
  opacity: .7;
}

/* The translucent Wufle live-price track reaches back to the fruit marker. */
.wufle-price-label {
  width: var(--wufle-live-width, 50px);
  background: var(--live-label-fill);
  box-shadow: none;
  text-align: right;
}
.wufle-price-label b,
.wufle-price-label em {
  position: absolute;
  right: 4px;
  max-width: calc(100% - 4px);
  overflow: hidden;
  text-overflow: clip;
}
/* Keep the fruit quote exactly the same size as the main live-price quote. */
.wufle-price-label b {
  top: 2px;
  font: 800 10px/1.15 Inter, sans-serif;
}
.wufle-price-label em {
  top: 15px;
  margin-top: 0;
  font: 700 9px/1.15 Inter, sans-serif;
  font-style: normal;
}

@media (max-width: 700px) {
  .lab-door {
    right: -7px;
    bottom: 7px;
    transform: scale(.54);
  }
}

/* BIO follows the exact compact transparent price treatment used by BTC. */
.price-line.bio-price-line {
  right: 0;
  z-index: 6;
  overflow: visible;
}
.price-line.bio-price-line .price-line-marker,
.price-line.bio-price-line .price-line-simple {
  left: var(--live-label-left, calc(var(--live-line-width, 100%) + 18px));
  right: auto;
  width: var(--live-label-width, 50px);
  min-width: var(--live-label-width, 50px);
  height: 26px;
  box-sizing: border-box;
  padding: 0;
  background: var(--live-label-fill) !important;
  box-shadow: none !important;
  opacity: 1;
  filter: none;
  text-align: right;
}
.price-line.bio-price-line .price-line-marker .price-line-copy {
  top: 2px;
  right: 4px;
  left: auto;
  width: calc(100% - 4px);
  font: 10px/1.15 Inter, sans-serif;
  text-align: right;
}
.price-line.bio-price-line .price-line-marker .price-line-copy b {
  font: 800 10px/1.15 Inter, sans-serif;
}
.price-line.bio-price-line .price-line-marker .price-line-copy em {
  margin-top: 2px;
  font: 700 9px/1.15 Inter, sans-serif;
  font-style: normal;
}

/* LAB topbar: keep the selected market compact and make the Wufle mark read as a menu. */
.lab-mode .market-selector {
  width: 100px;
  min-width: 100px;
  padding: 0 3px;
  gap: 3px;
}
.lab-mode .market-selector .coin-icon {
  width: 22px;
  height: 22px;
  flex-basis: 22px;
}
.lab-mode .market-selector .market-name {
  font-size: 14px;
  min-width: max-content;
  overflow: visible;
  text-overflow: clip;
  white-space: nowrap;
  flex: 0 0 auto;
}
.lab-mode .market-selector .chevron {
  display: block;
  flex: 0 0 auto;
  margin-left: auto;
  font-size: 14px;
}
.lab-mode .market-selector .market-type {
  display: none;
}
.lab-mode .brand-mark {
  position: relative;
  width: 44px;
  height: 52px;
  flex-basis: 44px;
  margin-left: -3px;
  padding-right: 0;
}
.lab-mode .quote-block {
}
.lab-mode .top-stats {
}
.lab-mode .top-actions {
}

@media (max-width: 700px) {
  .lab-mode .market-selector {
    width: 90px;
    min-width: 90px;
    padding: 0 2px;
    gap: 2px;
  }
  .lab-mode .market-selector .coin-icon {
    width: 21px;
    height: 21px;
    flex-basis: 21px;
  }
  .lab-mode .market-selector .market-name {
    font-size: 14px;
  }
  .lab-mode .brand-mark {
    width: 40px;
    height: 50px;
    flex-basis: 40px;
    margin-left: -4px;
    padding-right: 0;
  }
}

/* Keep the original live quote as bright and transparent as the Wufle quote.
   It must sit in its own higher stacking layer above the matte price panel. */
.price-line {
  z-index: 12;
  isolation: isolate;
}
.price-line-simple,
.price-line-marker,
.wufle-price-label {
  z-index: 13;
  border: 0;
  background: linear-gradient(90deg, transparent 0%, color-mix(in srgb, var(--price-label-bg) 78%, transparent) 100%) !important;
  box-shadow: none !important;
  text-shadow: 0 0 5px currentColor, 0 0 10px color-mix(in srgb, currentColor 45%, transparent);
}
.price-line-simple {
  color: var(--green);
  font-weight: 800;
}
.price-line.negative .price-line-simple,
.price-line.negative .price-line-marker .price-line-copy b,
.price-line.negative .price-line-marker .price-line-copy em {
  color: var(--red);
}
.price-line:not(.negative) .price-line-marker .price-line-copy b,
.price-line:not(.negative) .price-line-marker .price-line-copy em {
  color: var(--green);
}
.price-line-simple,
.price-line-marker,
.wufle-price-label {
  opacity: 1;
  filter: none;
}

/* The price scale is a fixed matte surface, never a hover/focus state. Keep
   the live quote labels independent from chart focus and pointer interaction. */
.price-scale-zone,
.price-scale-zone:hover,
.price-scale-zone:focus,
.price-scale-zone:focus-visible,
.price-scale-zone:active {
  background: var(--axis-bg) !important;
  outline: 0 !important;
  transition: none !important;
}

.price-line,
.price-line::before,
.price-line-simple,
.price-line-marker,
.price-line-marker .price-line-copy,
.wufle-price-label {
  z-index: 2147483646 !important;
  opacity: 1 !important;
  filter: none !important;
  mix-blend-mode: normal !important;
}

.price-line-simple,
.price-line-marker,
.wufle-price-label {
  visibility: visible;
}

/* Keep the selected coin's live quote inside the top row at every width. */
.quote-block {
  min-width: 0;
  flex: 0 1 156px;
  overflow: hidden;
  transform: translateX(-3px);
}
.quote-block strong,
.quote-block span {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: clip;
  font-variant-numeric: tabular-nums;
}
.quote-block strong {
  display: block;
}

@media (max-width: 1120px) {
  .topbar { gap: 8px; }
  .market-selector { min-width: 136px; flex: 0 1 146px; }
  .quote-block { flex-basis: 132px; }
  .top-stats { min-width: 0; gap: 9px; }
  .top-stats div { min-width: 0; }
}

@media (max-width: 820px) and (min-width: 701px) {
  .market-selector { min-width: 118px; flex-basis: 126px; gap: 5px; }
  .market-selector .market-type { display: none; }
  .quote-block { flex-basis: 112px; }
  .top-stats { gap: 7px; }
  .top-stats div:nth-child(n+3) { display: none; }
}

@media (max-width: 700px) {
  .market-selector {
    min-width: 106px;
    flex: 0 1 116px;
    gap: 5px;
    overflow: hidden;
  }
  .market-selector .market-name {
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: clip;
  }
  .quote-block {
    flex: 1 1 78px;
    width: auto;
    max-width: 116px;
    padding-left: 0;
  }
  .quote-block strong { font-size: clamp(12px, 4.2vw, 15px); letter-spacing: -.65px; }
  .quote-block span { font-size: 10px; }
}

@media (max-width: 380px) {
  .topbar { gap: 4px; padding-left: 6px; padding-right: 6px; }
  .brand-mark { width: 34px; flex-basis: 34px; }
  .brand-logo { width: 28px; height: 28px; flex-basis: 28px; }
  .market-selector { min-width: 104px; flex-basis: 108px; padding: 0 2px; gap: 3px; }
  .market-selector .coin-icon { width: 21px; height: 21px; flex-basis: 21px; }
  .market-selector .market-name { flex: 1 1 auto; min-width: 0; font-size: 11.5px; letter-spacing: -.25px; }
  .market-selector .chevron { flex: 0 0 auto; margin-left: 0; font-size: 14px; }
  .quote-block { flex-basis: 60px; max-width: 68px; }
  .quote-block strong { font-size: clamp(11px, 3.8vw, 14px); letter-spacing: -.75px; }
  .language-trigger { width: 30px; min-width: 30px; justify-content: center; padding: 0; }
  .language-trigger #languageCurrentName,
  .language-trigger .language-trigger-chevron { display: none; }
  .top-actions .icon-button { width: 25px; }
}

/* Give the selected market its full symbol before spending space on the quote.
   The quote is intentionally nudged left, while the selector keeps its label
   as one unbroken, non-clipped unit on narrow screens. */
@media (max-width: 700px) {
  .brand-mark {
    flex: 0 0 32px;
    width: 32px;
    margin-left: -3px;
  }
  .market-selector {
    flex: 0 0 clamp(120px, 38vw, 132px);
    width: clamp(120px, 38vw, 132px);
    min-width: clamp(120px, 38vw, 132px);
    padding: 0 3px;
    gap: 4px;
    overflow: visible;
  }
  .market-selector .market-name {
    flex: 0 0 auto;
    min-width: max-content;
    overflow: visible;
    text-overflow: clip;
    white-space: nowrap;
    font-size: clamp(10px, 2.9vw, 12px);
    letter-spacing: -.35px;
  }
  .market-selector .chevron {
    flex: 0 0 auto;
    margin-left: auto;
  }
  .quote-block {
    flex: 1 1 52px;
    width: auto;
    max-width: 92px;
    min-width: 46px;
    margin-left: -3px;
    transform: translateX(-3px);
  }
}

@media (max-width: 380px) {
  .topbar { gap: 3px; padding-left: 4px; padding-right: 4px; }
  .brand-mark {
    flex-basis: 29px;
    width: 29px;
    margin-left: -4px;
  }
  .brand-logo { width: 26px; height: 26px; flex-basis: 26px; }
  .market-selector {
    flex-basis: clamp(120px, 38vw, 126px);
    width: clamp(120px, 38vw, 126px);
    min-width: clamp(120px, 38vw, 126px);
    padding-left: 2px;
    padding-right: 2px;
    gap: 3px;
  }
  .market-selector .market-name { font-size: clamp(9.5px, 3vw, 11px); }
  .quote-block {
    flex-basis: 50px;
    max-width: 58px;
    min-width: 44px;
    margin-left: -4px;
    transform: translateX(-4px);
  }
  .quote-block strong { font-size: clamp(10.5px, 3.6vw, 13px); }
}

/* Give the compact header a guaranteed quote slot. Long BIO prices such as
   0.03062 must finish cleanly instead of being clipped by flex shrinking. */
@media (max-width: 380px) {
  .quote-block {
    flex: 0 0 60px;
    width: 60px;
    min-width: 60px;
    max-width: 60px;
    overflow: visible;
    margin-left: -4px;
    transform: translateX(-4px);
  }
  .quote-block strong {
    width: 60px;
    max-width: none;
    font-size: clamp(11px, 3.6vw, 13px);
    letter-spacing: -.8px;
  }
  .quote-block span {
    width: 60px;
    max-width: none;
  }
}

@media (max-width: 340px) {
  .brand-mark { flex-basis: 27px; width: 27px; }
  .market-selector {
    flex-basis: 116px;
    width: 116px;
    min-width: 116px;
  }
  .quote-block,
  .quote-block strong,
  .quote-block span {
    width: 56px;
    min-width: 56px;
    max-width: 56px;
  }
  .quote-block { flex-basis: 56px; }
  .language-trigger { width: 28px; min-width: 28px; }
  .top-actions .icon-button { width: 23px; }
}

/* Make room for the full live quote without sacrificing the selected symbol. */
@media (max-width: 700px) {
  .market-selector .market-name {
    font-size: clamp(9px, 2.55vw, 10.5px);
    letter-spacing: -.48px;
  }
  .market-selector .chevron {
    margin-right: 4px;
    transform: translateX(-2px);
  }
}

@media (max-width: 380px) {
  .market-selector .market-name {
    font-size: clamp(8.5px, 2.7vw, 10px);
    letter-spacing: -.55px;
  }
  .market-selector .chevron {
    margin-right: 3px;
    transform: translateX(-2px);
  }
}

@media (max-width: 340px) {
  .market-selector .market-name {
    font-size: 8.5px;
    letter-spacing: -.58px;
  }
  .market-selector .chevron {
    margin-right: 2px;
    transform: translateX(-1px);
  }
}

/* Restore the coin symbol to its original readable size while keeping the
   selector compact enough for the full live quote on narrow screens. */
@media (max-width: 700px) {
  .market-selector {
    flex-basis: 114px;
    width: 114px;
    min-width: 114px;
    padding-left: 2px;
    padding-right: 2px;
    gap: 3px;
  }
  .market-selector .market-name {
    font-size: 14px;
    letter-spacing: .2px;
  }
  .market-selector .chevron {
    margin-left: auto;
    margin-right: 0;
    transform: none;
  }
}

@media (max-width: 380px) {
  .market-selector {
    flex-basis: 112px;
    width: 112px;
    min-width: 112px;
    padding-left: 2px;
    padding-right: 2px;
    gap: 2px;
  }
  .market-selector .market-name {
    font-size: 14px;
    letter-spacing: .1px;
  }
  .market-selector .chevron {
    margin-left: auto;
    margin-right: 0;
    transform: none;
  }
}

@media (max-width: 340px) {
  .market-selector {
    flex-basis: 110px;
    width: 110px;
    min-width: 110px;
  }
  .market-selector .market-name {
    font-size: 13px;
    letter-spacing: 0;
  }
}

/* Keep the Bitcoin fruit quote and the BIO quote on one shared left guide.
   Both labels move together by one pixel so their text starts stay aligned. */
.price-line.bio-price-line .price-line-marker .price-line-copy {
  transform: translateX(1px);
}
.wufle-price-label.btc-fruit-label b,
.wufle-price-label.btc-fruit-label em {
  right: 0;
}

/* Move the main chart coin's vertical live quote 2px farther left.
   BIO keeps its shared left guide with the fruit price labels. */
.price-line:not(.bio-price-line) .price-line-marker .price-line-copy,
.price-line:not(.bio-price-line) .price-line-simple {
  transform: translateX(-6px);
}

