/* ===== PROFESSIONAL CHART STYLES ===== */

/* ── Chart Container ── */
.chart-container-wrap {
  flex: 1;
  position: relative;
  overflow-y: auto;
  overflow-x: hidden;
  background: #0d1117;
  display: flex;
  flex-direction: column;
}

.tv-chart-container {
  width: 100%;
  min-height: 280px;
  flex: 1;
  position: relative;
  touch-action: pan-x pinch-zoom;
}

.chart-container-wrap .tv-chart-container {
  position: relative;
  flex: 1;
  width: 100%;
  margin-top: 40px;
  margin-bottom: 34px;
  z-index: 1;
}

.m-chart .tv-chart-container {
  position: relative;
  flex: 1;
  width: 100%;
  margin-top: 0;
  margin-bottom: 34px;
  z-index: 1;
}

.tv-chart-container table {
  border-collapse: collapse;
}

/* ── Toolbar Enhancements ── */
.chart-toolbar {
  position: absolute;
  top: 6px;
  left: 6px;
  right: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  background: rgba(14, 20, 32, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  z-index: 10;
  height: 34px;
  transition: all 0.3s ease;
}

.toolbar-divider {
  width: 1px;
  height: 20px;
  background: var(--border2);
  margin: 0 4px;
}

.tf-group {
  display: flex;
  gap: 2px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 6px;
  padding: 2px;
  overflow-x: auto;
  scrollbar-width: none;
  max-width: 100%;
}

.tf-group::-webkit-scrollbar {
  display: none;
}

.tf-btn {
  background: none;
  border: none;
  color: var(--text3);
  padding: 5px 10px;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: 'Inter', sans-serif;
  letter-spacing: 0.3px;
}

.tf-btn:hover {
  background: rgba(0, 200, 83, 0.1);
  color: var(--green);
}

.tf-btn.active {
  background: rgba(0, 200, 83, 0.2);
  color: var(--green);
  box-shadow: 0 0 8px rgba(0, 200, 83, 0.15);
}

/* ── Chart Type Switcher ── */
.ct-group {
  display: flex;
  gap: 2px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 6px;
  padding: 2px;
}

.ct-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: none;
  border: none;
  color: var(--text3);
  padding: 5px 9px;
  border-radius: 5px;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.22s ease, color 0.22s ease, box-shadow 0.22s ease, transform 0.15s ease;
  font-family: 'Inter', sans-serif;
  letter-spacing: 0.2px;
}

.ct-btn .ct-icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.ct-btn .ct-label {
  display: none;
}

@media (min-width: 1200px) {
  .ct-btn .ct-label {
    display: inline;
  }
}

.ct-btn:hover {
  background: rgba(56, 189, 248, 0.1);
  color: #38bdf8;
}

.ct-btn.active {
  background: rgba(56, 189, 248, 0.2);
  color: #38bdf8;
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.18);
}

.ct-btn[data-chart-type="candlestick"].active {
  color: #fbbf24;
  background: rgba(251, 191, 36, 0.15);
  box-shadow: 0 0 8px rgba(251, 191, 36, 0.12);
}

.ct-btn[data-chart-type="line"].active {
  color: #00f0ff;
  background: rgba(0, 240, 255, 0.18);
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.25);
}

.ct-btn[data-chart-type="area"].active {
  color: #00f0ff;
  background: rgba(0, 240, 255, 0.18);
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.25);
}

.chart-type-badge {
  font-size: 9px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  background: rgba(56, 189, 248, 0.12);
  color: #38bdf8;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}

/* ══════════════════════════════════════════════════
 * ── Unified Chart Studio Hub (Forex, Candle, Ind, Draw) ──
 * ══════════════════════════════════════════════════ */
.chart-studio-group {
  display: inline-flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 2px 5px;
  gap: 3px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.05);
  flex-shrink: 0;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.chart-studio-group:hover {
  border-color: rgba(255, 255, 255, 0.14);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3), inset 0 1px 1px rgba(255, 255, 255, 0.08);
}

.studio-mini-divider {
  width: 1px;
  height: 16px;
  background: rgba(255, 255, 255, 0.1);
  margin: 0 2px;
  flex-shrink: 0;
}

.tb-studio-btn {
  background: transparent;
  border: 1px solid transparent;
  color: #cbd5e1;
  padding: 4px 9px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  height: 26px;
  font-family: 'Inter', -apple-system, sans-serif;
  letter-spacing: 0.2px;
  white-space: nowrap;
  user-select: none;
  outline: none;
}

.tb-studio-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.16);
  color: #ffffff;
  transform: translateY(-1px);
}

.tb-studio-btn:active {
  transform: translateY(0) scale(0.97);
}

.tb-studio-label {
  font-size: 11px;
  font-weight: 700;
  color: #e2e8f0;
  letter-spacing: 0.2px;
}

.tb-icon-box {
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.tb-studio-btn:hover .tb-icon-box {
  transform: scale(1.14);
}

.tb-svg-icon {
  width: 16px;
  height: 16px;
  display: block;
}

/* Tool specific accent glows on hover */
.toolbar-dropdown:hover .candle-icon-box .tb-svg-icon {
  filter: drop-shadow(0 0 6px rgba(0, 230, 118, 0.7));
}

.tb-studio-btn:hover .indicator-icon-box .tb-svg-icon {
  filter: drop-shadow(0 0 6px rgba(0, 229, 255, 0.7));
}

.tb-studio-btn:hover .drawing-icon-box .tb-svg-icon {
  filter: drop-shadow(0 0 6px rgba(192, 132, 252, 0.7));
}

.forex-studio-btn {
  position: relative;
}

.forex-studio-btn:hover {
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.35);
  color: #fbbf24;
}

.forex-studio-btn:hover .forex-icon-box .tb-svg-icon {
  filter: drop-shadow(0 0 6px rgba(245, 158, 11, 0.8));
}

.forex-studio-btn .forex-soon-badge {
  font-size: 8px;
  font-weight: 800;
  padding: 1px 4px;
  border-radius: 4px;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #0f172a;
  letter-spacing: 0.5px;
  margin-left: 2px;
  line-height: 1.1;
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.4);
}

.tb-studio-btn .ind-tab-count {
  font-size: 8.5px;
  font-weight: 800;
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(0, 229, 255, 0.15);
  border: 1px solid rgba(0, 229, 255, 0.3);
  color: #00e5ff;
  letter-spacing: 0.3px;
  line-height: 1.2;
  margin-left: 1px;
}

.chart-container-wrap.chart-type-switching,
.m-chart.chart-type-switching {
  animation: chartTypeFade 0.32s ease;
}

@keyframes chartTypeFade {
  0% {
    opacity: 0.55;
  }

  100% {
    opacity: 1;
  }
}

/* ── Indicator Buttons ── */
.indicator-group {
  display: flex;
  gap: 2px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 6px;
  padding: 2px;
}

.ind-btn {
  background: none;
  border: none;
  color: var(--text3);
  padding: 5px 8px;
  border-radius: 5px;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.25s ease;
  font-family: 'Inter', sans-serif;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.ind-btn:hover {
  background: rgba(0, 149, 255, 0.1);
  color: var(--blue);
}

.ind-btn.active {
  background: rgba(0, 149, 255, 0.2);
  color: var(--blue);
  box-shadow: 0 0 6px rgba(0, 149, 255, 0.15);
}

.ind-btn[data-indicator="ema"].active {
  color: #ffd600;
  background: rgba(255, 214, 0, 0.15);
}

.ind-btn[data-indicator="sma"].active {
  color: #00bcd4;
  background: rgba(0, 188, 212, 0.15);
}

.ind-btn[data-indicator="bb"].active {
  color: #ce93d8;
  background: rgba(206, 147, 216, 0.15);
}

/* ── Live Indicator ── */
.chart-live-indicator {
  position: absolute;
  top: 12px;
  left: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(0, 200, 83, 0.12);
  border: 1px solid rgba(0, 200, 83, 0.25);
  border-radius: 20px;
  padding: 4px 12px 4px 8px;
  font-size: 10px;
  font-weight: 700;
  color: var(--green);
  letter-spacing: 1.2px;
  z-index: 3;
  backdrop-filter: blur(6px);
}

.live-pulse {
  width: 7px;
  height: 7px;
  background: var(--green);
  border-radius: 50%;
  animation: livePulse 1.5s ease-in-out infinite;
  box-shadow: 0 0 6px rgba(0, 200, 83, 0.6);
}

@keyframes livePulse {

  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }

  50% {
    transform: scale(1.6);
    opacity: 0.5;
  }
}

/* ── Price Tag ── */
.price-tag {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  background: linear-gradient(135deg, #0095ff, #0077cc);
  border-radius: 6px 0 0 6px;
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 800;
  color: #fff;
  z-index: 4;
  font-family: 'Inter', monospace;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 12px rgba(0, 149, 255, 0.3);
  display: none;
  /* Hidden — TradingView has its own price scale */
}

/* ── Chart Bottom Bar ── */
.chart-bottom-tools {
  position: absolute;
  bottom: 4px;
  left: 6px;
  right: 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 3px 8px;
  background: rgba(17, 24, 39, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 6px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  z-index: 10;
  height: 28px;
  min-height: 28px;
  transition: all 0.3s ease;
}

.chart-bottom-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.chart-bottom-right {
  display: flex;
  align-items: center;
  gap: 6px;
}

.chart-market-badge {
  background: rgba(0, 149, 255, 0.12);
  border: 1px solid rgba(0, 149, 255, 0.2);
  color: var(--blue);
  border-radius: 4px;
  padding: 2px 8px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.3px;
}

.chart-tf-badge {
  background: rgba(0, 200, 83, 0.12);
  border: 1px solid rgba(0, 200, 83, 0.2);
  color: var(--green);
  border-radius: 4px;
  padding: 2px 8px;
  font-size: 10px;
  font-weight: 700;
}

/* ── Crosshair Tooltip ── */
.chart-tooltip {
  display: none;
  position: absolute;
  z-index: 100;
  pointer-events: none;
  background: rgba(17, 24, 39, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 12px;
  font-family: 'Inter', monospace;
  color: #e2e8f0;
  min-width: 150px;
  backdrop-filter: blur(16px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.tt-header {
  font-weight: 700;
  font-size: 12px;
  color: #fff;
  margin-bottom: 6px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  letter-spacing: 0.3px;
}

.tt-row {
  display: flex;
  justify-content: space-between;
  padding: 2px 0;
  font-size: 11px;
}

.tt-label {
  color: var(--text3);
  font-weight: 600;
  margin-right: 12px;
}

/* ── Mobile Chart Styles ── */
.m-chart {
  flex: 1;
  position: relative;
  background: #0d1117;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
}

.m-chart-time-info {
  position: absolute;
  top: 40px;
  left: 6px;
  z-index: 15;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  pointer-events: none;
}

.m-chart-time-info > * {
  pointer-events: auto;
}

.m-live-indicator {
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(0, 200, 83, 0.12);
  border: 1px solid rgba(0, 200, 83, 0.25);
  border-radius: 10px;
  padding: 2px 7px 2px 5px;
  font-size: 8px;
  font-weight: 700;
  color: var(--green);
  letter-spacing: 0.8px;
  backdrop-filter: blur(6px);
}

.m-live-indicator .live-pulse {
  width: 5px;
  height: 5px;
}

.m-price-tag {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  background: linear-gradient(135deg, #0095ff, #0077cc);
  border-radius: 5px 0 0 5px;
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 800;
  color: #fff;
  z-index: 4;
  font-family: 'Inter', monospace;
  box-shadow: 0 2px 8px rgba(0, 149, 255, 0.3);
  display: none;
  /* Hidden — TradingView has its own price scale */
}

/* ── Mobile Timeframe & Indicator Bar ── */
.m-tf-bar {
  position: absolute;
  bottom: 3px;
  left: 4px;
  right: 4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 3px;
  background: rgba(13, 17, 23, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  padding: 2px 4px;
  z-index: 10;
  height: 28px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
}

.m-tf-picker-trigger {
  background: linear-gradient(135deg, rgba(0, 200, 83, 0.15), rgba(0, 229, 255, 0.1));
  border: 1px solid rgba(0, 200, 83, 0.4);
  color: #00e676;
  padding: 2px 5px;
  border-radius: 4px;
  font-size: 8.5px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  box-shadow: 0 0 8px rgba(0, 200, 83, 0.15);
  outline: none;
}

.m-tf-picker-trigger:active {
  transform: scale(0.95);
}

.m-tf-scroll-group {
  display: flex;
  align-items: center;
  gap: 3px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  padding: 1px 0;
  flex: 1;
}

.m-tf-scroll-group::-webkit-scrollbar {
  display: none;
}

.m-tf-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #94a3b8;
  padding: 3px 6px;
  border-radius: 5px;
  font-size: 9.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.m-tf-btn.active {
  background: rgba(0, 200, 83, 0.2);
  border-color: rgba(0, 200, 83, 0.5);
  color: #00e676;
  box-shadow: 0 0 8px rgba(0, 200, 83, 0.3);
}

.m-tf-divider {
  width: 1px;
  height: 14px;
  background: rgba(255, 255, 255, 0.12);
  margin: 0 1px;
  flex-shrink: 0;
}

/* ── Mobile Timeframe Modal Sheet ── */
.m-tf-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  align-items: flex-end;
}

.m-tf-modal-overlay.show {
  opacity: 1;
  visibility: visible;
}

.m-tf-sheet {
  width: 100%;
  background: rgba(15, 23, 42, 0.98);
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 24px 24px 0 0;
  padding: 20px 20px 30px;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.8);
}

.m-tf-modal-overlay.show .m-tf-sheet {
  transform: translateY(0);
}

.m-tf-sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 12px;
}

.m-tf-sheet-title {
  font-size: 15px;
  font-weight: 800;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 8px;
}

.m-tf-sheet-close {
  background: rgba(255, 255, 255, 0.08);
  border: none;
  color: #fff;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.m-tf-section-lbl {
  font-size: 11px;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 14px 0 8px;
}

.m-tf-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.m-tf-grid-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 12px 6px;
  color: #ffffff;
  font-size: 13px;
  font-weight: 700;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  outline: none;
}

.m-tf-grid-btn:hover,
.m-tf-grid-btn:active {
  background: rgba(0, 200, 83, 0.15);
  border-color: rgba(0, 200, 83, 0.4);
  color: #00e676;
}

.m-tf-grid-btn.active {
  background: linear-gradient(135deg, rgba(0, 200, 83, 0.3), rgba(0, 229, 255, 0.2));
  border: 1.5px solid #00e676;
  color: #00e676;
  box-shadow: 0 4px 15px rgba(0, 200, 83, 0.3);
}

.m-ind-btn {
  background: none;
  border: none;
  color: var(--text3);
  padding: 2px 5px;
  border-radius: 4px;
  font-size: 8.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: 'Inter', sans-serif;
  letter-spacing: 0.3px;
}

.m-ind-btn:hover,
.m-ind-btn.active {
  background: rgba(0, 149, 255, 0.15);
  color: var(--blue);
}

.m-ind-btn[data-indicator="ema"].active {
  color: #ffd600;
  background: rgba(255, 214, 0, 0.12);
}

.m-ind-btn[data-indicator="sma"].active {
  color: #00bcd4;
  background: rgba(0, 188, 212, 0.12);
}

.m-ind-btn[data-indicator="bb"].active {
  color: #ce93d8;
  background: rgba(206, 147, 216, 0.12);
}

.m-ct-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--text3);
  width: 22px;
  height: 22px;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.2s ease;
  padding: 0;
}

.m-ct-btn svg {
  width: 12px;
  height: 12px;
}

.m-ct-btn:hover,
.m-ct-btn.active {
  background: rgba(56, 189, 248, 0.18);
  color: #38bdf8;
}

.m-ct-btn[data-chart-type="candlestick"].active {
  color: #fbbf24;
  background: rgba(251, 191, 36, 0.18);
  box-shadow: 0 0 8px rgba(251, 191, 36, 0.2);
}

.m-ct-btn[data-chart-type="line"].active {
  color: #00f0ff;
  background: rgba(0, 240, 255, 0.18);
  box-shadow: 0 0 8px rgba(0, 240, 255, 0.25);
}

.m-ct-btn[data-chart-type="area"].active {
  color: #00f0ff;
  background: rgba(0, 240, 255, 0.18);
  box-shadow: 0 0 8px rgba(0, 240, 255, 0.25);
}

/* ── Candle Countdown Timer ── */
.candle-countdown {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(17, 24, 39, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 5px 14px 5px 6px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: border-color 0.4s ease, box-shadow 0.4s ease;
}

.candle-countdown.mobile {
  position: relative;
  top: auto;
  left: auto;
  margin-top: 1px;
  padding: 2px 5px 2px 3px;
  gap: 4px;
  border-radius: 6px;
  background: rgba(13, 17, 23, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

/* Ring Wrapper */
.countdown-ring-wrap {
  position: relative;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
}

.candle-countdown.mobile .countdown-ring-wrap {
  width: 17px;
  height: 17px;
}

.countdown-ring {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.countdown-ring-bg {
  fill: none;
  stroke: rgba(255, 255, 255, 0.06);
  stroke-width: 3;
}

.countdown-ring-progress {
  fill: none;
  stroke: var(--green, #00c853);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-dasharray: 97.39;
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 0.5s ease, stroke 0.5s ease;
  filter: drop-shadow(0 0 4px rgba(0, 200, 83, 0.4));
}

/* Color States */
.countdown-ring-progress.warning {
  stroke: #ffab00;
  filter: drop-shadow(0 0 4px rgba(255, 171, 0, 0.5));
}

.countdown-ring-progress.urgent {
  stroke: #ff1744;
  filter: drop-shadow(0 0 6px rgba(255, 23, 68, 0.6));
  animation: urgentPulseRing 0.6s ease-in-out infinite;
}

@keyframes urgentPulseRing {

  0%,
  100% {
    stroke-width: 3;
  }

  50% {
    stroke-width: 4;
  }
}

/* Ring Center Text */
.countdown-ring-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 11px;
  font-weight: 800;
  font-family: 'Inter', monospace;
  color: #ffffff;
  letter-spacing: -0.3px;
  line-height: 1;
}

.candle-countdown.mobile .countdown-ring-text {
  font-size: 7px;
}

/* Info Section */
.countdown-info {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.countdown-label {
  font-size: 9px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.4);
  letter-spacing: 0.8px;
  text-transform: uppercase;
  line-height: 1.2;
}

.countdown-time {
  font-size: 14px;
  font-weight: 800;
  font-family: 'Inter', monospace;
  color: var(--green, #00c853);
  letter-spacing: 0.5px;
  line-height: 1.2;
  transition: color 0.4s ease;
}

.candle-countdown.mobile .countdown-label {
  font-size: 6.5px;
  letter-spacing: 0.4px;
}

.candle-countdown.mobile .countdown-time {
  font-size: 9.5px;
}

/* Warning/Urgent Color States for text */
.countdown-time.warning {
  color: #ffab00;
}

.countdown-time.urgent {
  color: #ff1744;
  animation: urgentBlink 0.6s ease-in-out infinite;
}

}

/* ── UTC Clock Overlay & Badges ── */
.countdown-divider {
  width: 1px;
  height: 20px;
  background: rgba(255, 255, 255, 0.14);
  margin: 0 4px;
}

.candle-countdown.mobile .countdown-divider {
  height: 12px;
  margin: 0 2px;
}

.utc-clock-box {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.utc-clock-label {
  font-size: 8px;
  font-weight: 700;
  color: #38bdf8;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  line-height: 1.1;
}

.candle-countdown.mobile .utc-clock-label {
  font-size: 6px;
  letter-spacing: 0.3px;
}

.utc-clock-val {
  font-size: 11.5px;
  font-weight: 800;
  font-family: 'Inter', monospace;
  color: #ffffff;
  letter-spacing: 0.3px;
  line-height: 1.1;
  white-space: nowrap;
}

.candle-countdown.mobile .utc-clock-val {
  font-size: 9px;
  color: #38bdf8;
}

.chart-utc-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 1px 7px;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  font-family: 'Inter', monospace;
  color: #38bdf8;
  margin-left: 6px;
}


/* Candle Complete Flash */
.candle-countdown.flash {
  animation: candleFlash 0.5s ease;
}

@keyframes candleFlash {
  0% {
    border-color: rgba(0, 200, 83, 0.6);
    box-shadow: 0 0 20px rgba(0, 200, 83, 0.3);
  }

  50% {
    border-color: rgba(0, 200, 83, 0.8);
    box-shadow: 0 0 30px rgba(0, 200, 83, 0.5);
  }

  100% {
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow: none;
  }
}

/* ── Light Mode Overrides ── */
body.light-mode {
  --bg: #f5f7fa;
  --bg2: #ffffff;
  --bg3: #f0f2f5;
  --bg4: #e8ebef;
  --text: #1a1a2e;
  --text2: #5a6577;
  --text3: #8b95a5;
  --border: #e0e4ea;
  --border2: #d0d4da;
}

body.light-mode .chart-container-wrap {
  background: #ffffff;
}

body.light-mode .chart-toolbar {
  background: rgba(240, 242, 245, 0.95);
  border-bottom-color: #e0e4ea;
}

body.light-mode .chart-studio-group {
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.08);
  box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.04);
}

body.light-mode .chart-studio-group:hover {
  border-color: rgba(0, 0, 0, 0.15);
}

body.light-mode .studio-mini-divider {
  background: rgba(0, 0, 0, 0.08);
}

body.light-mode .tb-studio-btn {
  color: #334155;
}

body.light-mode .tb-studio-btn:hover {
  background: rgba(0, 0, 0, 0.06);
  color: #0f172a;
}

body.light-mode .tb-studio-label {
  color: #1e293b;
}

@media (max-width: 1280px) {
  .tb-studio-btn {
    padding: 4px 7px;
    gap: 5px;
    font-size: 10.5px;
  }
  .tf-btn {
    padding: 5px 8px;
    font-size: 10.5px;
  }
}

@media (max-width: 1120px) {
  .chart-toolbar {
    overflow-x: auto;
    scrollbar-width: none;
  }
  .chart-toolbar::-webkit-scrollbar {
    display: none;
  }
}

body.light-mode .chart-live-indicator {
  background: rgba(0, 180, 83, 0.08);
  border-color: rgba(0, 180, 83, 0.2);
}

body.light-mode .chart-tooltip {
  background: rgba(255, 255, 255, 0.96);
  border-color: rgba(0, 0, 0, 0.1);
  color: #333;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
}

body.light-mode .tt-header {
  color: #1a1a2e;
  border-bottom-color: rgba(0, 0, 0, 0.08);
}

body.light-mode .m-tf-bar {
  background: rgba(255, 255, 255, 0.9);
  border-color: rgba(0, 0, 0, 0.08);
}

body.light-mode .ct-group,
body.light-mode .m-ct-btn {
  background: rgba(0, 0, 0, 0.03);
}

body.light-mode .chart-type-badge {
  background: rgba(2, 136, 209, 0.1);
  color: #0288d1;
}

body.light-mode .m-live-indicator {
  background: rgba(0, 180, 83, 0.08);
  border-color: rgba(0, 180, 83, 0.2);
}

body.light-mode .candle-countdown {
  background: rgba(255, 255, 255, 0.92);
  border-color: rgba(0, 0, 0, 0.08);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

body.light-mode .candle-countdown:hover {
  border-color: rgba(0, 180, 83, 0.3);
  box-shadow: 0 4px 20px rgba(0, 180, 83, 0.1);
}

body.light-mode .countdown-ring-bg {
  stroke: rgba(0, 0, 0, 0.08);
}

body.light-mode .countdown-ring-text {
  color: #1a1a2e;
}

body.light-mode .countdown-label {
  color: rgba(0, 0, 0, 0.4);
}

/* ── Tool Buttons (refined) ── */
.tool-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 6px;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text3);
  font-size: 13px;
  transition: all 0.25s ease;
}

.tool-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.12);
  transform: translateY(-1px);
}

/* ── Responsive Chart Adjustments ── */
@media (max-width: 767px) {
  .chart-toolbar {
    display: none;
    /* Mobile uses the bottom TF bar instead */
  }

  .chart-bottom-tools {
    display: none;
  }

  #desktopCandleCountdown {
    display: none;
  }
}

/* ── Desktop / Laptop compact controls (768px+) ── */
@media (min-width: 768px) {

  /* Compact timeframe buttons */
  .tf-btn {
    padding: 3px 7px;
    font-size: 10px;
    border-radius: 4px;
  }

  /* Compact tool icon buttons */
  .tool-btn {
    width: 26px;
    height: 26px;
    font-size: 12px;
  }

  /* Compact dropdown trigger */
  .tb-dropdown-trigger {
    padding: 3px 8px;
    font-size: 10px;
    height: 26px;
    border-radius: 5px;
    gap: 4px;
  }

  /* Compact toolbar divider */
  .toolbar-divider {
    height: 16px;
    margin: 0 2px;
  }

  /* Compact live indicator inside toolbar */
  .chart-live-indicator {
    padding: 2px 8px 2px 6px;
    font-size: 9px;
    border-radius: 16px;
  }

  .live-pulse {
    width: 5px;
    height: 5px;
  }

  /* Compact pair info */
  .pair-flags-lg {
    font-size: 16px;
  }

  .pair-name-lg {
    font-size: 12px;
  }

  .pair-pct-lg {
    font-size: 12px;
  }

  /* Desktop countdown: compact inline card */
  #desktopCandleCountdown {
    position: absolute;
    top: 46px;
    left: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(17, 24, 39, 0.78);
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 7px;
    padding: 3px 10px 3px 5px;
    z-index: 10;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.35);
    transition: border-color 0.3s ease;
  }

  #desktopCandleCountdown:hover {
    border-color: rgba(0, 200, 83, 0.3);
  }

  #desktopCandleCountdown .countdown-ring-wrap {
    width: 24px;
    height: 24px;
  }

  #desktopCandleCountdown .countdown-ring-text {
    font-size: 8px;
  }

  #desktopCandleCountdown .countdown-label {
    font-size: 8px;
  }

  #desktopCandleCountdown .countdown-time {
    font-size: 12px;
  }

  /* Desktop UTC Clock Box: compact, elegant micro-badge beside Next Candle */
  #desktopCandleCountdown .countdown-divider {
    width: 1px;
    height: 14px;
    background: rgba(255, 255, 255, 0.12);
    margin: 0 2px;
  }

  #desktopCandleCountdown .utc-clock-box {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 1.5px;
    padding: 2px 6px;
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.08), rgba(15, 23, 42, 0.45));
    border: 1px solid rgba(56, 189, 248, 0.2);
    border-radius: 5px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  }

  #desktopCandleCountdown:hover .utc-clock-box,
  #desktopCandleCountdown .utc-clock-box:hover {
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.14), rgba(15, 23, 42, 0.65));
    border-color: rgba(56, 189, 248, 0.42);
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  }

  #desktopCandleCountdown .utc-clock-label-wrap {
    display: flex;
    align-items: center;
    gap: 3px;
    line-height: 1;
  }

  #desktopCandleCountdown .utc-clock-icon {
    width: 7.5px;
    height: 7.5px;
    stroke: #38bdf8;
    flex-shrink: 0;
    opacity: 0.95;
    filter: drop-shadow(0 0 3px rgba(56, 189, 248, 0.5));
  }

  #desktopCandleCountdown .utc-clock-label {
    font-size: 6.8px;
    font-weight: 700;
    color: #38bdf8;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    line-height: 1;
  }

  #desktopCandleCountdown .utc-clock-val {
    font-size: 9.5px;
    font-weight: 700;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, monospace;
    font-variant-numeric: tabular-nums;
    color: #f1f5f9;
    letter-spacing: 0.2px;
    line-height: 1.1;
    white-space: nowrap;
  }

  /* Desktop bottom tools: compact overlay */
  .chart-bottom-tools {
    bottom: 4px;
    left: 6px;
    right: 6px;
    padding: 3px 8px;
    min-height: 28px;
  }
}

@media (max-width: 1100px) and (min-width: 768px) {
  .indicator-group {
    display: none;
    /* Hide on small desktop to save space */
  }
}

/* Override the old canvas style */
canvas#mainChart,
canvas#mobileChart {
  display: none !important;
}

/* ══════════════════════════════════════════════════════
   ── Professional Trade Marking System ──
   ══════════════════════════════════════════════════════ */

.tm-wrapper {
  position: absolute;
  display: flex;
  align-items: center;
  z-index: 10;
  pointer-events: none;
  transform: translate(calc(-100% + 4px), -50%);
  animation: tmAppear 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  filter: drop-shadow(0 2px 10px rgba(0, 0, 0, 0.35));
  will-change: left, top;
}

.tm-wrapper.flipped {
  flex-direction: row-reverse;
  transform: translate(-4px, -50%);
}

@keyframes tmAppear {
  0% {
    opacity: 0;
    scale: 0.5;
  }
  70% {
    opacity: 1;
    scale: 1.05;
  }
  100% {
    opacity: 1;
    scale: 1;
  }
}

/* ── Badge (pill) ── */
.tm-badge {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px 3px 4px;
  border-radius: 16px;
  font-family: 'Inter', sans-serif;
  font-size: 10.5px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.22);
}

/* Up = Blue */
.tm-wrapper.up .tm-badge {
  background: linear-gradient(135deg, rgba(33, 150, 243, 0.94), rgba(21, 101, 192, 0.98));
  box-shadow: 0 4px 18px rgba(33, 150, 243, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

/* Down = Red */
.tm-wrapper.down .tm-badge {
  background: linear-gradient(135deg, rgba(244, 67, 54, 0.94), rgba(183, 28, 28, 0.98));
  box-shadow: 0 4px 18px rgba(244, 67, 54, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

/* ── Direction icon circle ── */
.tm-icon-circle {
  width: 17px;
  height: 17px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9.5px;
  font-weight: 900;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.25);
  color: #fff;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.3);
}

/* ── Text ── */
.tm-amount {
  font-weight: 800;
  letter-spacing: 0.3px;
  font-size: 10.5px;
}

.tm-timer {
  opacity: 0.9;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.3px;
  font-family: 'JetBrains Mono', 'Inter', monospace;
  background: rgba(0, 0, 0, 0.2);
  padding: 1px 5px;
  border-radius: 8px;
}

/* ── Connector line ── */
.tm-connector {
  height: 1.5px;
  width: 12px;
  flex-shrink: 0;
  position: relative;
}

.tm-wrapper.up .tm-connector {
  background: linear-gradient(90deg, rgba(33, 150, 243, 0.9), rgba(33, 150, 243, 0.4));
}

.tm-wrapper.down .tm-connector {
  background: linear-gradient(90deg, rgba(244, 67, 54, 0.9), rgba(244, 67, 54, 0.4));
}

.tm-wrapper.flipped.up .tm-connector {
  background: linear-gradient(270deg, rgba(33, 150, 243, 0.9), rgba(33, 150, 243, 0.4));
}

.tm-wrapper.flipped.down .tm-connector {
  background: linear-gradient(270deg, rgba(244, 67, 54, 0.9), rgba(244, 67, 54, 0.4));
}

/* ── Entry dot ── */
.tm-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  box-sizing: border-box;
  border: 1.5px solid rgba(255, 255, 255, 0.9);
  position: relative;
  z-index: 2;
}

.tm-wrapper.up .tm-dot {
  background: #2196F3;
  box-shadow: 0 0 10px rgba(33, 150, 243, 0.9), 0 0 20px rgba(33, 150, 243, 0.4);
}

.tm-wrapper.down .tm-dot {
  background: #F44336;
  box-shadow: 0 0 10px rgba(244, 67, 54, 0.9), 0 0 20px rgba(244, 67, 54, 0.4);
}

/* Pulse ring on dot */
.tm-dot::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1.5px solid;
  transform: translate(-50%, -50%) scale(1);
  animation: tmDotPulse 2s ease-in-out infinite;
}

.tm-wrapper.up .tm-dot::after {
  border-color: rgba(33, 150, 243, 0.7);
}

.tm-wrapper.down .tm-dot::after {
  border-color: rgba(244, 67, 54, 0.7);
}

@keyframes tmDotPulse {
  0%, 100% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 0.7;
  }
  50% {
    transform: translate(-50%, -50%) scale(2);
    opacity: 0;
  }
}

/* ── Expired / exit animation ── */
.tm-wrapper.tm-expired {
  opacity: 0 !important;
  scale: 0.6 !important;
  transition: opacity 0.5s ease, scale 0.5s ease !important;
  pointer-events: none;
}

/* ── Light Mode ── */
body.light-mode .tm-wrapper {
  filter: drop-shadow(0 2px 10px rgba(0, 0, 0, 0.15));
}

body.light-mode .tm-wrapper.up .tm-badge {
  background: linear-gradient(135deg, rgba(33, 150, 243, 0.95), rgba(21, 101, 192, 0.98));
}

body.light-mode .tm-wrapper.down .tm-badge {
  background: linear-gradient(135deg, rgba(244, 67, 54, 0.95), rgba(183, 28, 28, 0.98));
}

body.light-mode .tm-dot {
  border-color: rgba(255, 255, 255, 0.9);
}

/* ── Mobile adjustments ── */
.m-chart .tm-wrapper .tm-badge {
  padding: 4px 8px 4px 4px;
  gap: 5px;
  font-size: 10px;
  border-radius: 16px;
}

.m-chart .tm-wrapper .tm-icon-circle {
  width: 17px;
  height: 17px;
  font-size: 9.5px;
}

.m-chart .tm-wrapper .tm-amount {
  font-size: 10px;
}

.m-chart .tm-wrapper .tm-timer {
  font-size: 9px;
}

.m-chart .tm-wrapper .tm-connector {
  width: 14px;
}

.m-chart .tm-wrapper .tm-dot {
  width: 8px;
  height: 8px;
}

/* ── Chart Background Image Overlay ── */
.chart-bg-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  pointer-events: none;
  z-index: 0;
  opacity: 0;
  transition: opacity 0.25s ease, background-image 0.25s ease;
}

.chart-container-wrap .tv-chart-container,
.m-chart .tv-chart-container {
  position: relative;
  z-index: 1;
}

/* ============================================================
   REAL-TIME TRADER SENTIMENT BAR (LIQUID / FLUID ANIMATED)
   ============================================================ */
.trader-sentiment-bar {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 12;
  height: 220px;
  width: 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  background: rgba(11, 16, 28, 0.82);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  padding: 8px 3px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  user-select: none;
  pointer-events: auto;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.trader-sentiment-bar:hover {
  border-color: rgba(0, 230, 118, 0.4);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.7), 0 0 24px rgba(0, 230, 118, 0.25);
  transform: translateY(-50%) scale(1.03);
}

.sentiment-val {
  font-family: 'JetBrains Mono', 'Inter', monospace;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
  text-align: center;
  transition: color 0.3s ease;
}

.sentiment-val-up {
  color: #00e676;
  text-shadow: 0 0 8px rgba(0, 230, 118, 0.6);
}

.sentiment-val-down {
  color: #ff2a6d;
  text-shadow: 0 0 8px rgba(255, 42, 109, 0.6);
}

.sentiment-track-wrap {
  position: relative;
  width: 6px;
  flex: 1;
  margin: 6px 0;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 6px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.sentiment-fill-up {
  width: 100%;
  background: linear-gradient(180deg, #00e676 0%, #00c853 100%);
  box-shadow: 0 0 12px rgba(0, 230, 118, 0.6);
  transition: height 0.45s cubic-bezier(0.25, 1, 0.5, 1);
}

.sentiment-fill-down {
  width: 100%;
  background: linear-gradient(180deg, #d50000 0%, #ff2a6d 100%);
  box-shadow: 0 0 12px rgba(255, 42, 109, 0.6);
  transition: height 0.45s cubic-bezier(0.25, 1, 0.5, 1);
}

.sentiment-divider {
  position: absolute;
  left: -3px;
  right: -3px;
  height: 3px;
  background: #ffffff;
  box-shadow: 0 0 10px #ffffff, 0 0 16px rgba(0, 229, 255, 0.9);
  border-radius: 3px;
  transition: bottom 0.45s cubic-bezier(0.25, 1, 0.5, 1);
  z-index: 2;
}

/* Mobile Chart Sentiment Bar */
.m-chart .trader-sentiment-bar {
  left: 6px;
  top: 50%;
  height: 160px;
  width: 26px;
  padding: 6px 2px;
  border-radius: 12px;
}

.m-chart .sentiment-val {
  font-size: 9px;
}

.m-chart .sentiment-track-wrap {
  width: 4px;
  margin: 4px 0;
}

/* ══════════════════════════════════════════════════════
   ── Vertical Expiration Target Line (Completely Removed) ──
   ══════════════════════════════════════════════════════ */
.tm-vertical-exp-line,
.tm-exp-badge-top,
.tm-exp-timer-pill {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

/* ══════════════════════════════════════════════════
 * ── Live Price Pulsing Beacon (Quotex / Pocket Option Style) ──
 * ══════════════════════════════════════════════════ */
.chart-live-beacon {
  position: absolute;
  pointer-events: none;
  z-index: 9;
  transform: translate(-50%, -50%);
  display: none;
  transition: transform 0.05s linear;
  --beacon-color: #00f0ff;
}

.chart-live-beacon .beacon-core {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--beacon-color, #00f0ff);
  box-shadow: 0 0 10px var(--beacon-color, #00f0ff), 0 0 20px var(--beacon-color, #00f0ff);
  position: relative;
  z-index: 2;
  border: 2px solid #ffffff;
}

.chart-live-beacon .beacon-ripple {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 24px;
  height: 24px;
  margin: -12px 0 0 -12px;
  border-radius: 50%;
  border: 1.5px solid var(--beacon-color, #00f0ff);
  animation: beaconPulseWave 1.8s cubic-bezier(0, 0.2, 0.8, 1) infinite;
  pointer-events: none;
  z-index: 1;
}

.chart-live-beacon .beacon-ripple-2 {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 38px;
  height: 38px;
  margin: -19px 0 0 -19px;
  border-radius: 50%;
  border: 1.5px solid var(--beacon-color, #00f0ff);
  animation: beaconPulseWave 1.8s cubic-bezier(0, 0.2, 0.8, 1) infinite 0.6s;
  pointer-events: none;
  z-index: 1;
}

@keyframes beaconPulseWave {
  0% {
    transform: scale(0.3);
    opacity: 0.95;
  }
  100% {
    transform: scale(1.6);
    opacity: 0;
  }
}

.chart-live-beacon .beacon-price-badge {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(13, 17, 23, 0.92);
  border: 1px solid var(--beacon-color, #00f0ff);
  border-radius: 4px;
  padding: 1px 6px;
  font-size: 10px;
  font-weight: 800;
  color: #ffffff;
  font-family: 'Inter', monospace;
  letter-spacing: 0.4px;
  white-space: nowrap;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5), 0 0 8px rgba(0, 240, 255, 0.25);
  pointer-events: none;
  z-index: 3;
}

/* ══════════════════════════════════════════════════
 * ── Floating "Jump to Latest Candle" Arrow Button ──
 * ══════════════════════════════════════════════════ */
.chart-scroll-latest-btn {
  position: absolute;
  right: 76px;
  bottom: 44px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.94) 0%, rgba(30, 41, 59, 0.96) 100%);
  border: 1.5px solid rgba(0, 229, 255, 0.5);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6), 0 0 16px rgba(0, 229, 255, 0.35), inset 0 1px 2px rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 35;
  color: #00e5ff;
  opacity: 0;
  pointer-events: none;
  transform: translateX(18px) scale(0.82);
  transition: opacity 0.28s cubic-bezier(0.16, 1, 0.3, 1), transform 0.28s cubic-bezier(0.16, 1, 0.3, 1), background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  user-select: none;
  -webkit-user-select: none;
  outline: none;
  padding: 0;
}

.chart-scroll-latest-btn.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0) scale(1);
}

.chart-scroll-latest-btn:hover {
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.32) 0%, rgba(30, 41, 59, 0.98) 100%);
  border-color: #00f0ff;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.7), 0 0 24px rgba(0, 240, 255, 0.65), inset 0 1px 2px rgba(255, 255, 255, 0.4);
  transform: translateY(-2px) scale(1.08);
  color: #ffffff;
}

.chart-scroll-latest-btn:hover .scroll-latest-icon {
  filter: drop-shadow(0 0 6px #00f0ff);
  transform: translateX(1.5px);
}

.chart-scroll-latest-btn:active {
  transform: translateY(0) scale(0.92);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5), 0 0 10px rgba(0, 240, 255, 0.3);
}

.scroll-latest-icon {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  transition: transform 0.2s ease, filter 0.2s ease;
}

/* Pulsing Live Beacon on Button Corner */
.scroll-latest-pulse {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #00e676;
  box-shadow: 0 0 8px #00e676;
  animation: scrollPulseAnim 1.8s infinite;
  pointer-events: none;
}

@keyframes scrollPulseAnim {
  0% { transform: scale(0.9); box-shadow: 0 0 0 0 rgba(0, 230, 118, 0.8); }
  70% { transform: scale(1.2); box-shadow: 0 0 0 6px rgba(0, 230, 118, 0); }
  100% { transform: scale(0.9); box-shadow: 0 0 0 0 rgba(0, 230, 118, 0); }
}

/* Floating Tooltip */
.scroll-latest-tooltip {
  position: absolute;
  bottom: calc(100% + 8px);
  right: 50%;
  transform: translateX(50%) translateY(4px);
  padding: 4px 9px;
  border-radius: 6px;
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid rgba(0, 229, 255, 0.35);
  color: #e2e8f0;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5);
  font-family: 'Inter', sans-serif;
  letter-spacing: 0.3px;
}

.chart-scroll-latest-btn:hover .scroll-latest-tooltip {
  opacity: 1;
  transform: translateX(50%) translateY(0);
}

/* Mobile Placement */
.chart-scroll-latest-btn.mobile {
  right: 64px;
  bottom: 54px;
  width: 36px;
  height: 36px;
}

.chart-scroll-latest-btn.mobile .scroll-latest-icon {
  width: 17px;
  height: 17px;
}

.chart-scroll-latest-btn.mobile .scroll-latest-pulse {
  top: 2px;
  right: 2px;
  width: 7px;
  height: 7px;
}

/* ==========================================================================
   IQ Option Style Live Trade Direction Prediction Zone (Half-Chart Overlay)
   ========================================================================== */

.chart-trade-preview-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 8;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.22s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.22s ease;
  will-change: opacity;
}

.chart-trade-preview-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* Prediction Zones (Upper & Lower halves) */
.preview-zone {
  position: absolute;
  left: 0;
  right: 0;
  overflow: hidden;
  pointer-events: none;
  transition: background 0.25s ease, opacity 0.2s ease;
}

.preview-zone-up {
  top: 0;
  height: 50%; /* Dynamically calculated to candle price coordinate */
}

.preview-zone-down {
  top: 50%;
  bottom: 0;
}

/* Background Gradients */
.preview-zone-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

/* MODE: UP (Higher Zone illuminated in vivid emerald green) */
.chart-trade-preview-overlay.mode-up .preview-zone-up .preview-zone-bg {
  background: linear-gradient(0deg, rgba(0, 230, 118, 0.28) 0%, rgba(0, 230, 118, 0.12) 45%, rgba(0, 230, 118, 0.02) 100%);
  border-bottom: 2px solid rgba(0, 230, 118, 0.95);
  box-shadow: 0 0 20px rgba(0, 230, 118, 0.5), inset 0 0 40px rgba(0, 230, 118, 0.15);
}

.chart-trade-preview-overlay.mode-up .preview-zone-down .preview-zone-bg {
  background: rgba(5, 10, 20, 0.32);
}

/* MODE: DOWN (Lower Zone illuminated in vivid crimson/red) */
.chart-trade-preview-overlay.mode-down .preview-zone-down .preview-zone-bg {
  background: linear-gradient(180deg, rgba(255, 68, 88, 0.28) 0%, rgba(255, 68, 88, 0.12) 45%, rgba(255, 68, 88, 0.02) 100%);
  border-top: 2px solid rgba(255, 68, 88, 0.95);
  box-shadow: 0 0 20px rgba(255, 68, 88, 0.5), inset 0 0 40px rgba(255, 68, 88, 0.15);
}

.chart-trade-preview-overlay.mode-down .preview-zone-up .preview-zone-bg {
  background: rgba(5, 10, 20, 0.32);
}

/* Floating Animated Chevron Stream Particles */
.preview-arrows-stream {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.chart-trade-preview-overlay.mode-up .preview-arrows-stream.up {
  opacity: 1;
}

.chart-trade-preview-overlay.mode-down .preview-arrows-stream.down {
  opacity: 1;
}

.preview-arrow-item {
  position: absolute;
  font-size: 14px;
  font-weight: 900;
  user-select: none;
  pointer-events: none;
}

.preview-arrows-stream.up .preview-arrow-item {
  color: #00e676;
  text-shadow: 0 0 10px rgba(0, 230, 118, 0.9), 0 0 20px rgba(0, 230, 118, 0.5);
  animation: previewFloatArrowUp 1.6s cubic-bezier(0.2, 0.7, 0.3, 1) infinite;
}

.preview-arrows-stream.down .preview-arrow-item {
  color: #ff3b30;
  text-shadow: 0 0 10px rgba(255, 59, 48, 0.9), 0 0 20px rgba(255, 59, 48, 0.5);
  animation: previewFloatArrowDown 1.6s cubic-bezier(0.2, 0.7, 0.3, 1) infinite;
}

@keyframes previewFloatArrowUp {
  0% {
    transform: translateY(30px) scale(0.7);
    opacity: 0;
  }
  20% {
    opacity: 0.85;
    transform: translateY(10px) scale(1);
  }
  80% {
    opacity: 0.85;
    transform: translateY(-25px) scale(1.1);
  }
  100% {
    transform: translateY(-45px) scale(1.2);
    opacity: 0;
  }
}

@keyframes previewFloatArrowDown {
  0% {
    transform: translateY(-30px) scale(0.7);
    opacity: 0;
  }
  20% {
    opacity: 0.85;
    transform: translateY(-10px) scale(1);
  }
  80% {
    opacity: 0.85;
    transform: translateY(25px) scale(1.1);
  }
  100% {
    transform: translateY(45px) scale(1.2);
    opacity: 0;
  }
}

/* Glowing Dynamic Price Projection Boundary Line */
.preview-price-line {
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  top: 50%;
  pointer-events: none;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 75px;
  transform: translateY(-50%);
  transition: top 0.05s linear;
}

.preview-line-laser {
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  pointer-events: none;
}

.chart-trade-preview-overlay.mode-up .preview-line-laser {
  background: linear-gradient(90deg, rgba(0, 230, 118, 0.15) 0%, rgba(0, 230, 118, 0.85) 30%, #00e676 100%);
  box-shadow: 0 0 10px #00e676, 0 0 20px rgba(0, 230, 118, 0.7);
}

.chart-trade-preview-overlay.mode-down .preview-line-laser {
  background: linear-gradient(90deg, rgba(255, 68, 88, 0.15) 0%, rgba(255, 68, 88, 0.85) 30%, #ff4458 100%);
  box-shadow: 0 0 10px #ff4458, 0 0 20px rgba(255, 68, 88, 0.7);
}

/* Sleek IQ Option Glassmorphic Projection Badge */
.preview-badge-chip {
  position: relative;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 20px;
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: 0.3px;
  white-space: nowrap;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.35);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
  transform: translateY(-1px);
  user-select: none;
}

.chart-trade-preview-overlay.mode-up .preview-badge-chip {
  background: linear-gradient(135deg, rgba(0, 200, 83, 0.9) 0%, rgba(0, 230, 118, 0.9) 100%);
  box-shadow: 0 0 16px rgba(0, 230, 118, 0.75), 0 4px 12px rgba(0, 0, 0, 0.4);
  animation: previewBadgePulseUp 1.4s ease-in-out infinite;
}

.chart-trade-preview-overlay.mode-down .preview-badge-chip {
  background: linear-gradient(135deg, rgba(213, 0, 0, 0.9) 0%, rgba(255, 82, 82, 0.9) 100%);
  box-shadow: 0 0 16px rgba(255, 68, 88, 0.75), 0 4px 12px rgba(0, 0, 0, 0.4);
  animation: previewBadgePulseDown 1.4s ease-in-out infinite;
}

@keyframes previewBadgePulseUp {
  0%, 100% {
    box-shadow: 0 0 12px rgba(0, 230, 118, 0.6), 0 4px 12px rgba(0, 0, 0, 0.3);
  }
  50% {
    box-shadow: 0 0 22px rgba(0, 230, 118, 0.95), 0 4px 16px rgba(0, 230, 118, 0.4);
  }
}

@keyframes previewBadgePulseDown {
  0%, 100% {
    box-shadow: 0 0 12px rgba(255, 68, 88, 0.6), 0 4px 12px rgba(0, 0, 0, 0.3);
  }
  50% {
    box-shadow: 0 0 22px rgba(255, 68, 88, 0.95), 0 4px 16px rgba(255, 68, 88, 0.4);
  }
}

.preview-badge-dir-icon {
  font-size: 11px;
  font-weight: 900;
}

.preview-badge-payout-text {
  font-weight: 700;
  opacity: 0.95;
}

/* Click Shockwave / Trade Confirmation Pulse */
.preview-pulse-wave {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  z-index: 7;
}

.preview-pulse-wave.trigger-up {
  background: radial-gradient(circle at 80% 50%, rgba(0, 230, 118, 0.5) 0%, rgba(0, 230, 118, 0) 70%);
  animation: previewShockwave 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.preview-pulse-wave.trigger-down {
  background: radial-gradient(circle at 80% 50%, rgba(255, 68, 88, 0.5) 0%, rgba(255, 68, 88, 0) 70%);
  animation: previewShockwave 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes previewShockwave {
  0% {
    opacity: 1;
    transform: scale(0.9);
  }
  100% {
    opacity: 0;
    transform: scale(1.1);
  }
}