/* ==========================================================================
   AuraBoard Studio - Whiteboard Workspace & Canvas Styles
   ========================================================================== */

#whiteboard-view {
  display: flex;
  flex-direction: column;
  background-color: #f8fafc;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
}

/* ==========================================================================
   Top Header Navigation
   ========================================================================== */
.wb-navbar {
  height: 60px;
  background: rgba(14, 19, 31, 0.94);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  z-index: 100;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.wb-nav-left, .wb-nav-center, .wb-nav-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-divider {
  width: 1px;
  height: 24px;
  background: var(--border-subtle);
}

/* Navigation Left Buttons */
.tool-btn-nav {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  transition: all var(--transition-fast);
}

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

.tool-btn-nav:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.tool-btn-nav.danger:hover {
  background: rgba(244, 63, 94, 0.18);
  color: #fb7185;
  border-color: rgba(244, 63, 94, 0.4);
}

/* Navigation Center Zoom & Grid Pills */
.zoom-controls-pill, .grid-selector-pill {
  display: flex;
  align-items: center;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  padding: 3px 6px;
  gap: 4px;
}

.zoom-btn, .zoom-reset-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  width: 26px;
  height: 26px;
  border-radius: var(--radius-full);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  transition: all var(--transition-fast);
}

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

.zoom-text {
  font-size: 12px;
  font-weight: 600;
  font-family: var(--font-family-mono);
  color: var(--text-primary);
  min-width: 44px;
  text-align: center;
}

.grid-style-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  width: 26px;
  height: 26px;
  border-radius: var(--radius-full);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  transition: all var(--transition-fast);
}

.grid-style-btn.active {
  background: rgba(99, 102, 241, 0.2);
  color: var(--accent-primary);
}

.grid-style-btn:hover:not(.active) {
  color: var(--text-primary);
}

/* ==========================================================================
   TOP RIGHT: BOARD NAME IN TITLE RIGHT (AS REQUESTED)
   ========================================================================== */
.wb-nav-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Auto-Save Status Badge */
.save-status-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.04);
  padding: 4px 10px;
  border-radius: var(--radius-full);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--accent-emerald);
  box-shadow: 0 0 6px var(--accent-emerald);
  transition: background-color 0.2s ease;
}

.save-status-badge.saving .status-dot {
  background-color: var(--accent-amber);
  box-shadow: 0 0 6px var(--accent-amber);
  animation: pulse 1s infinite alternate;
}

@keyframes pulse {
  from { opacity: 0.4; }
  to { opacity: 1; }
}

/* Board Title Input Pill in Header Right */
.board-title-container {
  position: relative;
  max-width: 280px;
}

.board-title-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 4px 12px;
  transition: all var(--transition-fast);
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.2);
}

.board-title-wrapper:hover, .board-title-wrapper:focus-within {
  border-color: var(--accent-primary);
  background: var(--bg-input);
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.25);
}

.title-icon {
  color: var(--accent-primary);
  font-size: 13px;
  flex-shrink: 0;
}

.board-title-input {
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-family: var(--font-family-display);
  font-size: 15px;
  font-weight: 700;
  outline: none;
  width: 170px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: text;
}

.board-title-input:focus {
  width: 210px;
}

.title-edit-hint {
  font-size: 11px;
  color: var(--text-muted);
  opacity: 0.5;
  transition: opacity var(--transition-fast);
}

.board-title-wrapper:hover .title-edit-hint {
  opacity: 1;
  color: var(--text-secondary);
}

.wb-nav-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ==========================================================================
   Whiteboard Viewport & Canvas (Clean White Canvas)
   ========================================================================== */
.wb-viewport-wrapper {
  flex: 1;
  position: relative;
  overflow: hidden;
  display: flex;
}

.canvas-viewport {
  width: 100%;
  height: 100%;
  position: relative;
  cursor: crosshair;
  background-color: #ffffff;
  overflow: hidden;
}

.canvas-viewport.panning,
.canvas-viewport.space-panning {
  cursor: grab !important;
}

.canvas-viewport.panning:active,
.canvas-viewport.space-panning:active,
.canvas-viewport.is-dragging-pan {
  cursor: grabbing !important;
}

.canvas-viewport.selecting {
  cursor: default;
}

#whiteboard-canvas {
  position: absolute;
  top: 0;
  left: 0;
  display: block;
}

/* Whiteboard Background Patterns on Pure White */
.grid-dots {
  background-color: #ffffff;
  background-image: radial-gradient(rgba(15, 23, 42, 0.16) 1.2px, transparent 1.2px);
  background-size: 24px 24px;
}

.grid-mesh,
.grid-grid {
  background-color: #ffffff;
  background-size: 28px 28px;
  background-image: 
    linear-gradient(to right, rgba(15, 23, 42, 0.08) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(15, 23, 42, 0.08) 1px, transparent 1px);
}

.grid-lines {
  background-color: #ffffff;
  background-size: 100% 28px;
  background-image: linear-gradient(to bottom, rgba(15, 23, 42, 0.08) 1px, transparent 1px);
}

.grid-blank {
  background-color: #ffffff;
  background-image: none;
}

/* ==========================================================================
   Floating Tool Palette (Left side) - Scrollable on laptops & desktops
   ========================================================================== */
.wb-floating-toolbar {
  position: absolute;
  top: 24px;
  left: 24px;
  max-height: calc(100vh - 108px);
  overflow-y: auto;
  overflow-x: hidden;
  background: rgba(18, 24, 38, 0.92);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 8px 6px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  width: 64px;
  z-index: 50;
  box-shadow: var(--shadow-lg), 0 0 24px rgba(0, 0, 0, 0.45);
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

.toolbar-drag-handle {
  width: 44px;
  height: 22px;
  margin: 2px auto;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: grab;
  color: var(--text-muted, #94a3b8);
  font-size: 13px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: all 0.16s ease;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}

.toolbar-drag-handle:hover {
  background: rgba(99, 102, 241, 0.18);
  border-color: rgba(99, 102, 241, 0.45);
  color: #ffffff;
}

.wb-floating-toolbar.is-dragging {
  cursor: grabbing !important;
  user-select: none !important;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.7), 0 0 24px rgba(99, 102, 241, 0.4) !important;
  transform: scale(1.02);
  transition: none !important;
}

.wb-floating-toolbar.is-dragging .toolbar-drag-handle {
  cursor: grabbing !important;
  background: rgba(99, 102, 241, 0.35);
  color: #ffffff;
}

.wb-floating-toolbar::-webkit-scrollbar {
  width: 3px;
}

.wb-floating-toolbar::-webkit-scrollbar-track {
  background: transparent;
}

.wb-floating-toolbar::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
}

.wb-floating-toolbar::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.35);
}

.toolbar-tools-container {
  display: flex;
  flex-direction: column;
  gap: 5px;
  width: 100%;
}

.tool-item-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.tool-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex-shrink: 0;
}

.toolbar-separator {
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
  margin: 3px 2px;
  flex-shrink: 0;
}

/* Tool Button: Modern Unified Button with Integrated Dropdown Caret */
.tool-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-secondary, #cbd5e1);
  width: 44px;
  height: 44px;
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  position: relative;
  transition: all 0.16s cubic-bezier(0.16, 1, 0.3, 1);
  flex-shrink: 0;
  margin: 0 auto;
  user-select: none;
  -webkit-user-select: none;
}

.tool-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(99, 102, 241, 0.45);
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}

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

.tool-btn.active {
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%) !important;
  color: #ffffff !important;
  border-color: rgba(255, 255, 255, 0.35) !important;
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.25) !important;
}

.tool-btn > i {
  transition: transform 0.16s ease;
  pointer-events: none;
}

.tool-btn:hover > i {
  transform: scale(1.08);
}

/* Tool Dropdown Caret (Small downward chevron in the bottom-right corner) */
.tool-caret {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 18px;
  height: 18px;
  font-size: 8px;
  color: rgba(255, 255, 255, 0.55);
  line-height: 1;
  pointer-events: auto;
  cursor: pointer;
  border-radius: 0 0 9px 0;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), color 0.16s ease, background 0.16s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

.tool-caret:hover {
  background: rgba(255, 255, 255, 0.22);
  color: #ffffff;
}

.tool-btn:hover .tool-caret,
.tool-btn.active .tool-caret {
  color: rgba(255, 255, 255, 0.95);
}

.tool-btn.dropdown-open .tool-caret {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.28);
}

.tool-btn.dropdown-open .tool-caret i {
  transform: rotate(180deg);
}

.tool-caret i {
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
}

/* ==========================================================================
   Selection Quick Action Bar (Top Floating Bar on Selected Canvas Elements)
   ========================================================================== */
.wb-selection-quick-bar {
  position: fixed;
  z-index: 1050;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 6px;
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 9px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4), 0 2px 8px rgba(0, 0, 0, 0.25);
  pointer-events: auto;
  user-select: none;
  animation: quickBarFadeIn 0.14s cubic-bezier(0.16, 1, 0.3, 1);
  transition: transform 0.08s ease, opacity 0.12s ease;
}

@keyframes quickBarFadeIn {
  from {
    opacity: 0;
    transform: translateY(4px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.wb-selection-quick-bar.hidden {
  display: none !important;
}

.quick-bar-group {
  display: flex;
  align-items: center;
  gap: 3px;
}

.quick-bar-group.hidden {
  display: none !important;
}

.quick-bar-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  border: 1px solid transparent;
  background: transparent;
  color: #e2e8f0;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.14s ease;
}

.quick-bar-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  transform: translateY(-1px);
}

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

.quick-bar-btn.active {
  background: rgba(99, 102, 241, 0.35);
  color: #a5b4fc;
  border-color: rgba(99, 102, 241, 0.6);
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.35);
}

.quick-bar-btn-danger:hover {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
  border-color: rgba(239, 68, 68, 0.4);
}

.quick-bar-divider {
  width: 1px;
  height: 18px;
  background: rgba(255, 255, 255, 0.18);
  margin: 0 3px;
}

/* Light Mode Overrides for Quick Bar */
body.theme-light .wb-selection-quick-bar {
  background: rgba(255, 255, 255, 0.94);
  border-color: rgba(0, 0, 0, 0.12);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12), 0 2px 6px rgba(0, 0, 0, 0.08);
}

body.theme-light .quick-bar-btn {
  color: #334155;
}

body.theme-light .quick-bar-btn:hover {
  background: rgba(0, 0, 0, 0.06);
  color: #0f172a;
}

body.theme-light .quick-bar-btn.active {
  background: rgba(99, 102, 241, 0.15);
  color: #4f46e5;
  border-color: rgba(99, 102, 241, 0.4);
}

body.theme-light .quick-bar-divider {
  background: rgba(0, 0, 0, 0.12);
}

/* ==========================================================================
   Floating Properties Panel (Connected Popover Overlay Anchored to Active Tool)
   ========================================================================== */
.wb-properties-panel {
  position: absolute;
  top: 24px;
  left: 84px;
  background: rgba(15, 23, 42, 0.94);
  backdrop-filter: blur(28px) saturate(190%);
  -webkit-backdrop-filter: blur(28px) saturate(190%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 100;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(255, 255, 255, 0.08), 0 0 28px rgba(99, 102, 241, 0.18);
  min-width: 230px;
  max-width: 270px;
  opacity: 1;
  visibility: visible;
  transform: translateX(0) scale(1);
  transform-origin: left center;
  transition: opacity 0.16s ease, transform 0.16s cubic-bezier(0.16, 1, 0.3, 1), top 0.18s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.16s;
}

/* Caret Arrow dynamically pointing to active dropdown chevron */
.wb-properties-panel::before {
  content: '';
  position: absolute;
  top: var(--arrow-top, 24px);
  left: -6px;
  width: 12px;
  height: 12px;
  background: rgba(15, 23, 42, 0.96);
  border-left: 1px solid rgba(255, 255, 255, 0.14);
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
  transform: rotate(45deg);
  border-radius: 0 0 0 2px;
  transition: top 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
  z-index: 2;
}

.wb-properties-panel.hidden {
  opacity: 0 !important;
  visibility: hidden !important;
  transform: translateX(-8px) scale(0.96) !important;
  pointer-events: none !important;
}

/* ==========================================================================
   Shapes & Lines Library Popover Palette
   ========================================================================== */
.wb-shapes-palette {
  position: absolute;
  top: 24px;
  left: 84px;
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(28px) saturate(190%);
  -webkit-backdrop-filter: blur(28px) saturate(190%);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 16px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 100;
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(255, 255, 255, 0.08), 0 0 32px rgba(99, 102, 241, 0.22);
  width: 360px;
  max-width: calc(100vw - 120px);
  max-height: min(580px, calc(100vh - 90px));
  opacity: 1;
  visibility: visible;
  transform: translateX(0) scale(1);
  transform-origin: left center;
  transition: opacity 0.16s ease, transform 0.16s cubic-bezier(0.16, 1, 0.3, 1), top 0.18s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.16s;
}

.wb-shapes-palette::before {
  content: '';
  position: absolute;
  top: var(--shapes-arrow-top, 36px);
  left: -6px;
  width: 12px;
  height: 12px;
  background: rgba(15, 23, 42, 0.96);
  border-left: 1px solid rgba(255, 255, 255, 0.14);
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
  transform: rotate(45deg);
  border-radius: 0 0 0 2px;
  transition: top 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
  z-index: 2;
}

.wb-shapes-palette.placed-left {
  transform-origin: right center;
}

.wb-shapes-palette.placed-left::before {
  left: auto;
  right: -6px;
  border-left: none;
  border-bottom: none;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  border-right: 1px solid rgba(255, 255, 255, 0.14);
}

.wb-shapes-palette.hidden {
  opacity: 0 !important;
  visibility: hidden !important;
  transform: translateX(-8px) scale(0.96) !important;
  pointer-events: none !important;
}

/* Palette Header */
.shapes-palette-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.palette-header-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.92rem;
  font-weight: 700;
  color: #ffffff;
}

.palette-header-title i {
  color: var(--accent-primary, #6366f1);
}

.palette-close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted, #94a3b8);
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  font-size: 14px;
  transition: all 0.14s ease;
}

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

/* Category Navigation Tabs */
.shapes-category-tabs {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
  background: rgba(0, 0, 0, 0.28);
  padding: 3px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.shapes-tab-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary, #94a3b8);
  padding: 6px 2px;
  border-radius: 7px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-size: 0.72rem;
  font-weight: 600;
  transition: all 0.14s ease;
}

.shapes-tab-btn i {
  font-size: 11px;
}

.shapes-tab-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.07);
}

.shapes-tab-btn.active {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.35);
}

/* Palette Body & Sections */
.shapes-palette-body {
  overflow-y: auto;
  overflow-x: hidden;
  max-height: 290px;
  padding-right: 4px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

.shapes-palette-body::-webkit-scrollbar {
  width: 4px;
}

.shapes-palette-body::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
}

.shapes-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--text-muted, #94a3b8);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
  padding-left: 2px;
}

.shape-count-badge {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-secondary, #cbd5e1);
  font-size: 0.68rem;
  padding: 1px 6px;
  border-radius: 9999px;
  font-weight: 600;
}

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

.shape-item-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 8px 4px 6px 4px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  color: var(--text-secondary, #cbd5e1);
  transition: all 0.15s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
}

.shape-icon-preview {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  color: #cbd5e1;
  transition: transform 0.16s ease;
}

.shape-item-btn span {
  font-size: 0.70rem;
  font-weight: 500;
  line-height: 1.1;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.shape-item-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(99, 102, 241, 0.5);
  color: #ffffff;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.shape-item-btn:hover .shape-icon-preview {
  transform: scale(1.15);
  color: #ffffff;
}

.shape-item-btn.active {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.35), rgba(139, 92, 246, 0.35));
  border-color: #6366f1;
  color: #ffffff;
  box-shadow: 0 0 12px rgba(99, 102, 241, 0.45), inset 0 0 0 1px rgba(255, 255, 255, 0.2);
}

.shape-item-btn.active .shape-icon-preview {
  color: #ffffff;
}

/* Palette Footer: Color & Style Formatting */
.shapes-palette-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 10px;
  margin-top: 2px;
}

.palette-styling-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.palette-style-block {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.palette-sub-title {
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--text-muted, #94a3b8);
  display: flex;
  align-items: center;
  gap: 5px;
}

.palette-sub-title i {
  color: var(--accent-primary, #6366f1);
  font-size: 11px;
}

.palette-mini-colors {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
}

.shape-color-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  padding: 0;
  transition: transform 0.14s ease, border-color 0.14s ease, box-shadow 0.14s ease;
}

.shape-color-dot:hover {
  transform: scale(1.2);
}

.shape-color-dot.active {
  border-color: #ffffff;
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.6);
  transform: scale(1.15);
}

.shape-custom-color-picker {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px dashed rgba(255, 255, 255, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-muted, #94a3b8);
  font-size: 10px;
  position: relative;
  overflow: hidden;
  transition: all 0.14s ease;
}

.shape-custom-color-picker:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
  border-style: solid;
}

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

.palette-opt-pills {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.opt-pill-group {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3px;
  background: rgba(0, 0, 0, 0.25);
  padding: 2px;
  border-radius: 6px;
}

.shape-opt-pill {
  background: transparent;
  border: none;
  color: var(--text-secondary, #94a3b8);
  padding: 3px 2px;
  border-radius: 4px;
  font-size: 0.68rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.14s ease;
  text-align: center;
}

.shape-opt-pill:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
}

.shape-opt-pill.active {
  background: rgba(99, 102, 241, 0.85);
  color: #ffffff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

/* ==========================================================================
   Customize Toolbar Modal Styles
   ========================================================================== */
.edit-tools-modal-card {
  max-width: 520px;
  width: 92%;
}

.edit-tools-content {
  padding: 12px 4px 18px 4px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.edit-tools-notice {
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.25);
  border-radius: 8px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--text-secondary, #cbd5e1);
}

.edit-tools-notice i {
  color: var(--accent-primary, #6366f1);
  font-size: 14px;
}

.tools-customizer-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 380px;
  overflow-y: auto;
  padding-right: 4px;
}

.tool-customizer-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--bg-card, rgba(18, 24, 38, 0.8));
  border: 1px solid var(--border-card, rgba(255, 255, 255, 0.08));
  border-radius: 10px;
  transition: all 0.14s ease;
}

.tool-customizer-item:hover {
  border-color: rgba(99, 102, 241, 0.35);
  background: rgba(255, 255, 255, 0.05);
}

.tool-customizer-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.tool-customizer-icon {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: rgba(99, 102, 241, 0.14);
  color: var(--accent-primary, #6366f1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
}

.tool-customizer-info {
  display: flex;
  flex-direction: column;
}

.tool-customizer-name {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-primary, #ffffff);
}

.tool-customizer-desc {
  font-size: 0.75rem;
  color: var(--text-muted, #94a3b8);
}

.tool-customizer-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-tool-reorder {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-muted, #94a3b8);
  width: 28px;
  height: 28px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  transition: all 0.14s ease;
}

.btn-tool-reorder:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
}

.btn-tool-reorder:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

/* Custom Switch Toggle */
.tool-toggle-switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 22px;
}

.tool-toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.tool-toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(255, 255, 255, 0.15);
  transition: 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  border-radius: 22px;
}

.tool-toggle-slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  border-radius: 50%;
}

.tool-toggle-switch input:checked + .tool-toggle-slider {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
}

.tool-toggle-switch input:checked + .tool-toggle-slider:before {
  transform: translateX(18px);
}

/* Popover Header */
.prop-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 2px;
}

.prop-panel-title-wrapper {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.prop-panel-title-wrapper i {
  color: var(--accent-primary);
  font-size: 12px;
}

.prop-panel-close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  width: 22px;
  height: 22px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 12px;
  transition: all var(--transition-fast);
}

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

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

.prop-title {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Color Swatches */
.color-palette {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  align-items: center;
}

.color-swatch {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform var(--transition-fast), border-color var(--transition-fast);
  outline: none;
}

.color-swatch:hover {
  transform: scale(1.18);
}

.color-swatch.active {
  border-color: #ffffff;
  transform: scale(1.15);
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

.custom-color-btn {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  font-size: 11px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

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

/* Sticky Note Pastel Color Swatches */
.sticky-color-palette {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 5px;
  align-items: center;
}

.sticky-color-swatch {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  outline: none;
}

.sticky-color-swatch:hover {
  transform: scale(1.18);
}

.sticky-color-swatch.active {
  border-color: #ffffff;
  transform: scale(1.14);
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.6);
}

/* Stroke Sizes */
.stroke-width-group {
  display: flex;
  background: var(--bg-input);
  border-radius: var(--radius-sm);
  padding: 3px;
  gap: 2px;
}

.stroke-size-btn {
  flex: 1;
  height: 28px;
  background: transparent;
  border: none;
  border-radius: var(--radius-xs);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition-fast);
}

.stroke-size-btn:hover {
  background: rgba(255, 255, 255, 0.08);
}

.stroke-size-btn.active {
  background: rgba(99, 102, 241, 0.25);
}

.stroke-dot {
  background: #ffffff;
  border-radius: 50%;
  display: block;
}
.dot-sm { width: 3px; height: 3px; }
.dot-md { width: 6px; height: 6px; }
.dot-lg { width: 10px; height: 10px; }
.dot-xl { width: 14px; height: 14px; }

/* Pen Inking Style & Smoothing Groups */
.pen-style-group, .smoothing-group {
  display: flex;
  background: var(--bg-input);
  border-radius: var(--radius-sm);
  padding: 3px;
  gap: 3px;
}

.pen-opt-btn {
  flex: 1;
  padding: 6px 6px;
  background: transparent;
  border: none;
  border-radius: var(--radius-xs);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.pen-opt-btn i {
  font-size: 11px;
}

.pen-opt-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
}

.pen-opt-btn.active {
  background: rgba(99, 102, 241, 0.3);
  color: #ffffff;
  box-shadow: inset 0 0 0 1px rgba(99, 102, 241, 0.6), 0 2px 8px rgba(99, 102, 241, 0.25);
}

.smooth-opt-btn {
  flex: 1;
  padding: 5px 4px;
  background: transparent;
  border: none;
  border-radius: var(--radius-xs);
  color: var(--text-secondary);
  font-size: 10.5px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  transition: all var(--transition-fast);
}

.smooth-opt-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
}

.smooth-opt-btn.active {
  background: rgba(99, 102, 241, 0.3);
  color: #ffffff;
  box-shadow: inset 0 0 0 1px rgba(99, 102, 241, 0.6);
}

/* Fill Style Group */
.fill-style-group, .line-style-group {
  display: flex;
  background: var(--bg-input);
  border-radius: var(--radius-sm);
  padding: 3px;
  gap: 2px;
}

.fill-opt-btn, .line-opt-btn {
  flex: 1;
  padding: 4px 6px;
  background: transparent;
  border: none;
  border-radius: var(--radius-xs);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.fill-opt-btn:hover, .line-opt-btn:hover {
  color: var(--text-primary);
}

.fill-opt-btn.active, .line-opt-btn.active {
  background: rgba(99, 102, 241, 0.25);
  color: var(--accent-primary);
}

/* Text Size Group in Properties Panel */
.font-size-group {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: var(--bg-input);
  border-radius: var(--radius-sm);
  padding: 3px;
  gap: 3px;
}

.font-size-btn {
  height: 28px;
  background: transparent;
  border: none;
  border-radius: var(--radius-xs);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  padding: 0 4px;
}

.font-size-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
}

.font-size-btn.active {
  background: rgba(99, 102, 241, 0.3);
  color: #ffffff;
  box-shadow: inset 0 0 0 1px rgba(99, 102, 241, 0.5);
}

.font-select {
  width: 100%;
  font-size: 12px;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  background-color: var(--bg-input);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  cursor: pointer;
}

/* ==========================================================================
   Canvas Inline Text & Sticky Editor Wrapper
   ========================================================================== */
.canvas-text-wrapper {
  position: absolute;
  z-index: 45;
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: rgba(18, 24, 38, 0.95);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(99, 102, 241, 0.5);
  border-radius: var(--radius-md);
  padding: 10px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5), 0 0 20px rgba(99, 102, 241, 0.3);
  min-width: 280px;
  animation: modalEnter 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.canvas-text-wrapper.is-dragging-window {
  cursor: grabbing !important;
  user-select: none !important;
  opacity: 0.96;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.8), 0 0 30px rgba(86, 156, 214, 0.45) !important;
  transition: none !important;
}

.canvas-text-wrapper.is-resizing-window {
  cursor: nwse-resize !important;
  user-select: none !important;
  transition: none !important;
}

.canvas-text-wrapper.is-resizing-window * {
  user-select: none !important;
  pointer-events: none !important;
}

.text-editor-resize-handle {
  position: absolute;
  right: 2px;
  bottom: 2px;
  width: 20px;
  height: 20px;
  cursor: nwse-resize;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  padding: 0 3px 3px 0;
  color: rgba(255, 255, 255, 0.35);
  z-index: 50;
  user-select: none;
  touch-action: none;
  transition: color 0.15s ease, transform 0.15s ease;
}

.text-editor-resize-handle:hover {
  color: #9cdcfe;
  transform: scale(1.15);
}

.text-editor-resize-handle:active {
  color: #60a5fa;
}

.canvas-text-wrapper.code-mode .text-editor-resize-handle {
  color: #6e7681;
}

.canvas-text-wrapper.code-mode .text-editor-resize-handle:hover {
  color: #9cdcfe;
}

.text-editor-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 4px;
  cursor: grab;
  user-select: none;
}

.text-editor-card-header:active {
  cursor: grabbing;
}

.window-drag-grip {
  color: var(--text-muted);
  font-size: 11px;
  cursor: grab;
  display: inline-flex;
  align-items: center;
  padding-right: 2px;
  transition: color 0.15s ease;
}

.window-drag-grip:hover {
  color: #9cdcfe;
}

.text-editor-header-title {
  font-size: 11px;
  font-weight: 700;
  color: #a5b4fc;
  display: flex;
  align-items: center;
  gap: 6px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  cursor: grab;
}

.text-editor-quick-tools {
  display: flex;
  align-items: center;
  gap: 4px;
}

.btn-discard-tick {
  background: transparent;
  border: none;
  color: var(--text-muted);
  width: 22px;
  height: 22px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  transition: all var(--transition-fast);
}

.btn-discard-tick:hover {
  background: rgba(244, 63, 94, 0.2);
  color: #fb7185;
}

.canvas-text-editor {
  background: #ffffff;
  color: #0f172a;
  border: 1px solid rgba(0, 0, 0, 0.15);
  outline: none;
  resize: none;
  font-family: var(--font-family-base);
  font-size: 22px;
  font-weight: 600;
  padding: 10px 12px;
  line-height: 1.4;
  overflow: hidden;
  border-radius: var(--radius-sm);
  width: 100%;
  min-height: 68px;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.06);
  transition: font-size 0.15s ease, font-family 0.15s ease;
}

.canvas-text-editor.sticky-mode {
  background-color: #fef08a;
  color: #1e293b;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(0,0,0,0.15);
  font-size: 16px;
  padding: 12px;
}

/* Card footer with Done Tick */
.text-editor-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 4px;
  gap: 12px;
}

.text-char-count {
  font-size: 11px;
  color: var(--text-muted);
  font-family: var(--font-family-mono);
}

.btn-inline-tick {
  background: var(--accent-emerald);
  color: #ffffff;
  border: none;
  padding: 7px 16px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.5);
  transition: all var(--transition-fast);
}

.btn-inline-tick:hover {
  background: #059669;
  transform: scale(1.04);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.7);
}

.btn-inline-tick:active {
  transform: scale(0.98);
}

/* ==========================================================================
   VS Code Studio & Code Editor Overlay Styles
   ========================================================================== */
.canvas-text-wrapper.code-mode {
  background: #1e1e1e !important;
  border: 1px solid #3c3c3c !important;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7), 0 0 20px rgba(86, 156, 214, 0.25) !important;
  min-width: 440px;
  min-height: 200px;
  max-width: 95vw;
  max-height: 90vh;
}

.code-window-dots {
  display: flex;
  align-items: center;
  gap: 6px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 4px;
}

.dot-btn {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.dot-red { background: #ff5f56; }
.dot-yellow { background: #ffbd2e; }
.dot-green { background: #27c93f; }

.inline-lang-pill, .inline-snippet-pill {
  background: #2d2d2d;
  color: #9cdcfe;
  border: 1px solid #454545;
  border-radius: var(--radius-xs);
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  cursor: pointer;
  outline: none;
}

/* Teacher Classroom Zoom / Font Scaling Controls */
.code-font-zoom-wrap {
  display: inline-flex;
  align-items: center;
  background: #252526;
  border: 1px solid #3c3c3c;
  border-radius: var(--radius-xs);
  padding: 1px 3px;
  gap: 2px;
}

.code-font-btn {
  background: transparent;
  border: none;
  color: #cccccc;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 3px;
  cursor: pointer;
  font-size: 10px;
  transition: background 0.15s, color 0.15s;
}

.code-font-btn:hover {
  background: #37373d;
  color: #ffffff;
}

.code-font-badge {
  font-family: 'Consolas', monospace;
  font-size: 11px;
  font-weight: 700;
  color: #9cdcfe;
  min-width: 32px;
  text-align: center;
  user-select: none;
}

/* Teacher Code Action Buttons */
.btn-code-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #252526;
  color: #cccccc;
  border: 1px solid #3c3c3c;
  border-radius: var(--radius-xs);
  font-size: 11px;
  font-weight: 600;
  padding: 3px 9px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-code-action:hover {
  background: #37373d;
  border-color: #569cd6;
  color: #ffffff;
}

.btn-code-action.btn-code-run {
  background: linear-gradient(135deg, #15803d, #16a34a);
  color: #ffffff;
  border-color: #22c55e;
  box-shadow: 0 2px 8px rgba(34, 197, 94, 0.25);
}

.btn-code-action.btn-code-run:hover {
  background: linear-gradient(135deg, #16a34a, #22c55e);
  border-color: #4ade80;
  transform: translateY(-1px);
}

.btn-code-action.btn-code-analyze {
  background: linear-gradient(135deg, #6d28d9, #7c3aed);
  color: #ffffff;
  border-color: #a855f7;
  box-shadow: 0 2px 8px rgba(168, 85, 247, 0.25);
}

.btn-code-action.btn-code-analyze:hover {
  background: linear-gradient(135deg, #7c3aed, #9333ea);
  border-color: #c084fc;
  transform: translateY(-1px);
}

/* VS Code Interactive Execution Console Drawer */
.code-console-drawer {
  background: #141416;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
  max-height: 180px;
  overflow: hidden;
  transition: all 0.2s ease;
}

.code-console-drawer.hidden {
  display: none !important;
}

.console-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 12px;
  background: #1c1c1f;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 11px;
}

.console-drawer-title {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #94a3b8;
  font-weight: 600;
}

.console-status-pill {
  padding: 2px 8px;
  border-radius: 9999px;
  font-size: 10px;
  font-weight: 700;
}

.console-status-pill.status-success {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.console-status-pill.status-error {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.4);
}

.console-exec-time {
  font-size: 10px;
  color: #64748b;
  font-family: var(--font-family-mono);
}

.console-drawer-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-console-vis-link {
  background: rgba(99, 102, 241, 0.15);
  color: #a5b4fc;
  border: 1px solid rgba(99, 102, 241, 0.35);
  border-radius: 4px;
  padding: 2px 8px;
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s ease;
}

.btn-console-vis-link:hover {
  background: rgba(99, 102, 241, 0.3);
  color: #ffffff;
}

.btn-console-icon {
  background: transparent;
  color: #94a3b8;
  border: none;
  padding: 3px 6px;
  font-size: 11px;
  border-radius: 4px;
  cursor: pointer;
}

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

.code-console-output {
  margin: 0;
  padding: 8px 12px;
  font-family: 'Consolas', 'Courier New', monospace;
  font-size: 12px;
  line-height: 1.45;
  color: #e2e8f0;
  background: #141416;
  overflow-y: auto;
  max-height: 140px;
  white-space: pre-wrap;
  word-break: break-all;
}



.editor-input-container {
  display: flex;
  position: relative;
  background: #1e1e1e;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.1);
  overflow: hidden;
  min-height: 120px;
  flex: 1 1 auto;
  box-sizing: border-box;
}

/* Line Numbers Gutter with Teacher Spotlight */
.code-line-numbers {
  width: 44px;
  padding: 10px 4px 10px 4px;
  background: #1e1e1e;
  color: #6e7681;
  font-family: 'Consolas', 'Courier New', monospace;
  font-size: 14px;
  line-height: 21px;
  text-align: right;
  user-select: none;
  border-right: 1px solid #2d2d2d;
  box-sizing: border-box;
  overflow: hidden;
  height: 100%;
}

.code-line-numbers .line-num {
  display: block;
  padding: 0 4px;
  cursor: pointer;
  border-radius: 3px;
  line-height: inherit;
  transition: background 0.15s, color 0.15s;
}

.code-line-numbers .line-num:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
}

.code-line-numbers .line-num.line-focus-active {
  background: #eab308;
  color: #000000;
  font-weight: 800;
  border-radius: 3px;
  box-shadow: 0 0 8px rgba(234, 179, 8, 0.6);
}

.editor-textarea-wrapper {
  position: relative;
  flex: 1;
  min-height: 120px;
  height: 100%;
  overflow: hidden;
  box-sizing: border-box;
}

/* Synchronized Highlight Backdrop & Textarea with Pixel-Perfect Alignment */
.code-highlight-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 10px 12px;
  border: 1px solid transparent;
  font-family: 'Consolas', 'Courier New', monospace;
  font-size: 14px;
  line-height: 21px;
  letter-spacing: 0px;
  word-spacing: 0px;
  white-space: pre-wrap;
  word-break: break-word;
  pointer-events: none;
  color: #d4d4d4;
  overflow: hidden;
  box-sizing: border-box;
}

.canvas-text-editor.code-mode {
  position: relative;
  width: 100%;
  height: 100% !important;
  background: transparent !important;
  color: #d4d4d4 !important;
  -webkit-text-fill-color: transparent !important;
  caret-color: #ffffff !important;
  font-family: 'Consolas', 'Courier New', monospace !important;
  font-size: 14px;
  line-height: 21px;
  letter-spacing: 0px !important;
  word-spacing: 0px !important;
  margin: 0 !important;
  padding: 10px 12px !important;
  border: 1px solid transparent !important;
  outline: none !important;
  box-shadow: none !important;
  box-sizing: border-box !important;
  white-space: pre-wrap !important;
  word-break: break-word !important;
  tab-size: 4;
  transition: none !important;
  min-height: 120px !important;
  overflow-y: auto !important;
  overflow-x: hidden;
}

/* Clear, smooth mouse selection in code editor */
.canvas-text-editor.code-mode::selection {
  background: rgba(38, 79, 120, 0.75) !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
}

/* Zero-width anchor for Ghost-Text so it NEVER displaces text or cursor alignment */
.ghost-anchor {
  display: inline-block;
  position: relative;
  width: 0;
  height: 0;
  vertical-align: baseline;
  pointer-events: none;
  user-select: none;
}

.ghost-code-suggestion {
  position: absolute;
  left: 0;
  top: 0;
  white-space: pre;
  opacity: 0.42;
  color: #93c5fd !important;
  font-style: italic;
  font-weight: 500;
  letter-spacing: 0px;
  pointer-events: none;
  user-select: none;
  text-shadow: 0 0 10px rgba(147, 197, 253, 0.2);
}

/* Teacher Focus Spotlight on Code Line */
.code-line-row.line-focus-spotlight {
  background: rgba(234, 179, 8, 0.16);
  border-left: 3px solid #eab308;
  margin-left: -12px;
  padding-left: 9px;
  border-radius: 0 4px 4px 0;
  box-shadow: inset 0 0 12px rgba(234, 179, 8, 0.1);
}



/* VS Code IntelliSense Fallback Popup (Non-intrusive) */
.vscode-intellisense-popup {
  position: absolute;
  top: 40px;
  left: 30px;
  z-index: 100;
  background: #252526;
  border: 1px solid #454545;
  border-radius: var(--radius-sm);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
  min-width: 260px;
  max-width: 360px;
  max-height: 220px;
  overflow-y: auto;
}

.intellisense-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  gap: 10px;
  cursor: pointer;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  transition: background 0.1s ease;
}

.intellisense-item:hover, .intellisense-item.active {
  background: #094771;
}

.intellisense-left {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow: hidden;
}

.intellisense-icon {
  font-size: 11px;
  width: 16px;
  text-align: center;
  color: #569cd6;
}

.intellisense-icon.kind-snippet { color: #dcdcaa; }
.intellisense-icon.kind-class { color: #4ec9b0; }
.intellisense-icon.kind-keyword { color: #c586c0; }

.intellisense-label {
  font-family: 'Consolas', 'Courier New', monospace;
  font-size: 12px;
  font-weight: 600;
  color: #ffffff;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

.intellisense-detail {
  font-size: 10px;
  color: #858585;
  white-space: nowrap;
}

.footer-left-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Ghost Tab Badge in Footer */
.ghost-tab-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.35);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  color: #c7d2fe;
  animation: fadeIn 0.15s ease;
}

.tab-kbd {
  background: #312e81;
  color: #e0e7ff;
  padding: 1px 5px;
  border-radius: 3px;
  font-weight: 700;
  font-family: monospace;
  font-size: 10px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.intellisense-hint {
  font-size: 11px;
  color: #a5b4fc;
}

.intellisense-hint code {
  background: rgba(99, 102, 241, 0.2);
  padding: 1px 4px;
  border-radius: 3px;
  color: #c084fc;
}

/* ==========================================================================
   Bottom Mode Dock & Done Action (Floating at bottom center)
   ========================================================================== */
.bottom-mode-dock {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(15, 23, 42, 0.94);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(16, 185, 129, 0.45);
  border-radius: var(--radius-full, 9999px);
  padding: 6px 8px 6px 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 20px rgba(16, 185, 129, 0.2);
  z-index: 65;
  animation: modalEnter 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
}

body.theme-light .bottom-mode-dock {
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(16, 185, 129, 0.5);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12), 0 0 20px rgba(16, 185, 129, 0.15);
}

.bottom-mode-indicator {
  font-size: 13px;
  font-weight: 700;
  color: #10b981;
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: 0.2px;
}

body.theme-light .bottom-mode-indicator {
  color: #059669;
}

.btn-bottom-done {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #ffffff;
  border: none;
  padding: 6px 18px;
  border-radius: var(--radius-full, 9999px);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  box-shadow: 0 3px 12px rgba(16, 185, 129, 0.45);
  transition: all var(--transition-fast, 0.15s ease);
}

.btn-bottom-done:hover {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  transform: translateY(-1px) scale(1.03);
  box-shadow: 0 5px 18px rgba(16, 185, 129, 0.7);
}

.btn-bottom-done:active {
  transform: translateY(0) scale(0.98);
}

/* Toolbar active state when Font / Text Mode is active */
.wb-floating-toolbar.text-mode-active .tool-btn:not([data-tool="text"]) {
  opacity: 0.8;
  cursor: pointer;
}

.wb-floating-toolbar.text-mode-active .tool-btn[data-tool="text"] {
  background: var(--accent-gradient) !important;
  color: #ffffff !important;
  box-shadow: 0 0 16px rgba(99, 102, 241, 0.6) !important;
  border-color: #ffffff !important;
  position: relative;
}

.canvas-viewport.text-mode {
  cursor: text !important;
}

/* Elements count minimap pill */
.wb-minimap-pill {
  position: absolute;
  bottom: 24px;
  right: 24px;
  background: rgba(18, 24, 38, 0.85);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  padding: 6px 14px;
  font-size: 12px;
  color: var(--text-secondary);
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: var(--shadow-sm);
}

.wb-minimap-pill i {
  color: var(--accent-primary);
}

/* ==========================================================================
   Nodes / Flow Mode (n8n Style Visual Programming System)
   ========================================================================== */

/* Top Navbar Nodes Control Banner */
.nodes-mode-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(99, 102, 241, 0.4);
  padding: 3px 6px 3px 10px;
  border-radius: var(--radius-full);
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.25);
  animation: modalEnter 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

body.theme-light .nodes-mode-banner {
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(99, 102, 241, 0.35);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.nodes-lang-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  color: #f97316;
  background: rgba(249, 115, 22, 0.15);
  padding: 3px 8px;
  border-radius: var(--radius-full);
  border: 1px solid rgba(249, 115, 22, 0.3);
}

.btn-run-nodes {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #ffffff;
  border: none;
  padding: 5px 14px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 2px 10px rgba(16, 185, 129, 0.4);
  transition: all var(--transition-fast);
}

.btn-run-nodes:hover {
  transform: scale(1.04);
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.6);
}

.btn-stop-nodes {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: #ffffff;
  border: none;
  padding: 5px 14px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 2px 10px rgba(239, 68, 68, 0.4);
  transition: all var(--transition-fast);
}

.btn-stop-nodes:hover {
  transform: scale(1.04);
  box-shadow: 0 4px 16px rgba(239, 68, 68, 0.6);
}

/* Toolbar active state during Nodes Mode */
.wb-floating-toolbar.nodes-mode-active .tool-btn:not([data-tool="nodes"]) {
  opacity: 0.8;
  cursor: pointer;
}

.wb-floating-toolbar.nodes-mode-active .tool-btn[data-tool="nodes"] {
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%) !important;
  color: #ffffff !important;
  box-shadow: 0 0 18px rgba(99, 102, 241, 0.7) !important;
  border-color: #ffffff !important;
}

/* Canvas Overlay for Nodes and SVG connections */
.node-canvas-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: auto;
  z-index: 30;
  overflow: hidden;
}

.node-connections-svg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: auto;
  z-index: 1;
}

.connection-cable {
  fill: none;
  stroke: #6366f1;
  stroke-width: 3px;
  cursor: pointer;
  filter: drop-shadow(0 0 6px rgba(99, 102, 241, 0.6));
  stroke-linecap: round;
  transition: stroke 0.2s, stroke-width 0.2s;
}

.connection-cable:hover {
  stroke: #a5b4fc;
  stroke-width: 5px;
}

.connection-cable.selected {
  stroke: #f43f5e;
  stroke-width: 4px;
  stroke-dasharray: 6 4;
}

.connection-cable.cable-true {
  stroke: #10b981;
  filter: drop-shadow(0 0 6px rgba(16, 185, 129, 0.6));
}

.connection-cable.cable-false {
  stroke: #ef4444;
  filter: drop-shadow(0 0 6px rgba(239, 68, 68, 0.6));
}

.connection-cable.cable-loop {
  stroke: #ec4899;
  filter: drop-shadow(0 0 6px rgba(236, 72, 153, 0.6));
}

.connecting-temp-cable {
  fill: none;
  stroke: #a5b4fc;
  stroke-width: 3px;
  stroke-dasharray: 6 4;
  pointer-events: none;
  animation: cableDash 1s linear infinite;
}

@keyframes cableDash {
  to {
    stroke-dashoffset: -20;
  }
}

.node-cards-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 2;
}

/* ==========================================================================
   n8n-Style Node Card Design
   ========================================================================== */
.n8n-node-card {
  position: absolute;
  min-width: 220px;
  max-width: 280px;
  background: rgba(18, 24, 38, 0.94);
  backdrop-filter: blur(18px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-top: 3px solid var(--node-color, #6366f1);
  border-radius: var(--radius-md);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45), 0 0 16px rgba(0, 0, 0, 0.2);
  pointer-events: auto;
  user-select: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
  animation: modalEnter 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.n8n-node-card:hover {
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6), 0 0 20px rgba(99, 102, 241, 0.25);
  border-color: rgba(255, 255, 255, 0.25);
}

.n8n-node-card.selected {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.8), 0 16px 40px rgba(0, 0, 0, 0.6);
}

.n8n-node-card.node-executing {
  border-color: #10b981 !important;
  box-shadow: 0 0 28px rgba(16, 185, 129, 0.8) !important;
  transform: scale(1.03);
}

.node-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid var(--border-subtle);
  cursor: grab;
}

.node-header:active {
  cursor: grabbing;
}

.node-icon-badge {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 11px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.node-title-wrap {
  flex: 1;
  min-width: 0;
}

.node-type-label {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  font-weight: 700;
}

.node-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.node-header-actions {
  display: flex;
  align-items: center;
}

.node-delete-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  width: 22px;
  height: 22px;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  transition: all var(--transition-fast);
}

.node-delete-btn:hover {
  background: rgba(244, 63, 94, 0.2);
  color: #fb7185;
}

.node-body {
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.node-form-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.node-form-row.dual-fields {
  display: flex;
  flex-direction: row;
  gap: 6px;
}

.field-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.node-field-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
}

.node-input, .node-select {
  width: 100%;
  height: 26px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xs);
  color: var(--text-primary);
  font-size: 11px;
  font-family: var(--font-family-mono);
  padding: 0 6px;
  outline: none;
  transition: border-color var(--transition-fast);
}

.node-textarea {
  height: auto !important;
  min-height: 48px;
  resize: vertical;
  padding: 4px 6px !important;
  line-height: 1.4;
}

.node-input.sm, .node-select.sm {
  height: 24px;
  font-size: 10.5px;
  padding: 0 4px;
}

.node-input:focus, .node-select:focus, .node-textarea:focus {
  border-color: var(--accent-primary);
  background: rgba(0, 0, 0, 0.6);
}

.math-calc-row {
  display: flex;
  align-items: center;
  gap: 4px;
}

.op-select {
  width: 48px;
  text-align: center;
  font-weight: 700;
}

.node-info-text {
  font-size: 10.5px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Ports Layer (Connection Handles) */
.node-ports-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.ports-column-in {
  position: absolute;
  left: -8px;
  top: 36px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ports-column-out {
  position: absolute;
  right: -8px;
  top: 36px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.node-port {
  display: flex;
  align-items: center;
  gap: 4px;
  pointer-events: auto;
  cursor: crosshair;
}

.port-dot {
  width: 14px;
  height: 14px;
  background: #1e293b;
  border: 2px solid #6366f1;
  border-radius: 50%;
  box-shadow: 0 0 6px rgba(99, 102, 241, 0.6);
  transition: all 0.15s ease;
}

.node-port:hover .port-dot {
  transform: scale(1.35);
  background: #6366f1;
  box-shadow: 0 0 12px rgba(99, 102, 241, 0.9);
}

.port-true .port-dot {
  border-color: #10b981;
  box-shadow: 0 0 6px rgba(16, 185, 129, 0.6);
}

.port-true:hover .port-dot {
  background: #10b981;
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.9);
}

.port-false .port-dot {
  border-color: #ef4444;
  box-shadow: 0 0 6px rgba(239, 68, 68, 0.6);
}

.port-false:hover .port-dot {
  background: #ef4444;
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.9);
}

.port-label {
  font-size: 9px;
  font-weight: 700;
  color: var(--text-muted);
  text-shadow: 0 1px 3px rgba(0,0,0,0.8);
}

/* ==========================================================================
   Floating '+' Add Node Button (Bottom-Right n8n Trigger)
   ========================================================================== */
.n8n-add-node-btn {
  position: absolute;
  bottom: 28px;
  right: 28px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1 0%, #ec4899 100%);
  color: #ffffff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.5), 0 0 20px rgba(236, 72, 153, 0.3);
  z-index: 50;
  transition: all var(--transition-normal);
  animation: bounceIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.n8n-add-node-btn:hover {
  transform: scale(1.1) rotate(90deg);
  box-shadow: 0 12px 32px rgba(99, 102, 241, 0.7), 0 0 28px rgba(236, 72, 153, 0.5);
}

.n8n-add-node-btn .pulse-ring {
  position: absolute;
  top: -4px;
  left: -4px;
  right: -4px;
  bottom: -4px;
  border-radius: 50%;
  border: 2px solid rgba(99, 102, 241, 0.6);
  animation: pulseOut 2s infinite ease-out;
  pointer-events: none;
}

@keyframes pulseOut {
  0% {
    transform: scale(1);
    opacity: 0.8;
  }
  100% {
    transform: scale(1.4);
    opacity: 0;
  }
}

/* ==========================================================================
   Node Selection Catalog Drawer (n8n Style)
   ========================================================================== */
.node-catalog-drawer {
  position: absolute;
  bottom: 96px;
  right: 28px;
  width: 320px;
  max-height: 480px;
  background: rgba(14, 19, 31, 0.96);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6), 0 0 24px rgba(99, 102, 241, 0.2);
  z-index: 60;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: modalEnter 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.catalog-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.catalog-icon {
  color: var(--accent-primary);
  font-size: 16px;
}

.catalog-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
}

.catalog-subtitle {
  font-size: 10px;
  color: var(--text-muted);
}

.catalog-close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  width: 24px;
  height: 24px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  transition: all var(--transition-fast);
}

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

.catalog-search-wrap {
  position: relative;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border-subtle);
}

.catalog-search-wrap .search-icon {
  position: absolute;
  left: 22px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 11px;
}

.catalog-search-input {
  width: 100%;
  height: 30px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 11px;
  padding-left: 28px;
  padding-right: 8px;
  outline: none;
}

.catalog-search-input:focus {
  border-color: var(--accent-primary);
}

.catalog-grid {
  padding: 10px 12px;
  overflow-y: auto;
  max-height: 380px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.catalog-category-title {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-top: 6px;
  margin-bottom: 2px;
}

.catalog-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.catalog-card:hover {
  background: rgba(99, 102, 241, 0.15);
  border-color: var(--accent-primary);
  transform: translateX(3px);
}

.catalog-card-icon {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
}

.catalog-card-info {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.catalog-card-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-primary);
}

.catalog-card-desc {
  font-size: 10px;
  color: var(--text-muted);
}

.catalog-add-badge {
  font-size: 11px;
  color: var(--text-muted);
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.catalog-card:hover .catalog-add-badge {
  opacity: 1;
  color: var(--accent-primary);
}

/* ==========================================================================
   Right Docked Execution Output Terminal Panel
   ========================================================================== */
.node-execution-panel {
  position: absolute;
  top: 70px;
  right: 20px;
  width: 400px;
  max-width: calc(100vw - 40px);
  height: calc(100vh - 100px);
  max-height: 580px;
  background: rgba(11, 15, 25, 0.97);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-md);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6), 0 0 24px rgba(99, 102, 241, 0.2);
  z-index: 55;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: slideLeftFade 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideLeftFade {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.exec-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid var(--border-subtle);
}

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

.exec-header-icon {
  color: var(--accent-primary);
  font-size: 13px;
}

.exec-header-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-primary);
}

.exec-status-pill-wrap .status-pill {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.status-pill.idle {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-secondary);
}

.status-pill.running {
  background: rgba(99, 102, 241, 0.25);
  color: #a5b4fc;
}

.status-pill.success {
  background: rgba(16, 185, 129, 0.25);
  color: #34d399;
}

.status-pill.error {
  background: rgba(239, 68, 68, 0.25);
  color: #f87171;
}

.exec-header-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.exec-tool-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  width: 24px;
  height: 24px;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  transition: all var(--transition-fast);
}

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

.exec-tabs-bar {
  display: flex;
  background: rgba(0, 0, 0, 0.3);
  border-bottom: 1px solid var(--border-subtle);
  padding: 2px 4px;
  gap: 2px;
}

.exec-tab-btn {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  padding: 8px 10px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: var(--radius-xs);
  transition: all var(--transition-fast);
}

.exec-tab-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.exec-tab-btn.active {
  color: var(--accent-primary);
  background: rgba(99, 102, 241, 0.18);
  font-weight: 700;
}

.exec-tab-content {
  flex: 1;
  overflow: hidden;
  display: flex;
}

.exec-tab-pane {
  display: none;
  width: 100%;
  height: 100%;
  flex-direction: column;
}

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

.console-terminal-body {
  flex: 1;
  padding: 12px;
  overflow-y: auto;
  font-family: var(--font-family-mono);
  font-size: 11px;
  line-height: 1.6;
  background: #090d16;
  color: #e2e8f0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.console-log-line {
  word-break: break-all;
  white-space: pre-wrap;
}

.line-info {
  color: #94a3b8;
}

.line-system {
  color: #38bdf8;
  font-weight: 600;
}

.line-log {
  color: #c084fc;
}

.line-comment {
  color: #facc15;
  font-style: italic;
}

.line-variable {
  color: #818cf8;
}

.line-datatype {
  color: #38bdf8;
}

.line-operators {
  color: #fbbf24;
}

.line-strings {
  color: #c084fc;
}

.line-math {
  color: #22d3ee;
}

.line-booleans {
  color: #34d399;
}

.line-control {
  color: #fb923c;
}

.line-array {
  color: #2dd4bf;
}

.line-method {
  color: #60a5fa;
}

.line-overload {
  color: #c4b5fd;
}

.line-scope {
  color: #94a3b8;
}

.line-recursion {
  color: #f472b6;
  font-weight: 500;
}

.line-warning {
  color: #fbbf24;
  background: rgba(245, 158, 11, 0.1);
  padding: 2px 6px;
  border-radius: 3px;
}

.line-print {
  color: #4ade80;
  font-weight: 700;
  background: rgba(74, 222, 128, 0.1);
  padding: 2px 6px;
  border-radius: 3px;
}

.line-error {
  color: #f87171;
  background: rgba(248, 113, 113, 0.12);
  padding: 2px 6px;
  border-radius: 3px;
}

.line-success {
  color: #34d399;
  font-weight: 700;
}

.code-viewer-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: #090d16;
  overflow: hidden;
}

.code-viewer-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 12px;
  background: rgba(255, 255, 255, 0.04);
  border-bottom: 1px solid var(--border-subtle);
  font-size: 11px;
  color: var(--text-muted);
}

.btn-copy-code {
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.3);
  color: #a5b4fc;
  padding: 3px 8px;
  border-radius: var(--radius-xs);
  font-size: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
}

.btn-copy-code:hover {
  background: rgba(99, 102, 241, 0.3);
  color: #ffffff;
}

.code-viewer-wrap pre {
  flex: 1;
  margin: 0;
  padding: 12px;
  overflow: auto;
}

.java-code-block {
  font-family: var(--font-family-mono);
  font-size: 11px;
  color: #cbd5e1;
  line-height: 1.5;
}

/* ==========================================================================
   Java Code & Algorithm Execution Visualizer Studio Styles
   ========================================================================== */
.btn-visualize-sparkle {
  background: linear-gradient(135deg, #4f46e5, #7c3aed);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 2px 10px rgba(99, 102, 241, 0.4);
  transition: all var(--transition-fast);
}

.btn-visualize-sparkle:hover {
  background: linear-gradient(135deg, #6366f1, #9333ea);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.6);
}

.visualizer-modal-card {
  width: 95vw !important;
  max-width: 1240px !important;
  height: 88vh !important;
  max-height: 920px !important;
  background: #0d111a !important;
  border: 1px solid rgba(99, 102, 241, 0.4) !important;
  border-radius: var(--radius-lg) !important;
  box-shadow: 0 25px 80px rgba(0, 0, 0, 0.9), 0 0 40px rgba(99, 102, 241, 0.3) !important;
  display: flex !important;
  flex-direction: column !important;
  padding: 0 !important;
  overflow: hidden !important;
}

.visualizer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  background: #141b2d;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.vis-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.vis-header-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #4f46e5, #06b6d4);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  box-shadow: 0 4px 12px rgba(6, 182, 212, 0.4);
}

.vis-title {
  font-size: 16px;
  font-weight: 700;
  color: #ffffff;
  margin: 0;
}

.vis-subtitle {
  font-size: 11px;
  color: var(--text-muted);
  margin: 2px 0 0 0;
}

.vis-header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.vis-lang-badge {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.vis-step-counter-pill {
  background: rgba(99, 102, 241, 0.2);
  color: #a5b4fc;
  border: 1px solid rgba(99, 102, 241, 0.4);
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 700;
  font-family: var(--font-family-mono);
}

/* Stepper Control Bar */
.visualizer-control-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 20px;
  background: #111726;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  flex-wrap: wrap;
  gap: 10px;
}

.vis-control-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-vis-ctrl {
  background: #1e293b;
  color: #f1f5f9;
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all var(--transition-fast);
}

.btn-vis-ctrl:hover {
  background: #334155;
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-1px);
}

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

.btn-vis-primary {
  background: #4f46e5;
  border-color: #6366f1;
}

.btn-vis-primary:hover {
  background: #4338ca;
}

.btn-vis-accent {
  background: #059669;
  border-color: #10b981;
}

.btn-vis-accent:hover {
  background: #047857;
}

.btn-vis-accent.btn-playing {
  background: #d97706;
  border-color: #f59e0b;
}

.btn-vis-outline {
  background: transparent;
  color: var(--text-muted);
}

.vis-control-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.vis-speed-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-muted);
}

.vis-speed-select {
  background: #1e293b;
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  outline: none;
  cursor: pointer;
}

.btn-vis-node-connect {
  background: linear-gradient(135deg, #0284c7, #2563eb);
  color: #ffffff;
  border: none;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
  transition: all var(--transition-fast);
}

.btn-vis-node-connect:hover {
  background: linear-gradient(135deg, #0369a1, #1d4ed8);
  transform: translateY(-1px);
}

/* Visualizer Body Grid (Split View) */
.visualizer-body-grid {
  flex: 1;
  display: grid;
  grid-template-columns: 46% 54%;
  overflow: hidden;
}

/* Left Pane: Code View */
.vis-code-pane {
  background: #18181b;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.vis-pane-header {
  padding: 10px 16px;
  background: #202023;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 12px;
  font-weight: 700;
  color: #a1a1aa;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.vis-hint-text {
  font-size: 11px;
  color: #71717a;
  font-weight: 500;
}

.vis-code-lines-container {
  flex: 1;
  overflow-y: auto;
  padding: 10px 0;
  font-family: var(--font-family-mono);
  font-size: 13px;
  line-height: 1.5;
  background: #18181b;
}

.vis-code-line {
  display: flex;
  align-items: center;
  padding: 3px 12px;
  transition: background 0.15s ease;
  position: relative;
}

.vis-line-pointer {
  width: 18px;
  font-size: 11px;
  color: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s ease;
}

.vis-line-num {
  width: 32px;
  color: #71717a;
  font-size: 11px;
  text-align: right;
  padding-right: 12px;
  user-select: none;
}

.vis-line-content {
  flex: 1;
  color: #e4e4e7;
  white-space: pre;
  overflow-x: auto;
}

/* Active Highlight Line States */
.vis-code-line.active {
  background: rgba(99, 102, 241, 0.22);
  border-left: 3px solid #6366f1;
}
.vis-code-line.active .vis-line-pointer {
  color: #818cf8;
}
.vis-code-line.active .vis-line-num {
  color: #a5b4fc;
  font-weight: 700;
}

.vis-code-line.active-iterator {
  background: rgba(6, 182, 212, 0.22);
  border-left: 3px solid #06b6d4;
}
.vis-code-line.active-iterator .vis-line-pointer {
  color: #22d3ee;
}
.vis-code-line.active-iterator .vis-line-num {
  color: #67e8f9;
  font-weight: 700;
}

.vis-code-line.active-output {
  background: rgba(16, 185, 129, 0.22);
  border-left: 3px solid #10b981;
}
.vis-code-line.active-output .vis-line-pointer {
  color: #34d399;
}
.vis-code-line.active-output .vis-line-num {
  color: #6ee7b7;
  font-weight: 700;
}

.vis-code-line.active-error {
  background: rgba(239, 68, 68, 0.28);
  border-left: 3px solid #ef4444;
}
.vis-code-line.active-error .vis-line-pointer {
  color: #f87171;
}
.vis-code-line.active-error .vis-line-num {
  color: #fca5a5;
  font-weight: 700;
}

/* Right Pane: State & Memory Inspector */
.vis-state-pane {
  background: #0f1422;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding: 16px;
  gap: 14px;
}

/* Pedagogical Explanation Box */
.vis-explanation-box {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.12), rgba(14, 165, 233, 0.12));
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.explanation-content {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.exp-icon {
  color: #f59e0b;
  font-size: 18px;
  margin-top: 2px;
}

.exp-text {
  font-size: 13px;
  font-weight: 600;
  color: #f8fafc;
  line-height: 1.5;
}

/* Error Diagnostic Card */
.vis-error-card {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.4);
  border-radius: var(--radius-md);
  padding: 12px 16px;
}

.error-card-title {
  color: #f87171;
  font-weight: 700;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.error-card-msg {
  color: #fecaca;
  font-size: 12px;
  font-family: var(--font-family-mono);
  margin-top: 4px;
}

.error-card-hint {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(239, 68, 68, 0.2);
  color: #fed7aa;
  font-size: 12px;
}

/* Sub sections */
.vis-sub-section {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-md);
  padding: 12px 14px;
}

.vis-sub-header {
  font-size: 12px;
  font-weight: 700;
  color: #94a3b8;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.vis-loop-badge {
  display: flex;
  align-items: center;
  gap: 8px;
}

.loop-iter-tag {
  background: rgba(6, 182, 212, 0.2);
  color: #22d3ee;
  border: 1px solid rgba(6, 182, 212, 0.4);
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.loop-var-tag {
  background: rgba(14, 165, 233, 0.15);
  color: #38bdf8;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  font-size: 11px;
}

.condition-eval-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(0, 0, 0, 0.25);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.06);
  flex-wrap: wrap;
  gap: 8px;
}

.condition-label {
  font-size: 11px;
  color: #94a3b8;
}

.condition-code {
  font-family: var(--font-family-mono);
  font-size: 12px;
  color: #cbd5e1;
  background: rgba(255, 255, 255, 0.05);
  padding: 2px 6px;
  border-radius: 4px;
}

.condition-pill {
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.condition-pill.pill-true {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.condition-pill.pill-false {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.4);
}

/* Variables Memory Cards */
.vis-variables-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
}

.empty-hint {
  font-size: 12px;
  color: var(--text-muted);
  font-style: italic;
}

.var-memory-card {
  background: #182234;
  border: 1px solid rgba(99, 102, 241, 0.25);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: all 0.2s ease;
}

.var-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.var-type-badge {
  font-size: 10px;
  color: #38bdf8;
  font-family: var(--font-family-mono);
  font-weight: 700;
}

.var-name {
  font-size: 12px;
  font-weight: 700;
  color: #e2e8f0;
}

.var-value-display {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px;
}

.var-val {
  font-size: 14px;
  font-weight: 700;
  font-family: var(--font-family-mono);
  color: #facc15;
}

.var-old-val {
  font-size: 10px;
  color: #64748b;
  text-decoration: line-through;
}

@keyframes varPulse {
  0% { transform: scale(1); box-shadow: 0 0 0 rgba(99, 102, 241, 0); }
  50% { transform: scale(1.05); box-shadow: 0 0 20px rgba(99, 102, 241, 0.8); border-color: #6366f1; }
  100% { transform: scale(1); box-shadow: 0 0 0 rgba(99, 102, 241, 0); }
}

.var-memory-card.var-updated-pulse {
  animation: varPulse 0.6s ease;
  border-color: #6366f1;
}

/* Array Track Container */
.vis-array-track-container {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 10px 14px;
}

.array-track-header {
  font-size: 11px;
  color: #94a3b8;
  margin-bottom: 8px;
}

.array-cells-row {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.array-cell {
  background: #1e293b;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 4px;
  min-width: 44px;
  text-align: center;
  padding: 6px 4px;
  position: relative;
  transition: all 0.2s ease;
}

.array-cell.active-cell {
  background: rgba(99, 102, 241, 0.3);
  border-color: #818cf8;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.cell-pointer-arrow {
  position: absolute;
  top: -18px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 9px;
  color: #38bdf8;
  white-space: nowrap;
  font-weight: 700;
}

.cell-value {
  font-size: 13px;
  font-weight: 700;
  font-family: var(--font-family-mono);
  color: #f1f5f9;
}

.cell-index {
  font-size: 10px;
  color: #64748b;
  margin-top: 2px;
}

/* Console Output */
.vis-console-output {
  background: #090d16;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  min-height: 70px;
  max-height: 120px;
  overflow-y: auto;
  font-family: var(--font-family-mono);
  font-size: 12px;
  color: #38bdf8;
}

.console-line {
  margin-bottom: 3px;
  display: flex;
  gap: 6px;
}

.console-line .prompt {
  color: #64748b;
  user-select: none;
}

.console-empty-text {
  color: #475569;
  font-style: italic;
  font-size: 11px;
}

/* Visualizer Call Stack Tracker */
.vis-call-stack-section {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.08), rgba(168, 85, 247, 0.05));
  border: 1px solid rgba(99, 102, 241, 0.2);
}

.call-depth-badge {
  background: rgba(99, 102, 241, 0.2);
  color: #a5b4fc;
  border: 1px solid rgba(99, 102, 241, 0.4);
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 10px;
  font-weight: 700;
  font-family: var(--font-family-mono);
}

.vis-call-stack-list {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

.stack-frame-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #1e1e2e;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-sm);
  padding: 4px 10px;
  font-size: 11px;
  font-family: var(--font-family-mono);
  color: #cbd5e1;
  transition: all 0.2s ease;
}

.stack-frame-item.active-frame {
  background: rgba(99, 102, 241, 0.25);
  border-color: #818cf8;
  color: #ffffff;
  box-shadow: 0 0 12px rgba(99, 102, 241, 0.35);
}

.stack-frame-item .frame-icon {
  color: #818cf8;
  font-size: 10px;
}

.stack-frame-item .frame-name {
  font-weight: 700;
  color: #38bdf8;
}

.stack-frame-item .frame-args {
  color: #94a3b8;
  font-size: 10px;
}

.stack-frame-arrow {
  color: #64748b;
  font-size: 10px;
}

/* Visualizer OOP Heap Objects Inspector */
.vis-objects-section {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.05), rgba(6, 182, 212, 0.05));
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.objects-count-badge {
  background: rgba(16, 185, 129, 0.2);
  color: #6ee7b7;
  border: 1px solid rgba(16, 185, 129, 0.4);
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 10px;
  font-weight: 700;
}

.vis-objects-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
  margin-top: 4px;
}

.vis-object-card {
  background: #111827;
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: var(--radius-sm);
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: all 0.2s ease;
}

.vis-object-card:hover {
  border-color: #34d399;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.2);
}

.obj-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 5px;
}

.obj-class-badge {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  font-weight: 700;
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 3px;
  font-family: var(--font-family-mono);
}

.obj-instance-id {
  font-size: 10px;
  color: #94a3b8;
  font-family: var(--font-family-mono);
}

.obj-fields-grid {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.obj-field-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  font-family: var(--font-family-mono);
}

.obj-field-key {
  color: #93c5fd;
}

.obj-field-val {
  color: #fde047;
  font-weight: 600;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ==========================================================================
   Fullscreen Mode & Floating Island Docks
   ========================================================================== */

/* Fullscreen state on #whiteboard-view and body */
#whiteboard-view.is-fullscreen {
  position: fixed !important;
  inset: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  z-index: 9999 !important;
  background-color: #0f172a;
}

#whiteboard-view.is-fullscreen .wb-navbar {
  display: none !important;
}

#whiteboard-view.is-fullscreen .wb-floating-toolbar {
  display: none !important;
}

#whiteboard-view.is-fullscreen .wb-properties-panel {
  display: none !important;
}

#whiteboard-view.is-fullscreen .wb-viewport-wrapper {
  height: 100vh !important;
  width: 100vw !important;
  position: relative !important;
}

#whiteboard-view.is-fullscreen .canvas-viewport {
  height: 100vh !important;
  width: 100vw !important;
}

#whiteboard-view.is-fullscreen .wb-minimap-pill {
  display: none !important;
}

#whiteboard-view.is-fullscreen #fs-top-center-dock {
  display: flex !important;
}

#whiteboard-view.is-fullscreen #fs-bottom-right-dock {
  display: flex !important;
}

#whiteboard-view.is-fullscreen #fs-top-right-dock {
  display: flex !important;
}

/* 1. Top Center Floating Island Dock */
.fs-top-center-dock {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10000;
  background: rgba(15, 23, 42, 0.88);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 9999px;
  padding: 5px 12px;
  display: flex;
  align-items: center;
  gap: 4px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.55), 0 0 24px rgba(99, 102, 241, 0.22);
  user-select: none;
  animation: fsSlideDown 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.24s ease;
}

@keyframes fsSlideDown {
  from {
    opacity: 0;
    transform: translate(-50%, -14px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0) scale(1);
  }
}

.fs-tool-group {
  display: flex;
  align-items: center;
  gap: 3px;
}

.fs-tool-btn {
  width: 36px;
  height: 36px;
  border-radius: 9999px;
  border: 1px solid transparent;
  background: transparent;
  color: #cbd5e1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.18s ease;
  position: relative;
  text-decoration: none;
}

.fs-tool-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  transform: translateY(-1px);
}

.fs-tool-btn:active:not(:disabled) {
  transform: translateY(0) scale(0.96);
}

.fs-tool-btn.active {
  background: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
  color: #ffffff !important;
  border-color: rgba(255, 255, 255, 0.3);
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.45);
}

.fs-tool-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.fs-divider {
  width: 1px;
  height: 20px;
  background: rgba(255, 255, 255, 0.14);
  margin: 0 3px;
}

.fs-dropdown-trigger {
  width: auto;
  min-width: 44px;
  padding: 0 8px;
  gap: 4px;
}

.fs-caret {
  font-size: 9px;
  opacity: 0.7;
  transition: transform 0.2s ease;
}

.fs-dropdown-wrapper {
  position: relative;
}

.fs-dropdown-wrapper.open .fs-caret {
  transform: rotate(180deg);
}

.fs-dropdown-popover {
  position: absolute;
  top: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%);
  background: rgba(15, 23, 42, 0.94);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 16px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.65), 0 0 20px rgba(99, 102, 241, 0.2);
  padding: 8px;
  z-index: 10005;
  min-width: 175px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  animation: fsPopIn 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes fsPopIn {
  from {
    opacity: 0;
    transform: translate(-50%, -8px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0) scale(1);
  }
}

.fs-dropdown-header {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #94a3b8;
  padding: 4px 10px 6px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 2px;
}

.fs-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  color: #cbd5e1;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s ease;
}

.fs-menu-item:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

.fs-menu-item.active {
  background: rgba(99, 102, 241, 0.2);
  border-color: rgba(99, 102, 241, 0.4);
  color: #c7d2fe;
  font-weight: 600;
}

.fs-menu-item i {
  width: 18px;
  text-align: center;
  font-size: 13px;
}

/* Style Dropdown & Popover */
.fs-style-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 9px;
  min-width: 52px;
}

.fs-color-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid #ffffff;
  box-shadow: 0 0 6px rgba(0, 0, 0, 0.5);
  display: inline-block;
  flex-shrink: 0;
}

.fs-style-popover {
  min-width: 280px;
  padding: 14px;
  gap: 12px;
}

.fs-popover-title {
  font-size: 12px;
  font-weight: 700;
  color: #f8fafc;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 8px;
}

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

.fs-style-label {
  font-size: 11px;
  font-weight: 600;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

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

.fs-swatch {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.fs-swatch:hover {
  transform: scale(1.18);
  border-color: #ffffff;
}

.fs-swatch.active {
  transform: scale(1.18);
  border-color: #ffffff;
  box-shadow: 0 0 0 2px #6366f1;
}

.fs-custom-color-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 4px;
  padding-top: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.fs-custom-color-label {
  font-size: 12px;
  color: #cbd5e1;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

.fs-color-input {
  width: 28px;
  height: 24px;
  border: none;
  background: transparent;
  cursor: pointer;
  border-radius: 4px;
}

.fs-size-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
}

.fs-size-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 6px 4px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: #cbd5e1;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.fs-size-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

.fs-size-btn.active {
  background: rgba(99, 102, 241, 0.25);
  border-color: #6366f1;
  color: #c7d2fe;
}

.fs-size-dot {
  background: currentColor;
  border-radius: 50%;
  display: inline-block;
}

.fs-size-dot.dot-sm { width: 4px; height: 4px; }
.fs-size-dot.dot-md { width: 7px; height: 7px; }
.fs-size-dot.dot-lg { width: 10px; height: 10px; }
.fs-size-dot.dot-xl { width: 13px; height: 13px; }

.fs-opt-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
}

.fs-opt-btn {
  padding: 6px 4px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: #cbd5e1;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: center;
}

.fs-opt-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

.fs-opt-btn.active {
  background: rgba(99, 102, 241, 0.25);
  border-color: #6366f1;
  color: #c7d2fe;
}

/* Exit Fullscreen Minimize Button */
.fs-exit-btn {
  background: rgba(239, 68, 68, 0.15);
  color: #fca5a5;
  border-color: rgba(239, 68, 68, 0.3);
}

.fs-exit-btn:hover {
  background: rgba(239, 68, 68, 0.35) !important;
  color: #ffffff !important;
  border-color: rgba(239, 68, 68, 0.6) !important;
  transform: scale(1.05) !important;
}

/* 2. Bottom Right Floating Zoom & Stats Dock */
.fs-bottom-right-dock {
  position: fixed;
  bottom: 20px;
  right: 24px;
  z-index: 10000;
  background: rgba(15, 23, 42, 0.88);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 9999px;
  padding: 5px 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.55);
  user-select: none;
  animation: fsSlideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.24s ease;
}

@keyframes fsSlideUp {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.fs-zoom-btn {
  width: 28px;
  height: 28px;
  border-radius: 9999px;
  border: none;
  background: transparent;
  color: #cbd5e1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.fs-zoom-btn:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
}

.fs-zoom-btn:active {
  transform: scale(0.92);
}

.fs-zoom-display {
  font-size: 12px;
  font-weight: 700;
  font-family: var(--font-family-mono, monospace);
  color: #f8fafc;
  min-width: 44px;
  text-align: center;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 4px;
  transition: background 0.15s;
}

.fs-zoom-display:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #60a5fa;
}

.fs-dock-mini-divider {
  width: 1px;
  height: 16px;
  background: rgba(255, 255, 255, 0.12);
  margin: 0 2px;
}

.fs-elements-stat {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: #94a3b8;
  font-weight: 600;
  padding: 3px 9px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 9999px;
}

/* Fullscreen Node Controls in Top Center Dock */
.fs-nodes-control-group {
  display: flex;
  align-items: center;
  gap: 6px;
  animation: fsPopIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.fs-nodes-control-group.hidden {
  display: none !important;
}

.fs-nodes-lang-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  background: rgba(99, 102, 241, 0.2);
  color: #a5b4fc;
  border: 1px solid rgba(99, 102, 241, 0.35);
  border-radius: 9999px;
}

.fs-btn-run-nodes {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #ffffff !important;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 9999px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
  transition: all 0.18s ease;
}

.fs-btn-run-nodes:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 18px rgba(16, 185, 129, 0.6);
}

.fs-btn-run-nodes:active {
  transform: scale(0.96);
}

.fs-btn-stop-nodes {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(239, 68, 68, 0.2);
  color: #fca5a5 !important;
  border: 1px solid rgba(239, 68, 68, 0.4);
  border-radius: 9999px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.18s ease;
}

/* ==========================================================================
   Fullscreen Top Right Dock (Zen Mode / Hide & Show Tools Toggle)
   ========================================================================== */
.fs-top-right-dock {
  position: fixed;
  top: 16px;
  right: 20px;
  z-index: 10001;
  display: none;
  align-items: center;
  user-select: none;
  animation: fsSlideDown 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.fs-toggle-tools-btn {
  width: 40px;
  height: 40px;
  border-radius: 9999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(15, 23, 42, 0.88);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  color: #cbd5e1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  outline: none;
}

.fs-toggle-tools-btn:hover {
  background: rgba(30, 41, 62, 0.96);
  border-color: rgba(99, 102, 241, 0.5);
  color: #ffffff;
  transform: scale(1.08);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.55), 0 0 16px rgba(99, 102, 241, 0.35);
}

.fs-toggle-tools-btn.is-zen-active {
  background: rgba(99, 102, 241, 0.22);
  border-color: #6366f1;
  color: #a5b4fc;
  box-shadow: 0 0 20px rgba(99, 102, 241, 0.4);
}

.fs-toggle-tools-btn.is-zen-active:hover {
  background: rgba(99, 102, 241, 0.35);
  color: #ffffff;
  transform: scale(1.08);
}

/* Zen Mode Hidden State: Top and Bottom docks slide off screen */
body.fs-tools-hidden #fs-top-center-dock,
#whiteboard-view.fs-tools-hidden #fs-top-center-dock {
  transform: translateX(-50%) translateY(-150%) !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

body.fs-tools-hidden #fs-bottom-right-dock,
#whiteboard-view.fs-tools-hidden #fs-bottom-right-dock {
  transform: translateY(150%) !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

body.fs-tools-hidden .fs-dropdown-popover {
  display: none !important;
}

/* Whiteboard Pro / Light Mode Styling for Zen Toggle */
body.theme-light .fs-toggle-tools-btn {
  background: rgba(255, 255, 255, 0.94) !important;
  border: 1px solid rgba(15, 23, 42, 0.14) !important;
  color: #334155 !important;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12) !important;
}

body.theme-light .fs-toggle-tools-btn:hover {
  background: #ffffff !important;
  border-color: rgba(79, 70, 229, 0.5) !important;
  color: #0f172a !important;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.18), 0 0 16px rgba(79, 70, 229, 0.25) !important;
}

body.theme-light .fs-toggle-tools-btn.is-zen-active {
  background: rgba(79, 70, 229, 0.12) !important;
  border-color: #4f46e5 !important;
  color: #4f46e5 !important;
  box-shadow: 0 0 20px rgba(79, 70, 229, 0.25) !important;
}

body.theme-light .fs-toggle-tools-btn.is-zen-active:hover {
  background: rgba(79, 70, 229, 0.2) !important;
  color: #3730a3 !important;
}

.fs-btn-stop-nodes:hover {
  background: rgba(239, 68, 68, 0.4);
  color: #ffffff !important;
  border-color: rgba(239, 68, 68, 0.7);
  transform: scale(1.05);
}

.fs-btn-add-node {
  background: linear-gradient(135deg, #6366f1, #ec4899) !important;
  color: #ffffff !important;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.fs-btn-visualize {
  color: #c084fc !important;
}

.fs-btn-visualize:hover {
  background: rgba(168, 85, 247, 0.25) !important;
  color: #ffffff !important;
  box-shadow: 0 0 14px rgba(168, 85, 247, 0.5) !important;
}

/* Modals & Panels in Fullscreen mode must appear in front */
.modal-overlay {
  z-index: 25000 !important;
}

#code-visualizer-modal {
  z-index: 26000 !important;
}

.node-execution-panel {
  z-index: 15000 !important;
}

.node-catalog-drawer {
  z-index: 15000 !important;
}

.n8n-add-node-btn {
  z-index: 15000 !important;
}

.canvas-text-editor-window {
  z-index: 12000 !important;
}

/* Fullscreen Popovers display fix */
.fs-dropdown-popover {
  pointer-events: auto !important;
  z-index: 10005 !important;
}

.fs-dropdown-popover:not(.hidden) {
  display: flex !important;
}

/* Professional Blocked / Disabled State for Fullscreen and Navbar Undo & Redo */
.fs-tool-btn:disabled,
.fs-tool-btn.disabled-state {
  opacity: 0.28 !important;
  cursor: not-allowed !important;
  pointer-events: auto !important;
  filter: grayscale(1) contrast(0.8) !important;
  box-shadow: none !important;
  background: transparent !important;
  border-color: transparent !important;
  transform: none !important;
}

.fs-tool-btn:disabled:hover,
.fs-tool-btn.disabled-state:hover {
  background: rgba(255, 255, 255, 0.02) !important;
  color: #64748b !important;
  transform: none !important;
  cursor: not-allowed !important;
  box-shadow: none !important;
  border-color: transparent !important;
}

.tool-btn-nav:disabled,
.tool-btn-nav.disabled-state {
  opacity: 0.3 !important;
  cursor: not-allowed !important;
  pointer-events: auto !important;
  filter: grayscale(1) !important;
  box-shadow: none !important;
  transform: none !important;
}

.tool-btn-nav:disabled:hover,
.tool-btn-nav.disabled-state:hover {
  cursor: not-allowed !important;
  transform: none !important;
  background: transparent !important;
  box-shadow: none !important;
}

/* ==========================================================================
   PROFESSIONAL WHITEBOARD PRO - WHITE MODE / LIGHT THEME STYLES
   High-Contrast Dark Charcoal Icons, Crisp Pure White Surfaces & Clean Borders
   ========================================================================== */

/* 1. Whiteboard Navbar in White Mode */
body.theme-light .wb-navbar {
  background: rgba(255, 255, 255, 0.95) !important;
  border-bottom: 1px solid rgba(15, 23, 42, 0.1) !important;
  box-shadow: 0 4px 20px rgba(15, 23, 42, 0.06) !important;
}

body.theme-light .wb-navbar .nav-divider {
  background: rgba(15, 23, 42, 0.12) !important;
}

body.theme-light .wb-navbar .tool-btn-nav {
  background: #f1f5f9 !important;
  border: 1px solid rgba(15, 23, 42, 0.12) !important;
  color: #334155 !important;
}

body.theme-light .wb-navbar .tool-btn-nav:hover:not(:disabled) {
  background: #e2e8f0 !important;
  color: #0f172a !important;
  border-color: rgba(15, 23, 42, 0.22) !important;
}

body.theme-light .wb-navbar .zoom-controls-pill,
body.theme-light .wb-navbar .grid-selector-pill {
  background: #f1f5f9 !important;
  border: 1px solid rgba(15, 23, 42, 0.12) !important;
}

body.theme-light .wb-navbar .zoom-btn,
body.theme-light .wb-navbar .zoom-reset-btn {
  color: #475569 !important;
}

body.theme-light .wb-navbar .zoom-btn:hover,
body.theme-light .wb-navbar .zoom-reset-btn:hover {
  color: #0f172a !important;
  background: rgba(15, 23, 42, 0.06) !important;
}

body.theme-light .wb-navbar .zoom-text {
  color: #0f172a !important;
  font-weight: 700 !important;
}

body.theme-light .wb-navbar .grid-style-btn {
  color: #64748b !important;
}

body.theme-light .wb-navbar .grid-style-btn:hover {
  color: #0f172a !important;
}

body.theme-light .wb-navbar .grid-style-btn.active {
  background: #ffffff !important;
  color: #4f46e5 !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12) !important;
}

body.theme-light #board-title-input {
  color: #0f172a !important;
  font-weight: 700 !important;
}

body.theme-light #board-title-input:hover,
body.theme-light #board-title-input:focus {
  background: #f1f5f9 !important;
  border-color: #cbd5e1 !important;
}

body.theme-light .save-status-badge {
  background: #f1f5f9 !important;
  border-color: rgba(15, 23, 42, 0.12) !important;
  color: #475569 !important;
}

body.theme-light .elements-count-display {
  background: #f1f5f9 !important;
  border: 1px solid rgba(15, 23, 42, 0.1) !important;
  color: #334155 !important;
}

/* 2. Floating Left Tool Palette in White Mode */
body.theme-light .wb-floating-toolbar {
  background: rgba(255, 255, 255, 0.96) !important;
  border: 1px solid rgba(15, 23, 42, 0.12) !important;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.12), 0 2px 10px rgba(0, 0, 0, 0.04) !important;
  scrollbar-color: rgba(15, 23, 42, 0.2) transparent !important;
}

body.theme-light .wb-floating-toolbar::-webkit-scrollbar-thumb {
  background: rgba(15, 23, 42, 0.2) !important;
}

body.theme-light .wb-floating-toolbar .toolbar-separator {
  background: rgba(15, 23, 42, 0.1) !important;
}

body.theme-light .wb-floating-toolbar .tool-btn {
  background: #f8fafc !important;
  border: 1px solid rgba(15, 23, 42, 0.1) !important;
  color: #334155 !important;
}

body.theme-light .wb-floating-toolbar .tool-btn i {
  color: #334155 !important;
}

body.theme-light .wb-floating-toolbar .tool-btn:hover:not(.active) {
  background: #f1f5f9 !important;
  color: #0f172a !important;
  border-color: rgba(79, 70, 229, 0.35) !important;
  transform: translateY(-1px) scale(1.02);
}

body.theme-light .wb-floating-toolbar .tool-btn:hover:not(.active) i {
  color: #0f172a !important;
}

body.theme-light .wb-floating-toolbar .tool-btn.active {
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%) !important;
  color: #ffffff !important;
  border-color: rgba(255, 255, 255, 0.4) !important;
  box-shadow: 0 4px 16px rgba(79, 70, 229, 0.42) !important;
}

body.theme-light .wb-floating-toolbar .tool-btn.active i {
  color: #ffffff !important;
}

body.theme-light .wb-floating-toolbar .tool-caret i {
  color: #64748b !important;
}

body.theme-light .wb-floating-toolbar .tool-btn.active .tool-caret i {
  color: rgba(255, 255, 255, 0.85) !important;
}

body.theme-light .toolbar-drag-handle {
  background: rgba(15, 23, 42, 0.04) !important;
  border: 1px solid rgba(15, 23, 42, 0.1) !important;
  color: #64748b !important;
}

body.theme-light .toolbar-drag-handle:hover {
  background: rgba(79, 70, 229, 0.12) !important;
  border-color: rgba(79, 70, 229, 0.35) !important;
  color: #4f46e5 !important;
}

body.theme-light .wb-floating-toolbar.is-dragging {
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.2), 0 0 24px rgba(79, 70, 229, 0.25) !important;
}

body.theme-light .wb-shapes-palette {
  background: rgba(255, 255, 255, 0.97) !important;
  border-color: rgba(15, 23, 42, 0.14) !important;
  box-shadow: 0 20px 48px rgba(15, 23, 42, 0.16), 0 0 24px rgba(79, 70, 229, 0.1) !important;
}

body.theme-light .wb-shapes-palette::before {
  background: rgba(255, 255, 255, 0.98) !important;
  border-color: rgba(15, 23, 42, 0.14) !important;
}

body.theme-light .palette-header-title {
  color: #0f172a !important;
}

body.theme-light .shapes-category-tabs {
  background: #f1f5f9 !important;
  border-color: rgba(15, 23, 42, 0.08) !important;
}

body.theme-light .shapes-tab-btn {
  color: #64748b !important;
}

body.theme-light .shapes-tab-btn:hover {
  color: #0f172a !important;
  background: rgba(15, 23, 42, 0.06) !important;
}

body.theme-light .shapes-tab-btn.active {
  background: linear-gradient(135deg, #4f46e5, #7c3aed) !important;
  color: #ffffff !important;
}

body.theme-light .shape-item-btn {
  background: #f8fafc !important;
  border-color: #e2e8f0 !important;
  color: #334155 !important;
}

body.theme-light .shape-item-btn:hover {
  background: #ffffff !important;
  border-color: #4f46e5 !important;
  color: #0f172a !important;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08) !important;
}

body.theme-light .shape-item-btn .shape-icon-preview {
  color: #475569 !important;
}

body.theme-light .shape-item-btn:hover .shape-icon-preview {
  color: #4f46e5 !important;
}

body.theme-light .shape-item-btn.active {
  background: #eef2ff !important;
  border-color: #4f46e5 !important;
  color: #4338ca !important;
}

body.theme-light .shape-item-btn.active .shape-icon-preview {
  color: #4f46e5 !important;
}

body.theme-light .shape-opt-pill {
  color: #64748b !important;
}

body.theme-light .shape-opt-pill:hover {
  color: #0f172a !important;
  background: rgba(15, 23, 42, 0.06) !important;
}

body.theme-light .shape-opt-pill.active {
  background: #4f46e5 !important;
  color: #ffffff !important;
}

body.theme-light .tool-customizer-item {
  background: #ffffff !important;
  border-color: #e2e8f0 !important;
}

body.theme-light .tool-customizer-name {
  color: #0f172a !important;
}

body.theme-light .btn-tool-reorder {
  background: #f1f5f9 !important;
  border-color: #cbd5e1 !important;
  color: #475569 !important;
}

body.theme-light .btn-tool-reorder:hover:not(:disabled) {
  background: #e2e8f0 !important;
  color: #0f172a !important;
}

body.theme-light .edit-tools-notice {
  background: rgba(79, 70, 229, 0.08) !important;
  border-color: rgba(79, 70, 229, 0.22) !important;
  color: #334155 !important;
}

/* 3. Fullscreen Floating Island Docks in White Mode */
body.theme-light .fs-top-center-dock,
body.theme-light .fs-bottom-right-dock {
  background: rgba(255, 255, 255, 0.94) !important;
  border: 1px solid rgba(15, 23, 42, 0.14) !important;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.15), 0 0 24px rgba(79, 70, 229, 0.12) !important;
}

body.theme-light .fs-tool-btn {
  color: #334155 !important;
}

body.theme-light .fs-tool-btn i {
  color: #334155 !important;
}

body.theme-light .fs-tool-btn:hover:not(:disabled):not(.active) {
  background: rgba(15, 23, 42, 0.07) !important;
  color: #0f172a !important;
}

body.theme-light .fs-tool-btn:hover:not(:disabled):not(.active) i {
  color: #0f172a !important;
}

body.theme-light .fs-tool-btn.active {
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%) !important;
  color: #ffffff !important;
  border-color: rgba(255, 255, 255, 0.3) !important;
}

body.theme-light .fs-tool-btn.active i {
  color: #ffffff !important;
}

body.theme-light .fs-caret {
  color: #64748b !important;
}

body.theme-light .fs-tool-btn.active .fs-caret {
  color: rgba(255, 255, 255, 0.8) !important;
}

body.theme-light .fs-divider,
body.theme-light .fs-dock-mini-divider {
  background: rgba(15, 23, 42, 0.12) !important;
}

body.theme-light .fs-zoom-btn {
  color: #334155 !important;
}

body.theme-light .fs-zoom-btn:hover {
  background: rgba(15, 23, 42, 0.07) !important;
  color: #0f172a !important;
}

body.theme-light .fs-zoom-display {
  color: #0f172a !important;
  font-weight: 700 !important;
}

body.theme-light .fs-elements-stat {
  background: rgba(15, 23, 42, 0.06) !important;
  color: #334155 !important;
}

body.theme-light .fs-elements-stat i {
  color: #4f46e5 !important;
}

/* 4. Fullscreen Dropdown Popovers in White Mode */
body.theme-light .fs-dropdown-popover {
  background: rgba(255, 255, 255, 0.98) !important;
  border: 1px solid rgba(15, 23, 42, 0.14) !important;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.18) !important;
}

body.theme-light .fs-dropdown-header,
body.theme-light .fs-popover-title {
  color: #0f172a !important;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08) !important;
}

body.theme-light .fs-style-label {
  color: #475569 !important;
}

body.theme-light .fs-menu-item {
  color: #334155 !important;
}

body.theme-light .fs-menu-item i {
  color: #334155 !important;
}

body.theme-light .fs-menu-item:hover {
  background: #f1f5f9 !important;
  color: #0f172a !important;
}

body.theme-light .fs-menu-item.active {
  background: rgba(79, 70, 229, 0.1) !important;
  color: #4f46e5 !important;
}

body.theme-light .fs-menu-item.active i {
  color: #4f46e5 !important;
}

body.theme-light .fs-size-btn,
body.theme-light .fs-opt-btn {
  background: #f1f5f9 !important;
  border: 1px solid #cbd5e1 !important;
  color: #334155 !important;
}

body.theme-light .fs-size-btn:hover,
body.theme-light .fs-opt-btn:hover {
  background: #e2e8f0 !important;
  color: #0f172a !important;
}

body.theme-light .fs-size-btn.active,
body.theme-light .fs-opt-btn.active {
  background: #4f46e5 !important;
  color: #ffffff !important;
  border-color: #4f46e5 !important;
}

body.theme-light .fs-swatch[data-color="#ffffff"] {
  border: 2px solid #94a3b8 !important;
}

/* 5. Properties Panel in White Mode */
body.theme-light .wb-properties-panel {
  background: rgba(255, 255, 255, 0.96) !important;
  border: 1px solid rgba(15, 23, 42, 0.14) !important;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.14) !important;
}

body.theme-light .wb-properties-panel .prop-header {
  border-bottom: 1px solid rgba(15, 23, 42, 0.08) !important;
}

body.theme-light .wb-properties-panel .prop-title h3 {
  color: #0f172a !important;
}

body.theme-light .wb-properties-panel .prop-icon i {
  color: #4f46e5 !important;
}

body.theme-light .wb-properties-panel .prop-close-btn {
  color: #64748b !important;
}

body.theme-light .wb-properties-panel .prop-close-btn:hover {
  color: #0f172a !important;
}

body.theme-light .wb-properties-panel .prop-section-label {
  color: #475569 !important;
}

body.theme-light .wb-properties-panel .prop-btn-opt,
body.theme-light .wb-properties-panel .size-opt-btn,
body.theme-light .wb-properties-panel .font-size-btn {
  background: #f1f5f9 !important;
  border: 1px solid #e2e8f0 !important;
  color: #334155 !important;
}

body.theme-light .wb-properties-panel .prop-btn-opt:hover,
body.theme-light .wb-properties-panel .size-opt-btn:hover,
body.theme-light .wb-properties-panel .font-size-btn:hover {
  background: #e2e8f0 !important;
  color: #0f172a !important;
}

body.theme-light .wb-properties-panel .prop-btn-opt.active,
body.theme-light .wb-properties-panel .size-opt-btn.active,
body.theme-light .wb-properties-panel .font-size-btn.active {
  background: #4f46e5 !important;
  color: #ffffff !important;
  border-color: #4f46e5 !important;
}

body.theme-light .wb-properties-panel .prop-select {
  background: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  color: #0f172a !important;
}

body.theme-light .wb-properties-panel .color-swatch[data-color="#ffffff"] {
  border: 2px solid #94a3b8 !important;
}

/* 6. Settings Modal Theme Selector Cards */
.theme-selector-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-top: 8px;
}

.theme-choice-card {
  background: var(--bg-card);
  border: 2px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: all var(--transition-normal);
  position: relative;
  text-align: left;
}

.theme-choice-card:hover {
  border-color: rgba(99, 102, 241, 0.45);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.theme-choice-card.active {
  border-color: #6366f1 !important;
  background: rgba(99, 102, 241, 0.12) !important;
  box-shadow: 0 0 20px rgba(99, 102, 241, 0.28) !important;
}

.theme-card-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.theme-choice-dark .theme-card-icon {
  background: #0f172a;
  color: #38bdf8;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.theme-choice-light .theme-card-icon {
  background: #ffffff;
  color: #f59e0b;
  border: 1px solid rgba(0, 0, 0, 0.1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.theme-choice-ganesh .theme-card-icon {
  background: linear-gradient(135deg, #2b1407 0%, #170802 100%);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.4);
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.35);
}

.theme-choice-ganesh:hover {
  border-color: rgba(245, 158, 11, 0.5) !important;
}

.theme-choice-ganesh.active {
  border-color: #f59e0b !important;
  background: rgba(245, 158, 11, 0.14) !important;
  box-shadow: 0 0 22px rgba(245, 158, 11, 0.35) !important;
}

.theme-choice-ganesh.active .theme-active-badge {
  color: #fbbf24;
  background: rgba(245, 158, 11, 0.25);
  border: 1px solid rgba(245, 158, 11, 0.4);
}

.theme-card-info {
  flex: 1;
}

.theme-card-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.theme-card-desc {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

.theme-active-badge {
  display: none;
  font-size: 10px;
  font-weight: 700;
  color: #6366f1;
  background: rgba(99, 102, 241, 0.2);
  padding: 2px 6px;
  border-radius: 9999px;
  margin-left: auto;
}

.theme-choice-card.active .theme-active-badge {
  display: inline-block;
}

/* Modals in White Mode */
body.theme-light .modal-card {
  background: #ffffff !important;
  border: 1px solid rgba(15, 23, 42, 0.14) !important;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.2) !important;
}

body.theme-light .modal-header {
  border-bottom: 1px solid rgba(15, 23, 42, 0.08) !important;
}

body.theme-light .modal-title-wrap h3 {
  color: #0f172a !important;
}

body.theme-light .modal-subtitle {
  color: #64748b !important;
}

body.theme-light .modal-close-btn {
  color: #64748b !important;
}

body.theme-light .modal-close-btn:hover {
  color: #0f172a !important;
  background: #f1f5f9 !important;
}

body.theme-light .setting-option-box {
  background: #f8fafc !important;
  border: 1px solid #e2e8f0 !important;
}

body.theme-light .custom-select {
  background: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  color: #0f172a !important;
}

/* ==========================================================================
   Whiteboard Ganesh Chaturthi Festive Theme Styles
   ========================================================================== */
body.theme-ganesh .wb-navbar {
  background: rgba(26, 14, 7, 0.94) !important;
  border-bottom: 1px solid rgba(245, 158, 11, 0.25) !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5) !important;
}

body.theme-ganesh .wb-navbar .nav-divider {
  background: rgba(245, 158, 11, 0.2) !important;
}

body.theme-ganesh .wb-navbar .tool-btn-nav {
  color: #fed7aa !important;
}

body.theme-ganesh .wb-navbar .tool-btn-nav:hover:not(:disabled) {
  background: rgba(245, 158, 11, 0.15) !important;
  color: #fbbf24 !important;
}

body.theme-ganesh .wb-navbar .zoom-controls-pill,
body.theme-ganesh .wb-navbar .grid-selector-pill {
  background: rgba(42, 22, 11, 0.85) !important;
  border: 1px solid rgba(245, 158, 11, 0.28) !important;
}

body.theme-ganesh .wb-navbar .zoom-btn,
body.theme-ganesh .wb-navbar .zoom-reset-btn {
  color: #fed7aa !important;
}

body.theme-ganesh .wb-navbar .zoom-btn:hover,
body.theme-ganesh .wb-navbar .zoom-reset-btn:hover {
  background: rgba(245, 158, 11, 0.2) !important;
  color: #fbbf24 !important;
}

body.theme-ganesh .wb-navbar .zoom-text {
  color: #fffbeb !important;
}

body.theme-ganesh .wb-navbar .grid-style-btn {
  color: #b48560 !important;
}

body.theme-ganesh .wb-navbar .grid-style-btn:hover {
  color: #fffbeb !important;
}

body.theme-ganesh .wb-navbar .grid-style-btn.active {
  background: rgba(245, 158, 11, 0.25) !important;
  color: #fbbf24 !important;
}

body.theme-ganesh #board-title-input {
  color: #fffbeb !important;
}

body.theme-ganesh #board-title-input:hover,
body.theme-ganesh #board-title-input:focus {
  background: rgba(42, 22, 11, 0.7) !important;
  border-color: #f59e0b !important;
}

body.theme-ganesh .save-status-badge {
  background: rgba(42, 22, 11, 0.7) !important;
  border: 1px solid rgba(245, 158, 11, 0.25) !important;
  color: #fed7aa !important;
}

body.theme-ganesh .elements-count-display {
  color: #b48560 !important;
}

body.theme-ganesh .wb-floating-toolbar {
  background: rgba(28, 15, 8, 0.94) !important;
  border: 1px solid rgba(245, 158, 11, 0.3) !important;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.65), 0 0 25px rgba(245, 158, 11, 0.2) !important;
}

body.theme-ganesh .wb-floating-toolbar .toolbar-separator {
  background: rgba(245, 158, 11, 0.2) !important;
}

body.theme-ganesh .wb-floating-toolbar .tool-btn {
  color: #fed7aa !important;
}

body.theme-ganesh .wb-floating-toolbar .tool-btn:hover:not(.active) {
  background: rgba(245, 158, 11, 0.15) !important;
  color: #fbbf24 !important;
}

body.theme-ganesh .wb-floating-toolbar .tool-btn.active {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.35), rgba(234, 88, 12, 0.35)) !important;
  border-color: rgba(245, 158, 11, 0.6) !important;
  color: #fbbf24 !important;
  box-shadow: 0 0 14px rgba(245, 158, 11, 0.45) !important;
}

body.theme-ganesh .wb-floating-toolbar .tool-btn.active i {
  color: #fbbf24 !important;
}

body.theme-ganesh .toolbar-drag-handle {
  color: #b48560 !important;
}

body.theme-ganesh .toolbar-drag-handle:hover {
  color: #f59e0b !important;
}

body.theme-ganesh .fs-top-center-dock,
body.theme-ganesh .fs-bottom-right-dock {
  background: rgba(28, 15, 8, 0.94) !important;
  border: 1px solid rgba(245, 158, 11, 0.3) !important;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.65) !important;
}

body.theme-ganesh .fs-tool-btn {
  color: #fed7aa !important;
}

body.theme-ganesh .fs-tool-btn:hover:not(:disabled):not(.active) {
  background: rgba(245, 158, 11, 0.15) !important;
  color: #fbbf24 !important;
}

body.theme-ganesh .fs-tool-btn.active {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.35), rgba(234, 88, 12, 0.35)) !important;
  border-color: rgba(245, 158, 11, 0.6) !important;
  color: #fbbf24 !important;
  box-shadow: 0 0 14px rgba(245, 158, 11, 0.45) !important;
}

body.theme-ganesh .fs-divider,
body.theme-ganesh .fs-dock-mini-divider {
  background: rgba(245, 158, 11, 0.2) !important;
}

body.theme-ganesh .wb-properties-panel {
  background: rgba(28, 15, 8, 0.96) !important;
  border: 1px solid rgba(245, 158, 11, 0.28) !important;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.65) !important;
}

body.theme-ganesh .wb-properties-panel .prop-title h3 {
  color: #fffbeb !important;
}

body.theme-ganesh .wb-properties-panel .prop-icon i {
  color: #f59e0b !important;
}

body.theme-ganesh .wb-properties-panel .prop-section-label {
  color: #fed7aa !important;
}

body.theme-ganesh .wb-shapes-palette {
  background: rgba(28, 15, 8, 0.96) !important;
  border: 1px solid rgba(245, 158, 11, 0.28) !important;
}

body.theme-ganesh .palette-header-title {
  color: #fffbeb !important;
}

body.theme-ganesh .shape-opt-pill {
  color: #fed7aa !important;
}

body.theme-ganesh .shape-opt-pill.active {
  background: rgba(245, 158, 11, 0.25) !important;
  color: #fbbf24 !important;
}

/* Modals in Ganesh Chaturthi Festive Mode */
body.theme-ganesh .modal-card {
  background: #1d1007 !important;
  border: 1px solid rgba(245, 158, 11, 0.3) !important;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.8), 0 0 30px rgba(245, 158, 11, 0.15) !important;
}

body.theme-ganesh .modal-header {
  border-bottom: 1px solid rgba(245, 158, 11, 0.2) !important;
}

body.theme-ganesh .modal-title-wrap h3 {
  color: #fffbeb !important;
}

body.theme-ganesh .modal-subtitle {
  color: #fed7aa !important;
}

body.theme-ganesh .modal-close-btn {
  color: #b48560 !important;
}

body.theme-ganesh .modal-close-btn:hover {
  color: #fbbf24 !important;
  background: rgba(245, 158, 11, 0.15) !important;
}

body.theme-ganesh .setting-option-box {
  background: rgba(42, 22, 11, 0.75) !important;
  border: 1px solid rgba(245, 158, 11, 0.22) !important;
}

body.theme-ganesh .custom-select {
  background: #190d06 !important;
  border: 1px solid rgba(245, 158, 11, 0.3) !important;
  color: #fffbeb !important;
}

/* Creative Festive Tool Icon Pulse Glow */
.tool-btn.festive-concept i,
.fs-tool-btn.festive-concept i {
  filter: drop-shadow(0 0 4px rgba(245, 158, 11, 0.4));
  transition: all var(--transition-fast);
}

.tool-btn.festive-concept:hover i,
.fs-tool-btn.festive-concept:hover i {
  filter: drop-shadow(0 0 8px rgba(245, 158, 11, 0.8));
  transform: scale(1.1);
}

/* ==========================================================================
   Professional Clean Scrollable Settings Modal
   ========================================================================== */
.settings-modal-card {
  max-width: 650px !important;
  max-height: 88vh !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
  padding: 0 !important;
}

.settings-modal-card .modal-header {
  padding: 20px 24px 16px 24px !important;
  margin-bottom: 0 !important;
  border-bottom: 1px solid var(--border-subtle) !important;
  flex-shrink: 0 !important;
}

.settings-modal-card .settings-tab-content {
  padding: 16px 24px 20px 24px !important;
  overflow-y: auto !important;
  flex: 1 1 auto !important;
  max-height: calc(88vh - 130px) !important;
  scrollbar-width: thin;
  scrollbar-color: var(--accent-primary) transparent;
}

.settings-modal-card .settings-tab-content::-webkit-scrollbar {
  width: 6px;
}

.settings-modal-card .settings-tab-content::-webkit-scrollbar-track {
  background: transparent;
}

.settings-modal-card .settings-tab-content::-webkit-scrollbar-thumb {
  background: rgba(245, 158, 11, 0.4);
  border-radius: 9999px;
}

body.theme-light .settings-modal-card .settings-tab-content::-webkit-scrollbar-thumb {
  background: rgba(79, 70, 229, 0.35);
}

body.theme-dark .settings-modal-card .settings-tab-content::-webkit-scrollbar-thumb {
  background: rgba(99, 102, 241, 0.35);
}

.settings-modal-card .modal-actions {
  padding: 14px 24px !important;
  border-top: 1px solid var(--border-subtle) !important;
  margin-top: 0 !important;
  flex-shrink: 0 !important;
  background: var(--bg-secondary) !important;
  display: flex !important;
  justify-content: flex-end !important;
}

/* ==========================================================================
   Festive Marigold Garland (Malai / Toran) Container & Canvas
   ========================================================================== */
.festive-garland-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100px;
  pointer-events: none;
  z-index: 95; /* Above canvas, below floating toolbar & modals */
  overflow: visible;
  transition: opacity var(--transition-normal);
}

.festive-garland-container.hidden {
  display: none !important;
}

#festive-garland-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100px;
  pointer-events: auto; /* Allows mouse hover and pulling */
  cursor: grab;
}

#festive-garland-canvas:active {
  cursor: grabbing;
}

