/* =========================================
   1. Base & Variables
   ========================================= */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

:root {
  --ui-font: 'JetBrains Mono', 'Fira Code', 'SF Mono', Consolas, monospace;
  --canvas-bg: #0f172a;
  --surface-card: #1e293b;
  --surface-modal: #2a3648;

  /* Colorless Sophisticated Accents */
  --accent: #ffffff;
  --text-primary: #e2e8f0;
  --text-secondary: #94a3b8;

  --shadow-glass: 0 24px 48px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  --shadow-modal: 0 32px 64px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;
}

html, body {
  height: 100%;
  /* 🔑 Force a pure black background instantly on page load */
  background: #000000 !important;
  color: var(--text-primary);
  font-family: var(--ui-font);
  overflow: hidden;
}

#chartWrap {
  position: relative;
  height: 100vh;
  height: 100dvh;
  background: #131722;

  /* 🔑 The ultimate flash prevention: physically hide the canvas */
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}

/* 🔑 Reveal the chart only when JS says it's ready */
body.app-ready #chartWrap {
  visibility: visible;
  opacity: 1;
}

#chartWrap {
  position: relative;
  height: 100vh;
  height: 100dvh;
  background: #131722;
}

#chart {
  width: 100%;
  height: 100%;
}

/* =========================================
   2. Floating Action Menu (Icon-Only)
   ========================================= */
.floating-menu {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 50;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  transition: opacity 0.2s ease;
}

.floating-menu.hidden {
  opacity: 0;
  pointer-events: none;
}

.fab-item {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  padding: 0;
  background: transparent !important;
  border: none !important;
  border-radius: var(--radius-sm);
  color: var(--text-secondary) !important;
  cursor: pointer;
  transition: all 0.1s ease-out; /* Snappy transition */
  outline: none;
  transform: translateY(0);
}

.fab-item:hover {
  background: rgba(255, 255, 255, 0.1) !important;
  color: #ffffff !important;
}

/* 🔑 THE 3D PRESS EFFECT */
.fab-item:active {
  transform: scale(0.92) translateY(2px);
  background: rgba(0, 0, 0, 0.3) !important;
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.6), inset 0 -1px 0 rgba(255, 255, 255, 0.05) !important;
}
/* 🔑 THE INVISIBLE FAB TRIGGER */
.fab-trigger {
  width: 40px;
  height: 40px;
  padding: 0;
  /* Kills the white browser box */
  background: transparent !important;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  -webkit-appearance: none !important;
  appearance: none !important;

  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
  /* NO opacity transition here. JS controls it. */
}

/* Force hover/active/focus to do absolutely nothing visually */
.fab-trigger:hover,
.fab-trigger:active,
.fab-trigger:focus {
  background: transparent !important;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  opacity: 1; /* Prevent the darkening effect */
}

.fab-trigger svg {
  width: 20px;
  height: 20px;
  display: block;
  filter: drop-shadow(0px 2px 4px rgba(0, 0, 0, 0.3));
  transition: transform 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
  transform-origin: center center !important;
  transform: rotate(0deg) !important;
}

.floating-menu.expanded .fab-trigger svg {
  transform: rotate(90deg) !important;
}

.fab-menu-content {
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: rgba(20, 24, 33, 0.85);
  backdrop-filter: blur(16px) saturate(1.6);
  -webkit-backdrop-filter: blur(16px) saturate(1.6);
  border: none;
  box-shadow: var(--shadow-glass);
  border-radius: var(--radius-md);
  padding: 6px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px) scale(0.97);
  transform-origin: top left;
  transition: opacity 0.2s ease, transform 0.2s cubic-bezier(0.175,0.885,0.32,1.275), visibility 0.2s;
}

.floating-menu.expanded .fab-menu-content {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.fab-item {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  padding: 0;
  background: transparent !important;
  border: none !important;
  border-radius: var(--radius-sm);
  color: var(--text-secondary) !important;
  cursor: pointer;
  transition: all 0.15s ease;
  outline: none;
}

.fab-item:hover {
  background: rgba(255, 255, 255, 0.1) !important;
  color: #ffffff !important;
}

.fab-item svg {
  width: 18px;
  height: 18px;
  display: block;
  transition: transform 0.15s ease;
}

.fab-item::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 100%;
  top: 50%;
  transform: translateY(-50%) translateX(8px);
  background: rgba(20, 24, 33, 0.95);
  color: var(--text-primary);
  font-size: 11px;
  font-family: var(--ui-font);
  padding: 6px 10px;
  border-radius: 6px;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.15s ease, transform 0.15s ease;
  box-shadow: 0 4px 12px rgba(0,0,0,0.5);
  z-index: 100;
}

.fab-item:hover::after {
  opacity: 1;
  visibility: visible;
  transform: translateY(-50%) translateX(12px);
}

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* =========================================
   3. Annotations
   ========================================= */
.annotation-layer { position: absolute; inset: 0; pointer-events: none; z-index: 20; }
.annotation-pins { position: absolute; inset: 0; pointer-events: none; }

.note-pin {
  position: absolute;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #ffffff;
  border: 2px solid var(--canvas-bg);
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
  transform: translate(-50%, -50%);
  pointer-events: auto;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s;
}

.note-pin:hover {
  transform: translate(-50%, -50%) scale(1.3);
  background: var(--accent);
  border-color: var(--canvas-bg);
  box-shadow: 0 4px 12px rgba(255,255,255,0.5);
}

.note-popup {
  position: absolute;
  display: block;
  min-width: 200px;
  max-width: 280px;
  background: rgba(20, 24, 33, 0.85);
  backdrop-filter: blur(16px) saturate(1.6);
  -webkit-backdrop-filter: blur(16px) saturate(1.6);
  border: none;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-glass);
  pointer-events: auto;
  z-index: 100;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.18s ease, transform 0.18s cubic-bezier(0.175,0.885,0.32,1.275), visibility 0.18s;
  transform: translate(-100%, -50%) scale(0.92);
  transform-origin: right center;
  margin-left: -18px;
}

.note-popup.flip-right {
  transform: translate(0%, -50%) scale(0.92);
  transform-origin: left center;
  margin-left: 18px;
}

.note-popup.active { opacity: 1; visibility: visible; }
.note-popup.active:not(.flip-right) { transform: translate(-100%, -50%) scale(1); }
.note-popup.active.flip-right { transform: translate(0%, -50%) scale(1); }

.note-leader {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  right: -9px;
  border-top: 9px solid transparent;
  border-bottom: 9px solid transparent;
  border-left: 9px solid rgba(20, 24, 33, 0.85);
}

.note-popup.flip-right .note-leader {
  right: auto;
  left: -9px;
  border-left: none;
  border-right: 9px solid rgba(20, 24, 33, 0.85);
}

.note-text {
  width: 100%;
  background: transparent;
  border: none;
  padding: 14px;
  color: var(--text-primary);
  font-family: var(--ui-font);
  font-size: 13px;
  font-weight: 400;
  resize: vertical;
  outline: none;
  line-height: 1.5;
  border-radius: var(--radius-md);
  transition: box-shadow 0.2s ease;
  min-height: 48px;
}

.note-text::placeholder { color: var(--text-secondary); font-style: italic; }
.note-text:focus { box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.2); }

.note-delete {
  position: absolute;
  top: 8px;
  right: 8px;
  background: transparent;
  color: var(--text-secondary);
  border: none;
  border-radius: 4px;
  width: 24px;
  height: 24px;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s, background 0.15s;
  outline: none;
}

.note-delete:hover { color: #ef4444; background: rgba(239, 68, 68, 0.1); }

/* =========================================
   4. Context Menu
   ========================================= */
.context-menu {
  display: none;
  position: fixed;
  z-index: 1000;
  padding: 6px;
  min-width: 160px;
  background: rgba(20, 24, 33, 0.85);
  backdrop-filter: blur(16px) saturate(1.6);
  -webkit-backdrop-filter: blur(16px) saturate(1.6);
  border: none;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-glass);
  animation: contextMenuIn 0.15s ease-out;
}

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

.context-menu.active { display: block; }

.menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  cursor: pointer;
  color: var(--text-primary);
  border-radius: var(--radius-sm);
  transition: background 0.15s;
  font-weight: 500;
  font-size: 13px;
  outline: none;
}

.menu-item:hover { background: rgba(255, 255, 255, 0.08); color: #fff; }
.menu-item svg { color: var(--text-secondary); }
.menu-item:hover svg { color: #fff; }

/* =========================================
   5. Settings Modal
   ========================================= */
.settings-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(8px);
  z-index: 1000;
  opacity: 0;
  transition: opacity 0.2s;
}

.settings-overlay.active {
  display: block;
  opacity: 1;
}

#authModal {
  transition: none !important;
  background: rgba(15, 23, 42, 0.6);
  z-index: 2500 !important;
}

.settings-panel {
  display: none;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.97);
  width: 400px;
  max-width: calc(100vw - 32px);
  background: rgba(20, 24, 33, 0.85);
  backdrop-filter: blur(24px) saturate(1.6);
  -webkit-backdrop-filter: blur(24px) saturate(1.6);
  border: none;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-modal);
  z-index: 1001;
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.settings-panel.active {
  display: flex;
  flex-direction: column;
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.settings-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.03);
  font-weight: 600;
  font-size: 15px;
  color: var(--text-primary);
}

.close-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 16px;
  cursor: pointer;
  transition: color 0.15s;
  outline: none;
}

.close-btn:hover { color: #ef4444; }

/* =========================================
   Tab Redesign (Muted, Tactile Press)
   ========================================= */
.settings-tabs {
  display: flex;
  padding: 8px 20px 16px;
  gap: 8px;
  box-shadow: none;
}

.tab-btn {
  flex: 1;
  background: transparent;
  border: none;
  padding: 10px 12px;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  border-radius: 6px;
  transition: all 0.1s ease-out;
  outline: none;
  text-align: center;
  box-shadow: none;
  transform: translateY(0);
}

.tab-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 2px 4px rgba(0, 0, 0, 0.2);
  transform: translateY(-1px);
}

.tab-btn:active {
  transform: translateY(1px);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.5);
  background: rgba(0, 0, 0, 0.2);
}

.tab-btn.active {
  color: #e2e8f0;
  background: rgba(0, 0, 0, 0.25);
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.5), inset 0 -1px 0 rgba(255, 255, 255, 0.02);
  transform: translateY(1px);
}

/* =========================================
   6. Settings Form Elements & Fixed Layout
   ========================================= */
.settings-main-view {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  height: 460px;
}

.settings-body {
  padding: 20px;
  flex: 1;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}

.settings-body::-webkit-scrollbar { width: 6px; }
.settings-body::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.1); border-radius: 3px; }

.tab-content { display: none; flex-direction: column; gap: 16px; flex: 1; }
.tab-content.active { display: flex; }

.settings-section {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0;
}

.settings-section-title {
  font-size: 10px;
  text-transform: uppercase;
  color: var(--text-secondary);
  letter-spacing: 0.1em;
  font-weight: 700;
  padding: 10px 0 4px;
}

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 0;
}

.setting-label {
  font-size: 13px;
  color: var(--text-primary);
  font-weight: 500;
}

.setting-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

.toggle-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  cursor: pointer;
  padding: 9px 0;
  color: var(--text-primary);
  outline: none;
}

.toggle-row input[type="checkbox"] { display: none; }

.toggle-switch {
  position: relative;
  width: 42px;
  height: 20px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  transition: background 0.2s ease;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

.toggle-switch::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  background: #ffffff;
  border-radius: 2px;
  transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  box-shadow: 0 1px 3px rgba(0,0,0,0.4);
}

.toggle-row input:checked + .toggle-switch {
  background: rgba(226, 232, 240, 0.9);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.toggle-row input:checked + .toggle-switch::after {
  transform: translateX(22px);
  background: #ffffff;
  box-shadow: -1px 1px 3px rgba(0,0,0,0.3);
}

.select-input {
  width: 130px;
  padding: 8px 30px 8px 12px;
  background: rgba(255, 255, 255, 0.05);
  border: none;
  border-radius: var(--radius-sm);
  color: #fff;
  font-family: var(--ui-font);
  font-size: 13px;
  outline: none;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23e2e8f0' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 14px;
  transition: background 0.2s ease;
  text-align: right;
}

.select-input:hover { background-color: rgba(255, 255, 255, 0.08); }
.select-input:focus { background-color: rgba(255, 255, 255, 0.1); box-shadow: none; }
.select-input option { background: var(--surface-card); color: #fff; text-align: left; }

.btn-reset-inline {
  padding: 8px 16px;
  background: rgba(255, 255, 255, 0.05);
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--ui-font);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
  white-space: nowrap;
}

.btn-reset-inline:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

/* Checkerboard Base with 3D Physical Depth */
.color-swatch, .color-preview {
  position: relative;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  cursor: pointer;
  flex-shrink: 0;
  overflow: hidden;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.4),
    0 1px 3px rgba(0, 0, 0, 0.6);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  background-image:
    linear-gradient(45deg, #2a2a2a 25%, transparent 25%),
    linear-gradient(-45deg, #2a2a2a 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #2a2a2a 75%),
    linear-gradient(-45deg, transparent 75%, #2a2a2a 75%);
  background-size: 8px 8px;
  background-position: 0 0, 0 4px, 4px -4px, -4px 0px;
  background-color: #1a1a1a;
}

.color-swatch::before, .color-preview::before {
  content: '';
  position: absolute;
  inset: 0;
  background-color: var(--swatch-color, transparent);
  z-index: 1;
}

.color-swatch:hover {
  transform: scale(1.1);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.6),
    0 3px 8px rgba(0, 0, 0, 0.8);
}

/* =========================================
   7. Color Picker Sub-View
   ========================================= */
.settings-color-view { display: none; flex-direction: column; flex: 1; min-height: 0; }
.settings-color-view.active { display: flex; }
.settings-panel.showing-color .settings-main-view { display: none; }
.settings-panel.showing-color .settings-header { display: none; }

.settings-subheader {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 20px 10px;
  box-shadow: none;
  font-weight: 600;
  font-size: 15px;
  color: var(--text-primary);
}

.back-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.1s ease-out;
  outline: none;
  box-shadow: none;
  transform: translateY(0);
}

.back-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 2px 4px rgba(0, 0, 0, 0.2);
  transform: translateY(-1px);
}

.back-btn:active {
  transform: translateY(1px);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.5);
  background: rgba(0, 0, 0, 0.2);
}

.back-btn svg { display: block; }

.color-body {
  padding: 10px 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

#colorPickerContainer { width: 100%; position: relative; z-index: 1; }

#colorPickerContainer .IroBox {
  width: 100% !important;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1);
}

#colorPickerContainer .IroSlider {
  width: 100% !important;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1);
  margin-top: 16px;
}

#colorPickerContainer *:focus { outline: none !important; }

.color-controls-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  background: rgba(0, 0, 0, 0.15);
  padding: 8px 12px;
  border-radius: 10px;
  border: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.preset-swatches { display: flex; gap: 8px; }

.preset-swatch {
  width: 24px;
  height: 24px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  border: 2px solid transparent;
  transition: transform 0.15s ease, border-color 0.15s ease;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.4);
  position: relative;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
  opacity: 1 !important;
}

.preset-swatch:hover { transform: scale(1.1); }
.preset-swatch:active { transform: scale(0.95); }

.selected-color-group {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(0, 0, 0, 0.3);
  padding: 4px;
  border-radius: var(--radius-sm);
  border: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.color-preview { cursor: default; }

.copy-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s, background 0.15s;
}

.copy-btn:hover { color: #ffffff; background: rgba(255, 255, 255, 0.1); }

/* =========================================
   8. Snapped Sophisticated Tooltip
   ========================================= */
.color-tooltip {
    position: fixed;
    background: rgba(20, 24, 33, 0.95);
    backdrop-filter: blur(16px) saturate(1.6);
    -webkit-backdrop-filter: blur(16px) saturate(1.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    padding: 6px 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none !important;
    opacity: 0;
    transform: translate(-50%, -100%);
    margin-top: -12px;
    transition: opacity 0.15s ease;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
    z-index: 9999;
    white-space: nowrap;
}

.color-tooltip * {
  pointer-events: none !important;
}

.color-tooltip::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 50%;
  transform: translateX(-50%);
  border-width: 5px 5px 0;
  border-style: solid;
  border-color: rgba(20, 24, 33, 0.95) transparent transparent transparent;
}

.tooltip-preview {
  width: 14px;
  height: 14px;
  border-radius: 4px;
  background: #fff;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

/* The text styling */
.tooltip-data {
  display: flex;
  flex-direction: row; /* Horizontal instead of vertical */
  align-items: center;
  gap: 8px; /* Space between hex and value */
  font-family: var(--ui-font);
  line-height: 1;
}


.tooltip-hex {
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.05em;
}

/* 🔑 Cleaned up single span */
.tooltip-val {
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  font-family: var(--ui-font);
  letter-spacing: 0.05em;
}

/* =========================================
   9. Toast Notification
   ========================================= */
.toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: rgba(20, 24, 33, 0.85);
  backdrop-filter: blur(16px) saturate(1.6);
  -webkit-backdrop-filter: blur(16px) saturate(1.6);
  border: none;
  box-shadow: var(--shadow-glass);
  color: #fff;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-family: var(--ui-font);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.02em;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s, transform 0.3s;
  z-index: 2000;
}

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

/* =========================================
   10. OHLC Info Panel
   ========================================= */
.ohlc-panel {
  position: absolute;
  top: 16px;
  right: 16px;
  left: auto;
  background: rgba(20, 24, 33, 0.85);
  backdrop-filter: blur(16px) saturate(1.6);
  -webkit-backdrop-filter: blur(16px) saturate(1.6);
  border: none;
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  pointer-events: none;
  color: var(--text-primary);
  opacity: 0;
  transition: opacity 150ms;
  z-index: 10;
  box-shadow: var(--shadow-glass);
}

.ohlc-panel.active { opacity: 1; }

.ohlc-panel .label {
  color: var(--text-secondary);
  margin: 0 4px 0 10px;
  font-weight: 600;
}
.ohlc-panel .label:first-child { margin-left: 0; }
.ohlc-panel .up { color: #26a69a; font-weight: 600; margin-left: 10px; }
.ohlc-panel .down { color: #ef5350; font-weight: 600; margin-left: 10px; }

/* =========================================
   11. Auth Modal
   ========================================= */
.auth-box {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 280px;
  background: rgba(20, 24, 33, 0.85);
  backdrop-filter: blur(24px) saturate(1.6);
  -webkit-backdrop-filter: blur(24px) saturate(1.6);
  border: none;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-modal);
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  text-align: center;
  z-index: 2501;
}

.auth-title { font-size: 14px; font-weight: 600; color: var(--text-primary); }
.auth-desc { font-size: 12px; color: var(--text-secondary); }

.auth-input {
  width: 100%;
  padding: 12px;
  background: rgba(0, 0, 0, 0.25);
  border: none;
  border-radius: var(--radius-sm);
  color: #ffffff;
  font-family: var(--ui-font);
  text-align: center;
  outline: none;
  transition: all 0.2s ease;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.4);
}

.auth-input:focus {
  box-shadow:
    inset 0 2px 4px rgba(0, 0, 0, 0.4),
    0 0 0 1px rgba(255, 255, 255, 0.15);
  background: rgba(0, 0, 0, 0.15);
}

.auth-input.error {
  box-shadow:
    inset 0 2px 4px rgba(0, 0, 0, 0.4),
    0 0 0 1px rgba(239, 68, 68, 0.8);
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}
.shake { animation: shake 0.4s ease-in-out; }
