:root {
  color-scheme: dark;
  --bg: #050505;
  --panel: #090909;
  --panel-2: #101010;
  --line: #1f1f1f;
  --line-soft: #161616;
  --muted: #8b8b8b;
  --muted-2: #5f5f5f;
  --text: #f5f5f5;
  --green: #22c55e;
  --red: #ef4444;
  --accent: #ffffff;
  --amber: #b9b9b9;
}

* {
  box-sizing: border-box;
  scrollbar-width: thin;
  scrollbar-color: rgba(88, 88, 88, 0.52) transparent;
}

[hidden] {
  display: none !important;
}

*::-webkit-scrollbar {
  width: 4px;
  height: 4px;
}

*::-webkit-scrollbar-track {
  background: transparent;
}

*::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(76, 76, 76, 0.58);
}

*::-webkit-scrollbar-thumb:hover {
  background: rgba(118, 118, 118, 0.72);
}

*::-webkit-scrollbar-corner {
  background: transparent;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button {
  color: inherit;
  font: inherit;
}

button:focus {
  outline: none;
}

button:focus-visible {
  outline: 1px solid rgba(245, 245, 245, 0.24);
  outline-offset: -2px;
}

.terminal {
  width: 100vw;
  height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: 34px minmax(0, 1fr);
  background: var(--bg);
}

.topbar {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 7px;
  border-bottom: 1px solid var(--line);
  background: #050505;
}

.brand {
  min-width: 132px;
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  font-weight: 460;
  letter-spacing: 0;
}

.mark {
  width: 12px;
  height: 12px;
  display: inline-block;
  border: 1px solid rgba(245, 245, 245, 0.9);
  border-radius: 2px;
  background:
    linear-gradient(90deg, transparent 45%, #f4f4f4 45%, #f4f4f4 55%, transparent 55%),
    linear-gradient(0deg, transparent 45%, #f4f4f4 45%, #f4f4f4 55%, transparent 55%);
}

.frames {
  position: relative;
  min-height: 28px;
  display: flex;
  align-items: center;
  gap: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}

.frames::before,
.frames::after {
  display: none;
}

.frames::before {
  top: 3px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.16), transparent);
}

.frames::after {
  display: none;
  bottom: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0, 192, 135, 0.28), transparent);
}

.favorite-frames {
  display: flex;
  align-items: center;
  gap: 0;
}

.top-fill {
  flex: 1;
}

.frame,
.mini-button,
.connect,
.icon-button {
  height: 30px;
  border: 1px solid #191919;
  border-radius: 3px;
  background: #080808;
  color: var(--muted);
  cursor: pointer;
  transition: background 120ms ease, color 120ms ease, border-color 120ms ease;
}

.frame {
  min-width: 32px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 7px;
  font-size: 9.5px;
  line-height: 1;
  background: transparent;
  border-color: transparent;
  border-radius: 0;
}

.favorite-frames::after {
  content: "";
  width: 1px;
  align-self: stretch;
  min-height: 24px;
  margin: 0 5px;
  background: rgba(255, 255, 255, 0.11);
}

.timeframe-select {
  height: 22px;
  min-width: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 0 6px;
  margin-left: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--text);
  font-size: 10px;
  line-height: 1;
  cursor: pointer;
}

.current-timeframe-readout {
  display: inline-flex;
  min-width: 22px;
  justify-content: center;
  font-weight: 560;
}

.timeframe-select[aria-expanded="true"] .chevron,
.candle-style-select[aria-expanded="true"] .chevron {
  transform: translateY(-1px) rotate(180deg);
}

.candle-style-select {
  height: 22px;
  min-width: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 6px;
  margin-left: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--text);
  font-size: 10px;
  line-height: 1;
  cursor: pointer;
}

.candle-style-select:hover,
.timeframe-select:hover,
.session-zones-toggle:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.035);
}

.session-zones-toggle {
  height: 22px;
  min-width: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 7px;
  margin-left: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  font-size: 9px;
  font-weight: 560;
  line-height: 1;
  cursor: pointer;
}

.candle-style-select::before {
  content: "";
  width: 1px;
  align-self: stretch;
  min-height: 24px;
  margin-left: -6px;
  margin-right: 6px;
  background: rgba(255, 255, 255, 0.11);
}

.candle-style-preview {
  width: 36px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.candle-preview {
  position: relative;
  width: 50px;
  height: 32px;
  display: block;
  border: 0;
  border-radius: 0;
  background: transparent;
  overflow: visible;
}

.candle-style-preview .candle-preview {
  transform: scale(0.74);
  transform-origin: center;
  filter: drop-shadow(0 0 4px rgba(255, 255, 255, 0.08));
}

.candle-preview i {
  position: absolute;
  bottom: 7px;
  width: 7px;
  height: 15px;
  border: 1.5px solid currentColor;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.candle-preview i::before {
  content: "";
  position: absolute;
  left: 50%;
  top: -7px;
  width: 1.5px;
  height: 7px;
  transform: translateX(-50%);
  background: currentColor;
  opacity: 1;
}

.candle-preview i::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -7px;
  width: 1.5px;
  height: 7px;
  transform: translateX(-50%);
  background: currentColor;
  opacity: 1;
}

.candle-preview i:nth-child(1) {
  left: 8px;
  height: 17px;
  color: var(--green);
}

.candle-preview i:nth-child(2) {
  left: 22px;
  height: 13px;
  color: var(--red);
}

.candle-preview i:nth-child(3) {
  left: 36px;
  height: 19px;
  color: var(--green);
}

.candle-preview-candles i {
  background: currentColor;
}

.candle-preview-hollow i:nth-child(2) {
  background: currentColor;
}

.candle-preview-heikin i {
  width: 8px;
  border-width: 1.5px;
  border-radius: 0;
}

.candle-preview-heikin i:nth-child(1) {
  left: 8px;
  height: 13px;
  bottom: 8px;
  background: currentColor;
}

.candle-preview-heikin i:nth-child(2) {
  left: 21px;
  height: 18px;
}

.candle-preview-heikin i:nth-child(3) {
  left: 36px;
  height: 14px;
  bottom: 6px;
  background: currentColor;
}

.candle-preview-heikin i::before {
  top: -6px;
  height: 6px;
}

.candle-preview-heikin i::after {
  bottom: -6px;
  height: 6px;
}

.candle-preview-bars i {
  width: 1px;
  border: 0;
  border-radius: 0;
  background: currentColor;
  box-shadow: none;
}

.candle-preview-bars i::after {
  content: "";
  position: absolute;
  left: -7px;
  top: 5px;
  width: 15px;
  height: 7px;
  transform: none;
  background: transparent;
  border-top: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
}

.candle-preview-bars i::before {
  top: -7px;
  height: 27px;
}

.candle-preview-line i,
.candle-preview-area i {
  display: none;
}

.candle-preview-line::before,
.candle-preview-area::before {
  content: "";
  position: absolute;
  left: 7px;
  right: 6px;
  top: 12px;
  height: 9px;
  border-top: 2px solid var(--green);
  border-right: 2px solid var(--green);
  transform: skewY(-18deg);
}

.candle-preview-area::after {
  content: "";
  position: absolute;
  left: 7px;
  right: 7px;
  bottom: 4px;
  height: 16px;
  background: linear-gradient(180deg, rgba(0, 200, 120, 0.34), transparent);
  clip-path: polygon(0 58%, 35% 28%, 64% 48%, 100% 18%, 100% 100%, 0 100%);
}

.timeframe-menu,
.candle-style-menu {
  position: fixed;
  z-index: 40;
  max-height: min(500px, calc(100vh - 18px));
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  padding: 8px;
  border: 1px solid #262626;
  border-radius: 4px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.04), transparent 18%, transparent 82%, rgba(0, 192, 135, 0.035)),
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.012) 46%, rgba(0, 0, 0, 0.28) 47%),
    #050505;
  box-shadow:
    0 22px 60px rgba(0, 0, 0, 0.62),
    inset 0 1px 0 rgba(255, 255, 255, 0.085),
    inset 0 -1px 0 rgba(0, 192, 135, 0.13);
  backdrop-filter: blur(14px);
  animation: menuIn 120ms ease;
}

.timeframe-menu {
  width: min(356px, calc(100vw - 16px));
}

.candle-style-menu {
  width: min(292px, calc(100vw - 16px));
}

.timeframe-menu.hidden,
.candle-style-menu.hidden {
  display: none;
}

.timeframe-menu-head {
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.timeframe-menu-head strong,
.candle-style-menu-head strong {
  color: var(--text);
  font-size: 10px;
  font-weight: 560;
}

.timeframe-menu-head span,
.candle-style-menu-head span {
  min-width: 28px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 3px;
  color: var(--text);
  font-size: 10px;
  background: rgba(255, 255, 255, 0.035);
}

.candle-style-menu-head {
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.candle-style-list {
  display: grid;
  gap: 5px;
}

.candle-style-favorites {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 7px;
  padding-bottom: 7px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.045);
}

.candle-style-fav-chip {
  width: 44px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 4px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent),
    rgba(255, 255, 255, 0.018);
  cursor: pointer;
}

.candle-style-fav-chip:hover,
.candle-style-fav-chip.active {
  border-color: rgba(0, 192, 135, 0.32);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.065), transparent),
    rgba(0, 192, 135, 0.08);
}

.candle-style-fav-chip .candle-preview {
  transform: scale(0.8);
  transform-origin: center;
}

.candle-style-option {
  width: 100%;
  min-height: 48px;
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) 18px;
  align-items: center;
  gap: 8px;
  padding: 5px 7px;
  border: 1px solid transparent;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.018);
  color: var(--muted);
  text-align: left;
  cursor: pointer;
}

.candle-style-option:hover,
.candle-style-option.active {
  border-color: rgba(0, 192, 135, 0.28);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.052), transparent),
    rgba(0, 192, 135, 0.075);
  color: var(--text);
}

.candle-style-option strong {
  display: block;
  color: var(--text);
  font-size: 10px;
  font-weight: 560;
}

.candle-style-option small {
  display: block;
  margin-top: 3px;
  color: var(--muted-2);
  font-size: 9px;
}

.candle-style-star {
  width: 18px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #555;
  font-style: normal;
  font-size: 10px;
}

.candle-style-star:hover,
.candle-style-star.active {
  color: #f4f4f4;
}

.timeframe-group {
  display: grid;
  gap: 4px;
  padding-top: 7px;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.timeframe-group + .timeframe-group {
  margin-top: 7px;
}

.timeframe-group-title {
  color: var(--muted-2);
  font-size: 9px;
  text-transform: uppercase;
}

.timeframe-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 4px;
}

.timeframe-option {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 16px;
  gap: 2px;
  align-items: center;
}

.timeframe-value,
.timeframe-star {
  height: 25px;
  border: 1px solid transparent;
  border-radius: 3px;
  background: transparent;
  color: var(--muted);
  font-size: 10px;
  cursor: pointer;
}

.timeframe-value {
  text-align: center;
  padding: 0;
}

.timeframe-star {
  padding: 0;
  color: #555;
  font-size: 8.5px;
}

.timeframe-value:hover,
.timeframe-star:hover,
.timeframe-value.active {
  border-color: #2f2f2f;
  color: var(--text);
  background: rgba(255, 255, 255, 0.035);
}

.timeframe-star.active {
  color: #f3f3f3;
}

.mini-button {
  min-width: 34px;
  padding: 0 8px;
  font-size: 10px;
}

.mini-button.active {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.035)),
    rgba(0, 192, 135, 0.14);
  border-color: rgba(0, 192, 135, 0.38);
  color: #f7fff9;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.16),
    inset 0 0 0 1px rgba(0, 192, 135, 0.06);
}

.frame.active {
  background: transparent;
  border-color: transparent;
  color: #f7fff9;
  box-shadow: inset 0 -1px 0 rgba(0, 192, 135, 0.8);
}

.frame:hover,
.mini-button:hover,
.icon-button:hover,
.connect:hover {
  border-color: rgba(245, 245, 245, 0.16);
  color: var(--text);
}

.frame:hover,
.timeframe-select:hover {
  color: var(--text);
}

.actions {
  display: flex;
  align-items: center;
  gap: 5px;
}

.connect {
  padding: 0 10px;
  color: var(--text);
  background: #101010;
  font-size: 10px;
}

.connect.connected {
  border-color: rgba(34, 197, 94, 0.28);
  color: var(--green);
}

.icon-button {
  width: 28px;
  padding: 0;
  display: grid;
  place-items: center;
}

.icon-button span {
  font-size: 13px;
  font-weight: 420;
  line-height: 1;
}

.chart-shell {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: 35px minmax(0, 1fr);
  overflow: hidden;
}

.chart-head {
  display: grid;
  grid-template-columns: minmax(218px, 1fr) auto auto;
  align-items: center;
  gap: 6px;
  padding: 1px 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.115);
  background: #060606;
  min-width: 0;
  overflow: visible;
  position: relative;
}

.market-info {
  position: relative;
  min-width: 0;
}

.instrument {
  height: 30px;
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  min-width: 0;
}

.market-select {
  height: 30px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  padding: 0 3px 0 0;
  border: 0;
  border-radius: 3px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent 76%);
  color: var(--text);
  cursor: pointer;
  transition: color 120ms ease, opacity 120ms ease;
}

.market-select:hover {
  color: #ffffff;
}

.instrument-icon {
  --icon-color: #00c087;
  --icon-bg: rgba(0, 192, 135, 0.14);
  --icon-ring: rgba(0, 192, 135, 0.4);
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.02) 42%, rgba(0, 0, 0, 0.2)),
    var(--icon-bg);
  color: var(--icon-color);
  font-size: 9px;
  font-weight: 600;
  line-height: 1;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 0 14px color-mix(in srgb, var(--icon-color) 22%, transparent);
  overflow: hidden;
}

.instrument-icon[hidden] {
  display: none;
}

.instrument-icon img {
  width: 100%;
  height: 100%;
  display: none;
  object-fit: contain;
  padding: 2px;
}

.instrument-icon.has-image {
  border-color: var(--icon-ring);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.025)),
    color-mix(in srgb, var(--icon-color) 10%, #050505);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.11),
    0 0 16px color-mix(in srgb, var(--icon-color) 16%, transparent);
}

.instrument-icon.image-ready img {
  display: block;
}

.instrument-icon.image-ready span {
  display: none;
}

.instrument-icon[data-category="Futures"] {
  width: 22px;
  height: 22px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.13), rgba(255, 255, 255, 0.02) 42%, rgba(0, 0, 0, 0.2)),
    var(--icon-bg);
}

.instrument-icon[data-category="Metals"] {
  width: 22px;
  height: 22px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.035) 42%, rgba(0, 0, 0, 0.18)),
    var(--icon-bg);
}

.instrument-icon[data-category="Energy"] {
  width: 22px;
  height: 22px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.025) 42%, rgba(0, 0, 0, 0.22)),
    var(--icon-bg);
}

.instrument-pair {
  height: 24px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0;
  line-height: 1;
}

.instrument-symbol,
.instrument-quote {
  font-size: 13px;
  font-weight: 580;
  letter-spacing: 0;
}

.instrument-slash {
  color: #5c5c5c;
  font-size: 13px;
  font-weight: 520;
}

.instrument-quote {
  color: var(--text);
  line-height: 1;
}

.chevron {
  color: var(--muted);
  font-size: 10px;
  line-height: 1;
  transform: translateY(-1px);
  transition: transform 140ms ease, color 140ms ease;
}

.market-select[aria-expanded="true"] .chevron {
  color: var(--text);
  transform: translateY(-1px) rotate(180deg);
}

.market-select .chevron {
  width: 14px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 1px;
  border: 0;
}

#instrumentSource {
  max-width: min(260px, 34vw);
  display: inline-flex;
  align-items: center;
  color: #777;
  overflow: hidden;
  font-size: 9.5px;
  line-height: 1;
  padding-left: 2px;
  text-overflow: ellipsis;
}

#instrumentSource::before {
  content: "";
  width: 1px;
  height: 9px;
  display: inline-block;
  margin: 0 7px 0 0;
  background: rgba(255, 255, 255, 0.11);
}

.next-candle {
  min-width: 58px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 7px;
  border: 1px solid rgba(0, 255, 95, 0.18);
  border-radius: 5px;
  background: rgba(0, 255, 95, 0.055);
  color: #00ff5f;
  font-size: 9px;
  line-height: 1;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.market-menu {
  position: fixed;
  z-index: 42;
  width: min(372px, calc(100vw - 16px));
  max-height: min(520px, calc(100vh - 18px));
  overflow: hidden;
  scrollbar-gutter: stable;
  padding: 7px;
  border: 1px solid #282828;
  border-radius: 4px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.045), transparent 16%, transparent 84%, rgba(0, 192, 135, 0.035)),
    linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.012) 44%, rgba(0, 0, 0, 0.28) 45%),
    #050505;
  box-shadow:
    0 22px 60px rgba(0, 0, 0, 0.58),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  transform-origin: top left;
  animation: menuIn 130ms ease-out;
  backdrop-filter: blur(14px);
}

.market-menu.hidden {
  display: none;
}

.market-menu-head {
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.market-menu-head strong {
  font-size: 11px;
  font-weight: 560;
}

.market-menu-head span {
  min-width: 34px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.075);
  border-radius: 3px;
  color: var(--text);
  font-size: 10px;
  background: rgba(255, 255, 255, 0.028);
}

.market-search {
  width: 100%;
  height: 25px;
  padding: 0 8px;
  border: 1px solid #202020;
  border-radius: 3px;
  outline: none;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.026), transparent),
    rgba(0, 0, 0, 0.42);
  color: var(--text);
  font-size: 10px;
}

.market-tabs {
  height: 26px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 2px;
  padding: 2px;
  margin: 6px 0;
  border: 1px solid rgba(255, 255, 255, 0.055);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.018);
}

.market-tabs button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
  border: 0;
  border-radius: 3px;
  background: transparent;
  color: var(--muted);
  font-size: 9.5px;
  cursor: pointer;
}

.market-tabs button.active {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.13), rgba(255, 255, 255, 0.025)),
    rgba(0, 192, 135, 0.1);
  color: var(--text);
}

.market-list {
  max-height: 372px;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  display: grid;
  gap: 7px;
  padding-right: 2px;
}

.market-list section {
  display: grid;
  gap: 4px;
}

.market-section-title {
  color: var(--muted-2);
  font-size: 9px;
  text-transform: uppercase;
}

.market-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 24px;
  border: 1px solid transparent;
  border-radius: 3px;
}

.market-option {
  width: 100%;
  min-height: 36px;
  display: grid;
  grid-template-columns: 28px 38px minmax(0, 1fr) 72px 64px;
  align-items: center;
  gap: 6px;
  padding: 0 7px;
  border: 0;
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: transform 120ms ease, border-color 120ms ease, background 120ms ease, color 120ms ease;
}

.market-option.no-market-icon {
  grid-template-columns: 38px minmax(0, 1fr) 64px 50px;
}

.market-row-icon {
  --icon-color: #00c087;
  --icon-bg: rgba(0, 192, 135, 0.14);
  --icon-ring: rgba(0, 192, 135, 0.4);
  width: 21px;
  height: 21px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 999px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.02) 42%, rgba(0, 0, 0, 0.2)),
    var(--icon-bg);
  color: var(--icon-color);
  font-size: 8px;
  font-weight: 650;
  overflow: hidden;
}

.market-row-icon[data-category="Futures"],
.market-row-icon[data-category="Metals"],
.market-row-icon[data-category="Energy"] {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  font-size: 9px;
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 0 10px rgba(255, 255, 255, 0.035);
}

.market-row-icon img {
  width: 100%;
  height: 100%;
  display: none;
  object-fit: contain;
  padding: 1px;
}

.market-row-icon.has-image {
  border-color: var(--icon-ring);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.02)),
    color-mix(in srgb, var(--icon-color) 10%, #050505);
}

.market-row-icon.image-ready img {
  display: block;
}

.market-row-icon.image-ready span {
  display: none;
}

.market-row-icon[data-category="Metals"] {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.035) 42%, rgba(0, 0, 0, 0.18)),
    var(--icon-bg);
}

.market-row-icon[data-category="Energy"] {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.025) 42%, rgba(0, 0, 0, 0.22)),
    var(--icon-bg);
}

.market-option:hover {
  background: rgba(255, 255, 255, 0.035);
  transform: translateX(1px);
}

.market-row.active {
  border-color: rgba(0, 192, 135, 0.34);
  background: rgba(0, 192, 135, 0.095);
}

.market-option strong {
  font-size: 10.5px;
  font-weight: 560;
}

.market-option span {
  color: var(--muted);
  font-size: 9.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.market-option em {
  color: var(--muted-2);
  font-size: 9px;
  font-style: normal;
  text-align: right;
}

.market-option b {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1px;
  font-size: 9px;
  font-weight: 520;
  text-align: right;
  line-height: 1.05;
}

.market-option b i {
  color: var(--muted-2);
  font-size: 8px;
  font-style: normal;
}

.market-star {
  border: 0;
  border-left: 1px solid rgba(255, 255, 255, 0.045);
  background: transparent;
  color: #555;
  font-size: 9px;
  cursor: pointer;
}

.market-star.active {
  color: #f4f4f4;
  text-shadow: 0 0 10px rgba(0, 192, 135, 0.42);
}

.market-empty {
  padding: 12px 0;
  color: var(--muted-2);
  font-size: 10px;
  text-align: center;
}

.layer-controls {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  gap: 0;
  margin-left: 4px;
}

.layer-toggle {
  position: relative;
  height: 22px;
  min-width: 50px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 8px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  font-size: 9.5px;
  font-weight: 560;
  line-height: 1;
  cursor: pointer;
  box-shadow: none;
  transition: color 120ms ease, background 120ms ease, box-shadow 120ms ease;
}

.layer-toggle::after {
  content: "";
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 0;
  height: 1px;
  background: transparent;
  pointer-events: none;
}

.layer-toggle + .layer-toggle::before {
  content: "";
  width: 1px;
  align-self: stretch;
  min-height: 22px;
  margin-left: -8px;
  margin-right: 8px;
  background: rgba(255, 255, 255, 0.11);
}

.layer-toggle:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.035);
}

.indicator-toggle.active {
  color: #33f0a3;
  background: transparent;
  box-shadow: none;
}

.indicator-toggle.active::after {
  background: rgba(0, 192, 135, 0.72);
}

.session-zones-toggle.active {
  color: #6fa2ff;
  background: transparent;
  box-shadow: none;
}

.session-zones-toggle.active::after {
  background: rgba(47, 125, 255, 0.72);
}

.session-zones-toggle {
  min-width: 30px;
  width: 30px;
  padding: 0;
  justify-content: center;
}

.session-zones-glyph {
  width: 15px;
  height: 15px;
  display: inline-grid;
  grid-template-columns: repeat(3, 1px);
  justify-content: center;
  gap: 4px;
  opacity: 0.82;
}

.session-zones-glyph i {
  display: block;
  width: 1px;
  height: 15px;
  background: currentColor;
}

.session-zones-glyph i:nth-child(2) {
  opacity: 0.55;
}

.session-zones-toggle.disabled {
  opacity: 0.45;
}

.indicator-panel {
  position: fixed;
  z-index: 45;
  top: 76px;
  left: 50%;
  width: min(720px, calc(100vw - 18px));
  max-height: min(640px, calc(100vh - 96px));
  display: grid;
  grid-template-rows: auto auto auto minmax(130px, 1fr) auto auto;
  overflow: hidden;
  scrollbar-gutter: stable;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 5px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.052), rgba(255, 255, 255, 0.01) 40%, rgba(0, 0, 0, 0.22)),
    #050505;
  box-shadow:
    0 24px 70px rgba(0, 0, 0, 0.66),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  transform: translateX(-50%);
  backdrop-filter: blur(16px);
}

.indicator-panel.hidden {
  display: none;
}

.indicator-panel-head,
.indicator-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.indicator-panel-head {
  height: 26px;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.055);
}

.indicator-panel-head strong {
  font-size: 12px;
  font-weight: 580;
}

.indicator-panel-head span {
  color: var(--muted);
  font-size: 9px;
}

.indicator-tabs {
  height: 28px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  padding: 0;
  margin-bottom: 9px;
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 0;
  background: transparent;
}

.indicator-tabs button {
  position: relative;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  font-size: 10px;
  cursor: pointer;
}

.indicator-tabs button.active {
  background: transparent;
  color: #e9fff8;
  box-shadow: inset 0 -1px 0 rgba(0, 192, 135, 0.72);
}

.indicator-search,
.indicator-save-row input {
  width: 100%;
  height: 26px;
  padding: 0 8px;
  border: 1px solid rgba(255, 255, 255, 0.075);
  border-radius: 4px;
  outline: none;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.025), transparent),
    rgba(0, 0, 0, 0.38);
  color: var(--text);
  font-size: 10px;
}

.indicator-search {
  margin-bottom: 7px;
}

.indicator-library {
  display: grid;
  gap: 7px;
  align-content: start;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  min-height: 0;
  margin-bottom: 8px;
  padding-right: 2px;
}

.indicator-library::-webkit-scrollbar {
  width: 8px;
}

.indicator-library::-webkit-scrollbar-track {
  background: transparent;
}

.indicator-library::-webkit-scrollbar-thumb {
  border: 2px solid transparent;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.13);
  background-clip: content-box;
}

.indicator-library section {
  display: grid;
  gap: 5px;
}

.indicator-library strong {
  color: #9a9a9a;
  font-size: 8px;
  font-weight: 620;
  letter-spacing: 0;
  text-transform: uppercase;
}

.indicator-card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
}

.indicator-card {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 22px;
  grid-template-rows: 1fr;
  border: 1px solid rgba(255, 255, 255, 0.065);
  border-radius: 4px;
  background: #080909;
  overflow: hidden;
  transition: border-color 120ms ease, background 120ms ease;
}

.indicator-card:hover {
  border-color: rgba(0, 192, 135, 0.28);
  background: #0b0d0d;
}

.indicator-card-main {
  min-width: 0;
  height: 54px;
  display: grid;
  align-content: center;
  gap: 4px;
  padding: 0 9px;
  border: 0;
  background: transparent;
  color: var(--muted);
  text-align: left;
  cursor: pointer;
}

.indicator-card-name {
  min-width: 0;
  overflow: hidden;
  color: #e0e0e0;
  font-size: 10px;
  font-weight: 590;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.indicator-card-main small {
  min-width: 0;
  overflow: hidden;
  color: var(--muted-2);
  font-size: 8.5px;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.indicator-fav,
.indicator-delete {
  width: 22px;
  padding: 0;
  border: 0;
  border-left: 1px solid rgba(255, 255, 255, 0.045);
  background: transparent;
  color: #555;
  font-size: 9px;
  cursor: pointer;
  transition: color 120ms ease, background 120ms ease;
}

.indicator-delete {
  grid-column: 2;
  border-top: 1px solid rgba(255, 255, 255, 0.045);
  color: #777;
}

.indicator-card:has(.indicator-delete) {
  grid-template-rows: 1fr 22px;
}

.indicator-card:has(.indicator-delete) .indicator-card-main {
  grid-row: 1 / 3;
  height: 90px;
}

.indicator-card:hover,
.indicator-card-main:hover,
.indicator-fav:hover,
.indicator-delete:hover {
  border-color: rgba(0, 192, 135, 0.28);
  color: var(--text);
}

.indicator-fav.active {
  color: #33f0a3;
  text-shadow: 0 0 10px rgba(0, 192, 135, 0.28);
}

.indicator-delete:hover {
  color: var(--red);
}

.indicator-empty {
  padding: 10px 0;
  color: var(--muted-2);
  font-size: 10px;
  text-align: center;
}

.indicator-create-row {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 7px;
}

.indicator-create-row button {
  height: 26px;
  padding: 0 10px;
  border: 1px solid rgba(0, 192, 135, 0.26);
  border-radius: 3px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), transparent),
    rgba(0, 192, 135, 0.08);
  color: var(--text);
  font-size: 10px;
  cursor: pointer;
}

.indicator-create-row button:hover {
  border-color: rgba(0, 192, 135, 0.45);
}

.indicator-save-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px 46px 50px 50px;
  gap: 5px;
  margin-bottom: 6px;
}

.indicator-save-row button {
  height: 26px;
  border: 1px solid #242424;
  border-radius: 3px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.055), transparent),
    #0a0a0a;
  color: var(--muted);
  font-size: 10px;
  cursor: pointer;
}

.indicator-save-row button:hover {
  border-color: rgba(0, 192, 135, 0.35);
  color: var(--text);
}

#indicatorCode {
  width: 100%;
  height: 86px;
  resize: none;
  padding: 8px;
  border: 1px solid #1f1f1f;
  border-radius: 4px;
  outline: none;
  background: rgba(0, 0, 0, 0.42);
  color: var(--text);
  font: 10px/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.indicator-editor {
  display: none;
  gap: 0;
  margin-top: 2px;
}

.indicator-panel[data-tab="saved"][data-editor-open="true"] .indicator-editor {
  display: grid;
  gap: 6px;
}

#indicatorCode:focus {
  border-color: rgba(245, 245, 245, 0.22);
}

.indicator-actions {
  margin-top: 7px;
  justify-content: flex-end;
}

.indicator-style-list {
  display: grid;
  gap: 5px;
  margin-top: 8px;
}

.indicator-style-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted-2);
  font-size: 9px;
  text-transform: uppercase;
}

.indicator-style-title em {
  color: #747474;
  font-style: normal;
  text-transform: none;
}

.indicator-style-row {
  height: 34px;
  display: grid;
  grid-template-columns: 24px minmax(88px, 1fr) 30px 58px 42px 72px 58px 24px;
  align-items: center;
  gap: 5px;
  padding: 0 5px;
  border: 1px solid rgba(255, 255, 255, 0.055);
  border-radius: 4px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.026), transparent),
    rgba(255, 255, 255, 0.014);
}

.indicator-style-row.disabled {
  opacity: 0.52;
}

.indicator-style-name {
  min-width: 0;
  overflow: hidden;
  color: #d8d8d8;
  font-size: 10px;
  font-weight: 560;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.indicator-style-row input,
.indicator-style-row select,
.indicator-style-row button {
  height: 22px;
  border: 1px solid #242424;
  border-radius: 3px;
  color: var(--muted);
  font-size: 9px;
}

.indicator-style-row input[type="color"] {
  width: 30px;
  padding: 2px;
  background: #050505;
  cursor: pointer;
}

.indicator-eye,
.indicator-remove {
  width: 22px;
  padding: 0;
  display: inline-grid;
  place-items: center;
  background: #070707;
  cursor: pointer;
}

.indicator-eye span {
  position: relative;
  width: 13px;
  height: 8px;
  border: 1px solid currentColor;
  border-radius: 999px;
  opacity: 0.68;
}

.indicator-eye span::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: currentColor;
  transform: translate(-50%, -50%);
}

.indicator-eye.active {
  color: #33f0a3;
  border-color: rgba(0, 192, 135, 0.32);
}

.indicator-remove {
  color: #777;
}

.indicator-remove:hover {
  color: #ff6072;
  border-color: rgba(246, 70, 93, 0.34);
}

.indicator-style-row select,
.drawing-editor select {
  appearance: none;
  -webkit-appearance: none;
  background:
    linear-gradient(45deg, transparent 50%, rgba(216, 216, 216, 0.72) 50%) calc(100% - 10px) 8px / 5px 5px no-repeat,
    linear-gradient(135deg, rgba(216, 216, 216, 0.72) 50%, transparent 50%) calc(100% - 5px) 8px / 5px 5px no-repeat,
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.008)),
    #070707;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.055),
    inset 0 -1px 0 rgba(0, 0, 0, 0.68);
  cursor: pointer;
  padding: 0 18px 0 7px;
}

.native-select-hidden {
  display: none !important;
}

.custom-select {
  position: relative;
  min-width: 58px;
}

.drawing-editor .custom-select {
  width: 66px;
}

.indicator-style-row .custom-select {
  width: 100%;
}

.custom-select-button {
  width: 100%;
  height: 21px;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 5px;
  padding: 0 18px 0 7px;
  border: 1px solid rgba(255, 255, 255, 0.085);
  border-radius: 3px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.052), transparent 62%, rgba(0, 192, 135, 0.032)),
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.006)),
    #070707;
  color: #d8d8d8;
  font-size: 9px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    inset 0 -1px 0 rgba(0, 0, 0, 0.72);
  cursor: pointer;
}

.custom-select-button::after {
  content: "";
  position: absolute;
  right: 7px;
  top: 8px;
  width: 6px;
  height: 6px;
  border-right: 1px solid rgba(0, 192, 135, 0.86);
  border-bottom: 1px solid rgba(0, 192, 135, 0.86);
  transform: rotate(45deg);
  transition: transform 120ms ease;
}

.custom-select.open .custom-select-button {
  border-color: rgba(0, 192, 135, 0.38);
  color: var(--text);
  box-shadow:
    0 0 0 1px rgba(0, 192, 135, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.07);
}

.custom-select.open .custom-select-button::after {
  transform: translateY(2px) rotate(225deg);
}

.custom-select-menu {
  position: absolute;
  z-index: 80;
  left: 0;
  top: calc(100% + 5px);
  min-width: 100%;
  padding: 4px;
  border: 1px solid rgba(0, 192, 135, 0.24);
  border-radius: 4px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.055), transparent 64%, rgba(0, 192, 135, 0.035)),
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.012)),
    rgba(5, 5, 5, 0.98);
  box-shadow:
    0 18px 46px rgba(0, 0, 0, 0.54),
    inset 0 1px 0 rgba(255, 255, 255, 0.075);
  backdrop-filter: blur(14px);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-3px) scale(0.985);
  transition: opacity 120ms ease, transform 120ms ease;
}

.custom-select.open .custom-select-menu {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.custom-select-menu button {
  width: 100%;
  height: 25px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 8px;
  border: 1px solid transparent;
  border-radius: 3px;
  background: transparent;
  color: #cfcfcf;
  font-size: 10px;
  text-align: left;
  cursor: pointer;
}

.custom-select-menu button:hover {
  border-color: rgba(255, 255, 255, 0.075);
  background: rgba(255, 255, 255, 0.035);
  color: var(--text);
}

.custom-select-menu button.active {
  border-color: rgba(0, 192, 135, 0.28);
  background:
    linear-gradient(90deg, rgba(0, 192, 135, 0.16), rgba(0, 192, 135, 0.035)),
    rgba(255, 255, 255, 0.018);
  color: #f5f5f5;
}

.custom-select-menu button.active::after {
  content: "";
  width: 6px;
  height: 10px;
  border-right: 1px solid rgba(0, 192, 135, 0.95);
  border-bottom: 1px solid rgba(0, 192, 135, 0.95);
  transform: rotate(45deg) translateY(-1px);
}

.indicator-style-row select:hover,
.drawing-editor select:hover {
  border-color: rgba(255, 255, 255, 0.16);
  color: var(--text);
}

.indicator-style-row select:focus,
.drawing-editor select:focus {
  border-color: rgba(0, 192, 135, 0.42);
  outline: 0;
  box-shadow:
    0 0 0 1px rgba(0, 192, 135, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.07);
}

.indicator-style-row option,
.drawing-editor option {
  background: #070707;
  color: #d8d8d8;
}

.indicator-style-row button {
  background: #080808;
}

.indicator-style-row input[type="color"] {
  width: 30px;
  padding: 1px;
}

.custom-number {
  width: 42px;
  height: 21px;
  padding: 0 5px;
  border: 1px solid #242424;
  border-radius: 3px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.005)),
    #070707;
  color: #d8d8d8;
  font-size: 9px;
}

.custom-number.hidden {
  display: none;
}

.theme-custom-number {
  width: 44px;
  margin-left: 5px;
}

.indicator-style-row button {
  cursor: pointer;
}

.indicator-style-row button:hover {
  color: var(--red);
  border-color: rgba(239, 68, 68, 0.32);
}

.indicator-actions button {
  height: 24px;
  padding: 0 9px;
  border: 1px solid #222;
  border-radius: 3px;
  background: #0b0b0b;
  color: var(--muted);
  font-size: 10px;
  cursor: pointer;
}

.indicator-actions button:hover {
  border-color: #3a3a3a;
  color: var(--text);
}

.chart-overlay {
  position: absolute;
  z-index: 2;
  top: 6px;
  left: 10px;
  display: grid;
  gap: 5px;
  pointer-events: none;
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.55);
}

.overlay-price {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  min-width: 0;
}

.overlay-price strong {
  font-size: 13px;
  font-weight: 520;
  color: var(--text);
}

.overlay-price span {
  color: var(--muted);
  font-size: 10px;
}

.overlay-stats {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted-2);
  font-size: 9px;
  line-height: 1;
}

.overlay-stats strong {
  color: var(--text);
  font-size: 9px;
  font-weight: 500;
}

.indicator-strip {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  max-width: min(560px, calc(100vw - 112px));
  margin-top: 1px;
  pointer-events: auto;
}

.indicator-chip {
  height: 20px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0 6px;
  border: 1px solid rgba(255, 255, 255, 0.075);
  border-radius: 3px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.012)),
    rgba(4, 4, 4, 0.72);
  color: #d8d8d8;
  font-size: 9px;
  line-height: 1;
  cursor: pointer;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.075),
    0 8px 22px rgba(0, 0, 0, 0.16);
}

.indicator-chip:hover {
  border-color: rgba(255, 255, 255, 0.18);
  color: var(--text);
}

.indicator-chip.muted {
  opacity: 0.46;
}

.indicator-chip.muted .indicator-dot {
  background: #555 !important;
  box-shadow: none;
}

.indicator-dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  box-shadow: 0 0 10px currentColor;
}

.indicator-chip b {
  color: var(--muted-2);
  font-size: 11px;
  font-weight: 460;
}

.indicator-chip:hover b {
  color: var(--red);
}

.positive {
  color: var(--green) !important;
}

.negative {
  color: var(--red) !important;
}

.canvas-wrap {
  position: relative;
  min-height: 0;
  min-width: 0;
  background: var(--bg);
}

.drawing-toolbar {
  position: absolute;
  z-index: 7;
  left: 7px;
  top: 52px;
  width: 34px;
  display: grid;
  gap: 3px;
  padding: 4px;
  border: 1px solid rgba(255, 255, 255, 0.085);
  border-radius: 5px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.065), transparent 42%, rgba(0, 192, 135, 0.026)),
    linear-gradient(180deg, rgba(255, 255, 255, 0.062), rgba(255, 255, 255, 0.01) 48%, rgba(0, 0, 0, 0.34) 49%),
    rgba(5, 5, 5, 0.84);
  box-shadow:
    inset 1px 0 0 rgba(255, 255, 255, 0.07),
    inset -1px 0 0 rgba(0, 0, 0, 0.62),
    inset 0 1px 0 rgba(255, 255, 255, 0.09),
    0 14px 36px rgba(0, 0, 0, 0.38);
  backdrop-filter: blur(12px);
}

.drawing-toolbar button {
  position: relative;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.045);
  border-radius: 3px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.07), transparent 44%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(0, 0, 0, 0.16)),
    rgba(255, 255, 255, 0.014);
  color: rgba(245, 245, 245, 0.66);
  font-size: 10px;
  font-weight: 620;
  line-height: 1;
  cursor: pointer;
  transition: border-color 120ms ease, background 120ms ease, color 120ms ease, box-shadow 120ms ease;
}

.drawing-toolbar button:hover,
.drawing-toolbar button.active {
  border-color: rgba(245, 245, 245, 0.2);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.12), transparent 44%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.075), rgba(0, 0, 0, 0.12)),
    rgba(255, 255, 255, 0.04);
  color: var(--text);
}

.drawing-toolbar button.active {
  box-shadow:
    inset 0 0 0 1px rgba(0, 192, 135, 0.18),
    inset 0 -1px 0 rgba(0, 192, 135, 0.24);
}

.tool-group {
  position: relative;
  width: 24px;
  height: 24px;
}

.tool-group > button::after {
  content: "";
  position: absolute;
  right: 2px;
  bottom: 2px;
  width: 3px;
  height: 3px;
  border-right: 1px solid currentColor;
  border-bottom: 1px solid currentColor;
  opacity: 0.55;
}

.tool-flyout {
  position: absolute;
  left: 32px;
  top: -4px;
  min-width: 188px;
  max-height: min(520px, calc(100vh - 84px));
  overflow: auto;
  display: none;
  gap: 2px;
  padding: 6px;
  border: 1px solid rgba(255, 255, 255, 0.085);
  border-radius: 5px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.062), transparent 56%, rgba(0, 192, 135, 0.026)),
    linear-gradient(180deg, rgba(255, 255, 255, 0.052), rgba(255, 255, 255, 0.01)),
    rgba(5, 5, 5, 0.94);
  box-shadow:
    0 18px 46px rgba(0, 0, 0, 0.48),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(14px);
}

.tool-group:hover .tool-flyout,
.tool-group.open .tool-flyout {
  display: grid;
}

.drawing-toolbar .tool-flyout button {
  width: 100%;
  height: 28px;
  grid-template-columns: 24px minmax(0, 1fr);
  justify-content: start;
  gap: 7px;
  padding: 0 9px 0 3px;
  color: rgba(245, 245, 245, 0.7);
  text-align: left;
}

.tool-section {
  height: 18px;
  display: flex;
  align-items: center;
  padding: 4px 5px 2px;
  color: rgba(139, 139, 139, 0.9);
  font-size: 8.5px;
  font-weight: 620;
  text-transform: uppercase;
  border-top: 1px solid rgba(255, 255, 255, 0.045);
}

.tool-section:first-child {
  border-top: 0;
}

.tool-flyout span {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border: 1px solid rgba(255, 255, 255, 0.055);
  border-radius: 3px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.006)),
    rgba(255, 255, 255, 0.018);
  color: rgba(245, 245, 245, 0.82);
  font-size: 9.5px;
}

.tool-flyout strong {
  overflow: hidden;
  color: inherit;
  font-size: 10px;
  font-weight: 520;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tool-flyout [data-drawing-tool="long"] span,
.tool-flyout [data-drawing-tool="support"] span,
.tool-flyout [data-drawing-tool="buytag"] span,
.tool-flyout [data-drawing-tool="vwapline"] span {
  color: rgba(0, 192, 135, 0.95);
}

.tool-flyout [data-drawing-tool="short"] span,
.tool-flyout [data-drawing-tool="resistance"] span,
.tool-flyout [data-drawing-tool="selltag"] span {
  color: rgba(242, 54, 69, 0.95);
}

.tool-flyout [data-drawing-tool="targettag"] span,
.tool-flyout [data-drawing-tool="fibext"] span,
.tool-flyout [data-drawing-tool="tripletrend"] span,
.tool-flyout [data-drawing-tool="pitchfork"] span {
  color: rgba(167, 139, 250, 0.95);
}

.tool-flyout [data-drawing-tool="regression"] span,
.tool-flyout [data-drawing-tool="callout"] span {
  color: rgba(56, 189, 248, 0.95);
}

.drawing-editor {
  position: absolute;
  z-index: 8;
  left: 47px;
  top: 52px;
  width: 194px;
  padding: 7px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 5px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.055), transparent 62%, rgba(0, 192, 135, 0.026)),
    linear-gradient(180deg, rgba(255, 255, 255, 0.052), rgba(255, 255, 255, 0.012)),
    rgba(5, 5, 5, 0.92);
  box-shadow:
    0 18px 46px rgba(0, 0, 0, 0.46),
    inset 0 1px 0 rgba(255, 255, 255, 0.075);
  backdrop-filter: blur(14px);
}

.drawing-editor.hidden {
  display: none;
}

.drawing-editor-head,
.drawing-editor label,
.drawing-editor-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 7px;
}

.drawing-editor-head {
  margin-bottom: 6px;
}

.drawing-editor-head strong {
  color: var(--text);
  font-size: 10px;
  font-weight: 560;
}

.drawing-editor-head button {
  width: 20px;
  height: 20px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.018);
  color: var(--muted);
  cursor: pointer;
}

.drawing-editor label {
  height: 28px;
  border-top: 1px solid rgba(255, 255, 255, 0.035);
}

.position-fields.hidden {
  display: none;
}

.position-fields {
  margin-top: 4px;
  padding-top: 2px;
  border-top: 1px solid rgba(0, 192, 135, 0.12);
}

.drawing-editor label span {
  color: var(--muted);
  font-size: 9px;
}

.drawing-editor input[type="color"] {
  width: 34px;
  height: 20px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  background: transparent;
  cursor: pointer;
}

.drawing-editor select {
  width: 66px;
  height: 21px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 3px;
  color: var(--text);
  font-size: 9px;
  padding: 0 18px 0 7px;
}

.position-fields input {
  width: 82px;
  height: 21px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 3px;
  background: #080808;
  color: var(--text);
  font-size: 9px;
  text-align: right;
}

.position-stats {
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  color: rgba(0, 192, 135, 0.8);
  font-size: 9px;
  font-weight: 560;
}

.position-quick {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
  margin-top: 4px;
}

.position-quick button {
  height: 22px;
  border: 1px solid rgba(255, 255, 255, 0.075);
  border-radius: 3px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), transparent),
    rgba(255, 255, 255, 0.018);
  color: rgba(245, 245, 245, 0.72);
  font-size: 9px;
  cursor: pointer;
}

.position-quick button:hover {
  border-color: rgba(0, 192, 135, 0.32);
  color: var(--text);
}

.drawing-editor-actions {
  margin-top: 7px;
}

.drawing-editor-actions button {
  flex: 1;
  height: 23px;
  border: 1px solid rgba(255, 255, 255, 0.075);
  border-radius: 3px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), transparent),
    rgba(255, 255, 255, 0.018);
  color: rgba(245, 245, 245, 0.72);
  font-size: 9.5px;
  cursor: pointer;
}

.drawing-editor-actions button:hover,
.drawing-editor-head button:hover {
  border-color: rgba(245, 245, 245, 0.2);
  color: var(--text);
}

.chart-settings-toggle {
  position: absolute;
  z-index: 5;
  right: 10px;
  bottom: 10px;
  width: 29px;
  height: 29px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.095);
  border-radius: 4px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.01)),
    rgba(7, 7, 7, 0.86);
  color: var(--muted);
  cursor: pointer;
  backdrop-filter: blur(8px);
}

.chart-settings-toggle:hover,
.chart-settings-toggle.active {
  border-color: rgba(245, 245, 245, 0.28);
  color: var(--text);
}

.chart-settings-panel {
  position: absolute;
  z-index: 6;
  right: 10px;
  bottom: 46px;
  width: 248px;
  max-height: min(520px, calc(100vh - 130px));
  overflow: auto;
  padding: 8px;
  border: 1px solid #242424;
  border-radius: 5px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent 42%),
    #070707;
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.42);
}

.chart-settings-panel.hidden {
  display: none;
}

.chart-settings-head,
.chart-settings-panel label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.chart-settings-head {
  margin-bottom: 7px;
}

.style-presets {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 5px;
  margin-bottom: 8px;
}

.chart-settings-panel .style-presets button {
  width: 100%;
  height: 24px;
  margin: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), transparent),
    #0a0a0a;
}

.chart-settings-panel .style-presets button:hover {
  border-color: color-mix(in srgb, var(--accent) 38%, #3a3a3a);
  color: var(--text);
}

.settings-section {
  margin: 8px 0 4px;
  color: #d8d8d8;
  font-size: 9px;
  font-weight: 560;
}

.chart-settings-head strong {
  font-size: 10px;
  font-weight: 560;
}

.chart-settings-head span,
.chart-settings-panel label span {
  color: var(--muted);
  font-size: 9px;
}

.chart-settings-panel label {
  height: 29px;
  border-top: 1px solid rgba(255, 255, 255, 0.035);
}

.chart-settings-panel input[type="color"] {
  width: 32px;
  height: 20px;
  padding: 0;
  border: 1px solid #262626;
  border-radius: 3px;
  background: transparent;
  cursor: pointer;
}

.chart-settings-panel input[type="range"] {
  width: 104px;
  accent-color: var(--text);
  cursor: pointer;
}

.chart-settings-panel select {
  width: 116px;
  height: 22px;
  border: 1px solid #272727;
  border-radius: 3px;
  background: #0b0b0b;
  color: var(--text);
  font-size: 10px;
  outline: none;
}

.chart-settings-panel select:focus {
  border-color: color-mix(in srgb, var(--accent) 44%, #303030);
}

.chart-settings-panel button {
  width: 100%;
  height: 25px;
  margin-top: 7px;
  border: 1px solid #222;
  border-radius: 3px;
  background: #0b0b0b;
  color: var(--muted);
  font-size: 10px;
  cursor: pointer;
}

.chart-settings-panel button:hover {
  border-color: #3a3a3a;
  color: var(--text);
}

#chart {
  display: block;
  width: 100%;
  height: 100%;
  cursor: grab;
  touch-action: none;
  user-select: none;
}

#chart.dragging {
  cursor: grabbing;
}

#chart.drawing-mode {
  cursor: crosshair;
}

#chart.y-scaling {
  cursor: ns-resize;
}

#chart.position-moving {
  cursor: move;
}

#chart.position-sizing {
  cursor: ew-resize;
}

.loader,
.tooltip {
  position: absolute;
  pointer-events: none;
}

.loader {
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  padding: 7px 10px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 4px;
  background:
    linear-gradient(110deg, transparent 0%, rgba(255, 255, 255, 0.055) 45%, transparent 62%) -120px 0 / 120px 100% no-repeat,
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.008)),
    rgba(4, 4, 4, 0.88);
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0;
  box-shadow: 0 16px 42px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.045);
  animation: loader-scan 1.25s linear infinite;
}

.loader.hidden,
.tooltip.hidden {
  display: none;
}

.tooltip {
  min-width: 146px;
  padding: 7px 8px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.025), transparent),
    #080808;
  font-size: 10px;
  line-height: 1.5;
  color: var(--text);
  box-shadow:
    0 16px 32px rgba(0, 0, 0, 0.22);
}

@keyframes menuIn {
  from {
    opacity: 0;
    transform: translateY(-4px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes loader-scan {
  from {
    background-position: -130px 0, 0 0, 0 0;
  }
  to {
    background-position: 130px 0, 0 0, 0 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

@media (max-width: 1100px) {
  .indicator-card-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .indicator-style-row {
    grid-template-columns: 24px minmax(84px, 1fr) 30px 54px 40px 66px 52px 24px;
    gap: 4px;
  }
}

@media (max-width: 820px) {
  .terminal {
    grid-template-columns: 1fr;
    grid-template-rows: 68px minmax(0, 1fr);
  }

  .topbar {
    flex-wrap: wrap;
    align-content: center;
  }

  .brand {
    min-width: auto;
    width: calc(100% - 116px);
  }

  .actions {
    margin-left: auto;
  }

  .chart-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
  }

  .chart-head > div:first-child {
    grid-column: 1 / -1;
    width: 100%;
    min-width: 0;
  }

  .instrument {
    white-space: normal;
  }

  .frames {
    width: auto;
    max-width: 100%;
    gap: 2px;
    padding: 3px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .timeframe-menu {
    width: min(356px, calc(100vw - 16px));
  }

  .candle-style-select {
    min-width: 48px;
    padding: 0 5px;
  }

  .session-zones-toggle {
    min-width: 30px;
    width: 30px;
    padding: 0;
  }

  .layer-controls {
    margin-left: 0;
  }

  .layer-toggle {
    min-width: 46px;
    padding: 0 6px;
  }

  .layer-toggle + .layer-toggle::before {
    margin-left: -6px;
    margin-right: 6px;
  }

  .candle-style-menu {
    width: min(292px, calc(100vw - 16px));
  }

  .indicator-panel {
    top: 84px;
    left: 50%;
    width: calc(100vw - 16px);
    max-height: calc(100vh - 118px);
    transform: translateX(-50%);
  }

  .indicator-card-grid {
    grid-template-columns: 1fr;
  }

  .indicator-style-row {
    height: auto;
    min-height: 58px;
    grid-template-columns: 24px minmax(0, 1fr) 30px 46px 24px;
    grid-template-rows: 25px 25px;
    align-items: center;
  }

  .indicator-style-row .indicator-style-name {
    grid-column: 2;
  }

  .indicator-style-row input[type="color"] {
    grid-column: 3;
  }

  .indicator-style-row .indicator-remove {
    grid-column: 5;
  }

  .indicator-style-row .custom-select:nth-of-type(1),
  .indicator-style-row select[data-style-prop="width"] {
    grid-column: 1 / 3;
    grid-row: 2;
  }

  .indicator-style-row .custom-number {
    grid-column: 3;
    grid-row: 2;
    width: 100%;
  }

  .indicator-style-row .custom-select:nth-of-type(2),
  .indicator-style-row select[data-style-prop="lineStyle"] {
    grid-column: 3 / 5;
    grid-row: 2;
  }

  .indicator-style-row .custom-select:nth-of-type(3),
  .indicator-style-row select[data-style-prop="opacity"] {
    grid-column: 5;
    grid-row: 2;
  }

  .indicator-tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    height: auto;
  }

  .indicator-tabs button {
    height: 24px;
  }

  .frames::-webkit-scrollbar {
    display: none;
  }

  .chart-shell {
    grid-template-rows: 96px minmax(0, 1fr);
  }

  .chart-overlay {
    top: 7px;
    left: 8px;
    right: 8px;
  }

  .overlay-price {
    flex-wrap: wrap;
    row-gap: 2px;
  }

  .overlay-stats {
    flex-wrap: wrap;
    gap: 7px;
  }
}
