/* ==========================================================================
   TradingView-Style Left Drawing Toolbar & Canvas Overlay System
   ReaperX Gold Intelligence Platform - Pixel-Perfect TV Aesthetics
   ========================================================================== */

/* Main Layout: Toolbar Column (Left) + Chart Area (Right) */
.fullchart-main-layout {
  display: flex !important;
  flex-direction: row !important;
  width: 100% !important;
  flex: 1 1 0 !important;
  min-height: 250px !important;
  position: relative !important;
  overflow: visible !important;
  background: #0f111a !important;
}

/* Left Pinned Toolbar Column (OUTSIDE chart grid, exactly like TradingView) */
.chart-drawing-toolbar {
  width: 40px !important;
  flex-shrink: 0 !important;
  background: #131722 !important;
  border-right: 1px solid #2a2e39 !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  padding: 4px 0 !important;
  position: relative !important;
  z-index: 30 !important;
  user-select: none !important;
  overflow: visible !important;
  box-sizing: border-box !important;
}

/* Tool Button Wrapper */
.draw-tool-item-wrap {
  position: relative;
  width: 38px;
  height: 36px;
  margin: 1px 0;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}

/* Tool Main Icon Button */
.draw-tool-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 5px;
  cursor: pointer;
  color: #787b86;
  transition: background 0.12s ease, color 0.12s ease;
  background: transparent;
  border: none;
  outline: none;
  padding: 0;
  box-sizing: border-box;
  position: relative;
}

/* SVG icons inside buttons: Crisp, delicate, authentic TV proportions */
.draw-tool-btn svg {
  width: 18px !important;
  height: 18px !important;
  stroke: currentColor;
  stroke-width: 1.5;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  display: block;
}

.draw-tool-btn:hover {
  background: #2a2e39;
  color: #d1d4dc;
}

.draw-tool-btn.active {
  background: rgba(245, 158, 11, 0.16) !important;
  color: #f59e0b !important;
  box-shadow: inset 0 0 0 1px rgba(245, 158, 11, 0.6), 0 0 8px rgba(245, 158, 11, 0.25) !important;
  border-radius: 6px !important;
}

.draw-tool-btn.active svg {
  stroke: #f59e0b !important;
}

.draw-tool-btn.magnet-active {
  background: #2a2e39;
  color: #a855f7;
  box-shadow: inset 0 0 0 1px rgba(168, 85, 247, 0.45);
}

.draw-tool-btn.draw-mode-active {
  background: #2a2e39;
  color: #00e676;
  box-shadow: inset 0 0 0 1px rgba(0, 230, 118, 0.45);
}

.draw-tool-btn.lock-active {
  background: #2a2e39;
  color: #ef4444;
  box-shadow: inset 0 0 0 1px rgba(239, 68, 68, 0.45);
}

.draw-tool-btn.fav-bar-active {
  background: #f59e0b !important;
  color: #0b0e14 !important;
  border-radius: 6px !important;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.4) !important;
}

.draw-tool-btn.fav-bar-active svg {
  stroke: #0b0e14 !important;
}

/* Permanent TradingView Submenu Caret Indicator (Visible ◢ triangle in bottom-right corner) */
.draw-tool-caret {
  position: absolute;
  right: 1px;
  bottom: 1px;
  width: 14px;
  height: 14px;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  padding: 0 1px 1px 0;
  cursor: pointer;
  background: transparent;
  border: none;
  color: #787b86;
  opacity: 0.85;
  transition: opacity 0.12s ease, color 0.12s ease;
  z-index: 10;
}

.draw-tool-item-wrap:hover .draw-tool-caret {
  opacity: 1;
  color: #2962ff;
}

.draw-tool-caret:hover {
  color: #2962ff !important;
}

.draw-tool-caret svg {
  width: 6px;
  height: 6px;
  display: block;
}

/* Toolbar Separator */
.draw-tool-sep {
  width: 24px;
  height: 1px;
  background: #2a2e39;
  margin: 4px 0;
  flex-shrink: 0;
}

/* Authentic TradingView Flyout Submenu (Pops out to the right over chart) */
.draw-flyout-menu {
  position: absolute !important;
  left: 42px !important;
  background: #1e222d !important;
  border: 1px solid #2a2e39 !important;
  border-radius: 6px !important;
  padding: 6px 4px !important;
  min-width: 270px !important;
  max-width: 330px !important;
  display: none !important;
  flex-direction: column !important;
  gap: 1px !important;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.85), 0 0 0 1px rgba(255, 255, 255, 0.08) !important;
  z-index: 9999 !important;
  pointer-events: auto !important;
  user-select: none !important;
  backdrop-filter: blur(8px) !important;
}

.draw-flyout-menu.show {
  display: flex !important;
  animation: tvFlyoutFade 0.12s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

@keyframes tvFlyoutFade {
  from { opacity: 0; transform: translateX(-6px); }
  to { opacity: 1; transform: translateX(0); }
}

.draw-flyout-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 10px 6px 10px;
  border-bottom: 1px solid #2a2e39;
  margin-bottom: 3px;
}

.draw-flyout-title {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #787b86;
  font-weight: 700;
}

.draw-flyout-count {
  font-size: 0.65rem;
  color: #50535e;
  font-family: var(--font-mono, monospace);
}

.draw-flyout-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 8px;
  border-radius: 4px;
  cursor: pointer;
  color: #d1d4dc;
  font-size: 0.8rem;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  transition: background 0.1s ease, color 0.1s ease;
  position: relative;
}

.draw-flyout-item:hover {
  background: #2a2e39;
  color: #ffffff;
}

.draw-flyout-item:hover .flyout-item-icon svg {
  color: #2962ff;
}

.draw-flyout-item.selected {
  background: rgba(41, 98, 255, 0.15);
  color: #2962ff;
  font-weight: 600;
  border-left: 2px solid #2962ff;
  border-radius: 0 4px 4px 0;
}

.draw-flyout-item.selected .flyout-item-icon svg {
  color: #2962ff;
}

.flyout-item-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1 1 auto;
}

.flyout-item-icon {
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.flyout-item-icon svg {
  width: 16px !important;
  height: 16px !important;
  stroke: currentColor;
  stroke-width: 1.5;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  color: #787b86;
  display: block;
}

.flyout-item-names {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.25;
}

.flyout-en-name {
  font-size: 0.8rem;
  color: #f0f3fa;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.flyout-th-name {
  font-size: 0.68rem;
  color: #787b86;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.flyout-item-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  margin-left: 8px;
}

.flyout-shortcut-badge {
  font-size: 0.65rem;
  color: #787b86;
  background: #131722;
  border: 1px solid #2a2e39;
  border-radius: 3px;
  padding: 1px 5px;
  font-family: var(--font-mono, monospace);
  font-weight: 500;
}

.flyout-fav-star {
  background: transparent;
  border: none;
  color: #50535e;
  font-size: 13px;
  cursor: pointer;
  padding: 2px;
  line-height: 1;
  transition: color 0.12s, transform 0.12s;
}

.flyout-fav-star:hover {
  color: #f59e0b;
  transform: scale(1.2);
}

.flyout-fav-star.active {
  color: #f59e0b;
}

/* Tooltip on hover */
.draw-tool-tooltip {
  position: absolute;
  left: 46px;
  background: #1e222d;
  color: #d1d4dc;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.72rem;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  border: 1px solid #2a2e39;
  z-index: 90;
}

.draw-tool-item-wrap:hover .draw-tool-tooltip {
  opacity: 1;
}

/* TradingView-Style Floating Quick Favorites Toolbar */
.chart-quick-favorites-bar {
  position: absolute;
  bottom: 24px;
  left: 56px;
  z-index: 35;
  display: flex;
  align-items: center;
  gap: 3px;
  background: #1e222d;
  border: 1px solid #2a2e39;
  border-radius: 6px;
  padding: 3px 5px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(255, 255, 255, 0.05);
  user-select: none;
  backdrop-filter: blur(6px);
  animation: tvFavFadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes tvFavFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.quick-fav-drag-handle {
  color: #50535e;
  cursor: grab;
  padding: 2px 4px;
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  letter-spacing: -1px;
  line-height: 1;
}

.quick-fav-drag-handle:active {
  cursor: grabbing;
}

.quick-fav-btn {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: 4px;
  color: #787b86;
  cursor: pointer;
  transition: all 0.12s ease;
  padding: 0;
}

.quick-fav-btn svg {
  width: 16px !important;
  height: 16px !important;
  stroke: currentColor;
  stroke-width: 1.5;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.quick-fav-btn:hover {
  background: #2a2e39;
  color: #f0f3fa;
}

.quick-fav-btn.active {
  background: rgba(41, 98, 255, 0.15);
  color: #2962ff;
  box-shadow: inset 0 0 0 1px rgba(41, 98, 255, 0.45);
}

.quick-fav-sep {
  width: 1px;
  height: 18px;
  background: #2a2e39;
  margin: 0 2px;
}

.quick-fav-btn.trash:hover {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
}

/* Fullchart Canvas Wrapper */
.fullchart-canvas-wrapper {
  position: relative !important;
  flex: 1 1 0 !important;
  height: 100% !important;
  overflow: hidden !important;
}

/* Drawing Canvas Overlay (Transparent layer over candles) */
.chart-drawing-canvas {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  z-index: 15;
  pointer-events: none;
}

.chart-drawing-canvas.drawing-active {
  pointer-events: auto !important;
  cursor: crosshair !important;
}

.chart-drawing-canvas.eraser-active {
  pointer-events: auto !important;
  cursor: crosshair !important;
}

/* Floating Action Bar for Selected Drawing (TradingView Style: ⚙️ Settings, Color, Width, Trash) */
.drawing-action-bar {
  position: absolute;
  background: #1e222d;
  border: 1px solid #2a2e39;
  border-radius: 4px;
  padding: 3px 6px;
  display: none;
  align-items: center;
  gap: 6px;
  z-index: 40;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.6);
  user-select: none;
}

.drawing-action-bar.show {
  display: flex !important;
}

.drawing-action-btn {
  background: transparent;
  border: none;
  color: #787b86;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.12s, color 0.12s;
}

.drawing-action-btn:hover {
  background: #2a2e39;
  color: #d1d4dc;
}

.drawing-action-btn.delete-btn:hover {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
}

.drawing-action-btn svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  stroke-width: 1.6;
  fill: none;
}

.action-bar-swatch {
  width: 16px;
  height: 16px;
  border-radius: 3px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  cursor: pointer;
  transition: transform 0.1s;
}

.action-bar-swatch:hover {
  transform: scale(1.15);
  border-color: #ffffff;
}

/* Toast Notifications */
.drawing-toast {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  background: #1e222d;
  color: #d1d4dc;
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 0.78rem;
  border: 1px solid #2a2e39;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
  opacity: 0;
  pointer-events: none;
  transition: all 0.22s ease;
  z-index: 100;
}

.drawing-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ==========================================================================
   Authentic TradingView Drawing Settings Modal Dialog
   Tabs: Style, Inputs, Text, Coordinates
   ========================================================================== */
.drawing-settings-modal-backdrop {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.45);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 120;
  backdrop-filter: blur(2px);
}

.drawing-settings-modal-backdrop.show,
.drawing-settings-modal-backdrop.open {
  display: flex !important;
}

.drawing-settings-modal {
  width: 390px;
  max-width: 95%;
  background: #1e222d;
  border: 1px solid #2a2e39;
  border-radius: 6px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.85);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  user-select: none;
  animation: dsmFadeIn 0.15s ease-out;
}

@keyframes dsmFadeIn {
  from { opacity: 0; transform: scale(0.97); }
  to { opacity: 1; transform: scale(1); }
}

.dsm-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid #2a2e39;
}

.dsm-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.dsm-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: #f0f3fa;
}

.dsm-title-icon {
  color: #787b86;
  font-size: 0.82rem;
}

.dsm-close-btn {
  background: transparent;
  border: none;
  color: #787b86;
  font-size: 1rem;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 4px;
  transition: color 0.12s, background 0.12s;
}

.dsm-close-btn:hover {
  color: #ffffff;
  background: #2a2e39;
}

/* Tabs */
.dsm-tabs {
  display: flex;
  border-bottom: 1px solid #2a2e39;
  background: #191c24;
  padding: 0 8px;
}

.dsm-tab {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: #787b86;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 10px 14px;
  cursor: pointer;
  transition: color 0.12s, border-color 0.12s;
}

.dsm-tab:hover {
  color: #d1d4dc;
}

.dsm-tab.active {
  color: #f0f3fa;
  border-bottom-color: #2962ff;
}

/* Body & Panes */
.dsm-body {
  padding: 16px;
  min-height: 180px;
  max-height: 380px;
  overflow-y: auto;
}

.dsm-pane {
  display: none;
}

.dsm-pane.active {
  display: block;
}

.dsm-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.dsm-row-vertical {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}

.dsm-row-check {
  margin-bottom: 10px;
  font-size: 0.82rem;
  color: #d1d4dc;
}

.dsm-row-check label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.dsm-label {
  font-size: 0.82rem;
  color: #d1d4dc;
  font-weight: 500;
}

.dsm-control-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.dsm-color-swatch-wrap {
  position: relative;
  width: 28px;
  height: 24px;
  border-radius: 3px;
  border: 1px solid #363a45;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.dsm-color-swatch {
  width: 100%;
  height: 100%;
  display: block;
}

.dsm-color-input {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.dsm-select {
  background: #131722;
  border: 1px solid #2a2e39;
  color: #f0f3fa;
  border-radius: 4px;
  padding: 4px 8px;
  font-size: 0.8rem;
  cursor: pointer;
  outline: none;
}

.dsm-select:focus {
  border-color: #2962ff;
}

.dsm-number-input {
  background: #131722;
  border: 1px solid #2a2e39;
  color: #f0f3fa;
  border-radius: 4px;
  padding: 4px 8px;
  font-size: 0.82rem;
  font-family: var(--font-mono, monospace);
  width: 110px;
  outline: none;
}

.dsm-number-input:focus {
  border-color: #2962ff;
}

.dsm-textarea {
  background: #131722;
  border: 1px solid #2a2e39;
  color: #f0f3fa;
  border-radius: 4px;
  padding: 8px;
  font-size: 0.84rem;
  font-family: inherit;
  width: 100%;
  min-height: 80px;
  box-sizing: border-box;
  resize: vertical;
  outline: none;
}

.dsm-textarea:focus {
  border-color: #2962ff;
}

.dsm-checkbox-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: #d1d4dc;
  cursor: pointer;
}

.dsm-badge-val {
  background: #131722;
  border: 1px solid #2a2e39;
  color: #00e676;
  font-weight: 700;
  font-family: var(--font-mono, monospace);
  font-size: 0.82rem;
  padding: 4px 10px;
  border-radius: 4px;
}

/* Footer */
.dsm-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  border-top: 1px solid #2a2e39;
  background: #171a22;
}

.dsm-footer-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.dsm-btn-secondary {
  background: transparent;
  border: 1px solid #363a45;
  color: #d1d4dc;
  padding: 6px 14px;
  border-radius: 4px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}

.dsm-btn-secondary:hover {
  background: #2a2e39;
  border-color: #434651;
  color: #ffffff;
}

.dsm-btn-primary {
  background: #2962ff;
  border: none;
  color: #ffffff;
  padding: 6px 18px;
  border-radius: 4px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.12s;
}

.dsm-btn-primary:hover {
  background: #1e53e5;
}

/* Chart Settings Modal Adjustments */
.chart-settings-modal {
  max-width: 520px;
  width: 95%;
}

.dsm-fib-level-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #1e222d;
  border: 1px solid #2a2e39;
  border-radius: 4px;
  padding: 4px 8px;
}

.dsm-fib-level-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: #f0f3fa;
  font-family: var(--font-mono, monospace);
  font-weight: 600;
}

/* ==========================================================================
   2-COLUMN CHART SETTINGS MODAL (REAPERX PRO INTELLIGENCE LAYOUT)
   ========================================================================== */
.csm-modal-container {
  background: #131722;
  border: 1px solid #2a2e39;
  border-radius: 8px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.85), 0 0 0 1px rgba(255, 255, 255, 0.06);
  width: 620px;
  max-width: 95vw;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  user-select: none;
  animation: csmModalPop 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  color: #d1d4dc;
  font-family: -apple-system, BlinkMacSystemFont, 'Trebuchet MS', Roboto, Ubuntu, sans-serif;
}

@keyframes csmModalPop {
  from { opacity: 0; transform: scale(0.96) translateY(-8px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.csm-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  border-bottom: 1px solid #2a2e39;
  background: #131722;
  flex-shrink: 0;
}

.csm-title-text {
  font-size: 1.05rem;
  font-weight: 600;
  color: #f0f3fa;
  letter-spacing: -0.01em;
}

.csm-close-btn {
  background: transparent;
  border: none;
  color: #787b86;
  font-size: 1.15rem;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.12s ease;
}

.csm-close-btn:hover {
  background: #2a2e39;
  color: #ffffff;
}

/* 2-Column Body */
.csm-body-wrapper {
  display: flex;
  flex-direction: row;
  flex: 1 1 auto;
  min-height: 380px;
  max-height: 480px;
  overflow: hidden;
}

/* Left Sidebar */
.csm-sidebar {
  width: 175px;
  flex-shrink: 0;
  background: #131722;
  border-right: 1px solid #2a2e39;
  padding: 10px 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.csm-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 18px;
  background: transparent;
  border: none;
  color: #787b86;
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  width: 100%;
  text-align: left;
  transition: background 0.12s, color 0.12s;
  border-left: 2px solid transparent;
}

.csm-nav-icon {
  width: 17px;
  height: 17px;
  stroke: currentColor;
  stroke-width: 1.5;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

.csm-nav-item:hover {
  background: #1e222d;
  color: #d1d4dc;
}

.csm-nav-item.active {
  background: #1e222d;
  color: #f0f3fa;
  font-weight: 600;
  border-left-color: #f59e0b;
}

.csm-nav-item.active .csm-nav-icon {
  stroke: #f59e0b;
}

/* Right Content Area */
.csm-content-area {
  flex: 1 1 auto;
  background: #171b26;
  padding: 18px 24px;
  overflow-y: auto;
}

.csm-tab-pane {
  display: none;
  flex-direction: column;
  gap: 14px;
}

.csm-tab-pane.active {
  display: flex;
}

.csm-section-header {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #787b86;
  margin-bottom: 2px;
}

.csm-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 32px;
  gap: 12px;
}

.csm-row-label {
  font-size: 0.86rem;
  color: #d1d4dc;
}

/* Checkbox with label */
.csm-checkbox-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.86rem;
  color: #d1d4dc;
  cursor: pointer;
  user-select: none;
}

.csm-checkbox-label input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border: 1px solid #434651;
  border-radius: 3px;
  background: #1e222d;
  cursor: pointer;
  position: relative;
  transition: all 0.12s;
  flex-shrink: 0;
}

.csm-checkbox-label input[type="checkbox"]:checked {
  background: #f59e0b;
  border-color: #f59e0b;
}

.csm-checkbox-label input[type="checkbox"]:checked::after {
  content: '✓';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -55%);
  color: #0b0e14;
  font-size: 11px;
  font-weight: 900;
}

/* Dual Color Swatch Wrap */
.csm-dual-swatch-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.csm-swatch-btn {
  width: 28px;
  height: 28px;
  border-radius: 4px;
  border: 1px solid #434651;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.3);
  transition: border-color 0.12s, transform 0.12s;
}

.csm-swatch-btn:hover {
  border-color: #f59e0b;
  transform: scale(1.05);
}

.csm-swatch-btn input[type="color"] {
  opacity: 0;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
}

/* Inputs & Selects */
.csm-select {
  background: #1e222d;
  border: 1px solid #363a45;
  color: #f0f3fa;
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 0.84rem;
  outline: none;
  cursor: pointer;
  min-width: 160px;
  transition: border-color 0.12s;
}

.csm-select:focus {
  border-color: #f59e0b;
}

.csm-number-input {
  background: #1e222d;
  border: 1px solid #363a45;
  color: #f0f3fa;
  padding: 6px 10px;
  border-radius: 4px;
  font-size: 0.84rem;
  width: 70px;
  text-align: center;
  outline: none;
}

.csm-number-input:focus {
  border-color: #f59e0b;
}

/* Footer */
.csm-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  border-top: 1px solid #2a2e39;
  background: #131722;
  flex-shrink: 0;
}

.csm-footer-left {
  display: flex;
  align-items: center;
}

.csm-template-menu-wrap {
  position: relative;
}

.csm-template-btn {
  background: #1e222d;
  border: 1px solid #363a45;
  color: #d1d4dc;
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.12s;
}

.csm-template-btn:hover {
  background: #2a2e39;
  color: #ffffff;
  border-color: #434651;
}

.csm-template-dropdown {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 0;
  background: #1e222d;
  border: 1px solid #2a2e39;
  border-radius: 6px;
  padding: 4px;
  min-width: 200px;
  box-shadow: 0 12px 30px rgba(0,0,0,0.8);
  z-index: 9999;
}

.csm-template-opt {
  padding: 8px 12px;
  font-size: 0.82rem;
  color: #d1d4dc;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}

.csm-template-opt:hover {
  background: #2a2e39;
  color: #f59e0b;
}

.csm-template-divider {
  height: 1px;
  background: #2a2e39;
  margin: 4px 0;
}

.csm-footer-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.csm-btn {
  padding: 6px 18px;
  border-radius: 4px;
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.12s;
}

.csm-btn-secondary {
  background: transparent;
  border: 1px solid #363a45;
  color: #d1d4dc;
}

.csm-btn-secondary:hover {
  background: #2a2e39;
  color: #ffffff;
}

.csm-btn-primary {
  background: #f59e0b;
  border: none;
  color: #0b0e14;
}

.csm-btn-primary:hover {
  background: #d97706;
}

.csm-btn-danger {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid #ef4444;
  color: #f87171;
}

.csm-btn-danger:hover {
  background: #ef4444;
  color: #ffffff;
}

/* Object Tree Modal Styles */
.object-tree-body {
  padding: 14px 18px;
  max-height: 380px;
  overflow-y: auto;
}

.object-tree-section-title {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #787b86;
  margin-bottom: 8px;
}

.object-tree-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.object-tree-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: #171b26;
  border: 1px solid #2a2e39;
  border-radius: 4px;
  font-size: 0.82rem;
  color: #d1d4dc;
}

.object-tree-item-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.object-tree-item-icon {
  color: #f59e0b;
}

.object-tree-item-btn {
  background: transparent;
  border: none;
  color: #787b86;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 3px;
  transition: all 0.12s;
}

.object-tree-item-btn:hover {
  background: #2a2e39;
  color: #f87171;
}

.object-tree-empty {
  padding: 16px;
  text-align: center;
  color: #64748b;
  font-size: 0.82rem;
  background: #171b26;
  border-radius: 4px;
  border: 1px dashed #2a2e39;
}


