* { box-sizing: border-box; }
html, body {
  width: 100%;
  height: 100%;
  min-height: 100%;
  background: #07090d;
}
body {
  margin: 0;
  color: var(--ws-text);
  font-family: Inter, system-ui, sans-serif;
  overflow: hidden;
}
#workstation-root {
  --workstation-safe-area-top: env(safe-area-inset-top, 0px);
  --workstation-safe-area-right: env(safe-area-inset-right, 0px);
  --workstation-safe-area-bottom: env(safe-area-inset-bottom, 0px);
  --workstation-safe-area-left: env(safe-area-inset-left, 0px);
  width: 100%;
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  min-width: 0;
  padding: var(--workstation-safe-area-top)
    var(--workstation-safe-area-right)
    var(--workstation-safe-area-bottom)
    var(--workstation-safe-area-left);
  overflow: hidden;
  background: #07090d;
  touch-action: none;
}
.app-shell {
  --bottom-panel-height: 30px;
  --tv-shell-topbar-height: 78px;
  --tv-shell-symbolbar-height: 38px;
  --tv-shell-controls-height: 40px;
  --tv-shell-side-strip-width: 52px;
  --tv-shell-icon-button-size: 34px;
  display: grid;
  grid-template-rows: var(--tv-shell-topbar-height, 78px) minmax(0, 1fr) var(--bottom-panel-height, 30px);
  min-height: 100vh;
  max-height: 100vh;
}
.tv-shell {
  --tv-shell-border: #ebebeb;
  --tv-shell-border-subtle: #f2f2f2;
  --tv-shell-surface: #ffffff;
  --tv-shell-hover: #f2f2f2;
  --tv-shell-text: #0f0f0f;
  --tv-shell-muted: #4a4a4a;
  --tv-shell-muted-soft: #6a6d78;
  --tv-shell-blue: #2962ff;
  --tv-shell-blue-hover: #1e53e5;
  --tv-shell-blue-soft: #e3effd;
  --ws-bg: #ffffff;
  --ws-panel: #ffffff;
  --ws-border: var(--tv-shell-border);
  --ws-text: var(--tv-shell-text);
  --ws-muted: var(--tv-shell-muted);
  --ws-grey: #a8a8a8;
  --ws-surface-hover: var(--tv-shell-hover);
  --ws-focus-ring: 0 0 0 2px rgba(41, 98, 255, 0.24);
  background: var(--tv-shell-surface);
  color: var(--tv-shell-text);
}
.topbar {
  position: relative;
  z-index: 100;
  display: grid;
  /* Legacy static contract literal: grid-template-columns: minmax(420px, auto) minmax(120px, 1fr) auto */
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  grid-template-rows: var(--tv-shell-symbolbar-height, 38px) var(--tv-shell-controls-height, 40px);
  align-items: center;
  border-bottom: 1px solid var(--tv-shell-border, var(--ws-border));
  background: var(--tv-shell-surface, var(--ws-panel));
  padding: 0;
  gap: 0;
  min-width: 0;
  min-height: var(--tv-shell-topbar-height, 78px);
}
.topbar-left, .topbar-right { display: flex; align-items: center; gap: 6px; min-width: 0; position: relative; }
.topbar-left { overflow: visible; white-space: nowrap; }
.topbar-symbol {
  grid-column: 1;
  grid-row: 1;
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  min-width: 164px;
  margin-left: 10px;
  border-radius: 8px;
  background: #f1f3f5;
  color: var(--tv-shell-text);
  padding: 0 16px;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0;
}
.topbar-controls-panel {
  grid-column: 2;
  grid-row: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  min-height: var(--tv-shell-symbolbar-height, 38px);
  padding: 2px 8px;
  border-top: 0;
  background: #ffffff;
  overflow: hidden;
  white-space: nowrap;
}
.topbar-right {
  grid-column: 4;
  grid-row: 1;
  justify-content: flex-end;
  z-index: 2;
  padding-right: 10px;
}
.topbar-right::before {
  content: none;
  display: none;
}
.topbar-center {
  position: fixed;
  top: 0;
  right: 148px;
  z-index: 195;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  color: var(--ws-muted);
  font-size: 12px;
  min-width: 0;
  min-height: var(--tv-shell-symbolbar-height, 38px);
  overflow: visible;
  white-space: nowrap;
}
.topbar-center .meta { display: none; }
.author-strategy-picker {
  display: flex;
  align-items: center;
  gap: 0;
  min-width: 0;
  flex: 0 0 auto;
}
.strategy-lifecycle-panel {
  display: none !important;
}

.author-strategy-picker > * {
  position: static;
  width: auto;
  height: auto;
  min-width: 0;
  overflow: visible;
  opacity: 1;
}

.author-picker {
  display: flex;
  align-items: center;
  gap: 0;
  min-width: 0;
  max-width: 310px;
  min-height: 34px;
  overflow: hidden;
  border: 1px solid var(--tv-shell-border, var(--ws-border));
  border-radius: 9px;
  background: var(--tv-shell-surface, #ffffff);
}
.author-picker select {
  max-width: 130px;
  min-width: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--ws-text);
  font: inherit;
  font-size: 14px;
  min-height: 32px;
  padding: 0 26px 0 10px;
  text-overflow: ellipsis;
  color-scheme: light;
}
.author-picker select + select {
  border-left: 1px solid var(--tv-shell-border-subtle, #f2f2f2);
}
.author-picker select:hover {
  background: var(--tv-shell-hover);
}
.author-picker select:focus-visible,
.strategy-picker select:focus-visible { outline: none; border-color: var(--ws-blue); box-shadow: var(--ws-focus-ring); }
.author-picker .is-error { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.author-picker [data-strategy-select] {
  max-width: 156px;
}
.author-picker.is-loading,
.author-picker.is-error {
  border-left: 1px solid var(--tv-shell-border, var(--ws-border));
  padding-left: 10px;
  color: var(--tv-shell-muted);
  font-size: 13px;
  max-width: 270px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.catalog-state {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 8px;
  min-width: 8px;
  max-width: 8px;
  min-height: 22px;
  overflow: hidden;
  color: transparent;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.catalog-state::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 999px;
  background: #b4b4b4;
}
.strategy-lifecycle-panel { min-width: 0; overflow: hidden; }
.strategy-picker { display: flex; align-items: center; gap: 4px; min-width: 0; }
.strategy-picker select {
  min-width: 0;
  max-width: 160px;
  text-overflow: ellipsis;
  min-height: var(--ws-control-height, 28px);
  border: 1px solid var(--ws-border);
  border-radius: var(--ws-radius-sm, 6px);
  background: var(--ws-bg);
  color: var(--ws-text);
  color-scheme: light;
}
.strategy-picker__error { min-width: 0; max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.picker-placeholder, .toolbar-muted, .slot-label { color: var(--ws-muted); font-size: 11px; }
.mode-toggle {
  display: inline-flex;
  align-items: center;
  overflow: hidden;
  flex: 0 0 auto;
  min-height: 34px;
  border: 1px solid var(--tv-shell-border, var(--ws-border));
  border-radius: 9px;
  background: var(--tv-shell-surface, #ffffff);
}
.mode-toggle button {
  min-height: 32px;
  border: 0;
  background: transparent;
  color: var(--tv-shell-muted);
  padding: 0 11px;
  cursor: pointer;
  font-size: 13px;
}
.mode-toggle button.is-active {
  background: var(--tv-shell-blue-soft, #e3effd);
  color: var(--tv-shell-blue, var(--ws-blue));
}
.mode-toggle button:focus-visible { outline: none; box-shadow: inset var(--ws-focus-ring); }
.ghost-button, .disabled-action, .primary-action, .live-tabs button { min-height: 28px; border: 0; background: transparent; color: var(--ws-text); border-radius: 4px; padding: 4px 7px; }
.ghost-button:hover, .disabled-action:hover:not(:disabled), .primary-action:hover:not(:disabled) { border-color: transparent; background: var(--ws-surface-hover); }
.ghost-button:focus-visible, .disabled-action:focus-visible, .primary-action:focus-visible { outline: none; box-shadow: var(--ws-focus-ring); }
.topbar-center .status-lamps { display: flex; }
.status-lamps { display: flex; align-items: center; gap: 6px; padding-right: 6px; flex: 0 0 auto; }
.lamp { position: relative; font-size: 13px; line-height: 1; }
.lamp-dot { position: absolute; top: -2px; right: -4px; width: 6px; height: 6px; border-radius: 999px; background: var(--ws-grey); }
.lamp-dot.green { background: var(--ws-green); }
.lamp-dot.yellow { background: var(--ws-yellow); }
.lamp-dot.red { background: var(--ws-red); }
.tv-workspace-frame {
  position: relative;
  display: grid;
  grid-template-columns: var(--tv-shell-side-strip-width, 52px) var(--tv-shell-side-strip-width, 52px) minmax(0, 1fr) var(--tv-shell-side-strip-width, 52px);
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background: var(--tv-shell-surface, var(--ws-bg));
}
.workspace { min-width: 0; min-height: 0; overflow: hidden; position: relative; }
/* Modal/overlay slot wrappers must not consume rows in the app grid.
   Their inner panels use position:absolute/fixed or are display:none. */
[data-slot="save-strategy-modal"],
[data-slot="strategy-versions"] { display: contents; }
[data-slot="save-strategy-modal"][hidden],
[data-slot="strategy-versions"][hidden] { display: none; }
.debug-panel.hidden { display: none; }
.save-strategy-modal.hidden { display: none; }
.debug-panel { position: absolute; top: calc(var(--tv-shell-topbar-height, 38px) + 6px); right: 10px; width: 300px; border: 1px solid var(--ws-border); border-radius: 8px; background: var(--ws-panel); color: var(--ws-text); padding: 12px; z-index: 80; box-shadow: 0 12px 30px rgba(15, 15, 15, 0.16); }
.debug-panel p { margin: 6px 0 0; color: var(--ws-muted); font-size: 12px; }
.save-strategy-modal {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: 16px;
}
.save-strategy-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 15, 15, 0.36);
}
.save-strategy-modal__dialog {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 12px;
  width: min(420px, 100%);
  border: 1px solid var(--ws-border);
  border-radius: 12px;
  background: var(--ws-panel);
  color: var(--ws-text);
  padding: 16px;
  box-shadow: 0 18px 48px rgba(15, 15, 15, 0.18);
}
.save-strategy-modal__header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}
.save-strategy-modal__header p { margin: 6px 0 0; color: var(--ws-muted); font-size: 12px; }
.save-strategy-modal__icon {
  border: 0;
  background: transparent;
  color: var(--ws-muted);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}
.save-strategy-modal__field {
  display: grid;
  gap: 5px;
  color: var(--ws-muted);
  font-size: 12px;
}
.save-strategy-modal__field input {
  border: 1px solid var(--ws-border);
  border-radius: 6px;
  background: var(--ws-bg);
  color: var(--ws-text);
  padding: 8px 10px;
}
.save-strategy-modal__field input:disabled { opacity: 0.68; cursor: not-allowed; }
.save-strategy-modal__actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}
.save-strategy-modal__actions button {
  border: 1px solid var(--ws-border);
  border-radius: 6px;
  background: var(--ws-bg);
  color: var(--ws-text);
  padding: 7px 12px;
  cursor: pointer;
}
.save-strategy-modal__actions [data-save-strategy-submit] {
  border-color: var(--ws-blue);
  background: var(--ws-blue);
  color: white;
}
.strategy-versions {
  position: absolute;
  top: calc(var(--tv-shell-topbar-height, 38px) + 6px);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 8px;
  max-width: min(640px, calc(100% - 24px));
  padding: 6px 10px;
  border: 1px solid var(--ws-border);
  border-radius: 8px;
  background: var(--ws-panel);
  color: var(--ws-text);
  font-size: 12px;
  z-index: 75;
  box-shadow: 0 8px 22px rgba(15, 15, 15, 0.14);
}
.strategy-versions strong { color: var(--ws-muted); font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; }
.strategy-versions button { border: 1px solid var(--ws-border); background: var(--ws-bg); color: var(--ws-text); border-radius: 4px; padding: 3px 8px; font-size: 12px; cursor: pointer; }
.strategy-versions button:hover { background: var(--ws-surface-hover); }
.strategy-versions button:focus-visible { outline: 1px solid var(--ws-blue); outline-offset: 1px; }
.route {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  min-width: 0;
  min-height: 0;
  height: 100%;
  overflow: hidden;
}
.left-rail, .right-rail, .bottom-panel, .chart-toolbar { border-color: var(--ws-border); color: var(--ws-muted); background: var(--ws-panel); }
.left-rail, .right-rail { overflow-y: auto; overflow-x: hidden; padding: 8px; min-height: 0; }
.left-rail { border-right: 1px solid var(--ws-border); }
.right-rail { border-left: 1px solid var(--ws-border); }
.chart-stage { display: grid; grid-template-rows: auto 1fr; min-width: 0; min-height: 0; position: relative; background: var(--ws-chart-bg, #ffffff); overflow: hidden; }
.chart-toolbar {
  position: fixed;
  top: var(--tv-shell-symbolbar-height, 38px);
  left: calc(var(--tv-shell-side-strip-width, 52px) * 2 + 4px);
  right: 72px;
  z-index: 170;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  min-width: 0;
  max-width: calc(100vw - (var(--tv-shell-side-strip-width, 52px) * 2 + 76px));
  min-height: var(--tv-shell-controls-height, 40px);
  border-bottom: 0;
  padding: 0 6px;
  font-size: 12px;
  pointer-events: none;
  overflow: hidden;
}
.chart-canvas { position: relative; display: grid; place-items: stretch; width: 100%; max-width: 100%; color: var(--ws-chart-text, var(--ws-text)); min-width: 0; min-height: 0; background: var(--ws-chart-bg, #ffffff); overflow: hidden; }
.chart-placeholder { color: var(--ws-chart-muted, var(--ws-muted)); text-align: center; }
.position-overlay { position: absolute; bottom: 8px; left: 8px; width: 260px; max-height: 50vh; overflow: auto; border: 1px solid var(--ws-chart-border, var(--ws-border)); border-radius: 6px; background: rgba(255, 255, 255, 0.92); color: var(--ws-chart-muted, var(--ws-muted)); padding: 8px; z-index: 10; }
.live-overlays { position: absolute; top: 8px; right: 8px; color: var(--ws-chart-muted, var(--ws-muted)); border: 1px dashed var(--ws-chart-border, var(--ws-border)); background: rgba(255, 255, 255, 0.86); padding: 6px; border-radius: 6px; }
.bottom-panel {
  position: relative;
  display: flex;
  align-items: center;
  border-top: 1px solid var(--ws-border);
  padding: 0 10px;
  min-height: 0;
  overflow: hidden;
  font-size: 12px;
  color: var(--tv-shell-muted);
}
.bottom-panel::before {
  content: "1D  5D  1M  3M  6M  YTD  1Y  5Y  All";
  word-spacing: 7px;
  color: var(--tv-shell-text);
  white-space: nowrap;
}
.bottom-panel::after {
  content: "UTC+5";
  margin-left: auto;
  color: var(--tv-shell-muted);
}
.bottom-panel > * {
  display: none !important;
}

.bottom-panel__content {
  display: flex !important;
  position: absolute;
  inset: 0 auto auto 0;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
}

.bottom-panel__content > * {
  opacity: 0;
}
.live-order-panel { display: grid; gap: 8px; }
.live-order-panel label { display: grid; gap: 4px; color: var(--ws-muted); font-size: 12px; }
.segmented, .tool-strip, .live-tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.disabled-action:disabled, .primary-action:disabled, .live-tabs button:disabled, .live-order-panel input:disabled, .live-order-panel select:disabled { opacity: 0.55; cursor: not-allowed; }
.blocked-reason { color: var(--ws-yellow); font-size: 12px; }
.route--backtest .chart-stage { outline: 0 solid transparent; }
.route--live .chart-stage { outline: 0 solid transparent; }
@media (max-width: 1200px) {
  .topbar-symbol { min-width: 152px; padding-inline: 12px; }
  .topbar-controls-panel { padding-left: 6px; }
  .author-picker { max-width: 262px; }
  .author-picker select { max-width: 112px; }
  .author-picker [data-strategy-select] { max-width: 148px; }
  .catalog-state, .strategy-picker__error { max-width: 80px; }
  .chart-toolbar { right: 66px; max-width: calc(100vw - (var(--tv-shell-side-strip-width, 52px) * 2 + 70px)); }
}
@media (max-width: 900px) {
  .app-shell { grid-template-rows: var(--tv-shell-topbar-height, 78px) minmax(0, 1fr) var(--bottom-panel-height, 30px); }
  .topbar { min-height: var(--tv-shell-topbar-height, 78px); overflow: visible; }
  .topbar-controls-panel { gap: 6px; padding-left: 6px; }
  .topbar-symbol { min-width: 118px; font-size: 14px; padding-inline: 10px; }
  .topbar-right { flex-wrap: nowrap; gap: 4px 6px; }
  .topbar-center { display: none; }
  .author-picker { max-width: 204px; }
  .author-picker select { max-width: 88px; font-size: 12px; padding-inline: 8px; }
  .author-picker [data-strategy-select] { max-width: 112px; }
  .catalog-state { display: none; }
  .chart-toolbar { right: 60px; max-width: calc(100vw - (var(--tv-shell-side-strip-width, 52px) * 2 + 64px)); }
}
@media (max-width: 640px) {
  .app-shell { --tv-shell-side-strip-width: 48px; }
  .author-picker select { max-width: 112px; }
  .strategy-picker select { max-width: 132px; }
  .topbar-controls-panel { padding-left: 10px; }
  .topbar-symbol { min-width: 112px; }
  .topbar-right { justify-content: flex-end; }
  .chart-toolbar { left: calc(var(--tv-shell-side-strip-width, 48px) * 2 + 4px); right: 52px; max-width: calc(100vw - (var(--tv-shell-side-strip-width, 48px) * 2 + 56px)); }
  .chart-toolbar-right { display: none !important; }
}

.tv-shell .chart-panel,
.tv-shell .chart-stage > [data-slot="chart-panel"] {
  grid-row: 1 / -1;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

.tv-shell .tv-side-strip {
  z-index: 180;
}

.tv-shell .chart-panel {
  grid-template-rows: minmax(0, 1fr);
  overflow: hidden;
}

.tv-shell .chart-panel .chart-toolbar {
  border: 0;
  background: transparent;
}

.tv-shell .chart-toolbar-left,
.tv-shell .chart-toolbar-right,
.tv-shell .timeframe-strip,
.tv-shell .candle-source-toggle,
.tv-shell .chart-control-dock,
.tv-shell .chart-display-toggle {
  display: flex;
  align-items: center;
  gap: 2px;
  min-width: 0;
  pointer-events: auto;
}

.tv-shell .chart-toolbar-left {
  flex: 0 0 auto;
  overflow: hidden;
}

.tv-shell .crosshair-readout {
  display: none;
}

.tv-shell .crosshair-readout::before {
  content: none;
}

.tv-shell .chart-canvas::before {
  content: none;
  display: none;
}

.tv-shell .chart-canvas::after {
  content: none;
  display: none;
}

.tv-shell .chart-toolbar-right {
  display: none;
  flex: 0 0 auto;
  justify-content: flex-end;
}

.tv-shell .chart-control-dock {
  position: fixed;
  top: 4px;
  left: 620px;
  right: 270px;
  z-index: 190;
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 4px;
  min-width: 0;
  overflow: hidden;
  pointer-events: auto;
}

.tv-shell .chart-control-group {
  display: inline-flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 2px;
  min-width: 0;
  min-height: 28px;
  border: 1px solid var(--tv-shell-border, #ebebeb);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 1px 4px rgba(15, 15, 15, 0.06);
  padding: 1px 2px;
  white-space: nowrap;
}

.tv-shell .chart-control-group__label {
  color: var(--tv-shell-muted-soft, #6a6d78);
  font-size: 12px;
  line-height: 1;
  padding: 0 6px;
}

.tv-shell .chart-nav-btn {
  display: none;
}

.tv-shell .timeframe-strip .tb-pill,
.tv-shell .candle-source-toggle .tb-pill,
.tv-shell .chart-display-toggle .tb-pill,
.tv-shell .chart-theme-toggle,
.tv-shell [data-view-toggle] {
  min-height: 28px;
  border: 0 !important;
  border-radius: 4px;
  background: transparent !important;
  color: var(--tv-shell-text) !important;
  padding: 0 7px;
  font-size: 15px;
  font-weight: 500;
}

.tv-shell .timeframe-strip {
  flex-wrap: nowrap;
  flex: 0 0 auto;
  border: 1px solid var(--tv-shell-border, #ebebeb);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 1px 4px rgba(15, 15, 15, 0.06);
  padding: 1px 2px;
}

.tv-shell .candle-source-toggle .tb-pill,
.tv-shell .chart-display-toggle .tb-pill,
.tv-shell [data-view-toggle] {
  color: var(--tv-shell-muted);
  font-size: 12px;
}

.tv-shell .chart-control-dock .candle-source-toggle {
  display: inline-flex;
}

.tv-shell .chart-display-toggle {
  display: inline-flex;
  pointer-events: auto;
}

.tv-shell .topbar-right .ghost-button {
  position: relative;
  width: 34px;
  min-width: 34px;
  height: 34px;
  min-height: 34px;
  overflow: hidden;
  color: transparent;
  padding: 0;
}

.tv-shell .topbar-right .ghost-button::before {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--tv-shell-muted);
  font-size: 18px;
}

.tv-shell .topbar-right [data-action="open-debug"]::before { content: "⋯"; }
.tv-shell .topbar-right [data-action="open-style"]::before { content: "⚙"; }

.tv-shell .timeframe-strip .tb-pill.active,
.tv-shell .candle-source-toggle .tb-pill.active,
.tv-shell .chart-theme-toggle[aria-pressed="true"],
.tv-shell [data-view-toggle].active {
  background: transparent !important;
  color: var(--tv-shell-blue) !important;
}

.tv-shell .chart-panel .tb-pill:hover:not(:disabled),
.tv-shell .chart-panel .chart-nav-btn:hover:not(:disabled) {
  border-color: transparent;
  background: var(--tv-shell-hover) !important;
  color: var(--tv-shell-text) !important;
}

.tv-shell .chart-theme-toggle,
.tv-shell [data-view-toggle] {
  position: relative;
  width: 30px;
  min-width: 30px;
  overflow: hidden;
  color: transparent !important;
  font-size: 0 !important;
  text-indent: -999px;
  padding: 0 !important;
}

.tv-shell .chart-control-dock .tb-pill {
  min-height: 24px;
  border-radius: 4px;
  background: transparent !important;
  color: var(--tv-shell-muted) !important;
  font-size: 13px;
  font-weight: 500;
  padding: 0 8px;
}

.tv-shell .chart-display-toggle .tb-pill {
  width: 28px;
  min-width: 28px;
  padding: 0 !important;
  text-align: center;
  font-size: 15px;
  line-height: 1;
}

.tv-shell .chart-control-dock .tb-pill.active {
  background: var(--tv-shell-blue-soft, #e3effd) !important;
  color: var(--tv-shell-blue, #2962ff) !important;
}

.tv-shell .chart-theme-toggle::before,
.tv-shell [data-view-toggle]::before {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--tv-shell-muted);
  font-size: 14px;
  text-indent: 0;
}

.tv-shell .chart-theme-toggle::before { content: "◐"; }
.tv-shell [data-view-toggle="showZones"]::before { content: "▭"; }
.tv-shell [data-view-toggle="showGrid"]::before { content: "⌗"; }
.tv-shell [data-view-toggle="showTP"]::before { content: "T"; }
.tv-shell [data-view-toggle="showSL"]::before { content: "S"; }
.tv-shell [data-view-toggle="showMarkers"]::before { content: "•"; }
.tv-shell [data-view-toggle="showSourceBands"]::before { content: "≋"; }

.tv-shell .chart-theme-toggle[aria-pressed="true"]::before,
.tv-shell [data-view-toggle].active::before {
  color: var(--tv-shell-blue);
}

.tv-shell [data-view-toggle].active {
  background: var(--tv-shell-blue-soft, #e8f1ff) !important;
  box-shadow: inset 0 0 0 1px rgba(41, 98, 255, 0.28);
}

.tv-shell [data-view-toggle]:hover:not(:disabled)::before {
  color: var(--tv-shell-text);
}

.tv-shell [data-slot="drawing-toolbar-host"] {
  position: fixed;
  top: calc(var(--tv-shell-topbar-height, 44px) + 8px);
  left: var(--tv-shell-side-strip-width, 52px);
  z-index: 220;
  display: flex;
  width: var(--tv-shell-side-strip-width, 52px);
  justify-content: center;
  pointer-events: auto;
}

.tv-shell .position-overlay {
  display: none;
}

.tv-shell .drawing-toolbar {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: var(--tv-shell-side-strip-width, 52px);
}

.tv-shell .drawing-toolbar__tools {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: center;
}

.tv-shell .drawing-toolbar__edit { display: none; }

.tv-shell .drawing-toolbar__tools .tb-pill,
.tv-shell .drawing-toolbar__edit .tb-pill {
  position: relative;
  width: 38px;
  min-width: 38px;
  height: 38px;
  min-height: 38px;
  overflow: hidden;
  border: 1px solid transparent;
  border-radius: 4px;
  padding: 0;
  background: transparent !important;
  color: #131722;
  font-size: 22px;
  font-weight: 500;
  line-height: 1;
  text-indent: 0;
}

.tv-shell .drawing-toolbar__tools .tb-pill.active,
.tv-shell .drawing-toolbar__edit .tb-pill.active,
.tv-shell .drawing-toolbar__tools .tb-pill:hover:not(:disabled),
.tv-shell .drawing-toolbar__edit .tb-pill:hover:not(:disabled) {
  background: var(--tv-shell-hover) !important;
  border-color: var(--tv-shell-border, #ebebeb);
}

.tv-shell .drawing-toolbar__tools .tb-pill.active {
  color: var(--tv-shell-blue);
}

.tv-shell .drawing-toolbar .tb-pill:disabled {
  pointer-events: none;
}

.tv-shell .drawing-toolbar__style,
.tv-shell .drawing-toolbar__status,
.tv-shell .drawing-toolbar__error {
  display: none;
}

.tv-shell .tv-side-strip--left {
  padding-top: 8px;
}

.tv-shell .tv-side-strip--drawing {
  padding-top: 8px;
  border-left: 1px solid var(--tv-shell-border-subtle, #f2f2f2);
  box-shadow: inset 1px 0 0 #ffffff, inset -1px 0 0 var(--tv-shell-border, #ebebeb);
  background: #ffffff;
}

.tv-chart-legend {
  position: absolute;
  top: 12px;
  left: 16px;
  z-index: 30;
  display: grid;
  gap: 8px;
  max-width: min(620px, calc(100% - 190px));
  color: #111111;
  font-size: 15px;
  line-height: 1.2;
  pointer-events: auto;
}

.tv-chart-legend__title {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) 10px;
  grid-template-areas:
    "coin title source"
    ". ohlc ohlc";
  align-items: center;
  gap: 2px 6px;
  min-width: 0;
  max-width: 100%;
  white-space: nowrap;
}

.tv-chart-legend__coin {
  grid-area: coin;
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: #f7931a;
  color: #ffffff;
  font-size: 13px;
  font-weight: 700;
}

.tv-chart-legend__title strong {
  grid-area: title;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 17px;
  font-weight: 500;
}

.tv-chart-legend__source {
  grid-area: source;
  display: inline-block;
  width: 8px;
  height: 18px;
  overflow: hidden;
  color: transparent;
  border-left: 9px solid var(--tv-shell-blue);
}

.tv-chart-legend__ohlc {
  grid-area: ohlc;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #111111;
  font-size: 14px;
}

.tv-chart-legend__indicators {
  display: grid;
  gap: 7px;
  color: #a8a8a8;
  font-size: 14px;
}

.tv-chart-legend__indicator {
  appearance: none;
  -webkit-appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: max-content;
  border: 0;
  background: transparent;
  color: #a8a8a8;
  padding: 0;
  font: inherit;
  cursor: pointer;
}

.tv-chart-legend__indicator:hover,
.tv-chart-legend__indicator:focus-visible {
  color: #4a4a4a;
}

.tv-chart-legend__indicator:focus-visible {
  outline: none;
  box-shadow: var(--ws-focus-ring, 0 0 0 2px rgba(41, 98, 255, 0.24));
}

.tv-chart-legend__indicator-dot {
  width: 6px;
  height: 6px;
  border: 1px solid currentColor;
  border-radius: 999px;
}

.tv-chart-legend__indicator.is-active {
  color: #111111;
}

.tv-chart-legend__indicator.is-active .tv-chart-legend__indicator-dot {
  border-color: var(--tv-shell-blue, #2962ff);
  background: var(--tv-shell-blue, #2962ff);
}
