/* Modern Minimalist Clean UI for Web ngspice */
:root {
  --primary: #0f766e;
  --primary-hover: #115e59;
  --primary-light: #ccfbf1;
  --bg-app: #f8fafc;
  --bg-canvas: #ffffff;
  --bg-card: #ffffff;
  --border-color: #e2e8f0;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-sub: #94a3b8;
  --danger: #ef4444;
  --danger-hover: #dc2626;
  --accent-blue: #2563eb;
  --accent-amber: #d97706;
  
  --scope-bg: #090d16;
  --scope-grid: #1e293b;
  --scope-text: #94a3b8;
  --ch1-color: #facc15;
  --ch2-color: #38bdf8;
  --ch3-color: #4ade80;
  --ch4-color: #f472b6;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background-color: var(--bg-app);
  color: var(--text-main);
  height: 100vh;
  overflow: hidden;
  user-select: none;
}

.app-layout {
  display: flex;
  flex-direction: column;
  height: 100vh;
  width: 100vw;
  position: relative;
}

/* Header */
.app-header {
  height: 52px;
  background: #ffffff;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  z-index: 20;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-icon {
  width: 30px;
  height: 30px;
}

.brand-name {
  font-size: 16px;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: -0.2px;
  display: block;
  line-height: 1.1;
}

.brand-sub {
  font-size: 11px;
  color: var(--text-muted);
  display: block;
}

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

.action-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 12px;
  font-size: 13px;
  font-weight: 500;
  border-radius: 6px;
  border: 1px solid var(--border-color);
  background: #ffffff;
  color: #334155;
  cursor: pointer;
  transition: all 0.15s ease;
}

.action-btn:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #0f172a;
}

.action-btn .btn-icon {
  width: 15px;
  height: 15px;
}

.btn-primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(15, 118, 110, 0.2);
}

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

.btn-help-pill {
  background: #fef3c7;
  border-color: #fde68a;
  color: #92400e;
  font-weight: 600;
  padding: 0 12px;
  gap: 8px;
}

.btn-help-pill:hover {
  background: #fde68a;
  border-color: #fcd34d;
  color: #78350f;
}

.help-bulb {
  font-size: 14px;
}

.help-badge {
  font-size: 10px;
  background: #dc2626;
  color: #ffffff;
  padding: 1px 6px;
  border-radius: 10px;
  font-weight: 700;
}

/* Dropdown Menu */
.dropdown-wrapper {
  position: relative;
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 4px;
  background: #ffffff;
  border: 1px solid var(--border-color);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  border-radius: 8px;
  width: 280px;
  padding: 6px;
  display: none;
  z-index: 50;
}

.dropdown-menu.show {
  display: block;
}

.dropdown-item {
  padding: 8px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.12s;
}

.dropdown-item:hover {
  background: #f8fafc;
}

.dropdown-item strong {
  display: block;
  font-size: 13px;
  color: #1e293b;
  margin-bottom: 2px;
}

.dropdown-item small {
  display: block;
  font-size: 11px;
  color: #64748b;
}

/* Main Workspace Split */
.workspace-body {
  display: flex;
  flex: 1;
  overflow: hidden;
  position: relative;
}

/* Left Palette */
.component-palette {
  width: 170px;
  background: #ffffff;
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  z-index: 10;
}

.palette-header {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  font-weight: 700;
  color: #334155;
  background: #f8fafc;
}

.palette-header small {
  font-size: 10px;
  font-weight: normal;
  color: var(--primary);
  background: var(--primary-light);
  padding: 1px 5px;
  border-radius: 4px;
}

.palette-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 10px 8px;
}

.palette-group-title {
  font-size: 11px;
  font-weight: 700;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 10px 4px 6px;
}

.palette-group-title:first-child {
  margin-top: 2px;
}

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

.palette-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 6px 4px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.palette-item:hover {
  background: #f8fafc;
  border-color: var(--primary);
  box-shadow: 0 2px 4px rgba(15, 118, 110, 0.08);
}

.palette-item.active {
  background: var(--primary-light);
  border-color: var(--primary);
}

.sym-svg {
  width: 44px;
  height: 26px;
  display: block;
}

.palette-item span {
  font-size: 11px;
  font-weight: 500;
  color: #475569;
  margin-top: 3px;
  text-align: center;
}

.palette-item.item-probe {
  grid-column: span 2;
  border-color: #bae6fd;
  background: #f0f9ff;
}

.palette-item.item-probe:hover {
  border-color: #0284c7;
  background: #e0f2fe;
}

/* Center Schematic Canvas */
.schematic-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--bg-canvas);
  position: relative;
  overflow: hidden;
}

.canvas-infobar {
  height: 30px;
  background: #f8fafc;
  border-bottom: 1px solid #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  font-size: 12px;
  color: #475569;
}

.info-tip strong {
  color: var(--primary);
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: #10b981;
  font-weight: 600;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
}

.status-indicator.busy .status-dot {
  background: #f59e0b;
  animation: pulse 1s infinite;
}

.status-indicator.busy {
  color: #f59e0b;
}

.status-indicator.error .status-dot {
  background: #ef4444;
}

.status-indicator.error {
  color: #ef4444;
}

@keyframes pulse {
  0% { transform: scale(0.9); opacity: 0.8; }
  50% { transform: scale(1.3); opacity: 1; }
  100% { transform: scale(0.9); opacity: 0.8; }
}

.canvas-container {
  flex: 1;
  position: relative;
  overflow: hidden;
  cursor: crosshair;
}

/* Floating Zoom & Fit Controls */
.canvas-zoom-controls {
  position: absolute;
  left: 16px;
  bottom: 16px;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  display: flex;
  align-items: center;
  padding: 3px;
  gap: 4px;
  z-index: 20;
  backdrop-filter: blur(4px);
}

.zoom-btn {
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  color: #334155;
  border-radius: 4px;
  height: 26px;
  padding: 0 8px;
  font-size: 11px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.zoom-btn:hover {
  background: #f1f5f9;
  border-color: var(--primary);
  color: var(--primary);
}

.zoom-btn.btn-fit {
  font-weight: 600;
  background: var(--primary-light);
  color: var(--primary);
  border-color: var(--primary);
}

.zoom-badge {
  font-size: 11px;
  font-family: monospace;
  font-weight: 600;
  color: #64748b;
  padding: 0 6px;
}

.schematic-svg {
  display: block;
}

/* Component Node Cursor Styles (Grab & Grabbing Hand) */
.comp-node {
  cursor: grab;
  user-select: none;
  transition: filter 0.15s ease;
}

.comp-node:hover {
  filter: drop-shadow(0 0 3px rgba(15, 118, 110, 0.45));
}

.comp-node.selected {
  filter: drop-shadow(0 0 5px #0f766e);
}

.comp-node.multi-selected {
  filter: drop-shadow(0 0 6px #f59e0b) !important;
}

.wire-line.multi-selected {
  stroke: #f59e0b !important;
  stroke-width: 3.5px !important;
  filter: drop-shadow(0 0 5px rgba(245, 158, 11, 0.7)) !important;
}

/* Multi-Selection Marquee & Floating Delete Bar */
.multi-select-menu {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  background: #0f172a;
  color: #f8fafc;
  border: 1px solid #334155;
  border-radius: 8px;
  padding: 6px 14px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  z-index: 45;
  font-size: 12px;
  font-weight: 600;
  animation: modalSlide 0.15s ease;
}

.btn-del-multi {
  background: #dc2626;
  color: #ffffff;
  border: none;
  border-radius: 5px;
  padding: 4px 12px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease;
}

.btn-del-multi:hover {
  background: #b91c1c;
}

.btn-copy-multi {
  background: #0d9488;
  color: #ffffff;
  border: none;
  border-radius: 5px;
  padding: 4px 12px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease;
}

.btn-copy-multi:hover {
  background: #0f766e;
}

.btn-close-multi {
  background: transparent;
  color: #94a3b8;
  border: 1px solid #475569;
  border-radius: 5px;
  padding: 3px 8px;
  font-size: 11px;
  cursor: pointer;
}

.btn-close-multi:hover {
  color: #ffffff;
  background: #334155;
}

.btn-action-tool {
  height: 28px;
  background: #f1f5f9;
  color: #334155;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  padding: 0 7px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.btn-action-tool:hover {
  background: #e2e8f0;
  color: #0f172a;
  border-color: #94a3b8;
}

/* Grabbing hand while dragging component */
body.is-dragging-comp,
body.is-dragging-comp * {
  cursor: grabbing !important;
  user-select: none !important;
}

/* Ghost Component attached to mouse */
#ghostLayer {
  filter: drop-shadow(0 4px 10px rgba(15, 118, 110, 0.4));
  pointer-events: none;
}

/* Component Action Menu (Rotate, Del) */
.comp-action-menu {
  position: absolute;
  background: #1e293b;
  border-radius: 6px;
  padding: 3px;
  display: flex;
  gap: 4px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 30;
  transform: translate(-50%, -100%);
  margin-top: -8px;
}

.comp-action-menu button {
  background: transparent;
  border: none;
  color: #f8fafc;
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 4px;
  cursor: pointer;
}

.comp-action-menu button:hover {
  background: #334155;
}

.comp-action-menu button.btn-del:hover {
  background: #dc2626;
}

/* Parameter Edit Popover */
.param-popover {
  position: absolute;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 10px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
  z-index: 35;
  width: 220px;
}

.popover-title {
  font-size: 12px;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 6px;
}

.param-input {
  width: 100%;
  height: 32px;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  padding: 0 8px;
  font-size: 13px;
  font-family: monospace;
  font-weight: 600;
  outline: none;
}

.param-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(15, 118, 110, 0.15);
}

.popover-actions {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}

.btn-save {
  flex: 1;
  height: 28px;
  background: var(--primary);
  color: #ffffff;
  border: none;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.btn-cancel {
  height: 28px;
  background: #f1f5f9;
  color: #475569;
  border: none;
  border-radius: 4px;
  padding: 0 10px;
  font-size: 12px;
  cursor: pointer;
}

.popover-hint {
  display: block;
  font-size: 10px;
  color: #94a3b8;
  margin-top: 6px;
}

/* Netlist Code Drawer */
.netlist-drawer {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 440px;
  background: #ffffff;
  border-left: 1px solid var(--border-color);
  box-shadow: -4px 0 20px rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
  z-index: 40;
}

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

.drawer-header h3 {
  font-size: 14px;
  color: #0f172a;
}

.drawer-close {
  background: none;
  border: none;
  font-size: 16px;
  color: #94a3b8;
  cursor: pointer;
}

.drawer-body {
  flex: 1;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.drawer-desc {
  font-size: 12px;
  color: #64748b;
  margin-bottom: 10px;
}

.netlist-textarea {
  flex: 1;
  background: #0f172a;
  color: #38bdf8;
  font-family: monospace;
  font-size: 12px;
  line-height: 1.5;
  border-radius: 6px;
  border: 1px solid #334155;
  padding: 10px;
  resize: none;
  outline: none;
}

.drawer-footer {
  margin-top: 12px;
}

/* Oscilloscope Panel (LTspice style: Floating, Resizable & Multi-Pane) */
.oscilloscope-panel {
  background: var(--scope-bg);
  display: flex;
  flex-direction: column;
  z-index: 50;
  transition: opacity 0.15s ease;
}

.oscilloscope-panel.floating {
  position: fixed !important;
  right: 24px;
  bottom: 24px;
  width: 760px;
  height: 440px;
  min-width: 380px;
  min-height: 220px;
  border-radius: 10px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.1);
  resize: both;
  overflow: hidden;
  border: 1px solid #334155;
  z-index: 85;
}

.oscilloscope-panel.popped-out {
  position: absolute !important;
  left: 0 !important;
  top: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  max-width: none !important;
  max-height: none !important;
  border-radius: 0 !important;
  border: none !important;
  box-shadow: none !important;
  resize: none !important;
  margin: 0 !important;
  z-index: 10 !important;
}

.oscilloscope-panel.popped-out .scope-resize-handle,
.oscilloscope-panel.popped-out #btnScopeDockToggle,
.oscilloscope-panel.popped-out #btnScopeMaximize,
.oscilloscope-panel.popped-out #btnToggleScope {
  display: none !important;
}

.oscilloscope-panel.docked {
  position: static;
  width: 100%;
  height: 300px;
  min-height: 180px;
  border-radius: 0;
  border-top: 2px solid #1e293b;
  resize: vertical;
}

.oscilloscope-panel.maximized {
  position: absolute !important;
  top: 56px !important;
  left: 170px !important;
  right: 0 !important;
  bottom: 0 !important;
  width: auto !important;
  height: auto !important;
  border-radius: 0 !important;
  z-index: 60 !important;
  resize: none !important;
}

.oscilloscope-panel.collapsed {
  height: 38px !important;
  min-height: 38px !important;
  overflow: hidden !important;
  resize: none !important;
}

.oscilloscope-panel.collapsed .scope-body,
.oscilloscope-panel.collapsed .scope-resize-handle {
  display: none !important;
}

.scope-header {
  height: 38px;
  background: #0b1120;
  border-bottom: 1px solid #1e293b;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  cursor: move;
  user-select: none;
  flex-shrink: 0;
}

.scope-drag-grip {
  cursor: grab;
  color: #64748b;
  font-size: 14px;
  letter-spacing: -2px;
  padding: 0 4px;
}

.scope-title-area {
  display: flex;
  align-items: center;
  gap: 8px;
}

.scope-brand {
  font-size: 12px;
  font-weight: 700;
  color: #f8fafc;
}

.scope-badge {
  font-size: 10px;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.12);
  padding: 1px 6px;
  border-radius: 4px;
  border: 1px solid rgba(56, 189, 248, 0.25);
}

.scope-tools {
  display: flex;
  align-items: center;
  gap: 8px;
}

.scope-readout {
  font-size: 11px;
  color: #94a3b8;
  font-family: monospace;
  max-width: 260px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.scope-body {
  flex: 1;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* Multi-Pane Panes Track */
.panes-header-bar {
  display: flex;
  flex-direction: column;
  background: #090e17;
  border-bottom: 1px solid #1e293b;
  flex-shrink: 0;
}

.pane-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 3px 10px;
  border-bottom: 1px solid rgba(30, 41, 59, 0.7);
  background: rgba(15, 23, 42, 0.6);
  min-height: 28px;
  transition: background 0.15s ease;
}

.pane-strip.drag-over {
  background: rgba(2, 132, 199, 0.25) !important;
  outline: 1px dashed #38bdf8;
}

.pane-info {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
}

.pane-title {
  font-size: 10px;
  font-weight: 700;
  color: #94a3b8;
  text-transform: uppercase;
  background: #1e293b;
  padding: 1px 5px;
  border-radius: 3px;
}

.pane-traces {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}

.pane-empty-hint {
  font-size: 10px;
  color: #64748b;
  font-style: italic;
}

.btn-del-pane {
  background: none;
  border: none;
  color: #64748b;
  font-size: 11px;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 3px;
  margin-left: 8px;
}

.btn-del-pane:hover {
  background: #dc2626;
  color: #ffffff;
}

.trace-pill {
  font-size: 11px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #1e293b;
  padding: 2px 8px;
  border-radius: 4px;
  cursor: grab;
  user-select: none;
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.trace-pill:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.trace-pill:active {
  cursor: grabbing;
}

.trace-pill.dragging {
  opacity: 0.4;
}

.trace-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.scope-resize-handle {
  position: absolute;
  right: 2px;
  bottom: 2px;
  width: 14px;
  height: 14px;
  cursor: se-resize;
  background: linear-gradient(135deg, transparent 50%, #64748b 50%, #64748b 65%, transparent 65%, transparent 80%, #64748b 80%);
  z-index: 10;
}

.btn-highlight {
  background: #0f766e !important;
  color: #ffffff !important;
  border-color: #14b8a6 !important;
}

.btn-highlight:hover {
  background: #115e59 !important;
}

.scope-btn {
  background: #1e293b;
  color: #cbd5e1;
  border: 1px solid #334155;
  font-size: 11px;
  padding: 3px 9px;
  border-radius: 4px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 500;
  transition: all 0.15s ease;
}

.scope-btn:hover {
  background: #334155;
  color: #ffffff;
}

.scope-btn.btn-popout {
  background: #0369a1;
  color: #f0f9ff;
  border-color: #0284c7;
  font-weight: 600;
}

.scope-btn.btn-popout:hover {
  background: #0284c7;
  border-color: #38bdf8;
  color: #ffffff;
}

.scope-btn.btn-popout.is-popped {
  background: #0d9488;
  border-color: #14b8a6;
  color: #ffffff;
}

.scope-btn.btn-popout.is-popped:hover {
  background: #0f766e;
  border-color: #2dd4bf;
}

/* Cross-screen Pop-out Placeholder in Main Window */
.scope-popout-placeholder {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 360px;
  padding: 16px 18px;
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(8px);
  border: 1px dashed #0284c7;
  border-radius: 10px;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.5);
  z-index: 70;
  color: #f8fafc;
  animation: fadeIn 0.2s ease;
}

.popout-placeholder-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.popout-placeholder-header {
  display: flex;
  align-items: center;
  gap: 8px;
}

.popout-placeholder-icon {
  font-size: 18px;
  color: #38bdf8;
}

.popout-placeholder-title {
  font-size: 13px;
  font-weight: 700;
  color: #38bdf8;
}

.popout-placeholder-desc {
  font-size: 11px;
  color: #94a3b8;
  line-height: 1.5;
  margin: 0;
}

.popout-placeholder-actions {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}

body.is-dragging-scope {
  user-select: none !important;
}

body.is-dragging-scope svg,
body.is-dragging-scope iframe,
body.is-dragging-scope canvas {
  pointer-events: none !important;
}

.scope-btn:hover {
  background: #334155;
  color: #ffffff;
}

.scope-body {
  flex: 1;
  position: relative;
  overflow: hidden;
}

.scope-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

/* Online Help Drawer */
.help-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 420px;
  background: #ffffff;
  box-shadow: -10px 0 30px rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
  z-index: 100;
  animation: slideIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideIn {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}

.help-drawer-header {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #f8fafc;
}

.help-title-line {
  display: flex;
  align-items: center;
  gap: 8px;
}

.help-title-icon {
  font-size: 18px;
}

.help-drawer-header h3 {
  font-size: 15px;
  color: #0f172a;
}

.help-close-btn {
  background: none;
  border: none;
  font-size: 18px;
  color: #94a3b8;
  cursor: pointer;
}

.help-close-btn:hover {
  color: #334155;
}

.help-tabs {
  display: flex;
  background: #f1f5f9;
  border-bottom: 1px solid var(--border-color);
  padding: 0 8px;
}

.help-tab {
  flex: 1;
  padding: 8px 4px;
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
  border: none;
  background: transparent;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.15s;
}

.help-tab:hover {
  color: #0f172a;
}

.help-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.help-drawer-content {
  flex: 1;
  overflow-y: auto;
  padding: 16px 18px;
}

.tab-pane {
  display: none;
}

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

.tab-pane h4 {
  font-size: 13px;
  color: #0f172a;
  margin-bottom: 10px;
  margin-top: 14px;
}

.tab-pane h4:first-child {
  margin-top: 0;
}

.help-steps {
  padding-left: 18px;
  font-size: 12px;
  line-height: 1.6;
  color: #334155;
}

.help-steps li {
  margin-bottom: 10px;
}

.help-alert {
  display: block;
  background: #fef2f2;
  border-left: 3px solid #ef4444;
  color: #991b1b;
  padding: 4px 8px;
  margin-top: 4px;
  border-radius: 0 4px 4px 0;
  font-size: 11px;
}

.help-shortcuts {
  list-style: none;
  font-size: 12px;
  color: #334155;
  line-height: 1.8;
}

kbd {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  padding: 1px 5px;
  font-size: 11px;
  font-family: monospace;
}

/* Template Cards */
.template-cards {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 8px;
}

.template-card {
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 10px 12px;
  background: #f8fafc;
  transition: all 0.15s;
}

.template-card:hover {
  border-color: var(--primary);
  background: #ffffff;
  box-shadow: 0 2px 6px rgba(15, 118, 110, 0.08);
}

.tc-title {
  font-size: 13px;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 4px;
}

.tc-desc {
  font-size: 11px;
  color: #64748b;
  line-height: 1.4;
  margin-bottom: 8px;
}

.tc-btn {
  background: var(--primary);
  color: #ffffff;
  border: none;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 4px;
  cursor: pointer;
}

/* FAQ */
.faq-item {
  margin-bottom: 12px;
  border-bottom: 1px dashed #e2e8f0;
  padding-bottom: 10px;
}

.faq-q {
  font-size: 12px;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 4px;
}

.faq-a {
  font-size: 12px;
  color: #475569;
  line-height: 1.5;
}

.code-box {
  background: #0f172a;
  color: #38bdf8;
  font-family: monospace;
  font-size: 11px;
  padding: 10px;
  border-radius: 6px;
  line-height: 1.5;
  overflow-x: auto;
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.3);
  z-index: 90;
}

/* ==========================================
   Simulation Settings Pill & Badge
   ========================================== */
.btn-sim-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #f8fafc;
  border-color: #cbd5e1;
}

.btn-sim-pill:hover {
  background: #f1f5f9;
  border-color: var(--primary);
}

.sim-badge {
  background: #0f172a;
  color: #38bdf8;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 4px;
  border: 1px solid #334155;
  font-weight: 600;
}

/* ==========================================
   Wire Selection, Routing & Net Labels
   ========================================== */
.wire-line {
  transition: stroke 0.15s ease, stroke-width 0.15s ease;
  cursor: grab;
}

.wire-line:hover {
  stroke: #38bdf8;
  stroke-width: 3.5px;
  cursor: grab;
}

.wire-line.selected {
  stroke: #f59e0b !important;
  stroke-width: 3.6px !important;
  filter: drop-shadow(0 0 5px rgba(245, 158, 11, 0.65));
}

.wire-hitbox {
  cursor: grab;
}

.wire-hitbox:active {
  cursor: grabbing;
}

body.is-dragging-wire,
body.is-dragging-wire * {
  cursor: grabbing !important;
  user-select: none !important;
}

body.is-wiring,
body.is-wiring * {
  cursor: crosshair !important;
}

.wire-junction-dot {
  pointer-events: none;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3));
}

/* Circled Port Node (Auto-created on mid-air double click, auto-disappears on reconnect) */
.circled-port-node {
  cursor: crosshair;
  transition: transform 0.15s ease;
}

.circled-port-node:hover .port-outer-ring {
  stroke: #f59e0b !important;
  fill: #fef3c7 !important;
  stroke-width: 2.6px !important;
  r: 8.5px !important;
}

.port-outer-ring {
  transition: all 0.15s ease;
}

.port-hotspot {
  cursor: crosshair;
}

.wire-drag-handle {
  cursor: grab;
  transition: r 0.15s ease, fill 0.15s ease;
}

.wire-drag-handle:hover {
  r: 8.5px;
  fill: #f59e0b;
  cursor: grab;
}

.wire-action-menu {
  position: absolute;
  background: #1e293b;
  border-radius: 6px;
  padding: 3px 4px;
  display: flex;
  gap: 4px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
  z-index: 32;
  transform: translate(-50%, -100%);
  margin-top: -8px;
}

.wire-action-menu button {
  background: transparent;
  border: none;
  color: #f8fafc;
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 3px;
}

.wire-action-menu button:hover {
  background: #334155;
}

.wire-action-menu button.btn-del:hover {
  background: #dc2626;
}

.net-label-tag {
  cursor: grab;
  user-select: none;
  transition: filter 0.15s ease;
}

.net-label-tag:hover {
  filter: drop-shadow(0 0 6px rgba(16, 185, 129, 0.9)) brightness(1.15);
  cursor: grab;
}

.net-label-tag:active,
body.is-dragging-wire-label,
body.is-dragging-wire-label * {
  cursor: grabbing !important;
}

.comp-text-labels {
  cursor: grab;
  user-select: none;
  transition: filter 0.15s ease;
}

.comp-text-labels:hover {
  filter: drop-shadow(0 0 5px rgba(2, 132, 199, 0.9));
  cursor: grab;
}

.comp-text-labels:active,
body.is-dragging-comp-text,
body.is-dragging-comp-text * {
  cursor: grabbing !important;
}

/* ==========================================
   Modern Component Property Dialog
   ========================================== */
.modern-property-dialog {
  position: absolute;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  padding: 14px 16px;
  box-shadow: 0 16px 36px -4px rgba(15, 23, 42, 0.22), 0 6px 16px -2px rgba(15, 23, 42, 0.1);
  z-index: 50;
  width: 330px;
  max-width: 90vw;
  box-sizing: border-box;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  animation: propFadeIn 0.12s ease-out;
}

@keyframes propFadeIn {
  from { opacity: 0; transform: translateY(-5px); }
  to { opacity: 1; transform: translateY(0); }
}

.popover-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #f1f5f9;
  padding-bottom: 8px;
  margin-bottom: 10px;
}

.popover-header-info {
  display: flex;
  align-items: center;
  gap: 8px;
}

.comp-type-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  color: #0f766e;
  background: #ccfbf1;
  padding: 2px 7px;
  border-radius: 4px;
  border: 1px solid #99f6e4;
}

.popover-title {
  font-size: 13px;
  font-weight: 700;
  color: #0f172a;
}

.popover-close-btn {
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 16px;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
  border-radius: 4px;
  transition: all 0.15s ease;
}

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

.prop-form-group {
  margin-bottom: 10px;
}

.prop-row-split {
  display: flex;
  gap: 8px;
}

.prop-field-half {
  flex: 1;
}

.prop-field-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: #475569;
  margin-bottom: 4px;
}

.param-input-sm {
  width: 100%;
  height: 28px;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  padding: 0 8px;
  font-size: 12px;
  font-weight: 600;
  color: #0f172a;
  outline: none;
  box-sizing: border-box;
}

.param-input-sm.readonly {
  background: #f8fafc;
  color: #64748b;
  border-color: #e2e8f0;
  cursor: default;
}

.param-input-sm:focus:not(.readonly) {
  border-color: #0f766e;
  box-shadow: 0 0 0 2px rgba(15, 118, 110, 0.15);
}

.param-input {
  width: 100%;
  height: 34px;
  border: 1.5px solid #cbd5e1;
  border-radius: 6px;
  padding: 0 10px;
  font-size: 13px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-weight: 600;
  color: #0f172a;
  outline: none;
  box-sizing: border-box;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.param-input:focus {
  border-color: #0f766e;
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.15);
}

.quick-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 6px;
}

.preset-chip {
  font-size: 11px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, monospace;
  font-weight: 600;
  color: #334155;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  padding: 2px 7px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.preset-chip:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #0f766e;
}

.preset-chip:active {
  background: #0f766e;
  color: #ffffff;
  border-color: #0f766e;
}

.param-unit-helper {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  font-size: 10px;
  color: #64748b;
  margin-top: 6px;
  line-height: 1.3;
}

.unit-helper-title {
  color: #94a3b8;
  font-size: 10px;
  margin-right: 2px;
}

.unit-btn {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: 3px;
  padding: 1px 6px;
  font-size: 10px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, monospace;
  font-weight: 700;
  color: #0f766e;
  cursor: pointer;
  transition: all 0.12s ease;
  line-height: 1.4;
}

.unit-btn:hover {
  background: #ccfbf1;
  border-color: #0f766e;
  color: #0f766e;
}

.unit-btn:active {
  background: #0f766e;
  color: #ffffff;
}

.prop-orient-group {
  border-top: 1px dashed #e2e8f0;
  padding-top: 8px;
  margin-top: 8px;
}

.orient-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.btn-orient-tool {
  height: 28px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 600;
  color: #475569;
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.btn-orient-tool:hover {
  background: #f1f5f9;
  color: #0f172a;
  border-color: #cbd5e1;
}

.popover-actions-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid #f1f5f9;
  padding-top: 10px;
  margin-top: 10px;
}

.action-btn-right {
  display: flex;
  gap: 6px;
}

.btn-primary {
  height: 30px;
  background: #0f766e;
  color: #ffffff;
  border: none;
  border-radius: 5px;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.btn-primary:hover {
  background: #115e59;
}

.btn-secondary {
  height: 30px;
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #e2e8f0;
  border-radius: 5px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-secondary:hover {
  background: #e2e8f0;
  color: #1e293b;
}

.btn-del-outline {
  height: 30px;
  background: #fff;
  color: #ef4444;
  border: 1px solid #fca5a5;
  border-radius: 5px;
  padding: 0 8px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-del-outline:hover {
  background: #fef2f2;
  border-color: #ef4444;
}

.quick-tags {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.tag-pill {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  padding: 2px 8px;
  font-size: 10px;
  font-weight: 600;
  font-family: monospace;
  color: #334155;
  cursor: pointer;
}

.tag-pill:hover {
  background: #ecfdf5;
  border-color: #10b981;
  color: #047857;
}

/* ==========================================
   Simulation Settings Modal (LTspice Style)
   ========================================== */
.sim-modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.sim-modal-dialog {
  background: #ffffff;
  width: 620px;
  max-width: 95vw;
  border-radius: 12px;
  box-shadow: 0 20px 30px -10px rgba(0, 0, 0, 0.25);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: modalSlide 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalSlide {
  from { opacity: 0; transform: translateY(-12px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-header {
  padding: 12px 18px;
  background: #0f172a;
  color: #ffffff;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

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

.modal-icon {
  width: 18px;
  height: 18px;
  color: #38bdf8;
}

.modal-header h3 {
  font-size: 14px;
  font-weight: 700;
  margin: 0;
}

.lt-badge {
  font-size: 10px;
  background: rgba(56, 189, 248, 0.2);
  color: #38bdf8;
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid rgba(56, 189, 248, 0.4);
}

.modal-tabs {
  display: flex;
  background: #f1f5f9;
  border-bottom: 1px solid var(--border-color);
  padding: 0 12px;
}

.modal-tab {
  padding: 10px 14px;
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
}

.modal-tab:hover {
  color: #0f172a;
}

.modal-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  background: #ffffff;
}

.modal-content {
  padding: 18px 20px;
  background: #ffffff;
  min-height: 240px;
  overflow-y: auto;
}

.sim-tab-pane {
  display: none;
}

.sim-tab-pane.active {
  display: block;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px 16px;
}

.form-field {
  display: flex;
  flex-direction: column;
}

.form-field.checkbox-field {
  grid-column: 1 / -1;
  margin-top: 4px;
}

.form-field label {
  font-size: 12px;
  font-weight: 600;
  color: #334155;
  margin-bottom: 5px;
}

.form-field label .req {
  color: #ef4444;
}

.form-input {
  height: 32px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 0 10px;
  font-size: 13px;
  font-family: monospace;
  outline: none;
  transition: border-color 0.15s ease;
}

.form-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(15, 118, 110, 0.15);
}

.field-desc {
  font-size: 11px;
  color: #94a3b8;
  margin-top: 4px;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #1e293b;
  cursor: pointer;
}

.preset-section {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px dashed #e2e8f0;
}

.preset-title {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: #64748b;
  margin-bottom: 8px;
}

.preset-buttons {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.preset-btn,
.preset-btn-ac,
.preset-btn-dc {
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 5px 10px;
  font-size: 11px;
  color: #334155;
  cursor: pointer;
  transition: all 0.15s ease;
}

.preset-btn:hover,
.preset-btn-ac:hover,
.preset-btn-dc:hover {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary);
}

.op-intro-box {
  display: flex;
  gap: 12px;
  padding: 14px;
  background: #f0fdfa;
  border: 1px solid #99f6e4;
  border-radius: 8px;
  color: #0f766e;
  font-size: 12px;
  line-height: 1.6;
}

.op-icon {
  font-size: 20px;
  flex-shrink: 0;
}

.modal-footer {
  padding: 12px 18px;
  background: #f8fafc;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.preview-box {
  display: flex;
  align-items: center;
  gap: 8px;
}

.preview-label {
  font-size: 11px;
  color: #64748b;
  font-weight: 600;
}

.preview-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12px;
  background: #0f172a;
  color: #38bdf8;
  padding: 3px 8px;
  border-radius: 4px;
  font-weight: 600;
}

.modal-btn-group {
  display: flex;
  gap: 8px;
}

/* ==========================================
   Right-Click SPICE Model Picker Context Menu
   ========================================== */
.model-context-menu {
  position: absolute;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
  width: 290px;
  max-width: 90vw;
  z-index: 60;
  overflow: hidden;
  animation: modalSlide 0.12s cubic-bezier(0.16, 1, 0.3, 1);
}

.model-menu-header {
  padding: 10px 14px;
  background: #0f172a;
  color: #ffffff;
  border-bottom: 1px solid #334155;
}

.model-menu-header span {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: #f8fafc;
}

.model-menu-header small {
  display: block;
  font-size: 10px;
  color: #94a3b8;
  margin-top: 2px;
}

.model-menu-list {
  max-height: 280px;
  overflow-y: auto;
  padding: 4px 0;
}

.model-menu-item {
  padding: 8px 14px;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  border-bottom: 1px solid #f1f5f9;
  transition: background 0.12s ease;
}

.model-menu-item:hover {
  background: #f0fdfa;
}

.model-menu-item.active {
  background: #ecfdf5;
}

.model-item-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.model-item-name {
  font-size: 12px;
  font-weight: 700;
  color: #0f172a;
  font-family: monospace;
}

.model-item-tag {
  font-size: 9px;
  padding: 1px 5px;
  border-radius: 3px;
  background: #e0f2fe;
  color: #0284c7;
  font-weight: 600;
}

.model-item-tag.ideal-tag {
  background: #dcfce7;
  color: #15803d;
}

.model-item-desc {
  font-size: 10px;
  color: #64748b;
  margin-top: 2px;
  line-height: 1.3;
}

/* ==========================================
   Right Property Inspector Panel
   ========================================== */
.property-inspector-panel {
  width: 280px;
  min-width: 280px;
  max-width: 320px;
  background: #ffffff;
  border-left: 1px solid #cbd5e1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 20;
  transition: width 0.2s ease, min-width 0.2s ease, margin-right 0.2s ease;
  user-select: none;
}

.property-inspector-panel.collapsed {
  width: 0 !important;
  min-width: 0 !important;
  border-left: none;
  visibility: hidden;
}

.inspector-header {
  height: 40px;
  padding: 0 12px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.inspector-header-title {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 700;
  color: #0f172a;
}

.inspector-icon {
  font-size: 14px;
}

.inspector-badge {
  font-size: 10px;
  font-weight: 700;
  background: #e0f2fe;
  color: #0284c7;
  padding: 2px 7px;
  border-radius: 4px;
  border: 1px solid #bae6fd;
}

.inspector-collapse-btn {
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 13px;
  cursor: pointer;
  padding: 3px 6px;
  border-radius: 4px;
  transition: all 0.15s ease;
}

.inspector-collapse-btn:hover {
  background: #fee2e2;
  color: #ef4444;
}

.inspector-content {
  flex: 1;
  overflow-y: auto;
  padding: 12px 14px;
  font-size: 12px;
  box-sizing: border-box;
}

.insp-section {
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid #f1f5f9;
}

.insp-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.insp-section-title {
  font-size: 11px;
  font-weight: 700;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.insp-form-group {
  margin-bottom: 9px;
}

.insp-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  font-weight: 600;
  color: #334155;
  margin-bottom: 3px;
}

.insp-label-sym {
  font-family: ui-monospace, SFMono-Regular, monospace;
  color: #0f766e;
  font-weight: 700;
  font-size: 10px;
  background: #f0fdfa;
  padding: 1px 4px;
  border-radius: 3px;
  border: 1px solid #ccfbf1;
}

.insp-input {
  width: 100%;
  height: 29px;
  border: 1px solid #cbd5e1;
  border-radius: 5px;
  padding: 0 8px;
  font-size: 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-weight: 600;
  color: #0f172a;
  outline: none;
  box-sizing: border-box;
  background: #ffffff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.insp-input:focus {
  border-color: #0f766e;
  box-shadow: 0 0 0 2px rgba(15, 118, 110, 0.15);
}

.insp-input.readonly {
  background: #f8fafc;
  color: #64748b;
  border-color: #e2e8f0;
  cursor: default;
}

.insp-select {
  width: 100%;
  height: 29px;
  border: 1px solid #cbd5e1;
  border-radius: 5px;
  padding: 0 6px;
  font-size: 11.5px;
  font-weight: 600;
  color: #0f172a;
  background: #ffffff;
  outline: none;
  box-sizing: border-box;
}

.insp-select:focus {
  border-color: #0f766e;
}

.insp-spice-preview {
  background: #0f172a;
  color: #38bdf8;
  padding: 8px 10px;
  border-radius: 6px;
  font-family: ui-monospace, SFMono-Regular, monospace;
  font-size: 11px;
  word-break: break-all;
  margin-top: 8px;
  border: 1px solid #1e293b;
  line-height: 1.4;
}

.insp-preview-label {
  display: block;
  font-size: 9px;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 2px;
}

.insp-stat-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  color: #0f766e;
  background: #f0fdfa;
  padding: 2px 6px;
  border-radius: 3px;
  border: 1px solid #ccfbf1;
  margin-top: 4px;
}

.insp-slider-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.insp-slider {
  flex: 1;
  accent-color: #0f766e;
}

.insp-slider-val {
  font-family: monospace;
  font-weight: 700;
  font-size: 11px;
  color: #0f766e;
  width: 40px;
  text-align: right;
}

/* Empty State */
.inspector-empty-state {
  text-align: center;
  padding: 24px 8px;
  color: #94a3b8;
}

.empty-icon {
  font-size: 32px;
  margin-bottom: 8px;
}

.empty-title {
  font-size: 13px;
  font-weight: 700;
  color: #334155;
  margin-bottom: 6px;
}

.empty-desc {
  font-size: 11px;
  color: #64748b;
  line-height: 1.5;
  margin-bottom: 16px;
}

.empty-hint {
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  border-radius: 6px;
  padding: 10px 12px;
  text-align: left;
  font-size: 11px;
  color: #475569;
}

.empty-hint ul {
  margin: 6px 0 0 16px;
  padding: 0;
  line-height: 1.6;
}

.empty-hint li {
  margin-bottom: 2px;
}
