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

:root {
  --bg-app: #1e1e1e;
  --bg-titlebar: #323233;
  --bg-panel: #252526;
  --bg-surface: #2d2d2d;
  --bg-surface-alt: #3c3c3c;
  --bg-sidebar-rail: #333333;
  --bg-hover: #505050;
  --bg-hover-accent: #094771;
  --bg-canvas-overlay: rgba(0, 0, 0, 0.6);
  --border-soft: #3c3c3c;
  --border-strong: #505050;
  --border-deep: #1a1a1a;
  --text-primary: #cccccc;
  --text-muted: #969696;
  --text-strong: #ffffff;
  --text-subtle: #666666;
  --accent: #007acc;
  --accent-strong: #0e639c;
  --accent-strong-hover: #1177bb;
  --accent-text: #4fc1ff;
  --success: #89d185;
  --danger: #f48771;
  --shadow-elevated: rgba(0, 0, 0, 0.5);
  --shadow-soft: rgba(0, 0, 0, 0.4);
}

body[data-theme="light"] {
  --bg-app: #f3f5f8;
  --bg-titlebar: #e6ebf1;
  --bg-panel: #ffffff;
  --bg-surface: #f6f8fb;
  --bg-surface-alt: #e8edf3;
  --bg-sidebar-rail: #edf2f7;
  --bg-hover: #d9e2ec;
  --bg-hover-accent: #dbeafe;
  --bg-canvas-overlay: rgba(255, 255, 255, 0.7);
  --border-soft: #d5dde7;
  --border-strong: #c0cad7;
  --border-deep: #c8d1dc;
  --text-primary: #22303c;
  --text-muted: #5f6f82;
  --text-strong: #0f172a;
  --text-subtle: #7b8794;
  --accent: #2563eb;
  --accent-strong: #1d4ed8;
  --accent-strong-hover: #1e40af;
  --accent-text: #2563eb;
  --success: #1f8f55;
  --danger: #d9485f;
  --shadow-elevated: rgba(15, 23, 42, 0.12);
  --shadow-soft: rgba(15, 23, 42, 0.08);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg-app);
  color: var(--text-primary);
  font-size: 13px;
  height: 100vh;
  display: flex;
  flex-direction: column;
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
}

.titlebar {
  height: 30px;
  background: var(--bg-titlebar);
  display: flex;
  align-items: center;
  padding: 0 10px;
  border-bottom: 1px solid var(--border-deep);
}

.titlebar-title {
  flex: 1;
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
}

.menubar {
  height: 30px;
  background: var(--bg-titlebar);
  display: flex;
  align-items: center;
  padding: 0 8px;
  gap: 2px;
  border-bottom: 1px solid var(--bg-surface-alt);
}

.menu-item {
  padding: 4px 8px;
  font-size: 12.5px;
  cursor: pointer;
  border-radius: 4px;
  user-select: none;
  position: relative;
}

.menu-item:hover,
.menu-item.active {
  background: var(--bg-hover);
  color: var(--text-strong);
}

.menu-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 240px;
  background: var(--bg-panel);
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  box-shadow: 0 4px 16px var(--shadow-elevated);
  padding: 4px 0;
  z-index: 500;
}

.menu-item.active .menu-dropdown {
  display: block;
}

.menu-dropdown-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 12px;
  font-size: 12px;
  color: var(--text-primary);
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  font-family: inherit;
  gap: 16px;
}

.menu-dropdown-item:hover {
  background: var(--bg-hover-accent);
  color: var(--text-strong);
}

.menu-shortcut-label {
  flex: 1;
}

.menu-shortcut {
  font-size: 11px;
  color: var(--text-muted);
  font-family: inherit;
}

.menu-dropdown-item:hover .menu-shortcut {
  color: var(--text-primary);
}

.menu-separator {
  height: 1px;
  background: var(--bg-surface-alt);
  margin: 4px 0;
}

/* Shortcuts modal */
.shortcuts-list {
  display: grid;
  grid-template-rows: repeat(14, auto);
  grid-auto-flow: column;
  gap: 2px 28px;
  max-height: 420px;
  overflow-x: auto;
}

.shortcut-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 4px;
  border-radius: 3px;
  min-width: 250px;
}

.shortcut-row:hover {
  background: var(--bg-surface);
}

.shortcut-desc {
  font-size: 12px;
  color: var(--text-primary);
}

.shortcut-keys {
  font-size: 11px;
  color: var(--text-muted);
  background: var(--bg-surface-alt);
  padding: 2px 8px;
  border-radius: 3px;
  font-family: inherit;
}

.learn-layout {
  display: flex;
  height: 520px;
  overflow: hidden;
}
.learn-sidebar {
  width: 160px;
  min-width: 160px;
  border-right: 1px solid var(--border-subtle);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  padding: 6px 0;
}
.learn-nav-label {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  padding: 12px 14px 6px;
  border-bottom: 1px solid var(--border-subtle);
  margin: 0 8px 4px;
  user-select: none;
}
.learn-nav-label:first-child {
  padding-top: 6px;
  margin-top: 0;
}
.learn-nav-item {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 12px;
  padding: 7px 14px;
  text-align: left;
  cursor: pointer;
  border-left: 2px solid transparent;
}
.learn-nav-item:hover {
  color: var(--text-primary);
  background: var(--bg-surface);
}
.learn-nav-item.active {
  color: var(--text-strong);
  border-left-color: var(--accent-strong);
  background: var(--bg-surface);
}
.learn-content {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
}
.learn-topic {
  display: none;
}
.learn-topic.active {
  display: block;
}
.learn-section {
  margin-bottom: 14px;
}
.learn-section:last-child {
  margin-bottom: 0;
}
.learn-heading {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-strong);
  margin: 0 0 8px 0;
}
.learn-subheading {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 16px 0 6px 0;
}
.learn-text {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.7;
  margin: 0 0 8px 0;
}
.learn-text:last-child {
  margin-bottom: 0;
}
.learn-references {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 4px;
}
.learn-ref-link {
  font-size: 12px;
  color: var(--accent-strong);
  text-decoration: none;
  padding: 5px 10px;
  border-radius: 4px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  transition: background 0.15s, border-color 0.15s;
}
.learn-ref-link:hover {
  background: var(--bg-surface-alt);
  border-color: var(--accent-strong);
}
.learn-img {
  width: 100%;
  max-width: 420px;
  border-radius: 6px;
  border: 1px solid var(--border-subtle);
  margin: 8px 0 12px 0;
  display: block;
}
.learn-img-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 8px 0 12px 0;
}
.learn-img-row .learn-img {
  max-width: 200px;
  margin: 0;
}
.learn-kbd {
  font-size: 11px;
  font-family: var(--font-mono, monospace);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 3px;
  padding: 1px 5px;
  color: var(--text-primary);
}

.layout {
  flex: 1;
  display: flex;
  overflow: hidden;
}

.left-layout {
  display: flex;
}

.activitybar {
  width: 48px;
  background: var(--bg-sidebar-rail);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 4px;
}

.activity-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-subtle);
  position: relative;
}

.activity-icon:hover {
  color: var(--text-primary);
}

.activity-icon.active {
  color: var(--text-strong);
}

.activity-icon.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--text-strong);
}

.activity-icon .codicon {
  font-size: 24px;
}

.sidebar {
  width: 240px;
  background: var(--bg-panel);
  border-right: 1px solid var(--bg-surface-alt);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
}

.sidebar-header {
  flex-shrink: 0;
}

.sidebar-view {
  display: none;
  flex-direction: column;
  overflow: hidden;
  height: 0;
  flex: 1;
}

.sidebar-view.active {
  display: flex;
  height: auto;
}

.sidebar-view .sidebar-content {
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}

.sidebar-header {
  padding: 10px 20px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
}

.sidebar-content {
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}

.sidebar-btn {
  width: 100%;
  padding: 6px 10px;
  background: var(--bg-surface-alt);
  border: 1px solid var(--bg-surface-alt);
  border-radius: 4px;
  color: var(--text-primary);
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  text-align: left;
}

.sidebar-btn:hover {
  background: var(--bg-hover);
  border-color: var(--bg-hover);
}

.sidebar-btn .codicon {
  font-size: 16px;
}

.sidebar-section-group {
  padding: 8px 10px;
}

.section-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.control-buttons {
  display: flex;
  gap: 4px;
}

.control-btn {
  flex: 1;
  height: 28px;
  background: var(--bg-surface-alt);
  border: 1px solid var(--bg-surface-alt);
  border-radius: 4px;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.control-btn:hover {
  background: var(--bg-hover);
  border-color: var(--bg-hover);
}

.control-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

.control-btn .codicon {
  font-size: 16px;
}

.param-group {
  margin-bottom: 12px;
}

.param-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.param-value {
  font-size: 12px;
  color: var(--accent-text);
  font-family: 'Consolas', 'Monaco', monospace;
  font-weight: 600;
  background: rgba(79, 193, 255, 0.08);
  padding: 1px 6px;
  border-radius: 3px;
}

.param-value.editable {
  cursor: text;
}

.param-value.editable:hover {
  background: rgba(79, 193, 255, 0.15);
}

.param-value.hidden {
  display: none;
}

.param-input {
  display: none;
  width: 80px;
  height: 20px;
  background: var(--bg-surface-alt);
  border: 1px solid var(--accent);
  border-radius: 3px;
  color: var(--accent-text);
  font-size: 12px;
  font-family: 'Consolas', 'Monaco', monospace;
  font-weight: 600;
  padding: 0 4px;
  outline: none;
  text-align: right;
}

.param-input.visible {
  display: inline-block;
}

.metrics-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-bottom: 12px;
}

.metric-item {
  background: var(--bg-surface);
  border: 1px solid var(--bg-surface-alt);
  border-radius: 4px;
  padding: 6px 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.metric-label {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.metric-value {
  font-size: 14px;
  color: var(--accent-text);
  font-family: 'Consolas', 'Monaco', monospace;
  font-weight: 600;
}

.chart-container {
  margin-bottom: 12px;
  background: var(--bg-surface);
  border: 1px solid var(--bg-surface-alt);
  border-radius: 4px;
  padding: 8px;
}

.chart-label {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.chart-container canvas {
  width: 100% !important;
  max-height: 100px;
}

.param-select {
  width: 100%;
  height: 26px;
  background: var(--bg-surface-alt);
  border: 1px solid var(--bg-surface-alt);
  border-radius: 4px;
  color: var(--text-primary);
  font-size: 12px;
  font-family: inherit;
  padding: 0 6px;
  cursor: pointer;
  outline: none;
}

.param-select:hover {
  border-color: var(--bg-hover);
}

.param-select:focus {
  border-color: var(--accent);
}

.param-select option {
  background: var(--bg-panel);
  color: var(--text-primary);
}

.param-slider {
  width: 100%;
  height: 4px;
  -webkit-appearance: none;
  appearance: none;
  background: var(--bg-surface-alt);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}

.param-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  background: var(--text-primary);
  border-radius: 50%;
  cursor: pointer;
}

.param-slider::-webkit-slider-thumb:hover {
  background: var(--text-strong);
}

.param-slider::-moz-range-thumb {
  width: 14px;
  height: 14px;
  background: var(--text-primary);
  border: none;
  border-radius: 50%;
  cursor: pointer;
}

.param-slider::-moz-range-thumb:hover {
  background: var(--text-strong);
}

.content {
  flex: 1;
  background: var(--bg-app);
  position: relative;
  overflow: hidden;
}

#network-canvas {
  width: 100%;
  height: 100%;
  display: block;
  cursor: grab;
}

.minimap-container {
  position: absolute;
  bottom: 56px;
  right: 12px;
  width: 180px;
  height: 120px;
  background: var(--border-deep);
  border: 1px solid var(--bg-surface-alt);
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 0 2px 8px var(--shadow-elevated);
  z-index: 10;
  cursor: crosshair;
}

#minimap-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

#network-canvas.panning {
  cursor: grabbing;
}

.canvas-controls {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 2px;
  background: var(--bg-panel);
  border: 1px solid var(--bg-surface-alt);
  border-radius: 6px;
  padding: 4px;
  box-shadow: 0 2px 8px var(--shadow-soft);
}

.canvas-ctrl-btn {
  width: 30px;
  height: 28px;
  background: transparent;
  border: none;
  border-radius: 4px;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.canvas-ctrl-btn:hover {
  background: var(--bg-surface-alt);
}

.canvas-ctrl-btn.active {
  background: var(--bg-hover-accent);
  color: var(--text-strong);
}

.canvas-ctrl-btn .codicon {
  font-size: 16px;
}

.zoom-level {
  font-size: 11px;
  color: var(--text-muted);
  font-family: 'Consolas', 'Monaco', monospace;
  padding: 0 8px;
  min-width: 44px;
  text-align: center;
}

.right-panel {
  width: 280px;
  background: var(--bg-panel);
  border-left: 1px solid var(--bg-surface-alt);
  display: flex;
  flex-direction: column;
  min-width: 150px;
}

.panel-section {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#panel-top {
  flex: 1;
}

#panel-bottom {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.panel-header-btn {
  float: right;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0;
  font-size: 14px;
  line-height: 1;
}

.panel-header-btn:hover {
  color: var(--text-primary);
}

.output-log {
  flex: 1;
  overflow-y: auto;
  padding: 6px 12px;
  font-family: 'Consolas', 'Courier New', monospace;
  font-size: 12px;
  line-height: 1.6;
  color: var(--text-primary);
  user-select: text;
}

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

.output-log .log-info {
  color: var(--accent-text);
}

.output-log .log-warn {
  color: #cca700;
}

.output-log .log-error {
  color: var(--danger);
}

.output-log .log-success {
  color: var(--success);
}

.output-log .log-time {
  color: var(--text-subtle);
  margin-right: 6px;
}

.resize-handle {
  height: 4px;
  background: var(--bg-app);
  cursor: row-resize;
  position: relative;
  flex-shrink: 0;
}

.resize-handle:hover,
.resize-handle.active {
  background: var(--accent);
}

.panel-header {
  padding: 10px 20px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--bg-surface-alt);
  flex-shrink: 0;
}

.panel-content {
  flex: 1;
  overflow-y: auto;
  padding: 0;
}

.props-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 40px 20px;
  color: var(--text-subtle);
  font-size: 12px;
}

.props-empty .codicon {
  font-size: 24px;
  opacity: 0.4;
}

.props-group {
  border-bottom: 1px solid var(--bg-surface);
}

.props-group-header {
  padding: 8px 12px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  background: var(--bg-surface);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  user-select: none;
}

.props-group-header:hover {
  background: var(--bg-surface-alt);
}

.props-group-header .codicon {
  font-size: 10px;
  transition: transform 0.15s;
}

.props-group-body {
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.props-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 24px;
}

.props-label {
  font-size: 11px;
  color: var(--text-muted);
  min-width: 75px;
  flex-shrink: 0;
}

.props-value {
  font-size: 11px;
  color: var(--text-primary);
  font-family: 'Consolas', 'Monaco', monospace;
}

.props-input {
  flex: 1;
  background: var(--bg-surface-alt);
  border: 1px solid var(--border-strong);
  border-radius: 3px;
  color: var(--text-primary);
  font-size: 11px;
  padding: 3px 6px;
  font-family: 'Consolas', 'Monaco', monospace;
  outline: none;
  min-width: 0;
}

.props-input:focus {
  border-color: var(--accent);
}

.props-select {
  flex: 1;
  background: var(--bg-surface-alt);
  border: 1px solid var(--border-strong);
  border-radius: 3px;
  color: var(--text-primary);
  font-size: 11px;
  padding: 3px 4px;
  outline: none;
  min-width: 0;
}

.props-select:focus {
  border-color: var(--accent);
}

.props-color-input {
  width: 28px;
  height: 22px;
  border: 1px solid var(--border-strong);
  border-radius: 3px;
  background: none;
  padding: 0;
  cursor: pointer;
}

.props-color-input::-webkit-color-swatch-wrapper { padding: 1px; }
.props-color-input::-webkit-color-swatch { border: none; border-radius: 2px; }

.props-checkbox {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text-primary);
  cursor: pointer;
}

.props-checkbox input[type="checkbox"] {
  accent-color: var(--accent);
}

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

.props-stat-label { color: var(--text-muted); }
.props-stat-value { color: var(--text-primary); font-family: 'Consolas', 'Monaco', monospace; }

.source-buttons {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.url-input-group {
  display: flex;
  gap: 4px;
  margin-top: 6px;
}

.param-input-inline {
  flex: 1;
  height: 26px;
  background: var(--bg-surface-alt);
  border: 1px solid var(--bg-surface-alt);
  border-radius: 4px;
  color: var(--text-primary);
  font-size: 11px;
  font-family: inherit;
  padding: 0 8px;
  outline: none;
}

.param-input-inline:focus {
  border-color: var(--accent);
}

.control-btn-inline {
  height: 26px;
  padding: 0 12px;
  background: var(--accent-strong);
  border: 1px solid var(--accent-strong);
  border-radius: 4px;
  color: #ffffff;
  font-size: 11px;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
}

.control-btn-inline:hover {
  background: var(--accent-strong-hover);
}

.data-preview {
  max-height: 160px;
  overflow: auto;
  border: 1px solid var(--bg-surface-alt);
  border-radius: 4px;
  margin-bottom: 12px;
}

.preview-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
  font-family: 'Consolas', 'Monaco', monospace;
}

.preview-table th {
  position: sticky;
  top: 0;
  background: var(--bg-surface);
  color: var(--text-muted);
  padding: 4px 8px;
  text-align: left;
  font-weight: 600;
  border-bottom: 1px solid var(--bg-surface-alt);
  white-space: nowrap;
}

.preview-table td {
  padding: 3px 8px;
  color: var(--text-primary);
  border-bottom: 1px solid rgba(60, 60, 60, 0.5);
  white-space: nowrap;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.preview-table tr:hover td {
  background: var(--bg-surface);
}

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

.column-item {
  background: var(--bg-surface);
  border: 1px solid var(--bg-surface-alt);
  border-radius: 4px;
  padding: 8px 10px;
}

.column-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.column-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.column-type {
  font-size: 9px;
  padding: 1px 5px;
  border-radius: 3px;
  background: var(--bg-surface-alt);
  color: var(--text-muted);
  text-transform: uppercase;
}

.column-type.numeric {
  background: rgba(79, 193, 255, 0.15);
  color: var(--accent-text);
}

.column-type.categorical {
  background: rgba(137, 209, 133, 0.15);
  color: var(--success);
}

.column-controls {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.column-toggle {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--text-muted);
  cursor: pointer;
}

.column-toggle input[type="checkbox"] {
  accent-color: var(--accent);
  cursor: pointer;
}

.column-select {
  height: 22px;
  background: var(--bg-surface-alt);
  border: 1px solid var(--bg-surface-alt);
  border-radius: 3px;
  color: var(--text-primary);
  font-size: 10px;
  padding: 0 4px;
  outline: none;
  cursor: pointer;
}

.column-select:focus {
  border-color: var(--accent);
}

.split-controls {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.split-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.split-label {
  font-size: 11px;
  color: var(--text-primary);
  min-width: 70px;
}

.split-value {
  font-size: 11px;
  color: var(--accent-text);
  font-family: 'Consolas', 'Monaco', monospace;
  font-weight: 600;
  min-width: 36px;
  text-align: right;
}

.split-slider {
  flex: 1;
}

.split-options {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 4px;
  padding-top: 6px;
  border-top: 1px solid var(--bg-surface-alt);
}

.split-option {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--text-primary);
  cursor: pointer;
}

.split-option input[type="checkbox"] {
  accent-color: var(--accent);
  cursor: pointer;
}

.param-input-small {
  width: 60px;
  height: 22px;
  background: var(--bg-surface-alt);
  border: 1px solid var(--bg-surface-alt);
  border-radius: 3px;
  color: var(--text-primary);
  font-size: 11px;
  font-family: 'Consolas', 'Monaco', monospace;
  padding: 0 6px;
  outline: none;
}

.param-input-small:focus {
  border-color: var(--accent);
}

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

.stat-item {
  display: flex;
  justify-content: space-between;
  padding: 4px 8px;
  background: var(--bg-surface);
  border-radius: 3px;
  font-size: 11px;
}

.stat-label {
  color: var(--text-muted);
}

.stat-value {
  color: var(--accent-text);
  font-family: 'Consolas', 'Monaco', monospace;
  font-weight: 600;
}

.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--bg-canvas-overlay);
}

.modal-content {
  position: relative;
  background: var(--bg-panel);
  border: 1px solid var(--bg-surface-alt);
  border-radius: 8px;
  min-width: 360px;
  max-width: 480px;
  box-shadow: 0 8px 32px var(--shadow-elevated);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--bg-surface-alt);
}

.modal-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 20px;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}

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

.modal-body {
  padding: 16px;
}

.modal-section {
  margin-bottom: 16px;
}

.modal-section:last-child {
  margin-bottom: 0;
}

.modal-label {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.modal-select {
  width: 100%;
  height: 28px;
  background: var(--bg-surface-alt);
  border: 1px solid var(--bg-surface-alt);
  border-radius: 4px;
  color: var(--text-primary);
  font-size: 12px;
  font-family: inherit;
  padding: 0 8px;
  cursor: pointer;
  outline: none;
}

.modal-select:hover {
  border-color: var(--bg-hover);
}

.modal-select:focus {
  border-color: var(--accent);
}

.modal-select option {
  background: var(--bg-panel);
  color: var(--text-primary);
}

.modal-row {
  display: flex;
  gap: 12px;
}

.modal-field {
  flex: 1;
}

.modal-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-primary);
  cursor: pointer;
}

.modal-checkbox input[type="checkbox"] {
  accent-color: var(--accent);
  cursor: pointer;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid var(--bg-surface-alt);
}

.modal-btn {
  padding: 6px 16px;
  border-radius: 4px;
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  border: 1px solid transparent;
}

.modal-btn-secondary {
  background: var(--bg-surface-alt);
  border-color: var(--bg-surface-alt);
  color: var(--text-primary);
}

.modal-btn-secondary:hover {
  background: var(--bg-hover);
}

.modal-btn-primary {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
  color: #ffffff;
}

.modal-btn-primary:hover {
  background: var(--accent-strong-hover);
}

.modal-input {
  width: 100%;
  height: 32px;
  background: var(--bg-surface-alt);
  border: 1px solid var(--bg-surface-alt);
  border-radius: 4px;
  color: var(--text-primary);
  font-size: 13px;
  font-family: inherit;
  padding: 0 10px;
  outline: none;
  transition: border-color 0.15s;
}

.modal-input:focus {
  border-color: var(--accent);
}

.modal-input::placeholder {
  color: var(--text-subtle);
}

/* Dataset Editor Modal */
.dataset-editor-content {
  min-width: 600px;
  max-width: 800px;
  width: 80vw;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
}

.dataset-editor-body {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 12px 16px !important;
  gap: 10px;
}

.de-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-shrink: 0;
}

.de-toolbar-left {
  display: flex;
  gap: 6px;
}

.de-toolbar-right {
  display: flex;
  align-items: center;
}

.de-info {
  font-size: 11px;
  color: var(--text-muted);
}

.de-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: var(--bg-surface-alt);
  border: 1px solid var(--bg-surface-alt);
  border-radius: 4px;
  color: var(--text-primary);
  font-size: 11px;
  font-family: inherit;
  cursor: pointer;
}

.de-btn:hover {
  background: var(--bg-hover);
}

.de-btn .codicon {
  font-size: 12px;
}

.de-danger {
  color: var(--danger);
}

.de-danger:hover {
  background: #4a2020;
}

.de-primary {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
  color: #ffffff;
}

.de-primary:hover {
  background: var(--accent-strong-hover);
}

.de-table-wrap {
  flex: 1;
  overflow: auto;
  border: 1px solid var(--bg-surface-alt);
  border-radius: 4px;
  min-height: 150px;
  max-height: 45vh;
}

.de-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.de-table th,
.de-table td {
  padding: 0;
  border: 1px solid var(--bg-surface);
  min-width: 80px;
}

.de-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--bg-surface);
}

.de-table th input,
.de-table td input {
  width: 100%;
  padding: 5px 8px;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 12px;
  font-family: 'Consolas', 'Courier New', monospace;
  outline: none;
  box-sizing: border-box;
}

.de-table th input {
  font-weight: 600;
  color: var(--accent-text);
  font-family: inherit;
}

.de-table th input::placeholder,
.de-table td input::placeholder {
  color: var(--text-subtle);
}

.de-table td input:focus,
.de-table th input:focus {
  background: rgba(0, 122, 204, 0.1);
}

.de-table .de-row-num {
  width: 36px;
  min-width: 36px;
  max-width: 36px;
  text-align: center;
  color: var(--text-subtle);
  font-size: 10px;
  background: var(--bg-app);
  padding: 5px 0;
  user-select: none;
}

.de-roles {
  flex-shrink: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.de-role-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: var(--bg-surface);
  border: 1px solid var(--bg-surface-alt);
  border-radius: 4px;
  font-size: 11px;
  color: var(--text-primary);
}

.de-role-item .de-col-name {
  font-weight: 600;
  color: var(--accent-text);
  max-width: 80px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.de-role-item select {
  background: var(--bg-surface-alt);
  border: 1px solid var(--bg-surface-alt);
  border-radius: 3px;
  color: var(--text-primary);
  font-size: 11px;
  padding: 2px 4px;
  outline: none;
  cursor: pointer;
}

.de-role-item select:focus {
  border-color: var(--accent);
}

.de-actions {
  flex-shrink: 0;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* Context Toolbar */

.canvas-tooltip {
  position: absolute;
  pointer-events: none;
  z-index: 200;
  display: none;
  background: var(--bg-app);
  border: 1px solid var(--bg-surface-alt);
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 11px;
  color: var(--text-primary);
  line-height: 1.55;
  box-shadow: 0 4px 16px var(--shadow-elevated);
  max-width: 260px;
  white-space: nowrap;
}

.canvas-tooltip .tt-title {
  font-weight: 600;
  color: var(--text-strong);
  margin-bottom: 3px;
  font-size: 12px;
}

.canvas-tooltip .tt-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.canvas-tooltip .tt-label {
  color: var(--text-muted);
}

.canvas-tooltip .tt-value {
  color: var(--accent-text);
  font-family: 'Consolas', monospace;
}

.canvas-tooltip .tt-value.positive {
  color: var(--success);
}

.canvas-tooltip .tt-value.negative {
  color: var(--danger);
}
.context-toolbar {
  position: absolute;
  z-index: 100;
  pointer-events: auto;
}

.ctx-tool-btn {
  width: 30px;
  height: 30px;
  background: var(--bg-panel);
  border: 1px solid var(--bg-surface-alt);
  border-radius: 6px;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 8px var(--shadow-soft);
  transition: background 0.1s;
}

.ctx-tool-btn:hover {
  background: var(--bg-surface-alt);
  color: var(--text-strong);
}

.ctx-tool-btn .codicon {
  font-size: 16px;
}

.ctx-dropdown {
  position: absolute;
  top: 34px;
  left: 0;
  min-width: 180px;
  background: var(--bg-panel);
  border: 1px solid var(--bg-surface-alt);
  border-radius: 6px;
  box-shadow: 0 4px 16px var(--shadow-elevated);
  padding: 4px 0;
  z-index: 101;
}

.ctx-dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  font-size: 12px;
  color: var(--text-primary);
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  font-family: inherit;
}

.ctx-dropdown-item:hover {
  background: var(--bg-hover-accent);
  color: var(--text-strong);
}

.ctx-dropdown-item .codicon {
  font-size: 14px;
  width: 16px;
  text-align: center;
  color: var(--text-muted);
}

.ctx-dropdown-item:hover .codicon {
  color: var(--text-strong);
}

.ctx-dropdown-separator {
  height: 1px;
  background: var(--bg-surface-alt);
  margin: 4px 0;
}

.ctx-color-row {
  display: flex;
  gap: 4px;
  padding: 6px 12px;
  flex-wrap: wrap;
}

.ctx-color-swatch {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: border-color 0.1s, transform 0.1s;
}

.ctx-color-swatch:hover {
  border-color: var(--text-strong);
  transform: scale(1.15);
}

.ctx-color-swatch.active {
  border-color: var(--text-strong);
}

.ctx-activation-row {
  display: flex;
  gap: 4px;
  padding: 6px 12px;
  flex-wrap: wrap;
}

.ctx-act-pill {
  padding: 3px 8px;
  border-radius: 10px;
  border: 1px solid var(--bg-surface-alt);
  background: var(--bg-surface);
  color: var(--text-primary);
  font-size: 11px;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.1s, border-color 0.1s;
}

.ctx-act-pill:hover {
  background: var(--bg-surface-alt);
  border-color: var(--bg-hover);
}

.ctx-act-pill.active {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
  color: #ffffff;
}

/* Canvas Context Menu */
.canvas-context-menu {
  position: absolute;
  z-index: 200;
  min-width: 200px;
  background: var(--bg-panel);
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  box-shadow: 0 4px 16px var(--shadow-elevated);
  padding: 4px 0;
  pointer-events: auto;
}

.ctxmenu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 20px 6px 12px;
  font-size: 12px;
  color: var(--text-primary);
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  font-family: inherit;
  white-space: nowrap;
}

.ctxmenu-item:hover {
  background: var(--bg-hover-accent);
  color: var(--text-strong);
}

.ctxmenu-item .codicon {
  font-size: 14px;
  width: 16px;
  text-align: center;
  color: var(--text-muted);
}

.ctxmenu-item:hover .codicon {
  color: var(--text-strong);
}

.ctxmenu-item.danger {
  color: var(--danger);
}

.ctxmenu-item.danger .codicon {
  color: var(--danger);
}

.ctxmenu-item.danger:hover {
  background: #5a1d1d;
  color: var(--danger);
}

.ctxmenu-item.disabled {
  color: var(--text-subtle);
  cursor: default;
  pointer-events: none;
}

.ctxmenu-item.disabled .codicon {
  color: var(--text-subtle);
}

.ctxmenu-separator {
  height: 1px;
  background: var(--bg-surface-alt);
  margin: 4px 0;
}

.ctxmenu-label {
  padding: 4px 12px 2px;
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* --- Predict Panel --- */
.predict-inputs {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.predict-empty {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-subtle);
  font-size: 12px;
  padding: 12px 0;
}

.predict-empty .codicon {
  font-size: 14px;
}

.predict-input-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.predict-input-label {
  font-size: 12px;
  color: var(--text-primary);
  min-width: 70px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex-shrink: 0;
}

.predict-input-field {
  flex: 1;
  height: 26px;
  background: var(--bg-surface-alt);
  border: 1px solid var(--bg-surface-alt);
  border-radius: 4px;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 13px;
  padding: 0 8px;
  outline: none;
  min-width: 0;
}

.predict-input-field:focus {
  border-color: var(--accent);
}

.predict-sample-row {
  margin-top: 6px;
}

.predict-run-btn {
  background: var(--accent-strong) !important;
  border-color: var(--accent-strong) !important;
  color: #ffffff !important;
  justify-content: center;
  font-weight: 500;
}

.predict-run-btn:hover {
  background: var(--accent-strong-hover) !important;
  border-color: var(--accent-strong-hover) !important;
}

.predict-run-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

.predict-checkbox-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-primary);
  margin-top: 8px;
  cursor: pointer;
}

.predict-checkbox-label input[type="checkbox"] {
  accent-color: var(--accent);
}

.predict-outputs {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.predict-output-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.predict-output-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
}

.predict-output-name {
  color: var(--text-primary);
}

.predict-output-val {
  color: var(--accent-text);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.predict-output-bar-bg {
  height: 6px;
  background: var(--bg-surface-alt);
  border-radius: 3px;
  overflow: hidden;
}

.predict-output-bar {
  height: 100%;
  border-radius: 3px;
  background: var(--accent-strong);
  transition: width 0.4s ease;
}

.predict-output-bar.highlight {
  background: var(--accent-text);
}

.predict-expected .predict-output-val {
  color: var(--success);
}

.predict-expected .predict-output-bar {
  background: var(--success);
}

.predict-expected .predict-output-bar.highlight {
  background: var(--success);
}

.predict-match-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  margin-top: 4px;
}

.predict-match-badge.correct {
  background: rgba(137, 209, 133, 0.15);
  color: var(--success);
}

.predict-match-badge.wrong {
  background: rgba(244, 135, 113, 0.15);
  color: var(--danger);
}

.decision-boundary-frame {
  margin-top: 4px;
  border: 1px solid var(--bg-surface-alt);
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg-app);
}

.decision-boundary-frame canvas {
  display: block;
  width: 100%;
  height: 220px;
}

.decision-boundary-note {
  margin-top: 8px;
  font-size: 11px;
  line-height: 1.5;
  color: var(--text-muted);
}
