/* X10 TradingView Pro Workspace (Lightweight Charts v5 + SSI Live Data) */
.tvp-shell {
  --tvp-bg: #131722;
  --tvp-toolbar: #1e222d;
  --tvp-border: #2a2e39;
  --tvp-text: #d1d4dc;
  --tvp-muted: #787b86;
  --tvp-accent: #2962ff;
  --tvp-hover: #2a2e39;
  --tvp-up: #089981;
  --tvp-down: #f23645;
  display: flex;
  flex-direction: column;
  width: 100%;
  background: var(--tvp-bg);
  color: var(--tvp-text);
  border: 1px solid var(--tvp-border);
  border-radius: 8px;
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
  user-select: none;
}

body.light .tvp-shell {
  --tvp-bg: #ffffff;
  --tvp-toolbar: #f8fafd;
  --tvp-border: #e0e3eb;
  --tvp-text: #131722;
  --tvp-muted: #6a6d78;
  --tvp-accent: #2962ff;
  --tvp-hover: #eef1f7;
}

.tvp-shell.is-fullscreen {
  position: fixed;
  inset: 0;
  z-index: 10050;
  border-radius: 0;
  border: 0;
  height: 100vh !important;
  width: 100vw !important;
}

.tvp-shell canvas {
  max-height: none !important;
  max-width: none !important;
}

body.tvp-has-fullscreen {
  overflow: hidden !important;
}

body.tvp-has-fullscreen #x10-mac-ai-fab {
  opacity: 0;
  pointer-events: none;
}

.tvp-topbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 6px;
  padding: 5px 10px;
  background: var(--tvp-toolbar);
  border-bottom: 1px solid var(--tvp-border);
  min-height: 38px;
}

.tvp-sym-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 750;
  font-size: 12px;
  padding: 3px 8px;
  border-radius: 5px;
  background: color-mix(in srgb, var(--tvp-accent) 14%, transparent);
  color: var(--tvp-text);
}

.tvp-live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--tvp-up);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--tvp-up) 25%, transparent);
}

.tvp-sep {
  width: 1px;
  height: 18px;
  background: var(--tvp-border);
  margin: 0 2px;
}

.tvp-btn-group {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.tvp-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 26px;
  padding: 3px 8px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--tvp-muted);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.tvp-btn:hover {
  background: var(--tvp-hover);
  color: var(--tvp-text);
}

.tvp-btn.is-active {
  background: color-mix(in srgb, var(--tvp-accent) 18%, transparent);
  color: var(--tvp-accent);
  font-weight: 700;
}

.tvp-ind-wrap {
  position: relative;
}

.tvp-ind-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 40;
  width: 278px;
  max-width: calc(100vw - 32px);
  max-height: 410px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 8px;
  background: var(--tvp-toolbar);
  border: 1px solid var(--tvp-border);
  border-radius: 10px;
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.34);
}

.tvp-ind-menu[hidden] {
  display: none;
}

.tvp-ind-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 2px 2px 6px;
  font-size: 11px;
  font-weight: 700;
  color: var(--tvp-text);
}

.tvp-ind-clear {
  border: 1px solid var(--tvp-border);
  background: transparent;
  color: var(--tvp-muted);
  border-radius: 5px;
  padding: 2px 7px;
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
  min-height: 22px;
}

.tvp-ind-clear:hover {
  color: var(--tvp-text);
  background: var(--tvp-hover);
}

.tvp-ind-search {
  width: 100%;
  box-sizing: border-box;
  height: 28px;
  min-height: 28px;
  padding: 4px 8px;
  margin-bottom: 6px;
  border-radius: 6px;
  border: 1px solid var(--tvp-border);
  background: var(--tvp-bg);
  color: var(--tvp-text);
  font-size: 11px;
  outline: none;
}

.tvp-ind-search:focus {
  border-color: var(--tvp-accent);
}

.tvp-ind-list {
  overflow-y: auto;
  display: grid;
  gap: 2px;
  padding-right: 2px;
}

.tvp-ind-group {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--tvp-muted);
  padding: 7px 6px 3px;
}

.tvp-ind-group:first-child {
  padding-top: 2px;
}

.tvp-ind-empty {
  padding: 12px 8px;
  text-align: center;
  font-size: 11px;
  color: var(--tvp-muted);
}

.tvp-ind-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 5px 7px;
  border-radius: 6px;
  font-size: 11px;
  color: var(--tvp-text);
  cursor: pointer;
}

.tvp-ind-item-meta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.tvp-ind-tag {
  font-size: 9px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 4px;
  background: color-mix(in srgb, var(--tvp-accent) 14%, transparent);
  color: var(--tvp-accent);
  white-space: nowrap;
}

.tvp-ind-item:hover {
  background: var(--tvp-hover);
}

.tvp-ind-item input {
  width: 14px;
  height: 14px;
  min-height: 14px;
  accent-color: var(--tvp-accent);
  margin: 0;
  flex: 0 0 auto;
}

.tvp-ind-swatch {
  width: 10px;
  height: 3px;
  border-radius: 2px;
  display: inline-block;
  margin-right: 5px;
}

.tvp-topbar-right {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.tvp-body {
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
  position: relative;
}

.tvp-left-rail {
  width: 40px;
  flex: 0 0 40px;
  background: var(--tvp-toolbar);
  border-right: 1px solid var(--tvp-border);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 6px 4px;
  gap: 4px;
}

.tvp-tool-btn {
  width: 30px;
  height: 30px;
  min-height: 30px;
  padding: 0;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--tvp-muted);
  cursor: pointer;
}

.tvp-tool-btn:hover {
  background: var(--tvp-hover);
  color: var(--tvp-text);
}

.tvp-tool-btn.is-active {
  background: color-mix(in srgb, var(--tvp-accent) 20%, transparent);
  color: var(--tvp-accent);
}

.tvp-tool-sep {
  width: 22px;
  height: 1px;
  background: var(--tvp-border);
  margin: 2px 0;
}

.tvp-stage {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: var(--tvp-bg);
}

.tvp-main-wrap {
  position: relative;
  flex: 1 1 auto;
  height: 410px;
  min-height: 320px;
  width: 100%;
}

.tvp-shell.is-compact .tvp-main-wrap {
  height: 340px;
  min-height: 295px;
}

.tvp-shell.is-fullscreen .tvp-main-wrap {
  height: auto;
}

.tvp-plot {
  width: 100%;
  height: 100%;
}

.tvp-draw-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 3;
  pointer-events: none;
  overflow: visible;
}

.tvp-draw-svg.is-drawing {
  pointer-events: all;
  cursor: crosshair;
}

.tvp-hud {
  position: absolute;
  top: 8px;
  left: 10px;
  z-index: 4;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  padding: 4px 9px;
  border-radius: 6px;
  background: color-mix(in srgb, var(--tvp-bg) 82%, transparent);
  backdrop-filter: blur(6px);
  border: 1px solid color-mix(in srgb, var(--tvp-border) 80%, transparent);
  font-size: 11px;
  pointer-events: none;
  font-variant-numeric: tabular-nums;
  max-width: calc(100% - 80px);
}

.tvp-hud b {
  color: var(--tvp-text);
  font-weight: 750;
}

.tvp-hud span {
  color: var(--tvp-muted);
}

.tvp-hud i {
  font-style: normal;
  color: var(--tvp-text);
  font-weight: 600;
}

.tvp-hud .is-up i {
  color: var(--tvp-up);
}

.tvp-hud .is-down i {
  color: var(--tvp-down);
}

.tvp-draw-status {
  position: absolute;
  bottom: 32px;
  left: 12px;
  z-index: 5;
  padding: 4px 9px;
  border-radius: 6px;
  background: color-mix(in srgb, var(--tvp-accent) 90%, #000);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  pointer-events: none;
}

.tvp-draw-status[hidden] {
  display: none;
}

.tvp-subpanes {
  display: flex;
  flex-direction: column;
  width: 100%;
}

.tvp-subpanes[hidden] {
  display: none;
}

.tvp-subpane {
  position: relative;
  height: 104px;
  border-top: 1px solid var(--tvp-border);
  width: 100%;
  background: var(--tvp-bg);
}

.tvp-shell.is-compact .tvp-subpane {
  height: 92px;
}

.tvp-subpane-label {
  position: absolute;
  top: 4px;
  left: 10px;
  z-index: 4;
  font-size: 10px;
  font-weight: 700;
  color: var(--tvp-muted);
  background: color-mix(in srgb, var(--tvp-bg) 80%, transparent);
  padding: 1px 6px;
  border-radius: 4px;
  pointer-events: none;
}

.tvp-empty {
  display: grid;
  place-items: center;
  height: 100%;
  min-height: 220px;
  color: var(--tvp-muted);
  font-size: 12px;
  padding: 20px;
  text-align: center;
}

@media (max-width: 760px) {
  .tvp-body {
    flex-direction: column;
  }
  .tvp-left-rail {
    width: 100%;
    flex: 0 0 auto;
    flex-direction: row;
    border-right: 0;
    border-bottom: 1px solid var(--tvp-border);
    overflow-x: auto;
    padding: 4px 8px;
  }
  .tvp-tool-sep {
    width: 1px;
    height: 18px;
    margin: 0 2px;
  }
}

.market-hero:has(#market-hero-chart > .tvp-shell) {
  align-items: start !important;
}

.market-hero > .hero-panel:has(#market-hero-chart > .tvp-shell) {
  height: auto !important;
  overflow: visible !important;
}

.market-hero > .hero-panel #market-hero-chart:has(> .tvp-shell),
#market-hero-chart:has(> .tvp-shell) {
  height: auto !important;
  min-height: 360px !important;
  flex: 0 0 auto !important;
  overflow: visible !important;
}

.tvp-symbol-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px !important;
}

.tvp-symbol-badge .tvp-live-dot {
  display: inline-block;
  flex: 0 0 auto;
}
