/* ==========================================================================
   iCharts Live Presentation & Demonstration Suite - Premium Dark Theme
   ========================================================================== */

:root {
  --bg-main: #0b0e14;
  --bg-card: rgba(18, 24, 38, 0.75);
  --bg-card-solid: #121826;
  --bg-hover: rgba(30, 41, 59, 0.8);
  --bg-active: rgba(45, 62, 90, 0.9);
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(0, 242, 254, 0.5);

  --accent-cyan: #00f2fe;
  --accent-blue: #4facfe;
  --accent-green: #00ff88;
  --accent-red: #ff3366;
  --accent-yellow: #ffbb00;
  --accent-purple: #a855f7;

  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  --glow-cyan: 0 0 20px rgba(0, 242, 254, 0.35);
  --glow-red: 0 0 20px rgba(255, 51, 102, 0.45);
  --glow-green: 0 0 20px rgba(0, 255, 136, 0.35);

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  --font-main: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-smooth: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  user-select: none;
}

body {
  background-color: var(--bg-main);
  color: var(--text-primary);
  font-family: var(--font-main);
  height: 100vh;
  width: 100vw;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

input, button, select, textarea {
  font-family: inherit;
  font-size: inherit;
}

/* Glassmorphism Panel */
.glass-panel {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-subtle);
  box-shadow: 0 12px 32px 0 rgba(0, 0, 0, 0.45);
}

.glass-card {
  background: rgba(22, 30, 48, 0.6);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
}

/* ==========================================================================
   Modals & Auth Screen
   ========================================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(5, 8, 15, 0.85);
  backdrop-filter: blur(14px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 1;
  visibility: visible;
  transition: opacity var(--transition-smooth);
}

.modal-overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.auth-card {
  width: 90%;
  max-width: 440px;
  border-radius: var(--radius-xl);
  padding: 36px 32px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.7), 0 0 35px rgba(0, 242, 254, 0.12);
  border: 1px solid rgba(0, 242, 254, 0.2);
}

.auth-header {
  text-align: center;
  margin-bottom: 24px;
}

.brand-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(0, 242, 254, 0.1);
  border: 1px solid rgba(0, 242, 254, 0.25);
  color: var(--accent-cyan);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-bottom: 14px;
}

.brand-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-cyan);
  box-shadow: 0 0 8px var(--accent-cyan);
}

.auth-header h2 {
  font-size: 1.55rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.auth-subtitle {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.auth-tabs {
  display: flex;
  background: rgba(0, 0, 0, 0.35);
  padding: 4px;
  border-radius: var(--radius-md);
  margin-bottom: 24px;
  border: 1px solid var(--border-subtle);
}

.tab-btn {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.tab-btn.active {
  background: rgba(0, 242, 254, 0.15);
  color: var(--accent-cyan);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.auth-form.hidden {
  display: none;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.input-group label {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.input-wrap input,
.input-group input {
  width: 100%;
  background: rgba(10, 15, 26, 0.8);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  color: var(--text-primary);
  font-size: 0.95rem;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.input-wrap input:focus,
.input-group input:focus {
  outline: none;
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 3px rgba(0, 242, 254, 0.15);
}

.icon-toggle-pwd {
  position: absolute;
  right: 12px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.1rem;
}

.input-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.35;
}

.auth-error-box {
  margin-top: 14px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  background: rgba(255, 51, 102, 0.15);
  border: 1px solid rgba(255, 51, 102, 0.35);
  color: #ff99b3;
  font-size: 0.85rem;
}

.auth-error-box.hidden {
  display: none;
}

/* Buttons */
.btn-primary {
  background: linear-gradient(135deg, #00f2fe 0%, #4facfe 100%);
  color: #050b14;
  border: none;
  border-radius: var(--radius-md);
  padding: 12px 20px;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 18px rgba(0, 242, 254, 0.3);
  transition: all var(--transition-smooth);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(0, 242, 254, 0.45);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-block {
  width: 100%;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  padding: 8px 14px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all var(--transition-fast);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-danger {
  background: rgba(255, 51, 102, 0.15);
  border: 1px solid rgba(255, 51, 102, 0.4);
  color: #ff668c;
  padding: 8px 14px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all var(--transition-fast);
}

.btn-danger:hover {
  background: rgba(255, 51, 102, 0.25);
  box-shadow: var(--glow-red);
}

.btn-compact {
  padding: 6px 10px;
  font-size: 0.8rem;
}

.btn-sm {
  padding: 4px 8px;
  font-size: 0.75rem;
  border-radius: var(--radius-sm);
}

.btn-icon {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1rem;
  transition: all var(--transition-fast);
}

.btn-icon:hover {
  background: rgba(255, 255, 255, 0.12);
  color: var(--text-primary);
  border-color: var(--border-focus);
}

.btn-logout:hover {
  color: var(--accent-red);
  border-color: var(--accent-red);
}

/* Badges & Pills */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.badge-subtle {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
}

.badge-role {
  background: rgba(0, 242, 254, 0.15);
  border: 1px solid rgba(0, 242, 254, 0.35);
  color: var(--accent-cyan);
}

.badge-live {
  background: rgba(255, 51, 102, 0.2);
  border: 1px solid rgba(255, 51, 102, 0.5);
  color: #ff668c;
  box-shadow: 0 0 10px rgba(255, 51, 102, 0.4);
}

.pulse {
  animation: pulse-glow 2s infinite ease-in-out;
}

@keyframes pulse-glow {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.75; transform: scale(0.97); }
}

.pill-count {
  background: rgba(0, 242, 254, 0.2);
  color: var(--accent-cyan);
  padding: 2px 6px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
}

/* ==========================================================================
   Main App Layout
   ========================================================================== */
.app-layout {
  display: flex;
  flex-direction: column;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
  position: relative;
}

.app-layout.hidden {
  display: none;
}

/* Header */
.app-header {
  height: 64px;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 100;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  border-top: none;
  border-left: none;
  border-right: none;
}

.header-left, .header-center, .header-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.symbol-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.symbol-title-row h1 {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 0.5px;
}

.symbol-meta-row {
  display: flex;
  gap: 10px;
  font-size: 0.75rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

/* Search Box */
.search-container {
  position: relative;
  width: 260px;
}

.search-box {
  display: flex;
  align-items: center;
  background: rgba(10, 15, 26, 0.7);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 6px 10px;
  transition: all var(--transition-fast);
}

.search-box:focus-within {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 12px rgba(0, 242, 254, 0.2);
}

.search-icon {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-right: 6px;
}

.search-box input {
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 0.85rem;
  width: 100%;
  outline: none;
}

.search-shortcut {
  font-size: 0.72rem;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.1);
  padding: 2px 5px;
  border-radius: 4px;
  font-family: var(--font-mono);
}

.search-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  max-height: 320px;
  overflow-y: auto;
  background: var(--bg-card-solid);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.6);
  z-index: 200;
}

.search-dropdown.hidden {
  display: none;
}

.search-item {
  padding: 8px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  transition: background var(--transition-fast);
}

.search-item:hover, .search-item.selected {
  background: rgba(0, 242, 254, 0.15);
}

.search-item-symbol {
  font-weight: 600;
  color: var(--text-primary);
}

.search-item-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Tags */
.tag-group {
  display: flex;
  gap: 6px;
}

.tag-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.tag-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

.tag-btn.active.tag-bullish {
  background: rgba(0, 255, 136, 0.2);
  border-color: var(--accent-green);
  color: var(--accent-green);
  box-shadow: var(--glow-green);
}

.tag-btn.active.tag-breakout {
  background: rgba(0, 242, 254, 0.2);
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
  box-shadow: var(--glow-cyan);
}

.tag-btn.active.tag-bearish {
  background: rgba(255, 51, 102, 0.2);
  border-color: var(--accent-red);
  color: var(--accent-red);
  box-shadow: var(--glow-red);
}

.tag-btn.active.tag-watch {
  background: rgba(255, 187, 0, 0.2);
  border-color: var(--accent-yellow);
  color: var(--accent-yellow);
}

.viewer-tag-pill {
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  border: 1px solid var(--border-subtle);
}

.viewer-tag-pill.hidden {
  display: none;
}

/* Viewer Follow Host & Jump Controls */
.viewer-follow-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.viewer-follow-group.hidden {
  display: none !important;
}

.btn-follow-host {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid var(--border-subtle);
  transition: all var(--transition-fast);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-secondary);
}

.btn-follow-host.following {
  background: rgba(0, 255, 136, 0.15);
  border-color: rgba(0, 255, 136, 0.5);
  color: var(--accent-green);
  box-shadow: 0 0 12px rgba(0, 255, 136, 0.2);
}

.btn-follow-host.free-browsing {
  background: rgba(0, 242, 254, 0.12);
  border-color: rgba(0, 242, 254, 0.4);
  color: var(--accent-cyan);
}

.btn-follow-host:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.btn-jump-host {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 14px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  background: linear-gradient(135deg, rgba(255, 51, 102, 0.25), rgba(255, 187, 0, 0.25));
  border: 1px solid rgba(255, 51, 102, 0.6);
  color: #ffffff;
  box-shadow: 0 0 14px rgba(255, 51, 102, 0.35);
  animation: pulse-jump 2s infinite ease-in-out;
  transition: all var(--transition-fast);
}

.btn-jump-host.hidden {
  display: none !important;
}

.btn-jump-host:hover {
  background: linear-gradient(135deg, rgba(255, 51, 102, 0.4), rgba(255, 187, 0, 0.4));
  border-color: #ff5c8a;
  transform: scale(1.04);
  box-shadow: 0 0 20px rgba(255, 51, 102, 0.55);
}

.jump-beacon {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ff3366;
  box-shadow: 0 0 8px #ff3366;
  display: inline-block;
  animation: beacon-blink 1s infinite alternate;
}

@keyframes pulse-jump {
  0%, 100% { box-shadow: 0 0 12px rgba(255, 51, 102, 0.3); }
  50% { box-shadow: 0 0 22px rgba(255, 51, 102, 0.6); }
}

@keyframes beacon-blink {
  0% { transform: scale(0.8); opacity: 0.6; }
  100% { transform: scale(1.3); opacity: 1; }
}

.slideshow-box {
  display: flex;
  align-items: center;
  gap: 4px;
}

.select-compact {
  background: rgba(10, 15, 26, 0.7);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  padding: 4px 6px;
  font-size: 0.75rem;
  outline: none;
}

.host-tools-group, .util-tools-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ==========================================================================
   Workspace & Viewport Area
   ========================================================================== */
.workspace-area {
  flex: 1;
  position: relative;
  overflow: hidden;
  display: flex;
}

.stage-viewport {
  flex: 1;
  position: relative;
  overflow: hidden;
  background: radial-gradient(circle at center, #101626 0%, #080c14 100%);
  cursor: grab;
}

.stage-viewport.panning {
  cursor: grabbing;
}

.chart-transform-container {
  position: absolute;
  top: 50%;
  left: 50%;
  transform-origin: center center;
  will-change: transform;
}

#base-chart-img {
  display: block;
  max-width: none;
  user-select: none;
  pointer-events: none;
}

#drawing-canvas, #overlay-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: auto;
}

#overlay-canvas {
  pointer-events: none;
}

/* Zoom HUD */
.viewport-zoom-hud {
  position: absolute;
  bottom: 20px;
  right: 20px;
  padding: 4px 8px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  gap: 6px;
  z-index: 50;
}

.btn-zoom {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 0.8rem;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-zoom:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
}

.zoom-level-text {
  font-size: 0.78rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
  min-width: 44px;
  text-align: center;
}

/* ==========================================================================
   Demonstration Toolbar Drawer (Docked to Left Wall)
   ========================================================================== */
.demo-hud.demo-drawer {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 270px;
  max-width: 85vw;
  z-index: 85;
  border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
  display: flex;
  flex-direction: column;
  background: rgba(10, 16, 26, 0.94);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(0, 242, 254, 0.25);
  border-left: none;
  box-shadow: 8px 0 32px rgba(0, 0, 0, 0.7), 0 0 20px rgba(0, 242, 254, 0.1);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.35s ease;
  transform: translateX(0);
}

.demo-hud.demo-drawer.closed {
  transform: translateX(-100%);
  box-shadow: none;
}

/* Floating Drawer Toggle Tab Handle on the left wall */
.drawer-toggle-tab {
  position: absolute;
  top: 50%;
  left: 100%;
  transform: translateY(-50%);
  background: rgba(10, 16, 26, 0.94);
  border: 1px solid rgba(0, 242, 254, 0.4);
  border-left: none;
  border-radius: 0 10px 10px 0;
  padding: 12px 7px 12px 6px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: var(--accent-cyan);
  box-shadow: 6px 0 18px rgba(0, 0, 0, 0.5), 0 0 12px rgba(0, 242, 254, 0.2);
  transition: all var(--transition-fast);
  z-index: 90;
  user-select: none;
}

.drawer-toggle-tab:hover {
  background: rgba(0, 242, 254, 0.15);
  color: #ffffff;
  border-color: var(--accent-cyan);
  box-shadow: 8px 0 24px rgba(0, 242, 254, 0.45);
  padding-right: 9px;
}

.drawer-tab-icon {
  font-size: 0.75rem;
  transition: transform 0.35s ease;
  line-height: 1;
}

.demo-hud.demo-drawer.closed .drawer-tab-icon {
  transform: rotate(180deg);
}

.drawer-tab-label {
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 1.5px;
  writing-mode: vertical-rl;
  text-orientation: mixed;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.drawer-toggle-tab:hover .drawer-tab-label {
  color: var(--accent-cyan);
}

.hud-header {
  padding: 12px 14px;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-subtle);
}

.hud-title-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.hud-icon {
  font-size: 1rem;
}

.hud-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--accent-cyan);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.btn-hud-close {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.8rem;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-hud-close:hover {
  background: rgba(255, 51, 102, 0.2);
  color: #ff5c8a;
  border-color: rgba(255, 51, 102, 0.4);
}

.hud-body {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
  overflow-y: auto;
}

.tool-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tool-section-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.tool-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.tool-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 8px 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.tool-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.2);
}

.tool-btn.active {
  background: rgba(0, 242, 254, 0.2);
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
  box-shadow: 0 0 12px rgba(0, 242, 254, 0.25);
}

.tool-icon {
  font-size: 1.1rem;
}

.tool-label {
  font-size: 0.68rem;
  font-weight: 600;
}

/* ==========================================================================
   Precision Circle Cursors & Active Tool Floating Badge
   ========================================================================== */
.active-tool-pill {
  position: absolute;
  top: 16px;
  left: 16px;
  padding: 6px 12px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-primary);
  z-index: 60;
  pointer-events: none;
  background: rgba(10, 15, 26, 0.85);
  border: 1px solid rgba(0, 242, 254, 0.35);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  transition: all var(--transition-fast);
}

.active-tool-pill-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-cyan);
}

/* Precision Circle Reticle Cursors */
.stage-viewport[data-tool="pen"],
.stage-viewport[data-tool="highlighter"],
.stage-viewport[data-tool="trendline"],
.stage-viewport[data-tool="horizontal"],
.stage-viewport[data-tool="box"],
.stage-viewport[data-tool="circle"],
.stage-viewport[data-tool="arrow"],
.stage-viewport[data-tool="text"] {
  cursor: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'><circle cx='12' cy='12' r='7' fill='none' stroke='%2300f2fe' stroke-width='1.5'/><circle cx='12' cy='12' r='1.5' fill='%23ffffff'/></svg>") 12 12, crosshair;
}

.stage-viewport[data-tool="eraser"] {
  cursor: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'><circle cx='12' cy='12' r='9' fill='none' stroke='%23ff3366' stroke-width='1.8'/><circle cx='12' cy='12' r='1.5' fill='%23ffffff'/></svg>") 12 12, crosshair;
}

.stage-viewport[data-tool="laser"] {
  cursor: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'><circle cx='12' cy='12' r='6' fill='%23ff3366'/><circle cx='12' cy='12' r='2' fill='%23ffffff'/></svg>") 12 12, crosshair;
}

.stage-viewport[data-tool="spotlight"] {
  cursor: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'><circle cx='12' cy='12' r='8' fill='none' stroke='%23ffd700' stroke-width='1.5' stroke-dasharray='3 2'/><circle cx='12' cy='12' r='1.5' fill='%23ffffff'/></svg>") 12 12, crosshair;
}

.stage-viewport[data-tool="magnifier"] {
  cursor: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'><circle cx='11' cy='11' r='6' fill='none' stroke='%2300f2fe' stroke-width='1.8'/><line x1='15.5' y1='15.5' x2='20' y2='20' stroke='%2300f2fe' stroke-width='2' stroke-linecap='round'/></svg>") 11 11, crosshair;
}

.stage-viewport[data-tool="select"] {
  cursor: default;
}

.color-palette {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
}

.color-dot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--c);
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform var(--transition-fast), border-color var(--transition-fast);
}

.color-dot.active {
  border-color: #ffffff;
  transform: scale(1.15);
  box-shadow: 0 0 8px var(--c);
}

#custom-color-picker {
  width: 24px;
  height: 24px;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  border-radius: 50%;
}

.slider-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.slider-row label {
  min-width: 65px;
}

.slider-row input[type="range"] {
  flex: 1;
  accent-color: var(--accent-cyan);
}

.font-stepper-control {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
}

.font-stepper-control input[type="range"] {
  flex: 1;
  min-width: 45px;
}

.btn-font-stepper {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 6px;
  cursor: pointer;
  line-height: 1.2;
  transition: all var(--transition-fast);
}

.btn-font-stepper:hover {
  background: rgba(0, 242, 254, 0.25);
  border-color: var(--accent-cyan);
  color: #ffffff;
  box-shadow: 0 0 8px rgba(0, 242, 254, 0.3);
}

.btn-font-stepper:active {
  transform: scale(0.92);
}

/* Floating Note Box Context Action Pill */
.note-action-pill {
  position: absolute;
  transform: translate(-50%, -100%);
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(10, 16, 28, 0.94);
  border: 1px solid rgba(0, 242, 254, 0.5);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.65), 0 0 16px rgba(0, 242, 254, 0.25);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  z-index: 70;
  pointer-events: auto;
  user-select: none;
  animation: pill-pop 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  transition: left 0.08s ease-out, top 0.08s ease-out, opacity 0.15s ease;
}

.note-action-pill.hidden {
  display: none !important;
}

@keyframes pill-pop {
  0% { transform: translate(-50%, -90%) scale(0.9); opacity: 0; }
  100% { transform: translate(-50%, -100%) scale(1); opacity: 1; }
}

.note-pill-tag {
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: var(--accent-cyan);
  padding: 0 4px;
  font-family: var(--font-mono);
}

.note-pill-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  color: var(--text-primary);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 7px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: all var(--transition-fast);
}

.note-pill-btn:hover {
  background: rgba(0, 242, 254, 0.25);
  border-color: var(--accent-cyan);
  color: #ffffff;
  box-shadow: 0 0 10px rgba(0, 242, 254, 0.35);
  transform: translateY(-1px);
}

.note-pill-btn:active {
  transform: translateY(1px) scale(0.95);
}

.note-pill-btn-danger:hover {
  background: rgba(255, 51, 102, 0.25);
  border-color: var(--accent-red);
  color: #ff5c8a;
  box-shadow: 0 0 10px rgba(255, 51, 102, 0.35);
}

.note-pill-size-badge {
  font-size: 0.75rem;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--text-primary);
  background: rgba(0, 242, 254, 0.15);
  border: 1px solid rgba(0, 242, 254, 0.3);
  padding: 2px 6px;
  border-radius: 4px;
  min-width: 38px;
  text-align: center;
}

.note-pill-divider {
  width: 1px;
  height: 14px;
  background: rgba(255, 255, 255, 0.18);
  margin: 0 2px;
}

.action-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
}

.btn-action {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 6px 8px;
  color: var(--text-primary);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-action:hover {
  background: rgba(255, 255, 255, 0.12);
}

.btn-action-danger:hover {
  background: rgba(255, 51, 102, 0.2);
  border-color: var(--accent-red);
  color: var(--accent-red);
}

.btn-action-success:hover {
  background: rgba(0, 255, 136, 0.2);
  border-color: var(--accent-green);
  color: var(--accent-green);
}

/* ==========================================================================
   Bottom Thumbnail Carousel
   ========================================================================== */
.bottom-drawer {
  height: 140px;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  border-bottom: none;
  border-left: none;
  border-right: none;
  display: flex;
  flex-direction: column;
  z-index: 90;
  transition: height var(--transition-smooth);
}

.bottom-drawer.collapsed {
  height: 38px;
}

.drawer-header {
  height: 38px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-subtle);
}

.drawer-filters {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
}

.filter-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
}

.filter-pill {
  background: transparent;
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  padding: 3px 10px;
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition-fast);
}

.filter-pill:hover, .filter-pill.active {
  background: rgba(0, 242, 254, 0.15);
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
}

.btn-drawer-toggle {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 0.9rem;
}

.drawer-filmstrip-wrap {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
  padding: 6px 12px;
  overflow: hidden;
}

.drawer-filmstrip {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  scroll-behavior: smooth;
  height: 100%;
  align-items: center;
  padding-bottom: 4px;
}

.drawer-filmstrip::-webkit-scrollbar {
  height: 4px;
}

.drawer-filmstrip::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}

.filmstrip-card {
  flex: 0 0 130px;
  height: 78px;
  background: rgba(10, 15, 26, 0.85);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  overflow: hidden;
  position: relative;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  transition: all var(--transition-fast);
}

.filmstrip-card:hover {
  transform: translateY(-2px);
  border-color: rgba(0, 242, 254, 0.5);
}

.filmstrip-card.active {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 14px rgba(0, 242, 254, 0.4);
}

.filmstrip-thumb {
  flex: 1;
  width: 100%;
  object-fit: cover;
  object-position: top;
}

.filmstrip-info {
  padding: 2px 6px;
  background: rgba(5, 8, 15, 0.9);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.72rem;
  font-weight: 700;
}

.filmstrip-scroll-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(5, 8, 15, 0.85);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  width: 28px;
  height: 48px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  transition: all var(--transition-fast);
}

.filmstrip-scroll-btn:hover {
  background: var(--accent-cyan);
  color: #050b14;
}

.scroll-left { left: 4px; }
.scroll-right { right: 4px; }

/* ==========================================================================
   Modals & Tables
   ========================================================================== */
.modal-card {
  width: 90%;
  max-width: 600px;
  max-height: 85vh;
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.7);
}

.modal-lg { max-width: 820px; }
.modal-xl { max-width: 1200px; width: 95%; }

.modal-header {
  padding: 16px 20px;
  background: rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-subtle);
}

.modal-title-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.modal-icon {
  font-size: 1.5rem;
}

.modal-subtitle {
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.btn-modal-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.2rem;
  cursor: pointer;
}

.btn-modal-close:hover {
  color: var(--text-primary);
}

.modal-body {
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.modal-footer {
  padding: 14px 20px;
  background: rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  border-top: 1px solid var(--border-subtle);
}

/* Info Banner */
.info-banner {
  background: rgba(0, 242, 254, 0.08);
  border: 1px solid rgba(0, 242, 254, 0.25);
}

.banner-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent-cyan);
  margin-bottom: 8px;
}

.key-display-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

.key-display-row code {
  background: rgba(0, 0, 0, 0.5);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 1rem;
  color: var(--accent-cyan);
  letter-spacing: 1px;
}

.banner-note {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* Table */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.data-table th {
  text-align: left;
  padding: 8px 12px;
  background: rgba(0, 0, 0, 0.35);
  color: var(--text-secondary);
  font-weight: 600;
  border-bottom: 1px solid var(--border-subtle);
}

.data-table td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.spectators-chips-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.spectator-chip {
  background: rgba(0, 255, 136, 0.15);
  border: 1px solid rgba(0, 255, 136, 0.3);
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  color: var(--accent-green);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* Compare View */
.compare-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  height: 65vh;
}

.compare-pane {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 12px;
}

.compare-pane-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.select-modern {
  background: rgba(10, 15, 26, 0.8);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  padding: 6px 12px;
  font-size: 0.85rem;
}

.compare-img-wrap {
  flex: 1;
  position: relative;
  overflow: hidden;
  background: #000;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
}

.compare-img-wrap img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

/* Keyboard Shortcuts Modal */
.shortcuts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.shortcut-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
}

kbd {
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 2px 6px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--accent-cyan);
}

/* Viewer Reactions in Top Panel */
.viewer-reactions {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 3px 10px;
}

.viewer-reactions.hidden {
  display: none !important;
}

.reactions-title {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent-cyan);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-right: 2px;
}

.btn-reaction {
  background: transparent;
  border: none;
  font-size: 1.25rem;
  padding: 2px 4px;
  cursor: pointer;
  line-height: 1;
  transition: transform var(--transition-fast), filter var(--transition-fast);
}

.btn-reaction:hover {
  transform: scale(1.3);
  filter: drop-shadow(0 0 8px rgba(0, 242, 254, 0.6));
}

.btn-reaction:active {
  transform: scale(0.95);
}

.floating-reactions-box {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 70;
}

.float-emoji {
  position: absolute;
  bottom: 40px;
  font-size: 2rem;
  animation: fly-up 2.5s forwards ease-out;
}

@keyframes fly-up {
  0% { transform: translateY(0) scale(0.8); opacity: 1; }
  100% { transform: translateY(-300px) scale(1.4); opacity: 0; }
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 9999;
}

.toast {
  background: rgba(18, 24, 38, 0.95);
  border: 1px solid var(--border-subtle);
  padding: 10px 16px;
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.85rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  gap: 10px;
  animation: slide-in 0.25s ease-out;
}

.toast-success { border-color: var(--accent-green); }
.toast-error { border-color: var(--accent-red); }

@keyframes slide-in {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ==========================================================================
   Mobile & Tablet Responsive Optimizations
   ========================================================================== */
@media (max-width: 768px) {
  .top-navbar {
    height: 52px;
    padding: 0 10px;
  }

  .brand-title {
    font-size: 0.95rem;
  }

  .nav-center {
    display: none;
  }

  .nav-btn span:not(.live-dot) {
    display: none;
  }

  .nav-btn {
    padding: 6px 8px;
  }

  .viewer-reactions {
    padding: 2px 6px;
    gap: 4px;
  }

  .btn-reaction {
    font-size: 1.05rem;
    padding: 1px 2px;
  }

  .active-tool-pill {
    top: 8px;
    left: 8px;
    padding: 4px 8px;
    font-size: 0.72rem;
  }

  .stage-viewport {
    touch-action: none;
  }
}

/* ==========================================================================
   Weekly Price Correction Strategy Flowchart & Checklist HUD
   ========================================================================== */

.badge-strategy {
  background: rgba(0, 242, 254, 0.1);
  border: 1px solid rgba(0, 242, 254, 0.35);
  color: var(--accent-cyan);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 12px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.badge-strategy:hover {
  background: rgba(0, 242, 254, 0.2);
  border-color: var(--accent-cyan);
  transform: translateY(-1px);
  box-shadow: 0 0 12px rgba(0, 242, 254, 0.3);
}

.badge-strategy.stage-3 {
  background: rgba(0, 255, 136, 0.15);
  border-color: var(--accent-green);
  color: var(--accent-green);
  box-shadow: 0 0 10px rgba(0, 255, 136, 0.25);
}

.badge-strategy.stage-early {
  background: rgba(0, 242, 254, 0.15);
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
  box-shadow: 0 0 10px rgba(0, 242, 254, 0.25);
}

.badge-strategy.stage-2 {
  background: rgba(59, 130, 246, 0.15);
  border-color: #3b82f6;
  color: #60a5fa;
}

.badge-strategy.stage-1 {
  background: rgba(255, 187, 0, 0.15);
  border-color: var(--accent-amber);
  color: var(--accent-amber);
}

/* ==========================================================================
   Strategy Flowchart HUD Drawer (Docked to Right Wall)
   ========================================================================== */
.strategy-hud.strategy-drawer {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 440px;
  max-width: 90vw;
  max-height: 100%;
  display: flex;
  flex-direction: column;
  background: rgba(10, 16, 26, 0.94);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(0, 242, 254, 0.25);
  border-right: none;
  border-radius: var(--radius-lg) 0 0 var(--radius-lg);
  box-shadow: -8px 0 32px rgba(0, 0, 0, 0.7), 0 0 20px rgba(0, 242, 254, 0.1);
  z-index: 85;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.35s ease;
  transform: translateX(0);
  font-family: 'JetBrains Mono', monospace;
}

.strategy-hud.strategy-drawer.closed {
  transform: translateX(100%);
  box-shadow: none;
}

/* Floating Drawer Toggle Tab Handle on the right wall */
.strategy-toggle-tab {
  position: absolute;
  top: 50%;
  right: 100%;
  transform: translateY(-50%);
  background: rgba(10, 16, 26, 0.94);
  border: 1px solid rgba(0, 242, 254, 0.4);
  border-right: none;
  border-radius: 10px 0 0 10px;
  padding: 12px 6px 12px 7px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: var(--accent-cyan);
  box-shadow: -6px 0 18px rgba(0, 0, 0, 0.5), 0 0 12px rgba(0, 242, 254, 0.2);
  transition: all var(--transition-fast);
  z-index: 90;
  user-select: none;
}

.strategy-toggle-tab:hover {
  background: rgba(0, 242, 254, 0.15);
  color: #ffffff;
  border-color: var(--accent-cyan);
  box-shadow: -8px 0 24px rgba(0, 242, 254, 0.45);
  padding-left: 9px;
}

.strategy-tab-icon {
  font-size: 0.75rem;
  transition: transform 0.35s ease;
  line-height: 1;
}

.strategy-hud.strategy-drawer.closed .strategy-tab-icon {
  transform: rotate(180deg);
}

.strategy-tab-label {
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 1.5px;
  writing-mode: vertical-rl;
  text-orientation: mixed;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.strategy-toggle-tab:hover .strategy-tab-label {
  color: var(--accent-cyan);
}

.strategy-hud-header {
  padding: 12px 14px;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-subtle);
}

.strategy-hud-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--accent-cyan);
  letter-spacing: 0.5px;
}

.strategy-hud-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.btn-hud-icon {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-secondary);
  font-size: 0.85rem;
  padding: 3px 6px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-hud-icon:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  border-color: var(--border-subtle);
}

.btn-hud-close:hover {
  background: rgba(255, 51, 102, 0.2);
  color: var(--accent-red);
}

.strategy-hud-body {
  padding: 12px 14px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

.strategy-status-banner {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 8px 12px;
}

.status-main-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.status-symbol {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
}

.status-badge {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
}

.status-sub-row {
  font-size: 0.74rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.badge-strategy {
  cursor: pointer;
  transition: all var(--transition-fast);
}

.badge-strategy.stage-3 {
  background: rgba(0, 255, 136, 0.2);
  color: var(--accent-green);
  border: 1px solid rgba(0, 255, 136, 0.5);
  box-shadow: 0 0 10px rgba(0, 255, 136, 0.3);
}

.badge-strategy.stage-rec {
  background: rgba(16, 185, 129, 0.2);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.5);
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.3);
}

.badge-strategy.stage-early {
  background: rgba(0, 242, 254, 0.2);
  color: var(--accent-cyan);
  border: 1px solid rgba(0, 242, 254, 0.5);
}

.badge-strategy.stage-2 {
  background: rgba(59, 130, 246, 0.2);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.5);
}

.badge-strategy.stage-1 {
  background: rgba(255, 187, 0, 0.2);
  color: #fbbf24;
  border: 1px solid rgba(255, 187, 0, 0.5);
}

.strategy-flowchart-tree {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 2px;
}

.ascii-arrow {
  text-align: center;
  color: var(--accent-cyan);
  font-family: monospace;
  font-size: 0.95rem;
  font-weight: bold;
  line-height: 1.05;
  opacity: 0.75;
  user-select: none;
}

.strategy-step-card {
  background: rgba(15, 21, 35, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  transition: all var(--transition-fast);
}

.strategy-step-card.passed {
  border-color: rgba(0, 255, 136, 0.45);
  background: rgba(0, 255, 136, 0.06);
  box-shadow: 0 0 14px rgba(0, 255, 136, 0.12);
}

.strategy-step-card.early-buffer {
  border-color: rgba(0, 242, 254, 0.45);
  background: rgba(0, 242, 254, 0.06);
  box-shadow: 0 0 14px rgba(0, 242, 254, 0.12);
}

.step-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.step-title-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--accent-cyan);
  font-size: 0.72rem;
  font-weight: 700;
}

.strategy-step-card.passed .step-number {
  background: var(--accent-green);
  color: #000000;
}

.strategy-step-card.early-buffer .step-number {
  background: var(--accent-cyan);
  color: #000000;
}

.step-name {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-primary);
}

.step-val-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.step-reading {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-primary);
  background: rgba(0, 0, 0, 0.4);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid var(--border-subtle);
}

.step-status-tag {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  letter-spacing: 0.3px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
}

.step-status-tag.tag-pass {
  background: rgba(0, 255, 136, 0.2);
  color: var(--accent-green);
}

.step-status-tag.tag-early {
  background: rgba(0, 242, 254, 0.2);
  color: var(--accent-cyan);
}

.step-status-tag.tag-fail {
  background: rgba(255, 51, 102, 0.15);
  color: var(--accent-red);
}

.step-desc {
  font-size: 0.72rem;
  color: var(--text-secondary);
  line-height: 1.35;
  margin: 4px 0 6px 0;
}

.step-subvalues-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.72rem;
  color: var(--text-secondary);
  background: rgba(0, 0, 0, 0.3);
  padding: 3px 8px;
  border-radius: 4px;
  margin: 4px 0;
}

.step-override-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  border-top: 1px dashed rgba(255, 255, 255, 0.08);
  padding-top: 4px;
  margin-top: 4px;
}

.override-checkbox-label {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.68rem;
  color: var(--text-muted);
  cursor: pointer;
}

.override-checkbox-label input {
  accent-color: var(--accent-cyan);
  cursor: pointer;
}

.card-macro-trend {
  border-color: rgba(168, 85, 247, 0.25);
  background: rgba(168, 85, 247, 0.04);
}

.trend-readings-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 4px 10px;
  font-size: 0.72rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

.strategy-hud-footer {
  margin-top: 4px;
}

.scan-status-text {
  font-size: 0.8rem;
  color: var(--accent-cyan);
  margin-top: 6px;
  font-family: 'JetBrains Mono', monospace;
}

/* Phone Connect Modal */
.phone-connect-grid {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 20px;
  align-items: start;
}

@media (max-width: 680px) {
  .phone-connect-grid {
    grid-template-columns: 1fr;
  }
}

.phone-qr-column {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.4);
  padding: 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  min-height: 240px;
}

.phone-links-column {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.network-option-card {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.opt-badge-row {
  display: flex;
  align-items: center;
  margin-bottom: 2px;
}

.copy-url-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.copy-url-row input {
  flex: 1;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  color: var(--accent-cyan);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.82rem;
  outline: none;
}

.opt-hint {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin: 0;
}

.permanent-tip-box {
  background: rgba(0, 242, 254, 0.04);
  border-color: rgba(0, 242, 254, 0.2);
}

.tip-title {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.tip-steps {
  margin: 0 0 0 16px;
  padding: 0;
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.tip-steps li {
  margin-bottom: 4px;
}

